diff --git a/README.md b/README.md
index b06a014..dcf64fd 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,3 @@
# Re:Spouted Grease
-Re:Spouted Grease is a Patch used to modify Minecraft to work with [Re:Spouted](https://github.com/ReSpouted) servers using [RetroMCP](https://github.com/ReSpouted/RetroMCP-Java) and based on [SpoutCraft](https://github.com/spoutcraft/Spoutcraft)
+Re:Spouted Grease is a set of patches used to modify Minecraft to work with [Re:Spouted](https://github.com/ReSpouted) servers using [RetroMCP](https://github.com/ReSpouted/RetroMCP-Java) and based on [SpoutCraft](https://github.com/spoutcraft/Spoutcraft).
diff --git a/client.patch b/client.patch
deleted file mode 100644
index b716a13..0000000
--- a/client.patch
+++ /dev/null
@@ -1,323819 +0,0 @@
---- net/minecraft/src/CallableIntCache.java
-+++ net/minecraft/src/CallableIntCache.java
-@@ -5,8 +5,8 @@
- class CallableIntCache implements Callable {
- final CrashReport theCrashReport;
-
-- CallableIntCache(CrashReport var1) {
-- this.theCrashReport = var1;
-+ CallableIntCache(CrashReport par1CrashReport) {
-+ this.theCrashReport = par1CrashReport;
- }
-
- public String func_85083_a() {
---- /dev/null
-+++ org/spoutcraft/api/gui/ServerPlayerList.java
-@@ -1,0 +1,31 @@
-+/*
-+ * This file is part of Spoutcraft.
-+ *
-+ * Copyright (c) 2011 SpoutcraftDev
-+ * Spoutcraft is licensed under the GNU Lesser General Public License.
-+ *
-+ * Spoutcraft is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation, either version 3 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Spoutcraft is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program. If not, see .
-+ */
-+package org.spoutcraft.api.gui;
-+
-+public final class ServerPlayerList extends GenericWidget {
-+ public WidgetType getType() {
-+ // TODO Auto-generated method stub
-+ return null;
-+ }
-+
-+ public void render() {
-+ // TODO Auto-generated method stub
-+ }
-+}
---- net/minecraft/src/Facing.java
-+++ net/minecraft/src/Facing.java
-@@ -1,9 +1,25 @@
- package net.minecraft.src;
-
- public class Facing {
-- public static final int[] oppositeSide = new int[]{1, 0, 3, 2, 5, 4};
-- public static final int[] offsetsXForSide = new int[]{0, 0, 0, 0, -1, 1};
-- public static final int[] offsetsYForSide = new int[]{-1, 1, 0, 0, 0, 0};
-- public static final int[] offsetsZForSide = new int[]{0, 0, -1, 1, 0, 0};
-- public static final String[] e = new String[]{"DOWN", "UP", "NORTH", "SOUTH", "WEST", "EAST"};
-+
-+ /**
-+ * Converts a side to the opposite side. This is the same as XOR'ing it with 1.
-+ */
-+ public static final int[] oppositeSide = new int[] {1, 0, 3, 2, 5, 4};
-+
-+ /**
-+ * gives the offset required for this axis to get the block at that side.
-+ */
-+ public static final int[] offsetsXForSide = new int[] {0, 0, 0, 0, -1, 1};
-+
-+ /**
-+ * gives the offset required for this axis to get the block at that side.
-+ */
-+ public static final int[] offsetsYForSide = new int[] { -1, 1, 0, 0, 0, 0};
-+
-+ /**
-+ * gives the offset required for this axis to get the block at that side.
-+ */
-+ public static final int[] offsetsZForSide = new int[] {0, 0, -1, 1, 0, 0};
-+ public static final String[] facings = new String[] {"DOWN", "UP", "NORTH", "SOUTH", "WEST", "EAST"};
- }
---- net/minecraft/src/ComponentMineshaftStairs.java
-+++ net/minecraft/src/ComponentMineshaftStairs.java
-@@ -4,71 +4,85 @@
- import java.util.Random;
-
- public class ComponentMineshaftStairs extends StructureComponent {
-- public ComponentMineshaftStairs() {
-- }
--
-- public ComponentMineshaftStairs(int var1, Random var2, StructureBoundingBox var3, int var4) {
-- super(var1);
-- this.coordBaseMode = var4;
-- this.boundingBox = var3;
-- }
--
-- protected void func_143012_a(NBTTagCompound var1) {
-- }
--
-- protected void func_143011_b(NBTTagCompound var1) {
-- }
--
-- public static StructureBoundingBox findValidPlacement(List var0, Random var1, int var2, int var3, int var4, int var5) {
-- StructureBoundingBox var6 = new StructureBoundingBox(var2, var3 - 5, var4, var2, var3 + 2, var4);
-- switch(var5) {
-- case 0:
-- var6.maxX = var2 + 2;
-- var6.maxZ = var4 + 8;
-- break;
-- case 1:
-- var6.minX = var2 - 8;
-- var6.maxZ = var4 + 2;
-- break;
-- case 2:
-- var6.maxX = var2 + 2;
-- var6.minZ = var4 - 8;
-- break;
-- case 3:
-- var6.maxX = var2 + 8;
-- var6.maxZ = var4 + 2;
-+ public ComponentMineshaftStairs() {}
-+
-+ public ComponentMineshaftStairs(int par1, Random par2Random, StructureBoundingBox par3StructureBoundingBox, int par4) {
-+ super(par1);
-+ this.coordBaseMode = par4;
-+ this.boundingBox = par3StructureBoundingBox;
-+ }
-+
-+ protected void func_143012_a(NBTTagCompound par1NBTTagCompound) {}
-+
-+ protected void func_143011_b(NBTTagCompound par1NBTTagCompound) {}
-+
-+ /**
-+ * Trys to find a valid place to put this component.
-+ */
-+ public static StructureBoundingBox findValidPlacement(List par0List, Random par1Random, int par2, int par3, int par4, int par5) {
-+ StructureBoundingBox var6 = new StructureBoundingBox(par2, par3 - 5, par4, par2, par3 + 2, par4);
-+
-+ switch (par5) {
-+ case 0:
-+ var6.maxX = par2 + 2;
-+ var6.maxZ = par4 + 8;
-+ break;
-+
-+ case 1:
-+ var6.minX = par2 - 8;
-+ var6.maxZ = par4 + 2;
-+ break;
-+
-+ case 2:
-+ var6.maxX = par2 + 2;
-+ var6.minZ = par4 - 8;
-+ break;
-+
-+ case 3:
-+ var6.maxX = par2 + 8;
-+ var6.maxZ = par4 + 2;
- }
-
-- return StructureComponent.findIntersecting(var0, var6) != null ? null : var6;
-+ return StructureComponent.findIntersecting(par0List, var6) != null ? null : var6;
- }
-
-- public void buildComponent(StructureComponent var1, List var2, Random var3) {
-+ /**
-+ * Initiates construction of the Structure Component picked, at the current Location of StructGen
-+ */
-+ public void buildComponent(StructureComponent par1StructureComponent, List par2List, Random par3Random) {
- int var4 = this.getComponentType();
-- switch(this.coordBaseMode) {
-- case 0:
-- StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.minX, this.boundingBox.minY, this.boundingBox.maxZ + 1, 0, var4);
-- break;
-- case 1:
-- StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.minX - 1, this.boundingBox.minY, this.boundingBox.minZ, 1, var4);
-- break;
-- case 2:
-- StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.minX, this.boundingBox.minY, this.boundingBox.minZ - 1, 2, var4);
-- break;
-- case 3:
-- StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.maxX + 1, this.boundingBox.minY, this.boundingBox.minZ, 3, var4);
-+
-+ switch (this.coordBaseMode) {
-+ case 0:
-+ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.minX, this.boundingBox.minY, this.boundingBox.maxZ + 1, 0, var4);
-+ break;
-+
-+ case 1:
-+ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.minX - 1, this.boundingBox.minY, this.boundingBox.minZ, 1, var4);
-+ break;
-+
-+ case 2:
-+ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.minX, this.boundingBox.minY, this.boundingBox.minZ - 1, 2, var4);
-+ break;
-+
-+ case 3:
-+ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.maxX + 1, this.boundingBox.minY, this.boundingBox.minZ, 3, var4);
- }
--
- }
-
-- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) {
-- if(this.isLiquidInStructureBoundingBox(var1, var3)) {
-+ /**
-+ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the
-+ * end, it adds Fences...
-+ */
-+ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) {
-+ if (this.isLiquidInStructureBoundingBox(par1World, par3StructureBoundingBox)) {
- return false;
- } else {
-- this.fillWithBlocks(var1, var3, 0, 5, 0, 2, 7, 1, 0, 0, false);
-- this.fillWithBlocks(var1, var3, 0, 0, 7, 2, 2, 8, 0, 0, false);
-+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 5, 0, 2, 7, 1, 0, 0, false);
-+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 0, 7, 2, 2, 8, 0, 0, false);
-
-- for(int var4 = 0; var4 < 5; ++var4) {
-- this.fillWithBlocks(var1, var3, 0, 5 - var4 - (var4 < 4 ? 1 : 0), 2 + var4, 2, 7 - var4, 2 + var4, 0, 0, false);
-+ for (int var4 = 0; var4 < 5; ++var4) {
-+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 5 - var4 - (var4 < 4 ? 1 : 0), 2 + var4, 2, 7 - var4, 2 + var4, 0, 0, false);
- }
-
- return true;
---- /dev/null
-+++ org/spoutcraft/client/gui/controls/SpoutcraftBindingItem.java
-@@ -1,0 +1,106 @@
-+/*
-+ * This file is part of Spoutcraft.
-+ *
-+ * Copyright (c) 2011 SpoutcraftDev
-+ * Spoutcraft is licensed under the GNU Lesser General Public License.
-+ *
-+ * Spoutcraft is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation, either version 3 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Spoutcraft is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program. If not, see .
-+ */
-+package org.spoutcraft.client.gui.controls;
-+
-+import net.minecraft.src.FontRenderer;
-+import net.minecraft.src.GameSettings;
-+import net.minecraft.src.KeyBinding;
-+
-+import org.spoutcraft.client.SpoutClient;
-+
-+public class SpoutcraftBindingItem extends ControlsBasicItem {
-+ protected KeyBinding binding;
-+ private ControlsModel parent;
-+ public SpoutcraftBindingItem(KeyBinding binding, ControlsModel model) {
-+ super(model);
-+ this.binding = binding;
-+ this.parent = model;
-+ }
-+
-+ public int getHeight() {
-+ return 11;
-+ }
-+
-+ public void render(int x, int y, int width, int height) {
-+ FontRenderer font = SpoutClient.getHandle().fontRenderer;
-+ font.drawStringWithShadow("S", x + 2, y + 2, 0xffff0000);
-+ int w = font.getStringWidth("S");
-+ font.drawStringWithShadow(getName(), x + w + 4, y + 2, !isConflicting() ? 0xffffffff:0xffff0000);
-+ String keyString = parent.getEditingItem() == this ? "> <" : getDisplayKey();
-+ w = font.getStringWidth(keyString);
-+ font.drawStringWithShadow(keyString, width - w, y + 2, 0xffcccccc);
-+ }
-+
-+ public String getDisplayKey() {
-+ if (binding.keyCode == -128) {
-+ return "Unbound";
-+ }
-+ return GameSettings.getKeyDisplayString(getKey());
-+ }
-+
-+ @Override
-+ public void setKey(int id) {
-+ binding.keyCode = id;
-+ SpoutClient.getHandle().gameSettings.saveOptions();
-+ KeyBinding.resetKeyBindingArrayAndHash();
-+ }
-+
-+ @Override
-+ public int getKey() {
-+ return binding.keyCode;
-+ }
-+
-+ public boolean useModifiers() {
-+ return false;
-+ }
-+
-+ public boolean useMouseButtons() {
-+ return true;
-+ }
-+
-+ public String getName() {
-+ return binding.keyDescription;
-+ }
-+
-+ @Override
-+ public boolean conflicts(ControlsBasicItem other) {
-+ if (other instanceof VanillaBindingItem) {
-+ GameSettings settings = SpoutClient.getHandle().gameSettings;
-+ VanillaBindingItem item = (VanillaBindingItem)other;
-+ boolean flightKey = binding == settings.keyFlyBack ||
-+ binding == settings.keyFlyLeft ||
-+ binding == settings.keyFlyForward ||
-+ binding == settings.keyFlyRight ||
-+ binding == settings.keyFlyUp ||
-+ binding == settings.keyFlyDown;
-+ boolean movementKey = item.binding == settings.keyBindBack ||
-+ item.binding == settings.keyBindLeft ||
-+ item.binding == settings.keyBindForward ||
-+ item.binding == settings.keyBindRight ||
-+ item.binding == settings.keyBindJump ||
-+ item.binding == settings.keyBindSneak;
-+ // Allow overlaps
-+ if (flightKey && movementKey) {
-+ return false;
-+ }
-+ }
-+ return super.conflicts(other);
-+ }
-+}
---- net/minecraft/src/ItemBlock.java
-+++ net/minecraft/src/ItemBlock.java
-@@ -1,76 +1,99 @@
- package net.minecraft.src;
-
-+//Spout Start
-+
- import java.util.List;
-
-+import com.prupe.mcpatcher.cc.ColorizeBlock;
-+
-+//Spout end
-+
- 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 var1) {
-- super(var1);
-- this.blockID = var1 + 256;
-+ public ItemBlock(int par1) {
-+ super(par1);
-+ this.blockID = par1 + 256;
- }
-
-+ /**
-+ * Returns the blockID for this Item
-+ */
- public int getBlockID() {
- 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;
- }
-
-- public Icon getIconFromDamage(int var1) {
-+ /**
-+ * 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);
- }
-
-- public boolean onItemUse(ItemStack var1, EntityPlayer var2, World var3, int var4, int var5, int var6, int var7, float var8, float var9, float var10) {
-- int var11 = var3.getBlockId(var4, var5, var6);
-- if(var11 == Block.snow.blockID && (var3.getBlockMetadata(var4, var5, var6) & 7) < 1) {
-- var7 = 1;
-- } else if(var11 != Block.vine.blockID && var11 != Block.tallGrass.blockID && var11 != Block.deadBush.blockID) {
-- if(var7 == 0) {
-- --var5;
-- }
--
-- if(var7 == 1) {
-- ++var5;
-- }
--
-- if(var7 == 2) {
-- --var6;
-- }
--
-- if(var7 == 3) {
-- ++var6;
-- }
--
-- if(var7 == 4) {
-- --var4;
-- }
--
-- if(var7 == 5) {
-- ++var4;
-+ /**
-+ * 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) {
-+ int var11 = par3World.getBlockId(par4, par5, par6);
-+
-+ if (var11 == Block.snow.blockID && (par3World.getBlockMetadata(par4, par5, par6) & 7) < 1) {
-+ par7 = 1;
-+ } else if (var11 != Block.vine.blockID && var11 != Block.tallGrass.blockID && var11 != Block.deadBush.blockID) {
-+ if (par7 == 0) {
-+ --par5;
-+ }
-+
-+ if (par7 == 1) {
-+ ++par5;
-+ }
-+
-+ if (par7 == 2) {
-+ --par6;
-+ }
-+
-+ if (par7 == 3) {
-+ ++par6;
-+ }
-+
-+ if (par7 == 4) {
-+ --par4;
-+ }
-+
-+ if (par7 == 5) {
-+ ++par4;
- }
- }
-
-- if(var1.stackSize == 0) {
-- return false;
-- } else if(!var2.canPlayerEdit(var4, var5, var6, var7, var1)) {
-- return false;
-- } else if(var5 == 255 && Block.blocksList[this.blockID].blockMaterial.isSolid()) {
-- return false;
-- } else if(var3.canPlaceEntityOnSide(this.blockID, var4, var5, var6, false, var7, var2, var1)) {
-+ if (par1ItemStack.stackSize == 0) {
-+ return false;
-+ } else if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack)) {
-+ return false;
-+ } else if (par5 == 255 && Block.blocksList[this.blockID].blockMaterial.isSolid()) {
-+ return false;
-+ } else if (par3World.canPlaceEntityOnSide(this.blockID, par4, par5, par6, false, par7, par2EntityPlayer, par1ItemStack)) {
- Block var12 = Block.blocksList[this.blockID];
-- int var13 = this.getMetadata(var1.getItemDamage());
-- int var14 = Block.blocksList[this.blockID].onBlockPlaced(var3, var4, var5, var6, var7, var8, var9, var10, var13);
-- if(var3.setBlock(var4, var5, var6, this.blockID, var14, 3)) {
-- if(var3.getBlockId(var4, var5, var6) == this.blockID) {
-- Block.blocksList[this.blockID].onBlockPlacedBy(var3, var4, var5, var6, var2, var1);
-- Block.blocksList[this.blockID].onPostBlockPlaced(var3, var4, var5, var6, var14);
-+ int var13 = this.getMetadata(par1ItemStack.getItemDamage());
-+ int var14 = Block.blocksList[this.blockID].onBlockPlaced(par3World, par4, par5, par6, par7, par8, par9, par10, var13);
-+
-+ if (par3World.setBlock(par4, par5, par6, this.blockID, var14, 3)) {
-+ if (par3World.getBlockId(par4, par5, par6) == this.blockID) {
-+ Block.blocksList[this.blockID].onBlockPlacedBy(par3World, par4, par5, par6, par2EntityPlayer, par1ItemStack);
-+ Block.blocksList[this.blockID].onPostBlockPlaced(par3World, par4, par5, par6, var14);
- }
-
-- var3.playSoundEffect((double)((float)var4 + 0.5F), (double)((float)var5 + 0.5F), (double)((float)var6 + 0.5F), var12.stepSound.getPlaceSound(), (var12.stepSound.getVolume() + 1.0F) / 2.0F, var12.stepSound.getPitch() * 0.8F);
-- --var1.stackSize;
-+ 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;
-@@ -79,60 +102,86 @@
- }
- }
-
-- public boolean canPlaceItemBlockOnSide(World var1, int var2, int var3, int var4, int var5, EntityPlayer var6, ItemStack var7) {
-- int var8 = var1.getBlockId(var2, var3, var4);
-- if(var8 == Block.snow.blockID) {
-- var5 = 1;
-- } else if(var8 != Block.vine.blockID && var8 != Block.tallGrass.blockID && var8 != Block.deadBush.blockID) {
-- if(var5 == 0) {
-- --var3;
-- }
--
-- if(var5 == 1) {
-- ++var3;
-- }
--
-- if(var5 == 2) {
-- --var4;
-- }
--
-- if(var5 == 3) {
-- ++var4;
-- }
--
-- if(var5 == 4) {
-- --var2;
-- }
--
-- if(var5 == 5) {
-- ++var2;
-+ /**
-+ * 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 var1.canPlaceEntityOnSide(this.getBlockID(), var2, var3, var4, false, var5, (Entity)null, var7);
-+ return par1World.canPlaceEntityOnSide(this.getBlockID(), par2, par3, par4, false, par5, (Entity) null, par7ItemStack);
- }
-
-- public String getUnlocalizedName(ItemStack var1) {
-+ /**
-+ * 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) {
- return Block.blocksList[this.blockID].getUnlocalizedName();
- }
-
-+ /**
-+ * 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();
- }
-
-- public void getSubItems(int var1, CreativeTabs var2, List var3) {
-- Block.blocksList[this.blockID].getSubBlocks(var1, var2, var3);
-+ /**
-+ * 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 var1) {
-+ public void registerIcons(IconRegister par1IconRegister) {
- String var2 = Block.blocksList[this.blockID].getItemIconName();
-- if(var2 != null) {
-- this.field_94588_b = var1.registerIcon(var2);
-+
-+ if (var2 != null) {
-+ this.field_94588_b = par1IconRegister.registerIcon(var2);
- }
-+ }
-
-+ //Spout MCPatcher start
-+ public int getColorFromItemStack(ItemStack var1, int var2) {
-+ return ColorizeBlock.getItemColorFromDamage(super.getColorFromItemStack(var1, var2), this.blockID, var2);
- }
-+ //Spout MCPatcher end
- }
---- net/minecraft/src/EntityAIFollowOwner.java
-+++ net/minecraft/src/EntityAIFollowOwner.java
-@@ -11,23 +11,27 @@
- float minDist;
- private boolean field_75344_i;
-
-- public EntityAIFollowOwner(EntityTameable var1, double var2, float var4, float var5) {
-- this.thePet = var1;
-- this.theWorld = var1.worldObj;
-- this.field_75336_f = var2;
-- this.petPathfinder = var1.getNavigator();
-- this.minDist = var4;
-- this.maxDist = var5;
-+ public EntityAIFollowOwner(EntityTameable par1EntityTameable, double par2, float par4, float par5) {
-+ this.thePet = par1EntityTameable;
-+ this.theWorld = par1EntityTameable.worldObj;
-+ this.field_75336_f = par2;
-+ this.petPathfinder = par1EntityTameable.getNavigator();
-+ this.minDist = par4;
-+ this.maxDist = par5;
- this.setMutexBits(3);
- }
-
-+ /**
-+ * Returns whether the EntityAIBase should begin execution.
-+ */
- public boolean shouldExecute() {
- EntityLivingBase var1 = this.thePet.func_130012_q();
-- if(var1 == null) {
-- return false;
-- } else if(this.thePet.isSitting()) {
-- return false;
-- } else if(this.thePet.getDistanceSqToEntity(var1) < (double)(this.minDist * this.minDist)) {
-+
-+ if (var1 == null) {
-+ return false;
-+ } else if (this.thePet.isSitting()) {
-+ return false;
-+ } else if (this.thePet.getDistanceSqToEntity(var1) < (double)(this.minDist * this.minDist)) {
- return false;
- } else {
- this.theOwner = var1;
-@@ -35,44 +39,57 @@
- }
- }
-
-+ /**
-+ * Returns whether an in-progress EntityAIBase should continue executing
-+ */
- public boolean continueExecuting() {
- return !this.petPathfinder.noPath() && this.thePet.getDistanceSqToEntity(this.theOwner) > (double)(this.maxDist * this.maxDist) && !this.thePet.isSitting();
- }
-
-+ /**
-+ * Execute a one shot task or start executing a continuous task
-+ */
- public void startExecuting() {
- this.field_75343_h = 0;
- this.field_75344_i = this.thePet.getNavigator().getAvoidsWater();
- this.thePet.getNavigator().setAvoidsWater(false);
- }
-
-+ /**
-+ * Resets the task
-+ */
- public void resetTask() {
- this.theOwner = null;
- this.petPathfinder.clearPathEntity();
- this.thePet.getNavigator().setAvoidsWater(this.field_75344_i);
- }
-
-+ /**
-+ * Updates the task
-+ */
- public void updateTask() {
- this.thePet.getLookHelper().setLookPositionWithEntity(this.theOwner, 10.0F, (float)this.thePet.getVerticalFaceSpeed());
-- if(!this.thePet.isSitting()) {
-- if(--this.field_75343_h <= 0) {
-+
-+ if (!this.thePet.isSitting()) {
-+ if (--this.field_75343_h <= 0) {
- this.field_75343_h = 10;
-- if(!this.petPathfinder.tryMoveToEntityLiving(this.theOwner, this.field_75336_f)) {
-- if(!this.thePet.getLeashed()) {
-- if(this.thePet.getDistanceSqToEntity(this.theOwner) >= 144.0D) {
-+
-+ if (!this.petPathfinder.tryMoveToEntityLiving(this.theOwner, this.field_75336_f)) {
-+ if (!this.thePet.getLeashed()) {
-+ if (this.thePet.getDistanceSqToEntity(this.theOwner) >= 144.0D) {
- int var1 = MathHelper.floor_double(this.theOwner.posX) - 2;
- int var2 = MathHelper.floor_double(this.theOwner.posZ) - 2;
- int var3 = MathHelper.floor_double(this.theOwner.boundingBox.minY);
-
-- for(int var4 = 0; var4 <= 4; ++var4) {
-- for(int var5 = 0; var5 <= 4; ++var5) {
-- if((var4 < 1 || var5 < 1 || var4 > 3 || var5 > 3) && this.theWorld.doesBlockHaveSolidTopSurface(var1 + var4, var3 - 1, var2 + var5) && !this.theWorld.isBlockNormalCube(var1 + var4, var3, var2 + var5) && !this.theWorld.isBlockNormalCube(var1 + var4, var3 + 1, var2 + var5)) {
-+ for (int var4 = 0; var4 <= 4; ++var4) {
-+ for (int var5 = 0; var5 <= 4; ++var5) {
-+ if ((var4 < 1 || var5 < 1 || var4 > 3 || var5 > 3) && this.theWorld.doesBlockHaveSolidTopSurface(var1 + var4, var3 - 1, var2 + var5) && !this.theWorld.isBlockNormalCube(var1 + var4, var3, var2 + var5) && !this.theWorld.isBlockNormalCube(var1 + var4, var3 + 1, var2 + var5)) {
- this.thePet.setLocationAndAngles((double)((float)(var1 + var4) + 0.5F), (double)var3, (double)((float)(var2 + var5) + 0.5F), this.thePet.rotationYaw, this.thePet.rotationPitch);
- this.petPathfinder.clearPathEntity();
- return;
- }
- }
- }
--
- }
- }
- }
---- net/minecraft/src/EntityAIVillagerMate.java
-+++ net/minecraft/src/EntityAIVillagerMate.java
-@@ -7,26 +7,31 @@
- private int matingTimeout;
- Village villageObj;
-
-- public EntityAIVillagerMate(EntityVillager var1) {
-- this.villagerObj = var1;
-- this.worldObj = var1.worldObj;
-+ public EntityAIVillagerMate(EntityVillager par1EntityVillager) {
-+ this.villagerObj = par1EntityVillager;
-+ this.worldObj = par1EntityVillager.worldObj;
- this.setMutexBits(3);
- }
-
-+ /**
-+ * Returns whether the EntityAIBase should begin execution.
-+ */
- public boolean shouldExecute() {
-- if(this.villagerObj.getGrowingAge() != 0) {
-+ if (this.villagerObj.getGrowingAge() != 0) {
- return false;
-- } else if(this.villagerObj.getRNG().nextInt(500) != 0) {
-+ } else if (this.villagerObj.getRNG().nextInt(500) != 0) {
- return false;
- } else {
- this.villageObj = this.worldObj.villageCollectionObj.findNearestVillage(MathHelper.floor_double(this.villagerObj.posX), MathHelper.floor_double(this.villagerObj.posY), MathHelper.floor_double(this.villagerObj.posZ), 0);
-- if(this.villageObj == null) {
-+
-+ if (this.villageObj == null) {
- return false;
-- } else if(!this.checkSufficientDoorsPresentForNewVillager()) {
-+ } else if (!this.checkSufficientDoorsPresentForNewVillager()) {
- return false;
- } else {
- Entity var1 = this.worldObj.findNearestEntityWithinAABB(EntityVillager.class, this.villagerObj.boundingBox.expand(8.0D, 3.0D, 8.0D), this.villagerObj);
-- if(var1 == null) {
-+
-+ if (var1 == null) {
- return false;
- } else {
- this.mate = (EntityVillager)var1;
-@@ -36,38 +41,50 @@
- }
- }
-
-+ /**
-+ * Execute a one shot task or start executing a continuous task
-+ */
- public void startExecuting() {
- this.matingTimeout = 300;
- this.villagerObj.setMating(true);
- }
-
-+ /**
-+ * Resets the task
-+ */
- public void resetTask() {
- this.villageObj = null;
- this.mate = null;
- this.villagerObj.setMating(false);
- }
-
-+ /**
-+ * Returns whether an in-progress EntityAIBase should continue executing
-+ */
- public boolean continueExecuting() {
- return this.matingTimeout >= 0 && this.checkSufficientDoorsPresentForNewVillager() && this.villagerObj.getGrowingAge() == 0;
- }
-
-+ /**
-+ * Updates the task
-+ */
- public void updateTask() {
- --this.matingTimeout;
- this.villagerObj.getLookHelper().setLookPositionWithEntity(this.mate, 10.0F, 30.0F);
-- if(this.villagerObj.getDistanceSqToEntity(this.mate) > 2.25D) {
-+
-+ if (this.villagerObj.getDistanceSqToEntity(this.mate) > 2.25D) {
- this.villagerObj.getNavigator().tryMoveToEntityLiving(this.mate, 0.25D);
-- } else if(this.matingTimeout == 0 && this.mate.isMating()) {
-+ } else if (this.matingTimeout == 0 && this.mate.isMating()) {
- this.giveBirth();
- }
-
-- if(this.villagerObj.getRNG().nextInt(35) == 0) {
-+ if (this.villagerObj.getRNG().nextInt(35) == 0) {
- this.worldObj.setEntityState(this.villagerObj, (byte)12);
- }
--
- }
-
- private boolean checkSufficientDoorsPresentForNewVillager() {
-- if(!this.villageObj.isMatingSeason()) {
-+ if (!this.villageObj.isMatingSeason()) {
- return false;
- } else {
- int var1 = (int)((double)((float)this.villageObj.getNumVillageDoors()) * 0.35D);
---- net/minecraft/src/EntityDamageSource.java
-+++ net/minecraft/src/EntityDamageSource.java
-@@ -3,22 +3,28 @@
- public class EntityDamageSource extends DamageSource {
- protected Entity damageSourceEntity;
-
-- public EntityDamageSource(String var1, Entity var2) {
-- super(var1);
-- this.damageSourceEntity = var2;
-+ public EntityDamageSource(String par1Str, Entity par2Entity) {
-+ super(par1Str);
-+ this.damageSourceEntity = par2Entity;
- }
-
- public Entity getEntity() {
- return this.damageSourceEntity;
- }
-
-- public ChatMessageComponent getDeathMessage(EntityLivingBase var1) {
-+ /**
-+ * Returns the message to be displayed on player death.
-+ */
-+ public ChatMessageComponent getDeathMessage(EntityLivingBase par1EntityLivingBase) {
- ItemStack var2 = this.damageSourceEntity instanceof EntityLivingBase ? ((EntityLivingBase)this.damageSourceEntity).getHeldItem() : null;
-- String var3 = "death.attack." + this.o;
-+ String var3 = "death.attack." + this.damageType;
- String var4 = var3 + ".item";
-- return var2 != null && var2.hasDisplayName() && StatCollector.func_94522_b(var4) ? ChatMessageComponent.createFromTranslationWithSubstitutions(var4, new Object[]{var1.getTranslatedEntityName(), this.damageSourceEntity.getTranslatedEntityName(), var2.getDisplayName()}) : ChatMessageComponent.createFromTranslationWithSubstitutions(var3, new Object[]{var1.getTranslatedEntityName(), this.damageSourceEntity.getTranslatedEntityName()});
-+ return var2 != null && var2.hasDisplayName() && StatCollector.func_94522_b(var4) ? ChatMessageComponent.createFromTranslationWithSubstitutions(var4, new Object[] {par1EntityLivingBase.getTranslatedEntityName(), this.damageSourceEntity.getTranslatedEntityName(), var2.getDisplayName()}): ChatMessageComponent.createFromTranslationWithSubstitutions(var3, new Object[] {par1EntityLivingBase.getTranslatedEntityName(), this.damageSourceEntity.getTranslatedEntityName()});
- }
-
-+ /**
-+ * Return whether this damage source will have its damage amount scaled based on the current difficulty.
-+ */
- public boolean isDifficultyScaled() {
- return this.damageSourceEntity != null && this.damageSourceEntity instanceof EntityLivingBase && !(this.damageSourceEntity instanceof EntityPlayer);
- }
---- net/minecraft/src/LanguageMetadataSectionSerializer.java
-+++ net/minecraft/src/LanguageMetadataSectionSerializer.java
-@@ -11,24 +11,25 @@
- import java.util.Map.Entry;
-
- public class LanguageMetadataSectionSerializer extends BaseMetadataSectionSerializer {
-- public LanguageMetadataSection func_135020_a(JsonElement var1, Type var2, JsonDeserializationContext var3) {
-- JsonObject var4 = var1.getAsJsonObject();
-+ 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()) {
-+ if (!var6.hasNext()) {
- return new LanguageMetadataSection(var5);
- }
-
- Entry var7 = (Entry)var6.next();
- var8 = (String)var7.getKey();
- JsonElement var9 = (JsonElement)var7.getValue();
-- if(!var9.isJsonObject()) {
-+
-+ if (!var9.isJsonObject()) {
- throw new JsonParseException("Invalid language->\'" + var8 + "\': expected object, was " + var9);
- }
-
-@@ -36,23 +37,27 @@
- 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()) {
-+
-+ if (var11.isEmpty()) {
- throw new JsonParseException("Invalid language->\'" + var8 + "\'->region: empty value");
- }
-
-- if(var12.isEmpty()) {
-+ if (var12.isEmpty()) {
- throw new JsonParseException("Invalid language->\'" + var8 + "\'->name: empty value");
- }
-- } while(var5.add(new Language(var8, var11, var12, var13)));
-+ } 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 var1, Type var2, JsonDeserializationContext var3) {
-- return this.func_135020_a(var1, var2, var3);
-+ public Object deserialize(JsonElement par1JsonElement, Type par2Type, JsonDeserializationContext par3JsonDeserializationContext) {
-+ return this.func_135020_a(par1JsonElement, par2Type, par3JsonDeserializationContext);
- }
- }
---- net/minecraft/src/GuiScreenOnlineServersSubscreen.java
-+++ net/minecraft/src/GuiScreenOnlineServersSubscreen.java
-@@ -8,60 +8,59 @@
- private final int field_104081_h;
- private final int field_104082_i;
- private final int field_104080_j;
-- List a = new ArrayList();
-- String[] b;
-- String[] c;
-- String[][] d;
-+ 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 var1, int var2, int var3, int var4, int var5, int var6) {
-- this.field_104074_g = var1;
-- this.field_104081_h = var2;
-- this.field_104082_i = var3;
-- this.field_104080_j = var4;
-- this.field_104076_e = var5;
-- this.field_104073_f = var6;
-+ 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.a.add(new GuiButton(5005, this.field_104082_i, this.field_104080_j + 1, 212, 20, this.func_104072_c()));
-- this.a.add(new GuiButton(5006, this.field_104082_i, this.field_104080_j + 25, 212, 20, this.func_104067_d()));
-+ 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.b = new String[]{I18n.getString("options.difficulty.peaceful"), I18n.getString("options.difficulty.easy"), I18n.getString("options.difficulty.normal"), I18n.getString("options.difficulty.hard")};
-- this.c = new String[]{I18n.getString("selectWorld.gameMode.survival"), I18n.getString("selectWorld.gameMode.creative"), I18n.getString("selectWorld.gameMode.adventure")};
-- this.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")}};
-+ 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.b[this.field_104076_e];
-+ return var1 + ": " + this.field_104077_b[this.field_104076_e];
- }
-
- private String func_104067_d() {
- String var1 = I18n.getString("selectWorld.gameMode");
-- return var1 + ": " + this.c[this.field_104073_f];
-+ return var1 + ": " + this.field_104078_c[this.field_104073_f];
- }
-
-- void func_104069_a(GuiButton var1) {
-- if(var1.enabled) {
-- if(var1.id == 5005) {
-- this.field_104076_e = (this.field_104076_e + 1) % this.b.length;
-- var1.f = this.func_104072_c();
-- } else if(var1.id == 5006) {
-- this.field_104073_f = (this.field_104073_f + 1) % this.c.length;
-- var1.f = this.func_104067_d();
-+ 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 var1, FontRenderer var2) {
-- var1.drawString(var2, this.d[this.field_104073_f][0], this.field_104082_i, this.field_104080_j + 50, 10526880);
-- var1.drawString(var2, this.d[this.field_104073_f][1], this.field_104082_i, this.field_104080_j + 60, 10526880);
-+ 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);
- }
- }
---- net/minecraft/src/ChunkProviderServer.java
-+++ net/minecraft/src/ChunkProviderServer.java
-@@ -8,101 +8,134 @@
- import java.util.Set;
-
- public class ChunkProviderServer implements IChunkProvider {
-- private Set b = new HashSet();
-- private Chunk dummyChunk;
-- private IChunkProvider serverChunkGenerator;
-- private IChunkLoader chunkLoader;
-- public boolean chunkLoadOverride = true;
-- private LongHashMap id2ChunkMap = new LongHashMap();
-- private List g = new ArrayList();
-+
-+ /**
-+ * 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 var1, IChunkLoader var2, IChunkProvider var3) {
-- this.dummyChunk = new EmptyChunk(var1, 0, 0);
-- this.worldObj = var1;
-- this.chunkLoader = var2;
-- this.serverChunkGenerator = var3;
-- }
--
-- public boolean chunkExists(int var1, int var2) {
-- return this.id2ChunkMap.containsItem(ChunkCoordIntPair.chunkXZ2Int(var1, var2));
-- }
--
-- public void dropChunk(int var1, int var2) {
-- if(this.worldObj.provider.canRespawnHere()) {
-+ 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 = var1 * 16 + 8 - var3.posX;
-- int var5 = var2 * 16 + 8 - var3.posZ;
-+ 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.b.add(Long.valueOf(ChunkCoordIntPair.chunkXZ2Int(var1, var2)));
-+
-+ if (var4 < -var6 || var4 > var6 || var5 < -var6 || var5 > var6) {
-+ this.chunksToUnload.add(Long.valueOf(ChunkCoordIntPair.chunkXZ2Int(par1, par2)));
- }
- } else {
-- this.b.add(Long.valueOf(ChunkCoordIntPair.chunkXZ2Int(var1, var2)));
-+ this.chunksToUnload.add(Long.valueOf(ChunkCoordIntPair.chunkXZ2Int(par1, par2)));
- }
--
- }
-
-+ /**
-+ * marks all chunks for unload, ignoring those near the spawn
-+ */
- public void unloadAllChunks() {
-- Iterator var1 = this.g.iterator();
-+ Iterator var1 = this.loadedChunks.iterator();
-
-- while(var1.hasNext()) {
-+ while (var1.hasNext()) {
- Chunk var2 = (Chunk)var1.next();
-- this.dropChunk(var2.xPosition, var2.zPosition);
-+ this.unloadChunksIfNotNearSpawn(var2.xPosition, var2.zPosition);
- }
--
- }
-
-- public Chunk loadChunk(int var1, int var2) {
-- long var3 = ChunkCoordIntPair.chunkXZ2Int(var1, var2);
-- this.b.remove(Long.valueOf(var3));
-- Chunk var5 = (Chunk)this.id2ChunkMap.getValueByKey(var3);
-- if(var5 == null) {
-- var5 = this.loadChunkFromFile(var1, var2);
-- if(var5 == null) {
-- if(this.serverChunkGenerator == null) {
-- var5 = this.dummyChunk;
-+ /**
-+ * 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.serverChunkGenerator.provideChunk(var1, var2);
-+ 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(var1), Integer.valueOf(var2)}));
-+ 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());
-+ var8.addCrashSection("Generator", this.currentChunkProvider.makeString());
- throw new ReportedException(var7);
- }
- }
- }
-
-- this.id2ChunkMap.add(var3, var5);
-- this.g.add(var5);
-- if(var5 != null) {
-+ this.loadedChunkHashMap.add(var3, var5);
-+ this.loadedChunks.add(var5);
-+
-+ if (var5 != null) {
- var5.onChunkLoad();
- }
-
-- var5.populateChunk(this, this, var1, var2);
-+ var5.populateChunk(this, this, par1, par2);
- }
-
- return var5;
- }
-
-- public Chunk provideChunk(int var1, int var2) {
-- Chunk var3 = (Chunk)this.id2ChunkMap.getValueByKey(ChunkCoordIntPair.chunkXZ2Int(var1, var2));
-- return var3 == null ? (!this.worldObj.findingSpawnPoint && !this.chunkLoadOverride ? this.dummyChunk : this.loadChunk(var1, var2)) : 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.loadedChunkHashMap.getValueByKey(ChunkCoordIntPair.chunkXZ2Int(par1, par2));
-+ return var3 == null ? (!this.worldObj.findingSpawnPoint && !this.loadChunkOnProvideRequest ? this.defaultEmptyChunk : this.loadChunk(par1, par2)) : var3;
- }
-
-- private Chunk loadChunkFromFile(int var1, int var2) {
-- if(this.chunkLoader == null) {
-+ /**
-+ * 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.chunkLoader.loadChunk(this.worldObj, var1, var2);
-- if(var3 != null) {
-+ Chunk var3 = this.currentChunkLoader.loadChunk(this.worldObj, par1, par2);
-+
-+ if (var3 != null) {
- var3.lastSaveTime = this.worldObj.getTotalWorldTime();
-- if(this.serverChunkGenerator != null) {
-- this.serverChunkGenerator.recreateStructures(var1, var2);
-+
-+ if (this.currentChunkProvider != null) {
-+ this.currentChunkProvider.recreateStructures(par1, par2);
- }
- }
-
-@@ -114,57 +147,71 @@
- }
- }
-
-- private void saveChunkExtraData(Chunk var1) {
-- if(this.chunkLoader != null) {
-+ /**
-+ * used by saveChunks, but catches any exceptions if the save fails.
-+ */
-+ private void safeSaveExtraChunkData(Chunk par1Chunk) {
-+ if (this.currentChunkLoader != null) {
- try {
-- this.chunkLoader.saveExtraChunkData(this.worldObj, var1);
-+ this.currentChunkLoader.saveExtraChunkData(this.worldObj, par1Chunk);
- } catch (Exception var3) {
- var3.printStackTrace();
- }
--
- }
- }
-
-- private void saveChunkData(Chunk var1) {
-- if(this.chunkLoader != null) {
-+ /**
-+ * used by saveChunks, but catches any exceptions if the save fails.
-+ */
-+ private void safeSaveChunk(Chunk par1Chunk) {
-+ if (this.currentChunkLoader != null) {
- try {
-- var1.lastSaveTime = this.worldObj.getTotalWorldTime();
-- this.chunkLoader.saveChunk(this.worldObj, var1);
-+ par1Chunk.lastSaveTime = this.worldObj.getTotalWorldTime();
-+ this.currentChunkLoader.saveChunk(this.worldObj, par1Chunk);
- } catch (IOException var3) {
- var3.printStackTrace();
- } catch (MinecraftException var4) {
- var4.printStackTrace();
- }
--
- }
- }
-
-- public void populate(IChunkProvider var1, int var2, int var3) {
-- Chunk var4 = this.provideChunk(var2, var3);
-- if(!var4.isTerrainPopulated) {
-+ /**
-+ * Populates chunk with ores etc etc
-+ */
-+ public void populate(IChunkProvider par1IChunkProvider, int par2, int par3) {
-+ Chunk var4 = this.provideChunk(par2, par3);
-+
-+ if (!var4.isTerrainPopulated) {
- var4.isTerrainPopulated = true;
-- if(this.serverChunkGenerator != null) {
-- this.serverChunkGenerator.populate(var1, var2, var3);
-+
-+ if (this.currentChunkProvider != null) {
-+ this.currentChunkProvider.populate(par1IChunkProvider, par2, par3);
- var4.setChunkModified();
- }
- }
--
- }
-
-- public boolean saveChunks(boolean var1, IProgressUpdate var2) {
-+ /**
-+ * 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) {
- int var3 = 0;
-
-- for(int var4 = 0; var4 < this.g.size(); ++var4) {
-- Chunk var5 = (Chunk)this.g.get(var4);
-- if(var1) {
-- this.saveChunkExtraData(var5);
-+ for (int var4 = 0; var4 < this.loadedChunks.size(); ++var4) {
-+ Chunk var5 = (Chunk)this.loadedChunks.get(var4);
-+
-+ if (par1) {
-+ this.safeSaveExtraChunkData(var5);
- }
-
-- if(var5.needsSaving(var1)) {
-- this.saveChunkData(var5);
-+ if (var5.needsSaving(par1)) {
-+ this.safeSaveChunk(var5);
- var5.isModified = false;
- ++var3;
-- if(var3 == 24 && !var1) {
-+
-+ if (var3 == 24 && !par1) {
- return false;
- }
- }
-@@ -173,56 +220,73 @@
- return true;
- }
-
-+ /**
-+ * 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();
-+ 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.levelSaving) {
-- for(int var1 = 0; var1 < 100; ++var1) {
-- if(!this.b.isEmpty()) {
-- Long var2 = (Long)this.b.iterator().next();
-- Chunk var3 = (Chunk)this.id2ChunkMap.getValueByKey(var2.longValue());
-+ 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.saveChunkData(var3);
-- this.saveChunkExtraData(var3);
-- this.b.remove(var2);
-- this.id2ChunkMap.remove(var2.longValue());
-- this.g.remove(var3);
-+ this.safeSaveChunk(var3);
-+ this.safeSaveExtraChunkData(var3);
-+ this.chunksToUnload.remove(var2);
-+ this.loadedChunkHashMap.remove(var2.longValue());
-+ this.loadedChunks.remove(var3);
- }
- }
-
-- if(this.chunkLoader != null) {
-- this.chunkLoader.chunkTick();
-+ if (this.currentChunkLoader != null) {
-+ this.currentChunkLoader.chunkTick();
- }
- }
-
-- return this.serverChunkGenerator.unloadQueuedChunks();
-+ return this.currentChunkProvider.unloadQueuedChunks();
- }
-
-+ /**
-+ * Returns if the IChunkProvider supports saving.
-+ */
- public boolean canSave() {
-- return !this.worldObj.levelSaving;
-+ return !this.worldObj.canNotSave;
- }
-
-+ /**
-+ * Converts the instance data to a readable string.
-+ */
- public String makeString() {
-- return "ServerChunkCache: " + this.id2ChunkMap.getNumHashElements() + " Drop: " + this.b.size();
-- }
--
-- public List getPossibleCreatures(EnumCreatureType var1, int var2, int var3, int var4) {
-- return this.serverChunkGenerator.getPossibleCreatures(var1, var2, var3, var4);
-- }
--
-- public ChunkPosition findClosestStructure(World var1, String var2, int var3, int var4, int var5) {
-- return this.serverChunkGenerator.findClosestStructure(var1, var2, var3, var4, var5);
-+ 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.id2ChunkMap.getNumHashElements();
-+ return this.loadedChunkHashMap.getNumHashElements();
- }
-
-- public void recreateStructures(int var1, int var2) {
-- }
-+ public void recreateStructures(int par1, int par2) {}
- }
---- /dev/null
-+++ org/spoutcraft/client/gui/about/GuiNewAbout.java
-@@ -1,0 +1,209 @@
-+/*
-+ * This file is part of Spoutcraft.
-+ *
-+ * Copyright (c) 2011 SpoutcraftDev
-+ * Spoutcraft is licensed under the GNU Lesser General Public License.
-+ *
-+ * Spoutcraft is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation, either version 3 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Spoutcraft is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program. If not, see .
-+ */
-+package org.spoutcraft.client.gui.about;
-+
-+import java.io.File;
-+import java.io.FileReader;
-+import java.net.URL;
-+import java.util.HashMap;
-+import java.util.Iterator;
-+import java.util.LinkedHashMap;
-+import java.util.LinkedList;
-+import java.util.List;
-+import java.util.Set;
-+import java.util.logging.Level;
-+import java.util.logging.Logger;
-+
-+import org.yaml.snakeyaml.Yaml;
-+
-+import net.minecraft.src.GuiScreen;
-+
-+import org.spoutcraft.api.gui.Button;
-+import org.spoutcraft.api.gui.GenericButton;
-+import org.spoutcraft.api.gui.GenericLabel;
-+import org.spoutcraft.api.gui.GenericScrollArea;
-+import org.spoutcraft.api.gui.Widget;
-+import org.spoutcraft.api.gui.WidgetAnchor;
-+import org.spoutcraft.client.SpoutClient;
-+import org.spoutcraft.client.gui.ClientTexture;
-+import org.spoutcraft.client.gui.GuiSpoutScreen;
-+import org.spoutcraft.client.gui.mainmenu.MainMenu;
-+import org.spoutcraft.client.io.FileUtil;
-+import org.spoutcraft.client.io.DownloadAssets;
-+import org.spoutcraft.client.io.CustomTextureManager;
-+
-+public class GuiNewAbout extends GuiSpoutScreen {
-+ private GuiScreen parent;
-+ private GenericButton buttonDone;
-+ private GenericLabel title, labelSpoutcraftVersion, labelMinecraftVersion;
-+ private GenericScrollArea scroll;
-+ private List> columns = new LinkedList>();
-+ private int sectionMargin = 20, columnMargin = 20;
-+ private ClientTexture textureSpoutcraft, textureMinecraft;
-+ private static HashMap root;
-+
-+ static {
-+ updateRoot();
-+ }
-+
-+ private static void updateRoot() {
-+ // DownloadAssets.downloadFile(FileUtil.getConfigDir(), "about.yml", "http://solder.inspirenxe.org/resources/spoutcraft/about.yml", true);
-+ File myFile = new File(FileUtil.getConfigDir(), "about.yml");
-+
-+ try {
-+ root = (HashMap) (new Yaml()).load((new FileReader(myFile)));
-+ } catch (Exception ex) {
-+ Logger.getLogger(GuiNewAbout.class.getName()).log(Level.SEVERE, null, ex);
-+ }
-+ }
-+
-+ public GuiNewAbout(GuiScreen parent) {
-+ this.parent = parent;
-+ }
-+
-+ @Override
-+ protected void createInstances() {
-+ title = new GenericLabel("About");
-+ buttonDone = new GenericButton("Main Menu");
-+ scroll = new GenericScrollArea();
-+
-+ labelSpoutcraftVersion = new GenericLabel(SpoutClient.getSpoutcraftVersion() + SpoutClient.getSpoutcraftBuild() + "\nLicensed under LGPLv3");
-+ labelMinecraftVersion = new GenericLabel("Copyright Mojang AB");
-+ labelSpoutcraftVersion.setAlign(WidgetAnchor.TOP_RIGHT);
-+ textureSpoutcraft = new ClientTexture(FileUtil.getAssetsDir().getPath()+"/logo/spoutcraft.png");
-+ textureMinecraft = new ClientTexture(FileUtil.getAssetsDir().getPath()+"/logo/minecraft.png");
-+
-+ getScreen().attachWidgets("Spoutcraft", title, buttonDone, scroll, labelMinecraftVersion, labelSpoutcraftVersion, textureMinecraft, textureSpoutcraft);
-+
-+ load();
-+ }
-+
-+ @SuppressWarnings("unchecked")
-+ public void load() {
-+ scroll.removeWidgets("Spoutcraft");
-+ try {
-+ if (root.containsKey("options")) {
-+ HashMap options = (HashMap) root
-+ .get("options");
-+ if (options.containsKey("section-margin")) {
-+ sectionMargin = (Integer) options.get("section-margin");
-+ }
-+ if (options.containsKey("column-margin")) {
-+ columnMargin = (Integer) options.get("column-margin");
-+ }
-+ }
-+ if (root.containsKey("columns")) {
-+ LinkedHashMap columns = (LinkedHashMap) root
-+ .get("columns");
-+ for (Object col : columns.values()) {
-+ List sections = new LinkedList();
-+ LinkedHashMap secs = (LinkedHashMap) col;
-+ for (Object sec : secs.values()) {
-+ LinkedHashMap section = (LinkedHashMap) sec;
-+ String title = "Untitled";
-+ if (section.containsKey("title")) {
-+ title = (String) section.get("title");
-+ }
-+ Set keys = section.keySet();
-+ if (keys.size() > 2) {
-+ continue;
-+ }
-+ String sectionType = "";
-+ for (String key : keys) {
-+ if (!key.equals("title")) {
-+ sectionType = key;
-+ }
-+ }
-+ Section sectionObject = Section.getSection(sectionType);
-+ if (sectionObject == null) {
-+ continue;
-+ }
-+ sectionObject.init(this, title, section.get(sectionType));
-+ scroll.attachWidgets("Spoutcraft", sectionObject
-+ .getWidgets().toArray(new Widget[0]));
-+ sections.add(sectionObject);
-+ }
-+ this.columns.add(sections);
-+ }
-+ }
-+ } catch (Exception e) {
-+ e.printStackTrace();
-+ } finally {
-+ layoutWidgets();
-+ }
-+ }
-+
-+ @Override
-+ protected void layoutWidgets() {
-+ int top = 10;
-+
-+ int swidth = mc.fontRenderer.getStringWidth(title.getText());
-+ title.setY(top).setX(width / 2 - swidth / 2).setHeight(11)
-+ .setWidth(swidth);
-+
-+ int viewheight = height - title.getY() - 16 - 53;
-+
-+ scroll.setGeometry(5, title.getY() + 16, width - 10, viewheight);
-+
-+ textureSpoutcraft.setGeometry(width - 133, height - 48, 128, 32);
-+ textureMinecraft.setGeometry(5, height - 46, 128, 20);
-+
-+ labelMinecraftVersion.setGeometry(5, height - 25, width - (width / 2 - 50) - 5, 21);
-+ labelSpoutcraftVersion.setGeometry(width - 5, height - 25, width - (width / 2 + 55), 21);
-+ buttonDone.setGeometry(width / 2 - 50, height - 25, 100, 20);
-+
-+ int columnCount = columns.size();
-+ if (columnCount > 0) {
-+ int columnWidth = (width - 10 - 16 - (columnCount + 1)
-+ * columnMargin)
-+ / (columnCount);
-+ int columnX = columnMargin;
-+ Iterator> iter = columns.iterator();
-+ while (iter.hasNext()) {
-+ List column = iter.next();
-+ int sectionY = columnMargin;
-+ for (Section section : column) {
-+ section.setX(columnX);
-+ section.setY(sectionY);
-+ section.setWidth(columnWidth);
-+ sectionY += section.getHeight() + sectionMargin;
-+ }
-+ columnX += columnWidth + columnMargin;
-+ }
-+ scroll.updateInnerSize();
-+ }
-+ }
-+
-+ @Override
-+ public void onGuiClosed() {
-+ super.onGuiClosed();
-+ }
-+
-+ @Override
-+ protected void buttonClicked(Button btn) {
-+ if (btn == buttonDone) {
-+ mc.displayGuiScreen(parent);
-+ }
-+ }
-+
-+ public void update() {
-+ layoutWidgets();
-+ }
-+}
---- /dev/null
-+++ org/spoutcraft/api/util/MutableLocation.java
-@@ -1,0 +1,114 @@
-+/*
-+ * This file is part of Spoutcraft.
-+ *
-+ * Copyright (c) 2011 SpoutcraftDev
-+ * Spoutcraft is licensed under the GNU Lesser General Public License.
-+ *
-+ * Spoutcraft is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation, either version 3 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Spoutcraft is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program. If not, see .
-+ */
-+package org.spoutcraft.api.util;
-+
-+import org.apache.commons.lang3.builder.EqualsBuilder;
-+import org.apache.commons.lang3.builder.HashCodeBuilder;
-+
-+public class MutableLocation extends MutableVector implements Location {
-+ private double pitch;
-+ private double yaw;
-+
-+ public MutableLocation() {
-+ pitch = yaw = 0D;
-+ }
-+
-+ /**
-+ * Constructs a new Location with the given coordinates
-+ *
-+ * @param world The world in which this location resides
-+ * @param x The x-coordinate of this new location
-+ * @param y The y-coordinate of this new location
-+ * @param z The z-coordinate of this new location
-+ */
-+ public MutableLocation(final double x, final double y, final double z) {
-+ this(x, y, z, 0, 0);
-+ }
-+
-+ /**
-+ * Constructs a new Location with the given coordinates and direction
-+ *
-+ * @param world The world in which this location resides
-+ * @param x The x-coordinate of this new location
-+ * @param y The y-coordinate of this new location
-+ * @param z The z-coordinate of this new location
-+ * @param yaw The absolute rotation on the x-plane, in degrees
-+ * @param pitch The absolute rotation on the y-plane, in degrees
-+ */
-+ public MutableLocation(final double x, final double y, final double z, final double yaw, final double pitch) {
-+ this.x = x;
-+ this.y = y;
-+ this.z = z;
-+ this.pitch = pitch;
-+ this.yaw = yaw;
-+ }
-+
-+ public double getYaw() {
-+ return yaw;
-+ }
-+
-+ public double getPitch() {
-+ return pitch;
-+ }
-+
-+ public Location setYaw(double yaw) {
-+ this.yaw = yaw;
-+ return this;
-+ }
-+
-+ public Location setPitch(double pitch) {
-+ this.pitch = pitch;
-+ return this;
-+ }
-+
-+ public Vector getDirection() {
-+ Vector vector = new MutableVector();
-+
-+ double rotX = this.getYaw();
-+ double rotY = this.getPitch();
-+
-+ vector.setY(-Math.sin(Math.toRadians(rotY)));
-+
-+ double h = Math.cos(Math.toRadians(rotY));
-+
-+ vector.setX(-h * Math.sin(Math.toRadians(rotX)));
-+ vector.setZ(h * Math.cos(Math.toRadians(rotX)));
-+
-+ return vector;
-+ }
-+
-+ @Override
-+ public boolean equals(Object obj) {
-+ if (obj instanceof Location) {
-+ Location other = (Location) obj;
-+ return (new EqualsBuilder()).append(getX(), other.getX()).append(getY(), other.getY()).append(getZ(), other.getZ()).append(getYaw(), other.getYaw()).append(getPitch(), other.getPitch()).isEquals();
-+ }
-+ return false;
-+ }
-+
-+ @Override
-+ public int hashCode() {
-+ return (new HashCodeBuilder()).append(getX()).append(getY()).append(getZ()).append(getYaw()).append(getPitch()).toHashCode();
-+ }
-+
-+ public Vector toVector() {
-+ return new MutableVector(x, y, z);
-+ }
-+}
---- net/minecraft/src/BlockPane.java
-+++ net/minecraft/src/BlockPane.java
-@@ -4,90 +4,127 @@
- import java.util.Random;
-
- public class BlockPane extends Block {
-- private final String a;
-+
-+ /**
-+ * Holds the texture index of the side of the pane (the thin lateral side)
-+ */
-+ private final String sideTextureIndex;
-+
-+ /**
-+ * 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 c;
-+ private final String field_94402_c;
- private Icon theIcon;
-
-- protected BlockPane(int var1, String var2, String var3, Material var4, boolean var5) {
-- super(var1, var4);
-- this.a = var3;
-- this.canDropItself = var5;
-- this.c = var2;
-+ protected BlockPane(int par1, String par2Str, String par3Str, Material par4Material, boolean par5) {
-+ super(par1, par4Material);
-+ this.sideTextureIndex = par3Str;
-+ this.canDropItself = par5;
-+ this.field_94402_c = par2Str;
- this.setCreativeTab(CreativeTabs.tabDecorations);
- }
-
-- public int idDropped(int var1, Random var2, int var3) {
-- return !this.canDropItself ? 0 : super.idDropped(var1, var2, var3);
-+ /**
-+ * Returns the ID of the items to drop on destruction.
-+ */
-+ public int idDropped(int par1, Random par2Random, int par3) {
-+ return !this.canDropItself ? 0 : super.idDropped(par1, par2Random, par3);
- }
-
-+ /**
-+ * 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;
- }
-
-+ /**
-+ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc)
-+ */
- public boolean renderAsNormalBlock() {
- return false;
- }
-
-+ /**
-+ * The type of render function that is called for this block
-+ */
- public int getRenderType() {
- return 18;
- }
-
-- public boolean shouldSideBeRendered(IBlockAccess var1, int var2, int var3, int var4, int var5) {
-- int var6 = var1.getBlockId(var2, var3, var4);
-- return var6 == this.blockID ? false : super.shouldSideBeRendered(var1, var2, var3, var4, var5);
-- }
--
-- public void addCollisionBoxesToList(World var1, int var2, int var3, int var4, AxisAlignedBB var5, List var6, Entity var7) {
-- boolean var8 = this.canThisPaneConnectToThisBlockID(var1.getBlockId(var2, var3, var4 - 1));
-- boolean var9 = this.canThisPaneConnectToThisBlockID(var1.getBlockId(var2, var3, var4 + 1));
-- boolean var10 = this.canThisPaneConnectToThisBlockID(var1.getBlockId(var2 - 1, var3, var4));
-- boolean var11 = this.canThisPaneConnectToThisBlockID(var1.getBlockId(var2 + 1, var3, var4));
-- if((!var10 || !var11) && (var10 || var11 || var8 || var9)) {
-- if(var10 && !var11) {
-- this.setBlockBounds(0.0F, 0.0F, 7.0F / 16.0F, 0.5F, 1.0F, 9.0F / 16.0F);
-- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7);
-- } else if(!var10 && var11) {
-- this.setBlockBounds(0.5F, 0.0F, 7.0F / 16.0F, 1.0F, 1.0F, 9.0F / 16.0F);
-- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7);
-- }
-- } else {
-- this.setBlockBounds(0.0F, 0.0F, 7.0F / 16.0F, 1.0F, 1.0F, 9.0F / 16.0F);
-- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7);
-- }
--
-- if((!var8 || !var9) && (var10 || var11 || var8 || var9)) {
-- if(var8 && !var9) {
-- this.setBlockBounds(7.0F / 16.0F, 0.0F, 0.0F, 9.0F / 16.0F, 1.0F, 0.5F);
-- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7);
-- } else if(!var8 && var9) {
-- this.setBlockBounds(7.0F / 16.0F, 0.0F, 0.5F, 9.0F / 16.0F, 1.0F, 1.0F);
-- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7);
-- }
-- } else {
-- this.setBlockBounds(7.0F / 16.0F, 0.0F, 0.0F, 9.0F / 16.0F, 1.0F, 1.0F);
-- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7);
-- }
--
-- }
--
-+ /**
-+ * 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) {
-+ boolean var8 = this.canThisPaneConnectToThisBlockID(par1World.getBlockId(par2, par3, par4 - 1));
-+ boolean var9 = this.canThisPaneConnectToThisBlockID(par1World.getBlockId(par2, par3, par4 + 1));
-+ boolean var10 = this.canThisPaneConnectToThisBlockID(par1World.getBlockId(par2 - 1, par3, par4));
-+ boolean var11 = this.canThisPaneConnectToThisBlockID(par1World.getBlockId(par2 + 1, par3, par4));
-+
-+ if ((!var10 || !var11) && (var10 || var11 || var8 || var9)) {
-+ if (var10 && !var11) {
-+ this.setBlockBounds(0.0F, 0.0F, 0.4375F, 0.5F, 1.0F, 0.5625F);
-+ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity);
-+ } else if (!var10 && var11) {
-+ this.setBlockBounds(0.5F, 0.0F, 0.4375F, 1.0F, 1.0F, 0.5625F);
-+ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity);
-+ }
-+ } else {
-+ this.setBlockBounds(0.0F, 0.0F, 0.4375F, 1.0F, 1.0F, 0.5625F);
-+ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity);
-+ }
-+
-+ if ((!var8 || !var9) && (var10 || var11 || var8 || var9)) {
-+ if (var8 && !var9) {
-+ this.setBlockBounds(0.4375F, 0.0F, 0.0F, 0.5625F, 1.0F, 0.5F);
-+ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity);
-+ } else if (!var8 && var9) {
-+ this.setBlockBounds(0.4375F, 0.0F, 0.5F, 0.5625F, 1.0F, 1.0F);
-+ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity);
-+ }
-+ } else {
-+ this.setBlockBounds(0.4375F, 0.0F, 0.0F, 0.5625F, 1.0F, 1.0F);
-+ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity);
-+ }
-+ }
-+
-+ /**
-+ * Sets the block's bounds for rendering it as an item
-+ */
- public void setBlockBoundsForItemRender() {
- this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
- }
-
-- public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) {
-- float var5 = 7.0F / 16.0F;
-- float var6 = 9.0F / 16.0F;
-- float var7 = 7.0F / 16.0F;
-- float var8 = 9.0F / 16.0F;
-- boolean var9 = this.canThisPaneConnectToThisBlockID(var1.getBlockId(var2, var3, var4 - 1));
-- boolean var10 = this.canThisPaneConnectToThisBlockID(var1.getBlockId(var2, var3, var4 + 1));
-- boolean var11 = this.canThisPaneConnectToThisBlockID(var1.getBlockId(var2 - 1, var3, var4));
-- boolean var12 = this.canThisPaneConnectToThisBlockID(var1.getBlockId(var2 + 1, var3, var4));
-- if((!var11 || !var12) && (var11 || var12 || var9 || var10)) {
-- if(var11 && !var12) {
-+ /**
-+ * 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) {
-+ float var5 = 0.4375F;
-+ float var6 = 0.5625F;
-+ float var7 = 0.4375F;
-+ float var8 = 0.5625F;
-+ boolean var9 = this.canThisPaneConnectToThisBlockID(par1IBlockAccess.getBlockId(par2, par3, par4 - 1));
-+ boolean var10 = this.canThisPaneConnectToThisBlockID(par1IBlockAccess.getBlockId(par2, par3, par4 + 1));
-+ boolean var11 = this.canThisPaneConnectToThisBlockID(par1IBlockAccess.getBlockId(par2 - 1, par3, par4));
-+ boolean var12 = this.canThisPaneConnectToThisBlockID(par1IBlockAccess.getBlockId(par2 + 1, par3, par4));
-+
-+ if ((!var11 || !var12) && (var11 || var12 || var9 || var10)) {
-+ if (var11 && !var12) {
- var5 = 0.0F;
-- } else if(!var11 && var12) {
-+ } else if (!var11 && var12) {
- var6 = 1.0F;
- }
- } else {
-@@ -95,10 +132,10 @@
- var6 = 1.0F;
- }
-
-- if((!var9 || !var10) && (var11 || var12 || var9 || var10)) {
-- if(var9 && !var10) {
-+ if ((!var9 || !var10) && (var11 || var12 || var9 || var10)) {
-+ if (var9 && !var10) {
- var7 = 0.0F;
-- } else if(!var9 && var10) {
-+ } else if (!var9 && var10) {
- var8 = 1.0F;
- }
- } else {
-@@ -109,24 +146,44 @@
- 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;
- }
-
-- public final boolean canThisPaneConnectToThisBlockID(int var1) {
-- return Block.opaqueCubeLookup[var1] || var1 == this.blockID || var1 == Block.glass.blockID;
-+ /**
-+ * 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) {
-+ // Spout Start - Add cloth and stoneBrick IDs
-+ return Block.opaqueCubeLookup[par1] || par1 == this.blockID || par1 == Block.glass.blockID || par1 == Block.cloth.blockID || par1 == Block.stoneBrick.blockID;
-+ // Spout End
- }
-
-+ /**
-+ * Return true if a player with Silk Touch can harvest this block directly, and not its normal drops.
-+ */
- protected boolean canSilkHarvest() {
- return true;
- }
-
-- protected ItemStack createStackedBlock(int var1) {
-- return new ItemStack(this.blockID, 1, var1);
-+ /**
-+ * 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);
- }
-
-- public void registerIcons(IconRegister var1) {
-- this.blockIcon = var1.registerIcon(this.c);
-- this.theIcon = var1.registerIcon(this.a);
-+ /**
-+ * 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);
- }
- }
---- net/minecraft/src/CommandServerSaveOff.java
-+++ net/minecraft/src/CommandServerSaveOff.java
-@@ -7,30 +7,34 @@
- return "save-off";
- }
-
-+ /**
-+ * Return the required permission level for this command.
-+ */
- public int getRequiredPermissionLevel() {
- return 4;
- }
-
-- public String getCommandUsage(ICommandSender var1) {
-+ public String getCommandUsage(ICommandSender par1ICommandSender) {
- return "commands.save-off.usage";
- }
-
-- public void processCommand(ICommandSender var1, String[] var2) {
-+ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) {
- MinecraftServer var3 = MinecraftServer.getServer();
- boolean var4 = false;
-
-- for(int var5 = 0; var5 < var3.worldServers.length; ++var5) {
-- if(var3.worldServers[var5] != null) {
-+ for (int var5 = 0; var5 < var3.worldServers.length; ++var5) {
-+ if (var3.worldServers[var5] != null) {
- WorldServer var6 = var3.worldServers[var5];
-- if(!var6.levelSaving) {
-- var6.levelSaving = true;
-+
-+ if (!var6.canNotSave) {
-+ var6.canNotSave = true;
- var4 = true;
- }
- }
- }
-
-- if(var4) {
-- notifyAdmins(var1, "commands.save.disabled", new Object[0]);
-+ if (var4) {
-+ notifyAdmins(par1ICommandSender, "commands.save.disabled", new Object[0]);
- } else {
- throw new CommandException("commands.save-off.alreadyOff", new Object[0]);
- }
---- net/minecraft/src/AABBPool.java
-+++ net/minecraft/src/AABBPool.java
-@@ -4,42 +4,69 @@
- import java.util.List;
-
- public class AABBPool {
-+
-+ /**
-+ * Maximum number of times the pool can be "cleaned" before the list is shrunk
-+ */
- private final int maxNumCleans;
-+
-+ /**
-+ * Number of Pool entries to remove when cleanPool is called maxNumCleans times.
-+ */
- private final int numEntriesToRemove;
-- private final List c = new ArrayList();
-+
-+ /** List of AABB stored in this Pool */
-+ private final List listAABB = new ArrayList();
-+
-+ /** Next index to use when adding a Pool Entry. */
- private int nextPoolIndex;
-+
-+ /**
-+ * Largest index reached by this Pool (can be reset to 0 upon calling cleanPool)
-+ */
- private int maxPoolIndex;
-+
-+ /** Number of times this Pool has been cleaned */
- private int numCleans;
-
-- public AABBPool(int var1, int var2) {
-- this.maxNumCleans = var1;
-- this.numEntriesToRemove = var2;
-+ public AABBPool(int par1, int par2) {
-+ this.maxNumCleans = par1;
-+ this.numEntriesToRemove = par2;
- }
-
-- public AxisAlignedBB getAABB(double var1, double var3, double var5, double var7, double var9, double var11) {
-+ /**
-+ * Creates a new AABB, or reuses one that's no longer in use. Parameters: minX, minY, minZ, maxX, maxY, maxZ. AABBs
-+ * returned from this function should only be used for one frame or tick, as after that they will be reused.
-+ */
-+ public AxisAlignedBB getAABB(double par1, double par3, double par5, double par7, double par9, double par11) {
- AxisAlignedBB var13;
-- if(this.nextPoolIndex >= this.c.size()) {
-- var13 = new AxisAlignedBB(var1, var3, var5, var7, var9, var11);
-- this.c.add(var13);
-+
-+ if (this.nextPoolIndex >= this.listAABB.size()) {
-+ var13 = new AxisAlignedBB(par1, par3, par5, par7, par9, par11);
-+ this.listAABB.add(var13);
- } else {
-- var13 = (AxisAlignedBB)this.c.get(this.nextPoolIndex);
-- var13.setBounds(var1, var3, var5, var7, var9, var11);
-+ var13 = (AxisAlignedBB)this.listAABB.get(this.nextPoolIndex);
-+ var13.setBounds(par1, par3, par5, par7, par9, par11);
- }
-
- ++this.nextPoolIndex;
- return var13;
- }
-
-+ /**
-+ * Marks the pool as "empty", starting over when adding new entries. If this is called maxNumCleans times, the list
-+ * size is reduced
-+ */
- public void cleanPool() {
-- if(this.nextPoolIndex > this.maxPoolIndex) {
-+ if (this.nextPoolIndex > this.maxPoolIndex) {
- this.maxPoolIndex = this.nextPoolIndex;
- }
-
-- if(this.numCleans++ == this.maxNumCleans) {
-- int var1 = Math.max(this.maxPoolIndex, this.c.size() - this.numEntriesToRemove);
-+ if (this.numCleans++ == this.maxNumCleans) {
-+ int var1 = Math.max(this.maxPoolIndex, this.listAABB.size() - this.numEntriesToRemove);
-
-- while(this.c.size() > var1) {
-- this.c.remove(var1);
-+ while (this.listAABB.size() > var1) {
-+ this.listAABB.remove(var1);
- }
-
- this.maxPoolIndex = 0;
-@@ -49,13 +76,16 @@
- this.nextPoolIndex = 0;
- }
-
-+ /**
-+ * Clears the AABBPool
-+ */
- public void clearPool() {
- this.nextPoolIndex = 0;
-- this.c.clear();
-+ this.listAABB.clear();
- }
-
- public int getlistAABBsize() {
-- return this.c.size();
-+ return this.listAABB.size();
- }
-
- public int getnextPoolIndex() {
---- /dev/null
-+++ org/spoutcraft/api/material/item/GenericFood.java
-@@ -1,0 +1,34 @@
-+/*
-+ * This file is part of Spoutcraft.
-+ *
-+ * Copyright (c) 2011 SpoutcraftDev
-+ * Spoutcraft is licensed under the GNU Lesser General Public License.
-+ *
-+ * Spoutcraft is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation, either version 3 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Spoutcraft is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program. If not, see .
-+ */
-+package org.spoutcraft.api.material.item;
-+
-+import org.spoutcraft.api.material.Food;
-+
-+public class GenericFood extends GenericItem implements Food {
-+ private final int hunger;
-+ public GenericFood(String name, int id, int hunger) {
-+ super(name, id);
-+ this.hunger = hunger;
-+ }
-+
-+ public int getHungerRestored() {
-+ return hunger;
-+ }
-+}
---- net/minecraft/src/GenLayerShore.java
-+++ net/minecraft/src/GenLayerShore.java
-@@ -1,55 +1,63 @@
- package net.minecraft.src;
-
- public class GenLayerShore extends GenLayer {
-- public GenLayerShore(long var1, GenLayer var3) {
-- super(var1);
-- this.parent = var3;
-+ public GenLayerShore(long par1, GenLayer par3GenLayer) {
-+ super(par1);
-+ this.parent = par3GenLayer;
- }
-
-- public int[] getInts(int var1, int var2, int var3, int var4) {
-- int[] var5 = this.parent.getInts(var1 - 1, var2 - 1, var3 + 2, var4 + 2);
-- int[] var6 = IntCache.getIntCache(var3 * var4);
-+ /**
-+ * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall
-+ * amounts, or biomeList[] indices based on the particular GenLayer subclass.
-+ */
-+ public int[] getInts(int par1, int par2, int par3, int par4) {
-+ int[] var5 = this.parent.getInts(par1 - 1, par2 - 1, par3 + 2, par4 + 2);
-+ int[] var6 = IntCache.getIntCache(par3 * par4);
-
-- for(int var7 = 0; var7 < var4; ++var7) {
-- for(int var8 = 0; var8 < var3; ++var8) {
-- this.initChunkSeed((long)(var8 + var1), (long)(var7 + var2));
-- int var9 = var5[var8 + 1 + (var7 + 1) * (var3 + 2)];
-+ for (int var7 = 0; var7 < par4; ++var7) {
-+ for (int var8 = 0; var8 < par3; ++var8) {
-+ this.initChunkSeed((long)(var8 + par1), (long)(var7 + par2));
-+ int var9 = var5[var8 + 1 + (var7 + 1) * (par3 + 2)];
- int var10;
- int var11;
- int var12;
- int var13;
-- if(var9 == BiomeGenBase.mushroomIsland.biomeID) {
-- var10 = var5[var8 + 1 + (var7 + 1 - 1) * (var3 + 2)];
-- var11 = var5[var8 + 1 + 1 + (var7 + 1) * (var3 + 2)];
-- var12 = var5[var8 + 1 - 1 + (var7 + 1) * (var3 + 2)];
-- var13 = var5[var8 + 1 + (var7 + 1 + 1) * (var3 + 2)];
-- if(var10 != BiomeGenBase.ocean.biomeID && var11 != BiomeGenBase.ocean.biomeID && var12 != BiomeGenBase.ocean.biomeID && var13 != BiomeGenBase.ocean.biomeID) {
-- var6[var8 + var7 * var3] = var9;
-- } else {
-- var6[var8 + var7 * var3] = BiomeGenBase.mushroomIslandShore.biomeID;
-- }
-- } else if(var9 != BiomeGenBase.ocean.biomeID && var9 != BiomeGenBase.river.biomeID && var9 != BiomeGenBase.swampland.biomeID && var9 != BiomeGenBase.extremeHills.biomeID) {
-- var10 = var5[var8 + 1 + (var7 + 1 - 1) * (var3 + 2)];
-- var11 = var5[var8 + 1 + 1 + (var7 + 1) * (var3 + 2)];
-- var12 = var5[var8 + 1 - 1 + (var7 + 1) * (var3 + 2)];
-- var13 = var5[var8 + 1 + (var7 + 1 + 1) * (var3 + 2)];
-- if(var10 != BiomeGenBase.ocean.biomeID && var11 != BiomeGenBase.ocean.biomeID && var12 != BiomeGenBase.ocean.biomeID && var13 != BiomeGenBase.ocean.biomeID) {
-- var6[var8 + var7 * var3] = var9;
-- } else {
-- var6[var8 + var7 * var3] = BiomeGenBase.beach.biomeID;
-- }
-- } else if(var9 == BiomeGenBase.extremeHills.biomeID) {
-- var10 = var5[var8 + 1 + (var7 + 1 - 1) * (var3 + 2)];
-- var11 = var5[var8 + 1 + 1 + (var7 + 1) * (var3 + 2)];
-- var12 = var5[var8 + 1 - 1 + (var7 + 1) * (var3 + 2)];
-- var13 = var5[var8 + 1 + (var7 + 1 + 1) * (var3 + 2)];
-- if(var10 == BiomeGenBase.extremeHills.biomeID && var11 == BiomeGenBase.extremeHills.biomeID && var12 == BiomeGenBase.extremeHills.biomeID && var13 == BiomeGenBase.extremeHills.biomeID) {
-- var6[var8 + var7 * var3] = var9;
-- } else {
-- var6[var8 + var7 * var3] = BiomeGenBase.extremeHillsEdge.biomeID;
-+
-+ if (var9 == BiomeGenBase.mushroomIsland.biomeID) {
-+ var10 = var5[var8 + 1 + (var7 + 1 - 1) * (par3 + 2)];
-+ var11 = var5[var8 + 1 + 1 + (var7 + 1) * (par3 + 2)];
-+ var12 = var5[var8 + 1 - 1 + (var7 + 1) * (par3 + 2)];
-+ var13 = var5[var8 + 1 + (var7 + 1 + 1) * (par3 + 2)];
-+
-+ if (var10 != BiomeGenBase.ocean.biomeID && var11 != BiomeGenBase.ocean.biomeID && var12 != BiomeGenBase.ocean.biomeID && var13 != BiomeGenBase.ocean.biomeID) {
-+ var6[var8 + var7 * par3] = var9;
-+ } else {
-+ var6[var8 + var7 * par3] = BiomeGenBase.mushroomIslandShore.biomeID;
-+ }
-+ } else if (var9 != BiomeGenBase.ocean.biomeID && var9 != BiomeGenBase.river.biomeID && var9 != BiomeGenBase.swampland.biomeID && var9 != BiomeGenBase.extremeHills.biomeID) {
-+ var10 = var5[var8 + 1 + (var7 + 1 - 1) * (par3 + 2)];
-+ var11 = var5[var8 + 1 + 1 + (var7 + 1) * (par3 + 2)];
-+ var12 = var5[var8 + 1 - 1 + (var7 + 1) * (par3 + 2)];
-+ var13 = var5[var8 + 1 + (var7 + 1 + 1) * (par3 + 2)];
-+
-+ if (var10 != BiomeGenBase.ocean.biomeID && var11 != BiomeGenBase.ocean.biomeID && var12 != BiomeGenBase.ocean.biomeID && var13 != BiomeGenBase.ocean.biomeID) {
-+ var6[var8 + var7 * par3] = var9;
-+ } else {
-+ var6[var8 + var7 * par3] = BiomeGenBase.beach.biomeID;
-+ }
-+ } else if (var9 == BiomeGenBase.extremeHills.biomeID) {
-+ var10 = var5[var8 + 1 + (var7 + 1 - 1) * (par3 + 2)];
-+ var11 = var5[var8 + 1 + 1 + (var7 + 1) * (par3 + 2)];
-+ var12 = var5[var8 + 1 - 1 + (var7 + 1) * (par3 + 2)];
-+ var13 = var5[var8 + 1 + (var7 + 1 + 1) * (par3 + 2)];
-+
-+ if (var10 == BiomeGenBase.extremeHills.biomeID && var11 == BiomeGenBase.extremeHills.biomeID && var12 == BiomeGenBase.extremeHills.biomeID && var13 == BiomeGenBase.extremeHills.biomeID) {
-+ var6[var8 + var7 * par3] = var9;
-+ } else {
-+ var6[var8 + var7 * par3] = BiomeGenBase.extremeHillsEdge.biomeID;
- }
- } else {
-- var6[var8 + var7 * var3] = var9;
-+ var6[var8 + var7 * par3] = var9;
- }
- }
- }
---- net/minecraft/src/StructureStrongholdPieceWeight.java
-+++ net/minecraft/src/StructureStrongholdPieceWeight.java
-@@ -1,18 +1,25 @@
- package net.minecraft.src;
-
- class StructureStrongholdPieceWeight {
-- public Class a;
-+ public Class pieceClass;
-+
-+ /**
-+ * This basically keeps track of the 'epicness' of a structure. Epic structure components have a higher 'weight', and
-+ * Structures may only grow up to a certain 'weight' before generation is stopped
-+ */
- public final int pieceWeight;
- public int instancesSpawned;
-+
-+ /** How many Structure Pieces of this type may spawn in a structure */
- public int instancesLimit;
-
-- public StructureStrongholdPieceWeight(Class var1, int var2, int var3) {
-- this.a = var1;
-- this.pieceWeight = var2;
-- this.instancesLimit = var3;
-+ public StructureStrongholdPieceWeight(Class par1Class, int par2, int par3) {
-+ this.pieceClass = par1Class;
-+ this.pieceWeight = par2;
-+ this.instancesLimit = par3;
- }
-
-- public boolean canSpawnMoreStructuresOfType(int var1) {
-+ public boolean canSpawnMoreStructuresOfType(int par1) {
- return this.instancesLimit == 0 || this.instancesSpawned < this.instancesLimit;
- }
-
---- net/minecraft/src/EntityMoveHelper.java
-+++ net/minecraft/src/EntityMoveHelper.java
-@@ -1,18 +1,22 @@
- package net.minecraft.src;
-
- public class EntityMoveHelper {
-+
-+ /** The EntityLiving that is being moved */
- private EntityLiving entity;
- private double posX;
- private double posY;
- private double posZ;
-+
-+ /** The speed at which the entity should move */
- private double speed;
- private boolean update;
-
-- public EntityMoveHelper(EntityLiving var1) {
-- this.entity = var1;
-- this.posX = var1.posX;
-- this.posY = var1.posY;
-- this.posZ = var1.posZ;
-+ public EntityMoveHelper(EntityLiving par1EntityLiving) {
-+ this.entity = par1EntityLiving;
-+ this.posX = par1EntityLiving.posX;
-+ this.posY = par1EntityLiving.posY;
-+ this.posZ = par1EntityLiving.posZ;
- }
-
- public boolean isUpdating() {
-@@ -23,45 +27,54 @@
- return this.speed;
- }
-
-- public void setMoveTo(double var1, double var3, double var5, double var7) {
-- this.posX = var1;
-- this.posY = var3;
-- this.posZ = var5;
-- this.speed = var7;
-+ /**
-+ * Sets the speed and location to move to
-+ */
-+ public void setMoveTo(double par1, double par3, double par5, double par7) {
-+ this.posX = par1;
-+ this.posY = par3;
-+ this.posZ = par5;
-+ this.speed = par7;
- this.update = true;
- }
-
- public void onUpdateMoveHelper() {
- this.entity.setMoveForward(0.0F);
-- if(this.update) {
-+
-+ if (this.update) {
- this.update = false;
- int var1 = MathHelper.floor_double(this.entity.boundingBox.minY + 0.5D);
- double var2 = this.posX - this.entity.posX;
- double var4 = this.posZ - this.entity.posZ;
- double var6 = this.posY - (double)var1;
- double var8 = var2 * var2 + var6 * var6 + var4 * var4;
-- if(var8 >= (double)2.5000003E-7F) {
-- float var10 = (float)(Math.atan2(var4, var2) * 180.0D / (double)((float)Math.PI)) - 90.0F;
-+
-+ if (var8 >= 2.500000277905201E-7D) {
-+ float var10 = (float)(Math.atan2(var4, var2) * 180.0D / Math.PI) - 90.0F;
- this.entity.rotationYaw = this.limitAngle(this.entity.rotationYaw, var10, 30.0F);
- this.entity.setAIMoveSpeed((float)(this.speed * this.entity.getEntityAttribute(SharedMonsterAttributes.movementSpeed).getAttributeValue()));
-- if(var6 > 0.0D && var2 * var2 + var4 * var4 < 1.0D) {
-+
-+ if (var6 > 0.0D && var2 * var2 + var4 * var4 < 1.0D) {
- this.entity.getJumpHelper().setJumping();
- }
--
- }
- }
- }
-
-- private float limitAngle(float var1, float var2, float var3) {
-- float var4 = MathHelper.wrapAngleTo180_float(var2 - var1);
-- if(var4 > var3) {
-- var4 = var3;
-- }
--
-- if(var4 < -var3) {
-- var4 = -var3;
-- }
--
-- return var1 + var4;
-+ /**
-+ * Limits the given angle to a upper and lower limit.
-+ */
-+ private float limitAngle(float par1, float par2, float par3) {
-+ float var4 = MathHelper.wrapAngleTo180_float(par2 - par1);
-+
-+ if (var4 > par3) {
-+ var4 = par3;
-+ }
-+
-+ if (var4 < -par3) {
-+ var4 = -par3;
-+ }
-+
-+ return par1 + var4;
- }
- }
---- /dev/null
-+++ com/prupe/mcpatcher/mob/MobRandomizer.java
-@@ -1,0 +1,58 @@
-+package com.prupe.mcpatcher.mob;
-+
-+import com.prupe.mcpatcher.MCLogger;
-+import com.prupe.mcpatcher.TexturePackChangeHandler;
-+import com.prupe.mcpatcher.mob.MobRandomizer$1;
-+import com.prupe.mcpatcher.mob.MobRandomizer$ExtraInfo;
-+import java.util.LinkedHashMap;
-+import net.minecraft.src.Entity;
-+import net.minecraft.src.EntityLivingBase;
-+import net.minecraft.src.ResourceLocation;
-+
-+public class MobRandomizer {
-+ private static final MCLogger logger = MCLogger.getLogger("Random Mobs");
-+ private static final LinkedHashMap cache = new LinkedHashMap();
-+
-+ static void init() {}
-+
-+ public static ResourceLocation randomTexture(EntityLivingBase entity, ResourceLocation texture) {
-+ if (texture != null && texture.getResourcePath().endsWith(".png")) {
-+ String key = texture.toString() + ":" + entity.entityId;
-+ ResourceLocation newTexture = (ResourceLocation)cache.get(key);
-+
-+ if (newTexture == null) {
-+ MobRandomizer$ExtraInfo info = MobRandomizer$ExtraInfo.getInfo(entity);
-+ MobRuleList list = MobRuleList.get(texture);
-+ newTexture = list.getSkin(MobRandomizer$ExtraInfo.access$100(info), MobRandomizer$ExtraInfo.access$200(info), MobRandomizer$ExtraInfo.access$300(info), MobRandomizer$ExtraInfo.access$400(info), MobRandomizer$ExtraInfo.access$500(info));
-+ cache.put(key, newTexture);
-+ logger.finer("entity %s using %s (cache: %d)", new Object[] {entity, newTexture, Integer.valueOf(cache.size())});
-+
-+ if (cache.size() > 250) {
-+ while (cache.size() > 200) {
-+ cache.remove(cache.keySet().iterator().next());
-+ }
-+ }
-+ }
-+
-+ return newTexture;
-+ } else {
-+ return texture;
-+ }
-+ }
-+
-+ public static ResourceLocation randomTexture(Entity entity, ResourceLocation texture) {
-+ return entity instanceof EntityLivingBase ? randomTexture((EntityLivingBase)entity, texture) : texture;
-+ }
-+
-+ static LinkedHashMap access$000() {
-+ return cache;
-+ }
-+
-+ static MCLogger access$600() {
-+ return logger;
-+ }
-+
-+ static {
-+ TexturePackChangeHandler.register(new MobRandomizer$1("Random Mobs", 2));
-+ }
-+}
---- net/minecraft/src/CommandGive.java
-+++ net/minecraft/src/CommandGive.java
-@@ -8,50 +8,60 @@
- return "give";
- }
-
-+ /**
-+ * Return the required permission level for this command.
-+ */
- public int getRequiredPermissionLevel() {
- return 2;
- }
-
-- public String getCommandUsage(ICommandSender var1) {
-+ public String getCommandUsage(ICommandSender par1ICommandSender) {
- return "commands.give.usage";
- }
-
-- public void processCommand(ICommandSender var1, String[] var2) {
-- if(var2.length >= 2) {
-- EntityPlayerMP var3 = getPlayer(var1, var2[0]);
-- int var4 = parseIntWithMin(var1, var2[1], 1);
-+ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) {
-+ if (par2ArrayOfStr.length >= 2) {
-+ EntityPlayerMP var3 = getPlayer(par1ICommandSender, par2ArrayOfStr[0]);
-+ int var4 = parseIntWithMin(par1ICommandSender, par2ArrayOfStr[1], 1);
- int var5 = 1;
- int var6 = 0;
-- if(Item.itemsList[var4] == null) {
-- throw new NumberInvalidException("commands.give.notFound", new Object[]{Integer.valueOf(var4)});
-+
-+ if (Item.itemsList[var4] == null) {
-+ throw new NumberInvalidException("commands.give.notFound", new Object[] {Integer.valueOf(var4)});
- } else {
-- if(var2.length >= 3) {
-- var5 = parseIntBounded(var1, var2[2], 1, 64);
-+ if (par2ArrayOfStr.length >= 3) {
-+ var5 = parseIntBounded(par1ICommandSender, par2ArrayOfStr[2], 1, 64);
- }
-
-- if(var2.length >= 4) {
-- var6 = parseInt(var1, var2[3]);
-+ if (par2ArrayOfStr.length >= 4) {
-+ var6 = parseInt(par1ICommandSender, par2ArrayOfStr[3]);
- }
-
- ItemStack var7 = new ItemStack(var4, var5, var6);
- EntityItem var8 = var3.dropPlayerItem(var7);
- var8.delayBeforeCanPickup = 0;
-- notifyAdmins(var1, "commands.give.success", new Object[]{Item.itemsList[var4].getItemStackDisplayName(var7), Integer.valueOf(var4), Integer.valueOf(var5), var3.getEntityName()});
-+ notifyAdmins(par1ICommandSender, "commands.give.success", new Object[] {Item.itemsList[var4].getItemStackDisplayName(var7), Integer.valueOf(var4), Integer.valueOf(var5), var3.getEntityName()});
- }
- } else {
- throw new WrongUsageException("commands.give.usage", new Object[0]);
- }
- }
-
-- public List addTabCompletionOptions(ICommandSender var1, String[] var2) {
-- return var2.length == 1 ? getListOfStringsMatchingLastWord(var2, this.getPlayers()) : null;
-+ /**
-+ * Adds the strings available in this command to the given list of tab completion options.
-+ */
-+ public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) {
-+ return par2ArrayOfStr.length == 1 ? getListOfStringsMatchingLastWord(par2ArrayOfStr, this.getPlayers()) : null;
- }
-
- protected String[] getPlayers() {
- return MinecraftServer.getServer().getAllUsernames();
- }
-
-- public boolean isUsernameIndex(String[] var1, int var2) {
-- return var2 == 0;
-+ /**
-+ * Return whether the specified command parameter index is a username parameter.
-+ */
-+ public boolean isUsernameIndex(String[] par1ArrayOfStr, int par2) {
-+ return par2 == 0;
- }
- }
---- net/minecraft/src/EnchantmentArrowInfinite.java
-+++ net/minecraft/src/EnchantmentArrowInfinite.java
-@@ -1,19 +1,28 @@
- package net.minecraft.src;
-
- public class EnchantmentArrowInfinite extends Enchantment {
-- public EnchantmentArrowInfinite(int var1, int var2) {
-- super(var1, var2, EnumEnchantmentType.bow);
-+ public EnchantmentArrowInfinite(int par1, int par2) {
-+ super(par1, par2, EnumEnchantmentType.bow);
- this.setName("arrowInfinite");
- }
-
-- public int getMinEnchantability(int var1) {
-+ /**
-+ * Returns the minimal value of enchantability needed on the enchantment level passed.
-+ */
-+ public int getMinEnchantability(int par1) {
- return 20;
- }
-
-- public int getMaxEnchantability(int var1) {
-+ /**
-+ * Returns the maximum value of enchantability nedded on the enchantment level passed.
-+ */
-+ public int getMaxEnchantability(int par1) {
- return 50;
- }
-
-+ /**
-+ * Returns the maximum level that the enchantment can have.
-+ */
- public int getMaxLevel() {
- return 1;
- }
---- net/minecraft/src/MapItemRenderer.java
-+++ net/minecraft/src/MapItemRenderer.java
-@@ -10,32 +10,33 @@
- private GameSettings gameSettings;
- private final ResourceLocation field_111276_e;
-
-- public MapItemRenderer(GameSettings var1, TextureManager var2) {
-- this.gameSettings = var1;
-+ public MapItemRenderer(GameSettings par1GameSettings, TextureManager par2TextureManager) {
-+ this.gameSettings = par1GameSettings;
- this.bufferedImage = new DynamicTexture(128, 128);
-- this.field_111276_e = var2.getDynamicTextureLocation("map", this.bufferedImage);
-+ this.field_111276_e = par2TextureManager.getDynamicTextureLocation("map", this.bufferedImage);
- this.intArray = this.bufferedImage.getTextureData();
-
-- for(int var4 = 0; var4 < this.intArray.length; ++var4) {
-+ for (int var4 = 0; var4 < this.intArray.length; ++var4) {
- this.intArray[var4] = 0;
- }
--
- }
-
-- public void renderMap(EntityPlayer var1, TextureManager var2, MapData var3) {
-- for(int var4 = 0; var4 < 16384; ++var4) {
-- byte var5 = var3.colors[var4];
-- if(var5 / 4 == 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) {
-+
-+ if (var7 == 2) {
- var8 = 255;
- }
-
-- if(var7 == 0) {
-+ if (var7 == 0) {
- var8 = 180;
- }
-
-@@ -51,28 +52,28 @@
- byte var16 = 0;
- Tessellator var17 = Tessellator.instance;
- float var18 = 0.0F;
-- var2.bindTexture(this.field_111276_e);
-+ 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), (double)-0.01F, 0.0D, 1.0D);
-- var17.addVertexWithUV((double)((float)(var15 + 128) - var18), (double)((float)(var16 + 128) - var18), (double)-0.01F, 1.0D, 1.0D);
-- var17.addVertexWithUV((double)((float)(var15 + 128) - var18), (double)((float)(var16 + 0) + var18), (double)-0.01F, 1.0D, 0.0D);
-- var17.addVertexWithUV((double)((float)(var15 + 0) + var18), (double)((float)(var16 + 0) + var18), (double)-0.01F, 0.0D, 0.0D);
-+ 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);
-- var2.bindTexture(field_111277_a);
-+ par2TextureManager.bindTexture(field_111277_a);
- int var19 = 0;
-
-- for(Iterator var20 = var3.g.values().iterator(); var20.hasNext(); ++var19) {
-+ 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(-(2.0F / 16.0F), 2.0F / 16.0F, 0.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;
---- /dev/null
-+++ org/spoutcraft/client/pluginloader/ClassLoader.java
-@@ -1,0 +1,41 @@
-+/*
-+ * This file is part of Spoutcraft.
-+ *
-+ * Copyright (c) 2011 SpoutcraftDev
-+ * Spoutcraft is licensed under the GNU Lesser General Public License.
-+ *
-+ * Spoutcraft is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation, either version 3 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Spoutcraft is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program. If not, see .
-+ */
-+package org.spoutcraft.client.pluginloader;
-+
-+import java.net.URL;
-+import java.net.URLClassLoader;
-+
-+public class ClassLoader extends URLClassLoader {
-+ public ClassLoader(final URL[] urls, final ClassLoader parent) {
-+ super(urls, parent);
-+ }
-+
-+ @Override
-+ protected Class> findClass(String name) throws ClassNotFoundException {
-+ if (!whitelisted(name)) {
-+ throw new SecurityException("Plugin attempted to access non-whitelisted class: " + name);
-+ }
-+ return super.findClass(name);
-+ }
-+
-+ private boolean whitelisted(String classname) {
-+ return true;
-+ }
-+}
---- /dev/null
-+++ org/spoutcraft/client/gui/GuiSpoutScreen.java
-@@ -1,0 +1,75 @@
-+/*
-+ * This file is part of Spoutcraft.
-+ *
-+ * Copyright (c) 2011 SpoutcraftDev
-+ * Spoutcraft is licensed under the GNU Lesser General Public License.
-+ *
-+ * Spoutcraft is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation, either version 3 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Spoutcraft is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program. If not, see .
-+ */
-+package org.spoutcraft.client.gui;
-+
-+import net.minecraft.src.Minecraft;
-+import net.minecraft.src.GuiParticle;
-+import net.minecraft.src.GuiScreen;
-+
-+import org.spoutcraft.api.gui.GenericGradient;
-+
-+public abstract class GuiSpoutScreen extends GuiScreen {
-+ protected boolean instancesCreated = false;
-+
-+ /**
-+ * Init the widgets in this method.
-+ * You should create new Instances of the widgets here,
-+ * and also set unique properties that will not change when you resize the screen.
-+ * Also attach the widgets to their screen.
-+ */
-+ protected abstract void createInstances();
-+
-+ /**
-+ * Set the width, height and the position of the widgets here.
-+ */
-+ protected abstract void layoutWidgets();
-+
-+ @Override
-+ public void initGui() {
-+ if (!instancesCreated) {
-+ createInstances();
-+ }
-+ layoutWidgets();
-+ instancesCreated = true;
-+ }
-+
-+ @Override
-+ public void drawScreen(int var1, int var2, float var3) {
-+ drawDefaultBackground();
-+ }
-+
-+ @Override
-+ public void setWorldAndResolution(Minecraft var1, int var2, int var3) {
-+ //ToDo: broken
-+ //this.guiParticles = new GuiParticle(var1);
-+ this.mc = var1;
-+ this.fontRenderer = var1.fontRenderer;
-+ this.width = var2;
-+ this.height = var3;
-+
-+ if (!instancesCreated) {
-+ createInstances();
-+ }
-+ layoutWidgets();
-+ instancesCreated = true;
-+
-+ bg = (GenericGradient) new GenericGradient().setHeight(this.height).setWidth(this.width);
-+ }
-+}
---- net/minecraft/src/Packet13PlayerLookMove.java
-+++ net/minecraft/src/Packet13PlayerLookMove.java
-@@ -10,38 +10,47 @@
- this.moving = true;
- }
-
-- public Packet13PlayerLookMove(double var1, double var3, double var5, double var7, float var9, float var10, boolean var11) {
-- this.xPosition = var1;
-- this.yPosition = var3;
-- this.stance = var5;
-- this.zPosition = var7;
-- this.yaw = var9;
-- this.pitch = var10;
-- this.onGround = var11;
-+ public Packet13PlayerLookMove(double par1, double par3, double par5, double par7, float par9, float par10, boolean par11) {
-+ this.xPosition = par1;
-+ this.yPosition = par3;
-+ this.stance = par5;
-+ this.zPosition = par7;
-+ this.yaw = par9;
-+ this.pitch = par10;
-+ this.onGround = par11;
- this.rotating = true;
- this.moving = true;
- }
-
-- public void readPacketData(DataInput var1) throws IOException {
-- this.xPosition = var1.readDouble();
-- this.yPosition = var1.readDouble();
-- this.stance = var1.readDouble();
-- this.zPosition = var1.readDouble();
-- this.yaw = var1.readFloat();
-- this.pitch = var1.readFloat();
-- super.readPacketData(var1);
-- }
--
-- public void writePacketData(DataOutput var1) throws IOException {
-- var1.writeDouble(this.xPosition);
-- var1.writeDouble(this.yPosition);
-- var1.writeDouble(this.stance);
-- var1.writeDouble(this.zPosition);
-- var1.writeFloat(this.yaw);
-- var1.writeFloat(this.pitch);
-- super.writePacketData(var1);
-- }
--
-+ /**
-+ * Abstract. Reads the raw packet data from the data stream.
-+ */
-+ public void readPacketData(DataInput par1DataInput) throws IOException {
-+ this.xPosition = par1DataInput.readDouble();
-+ this.yPosition = par1DataInput.readDouble();
-+ this.stance = par1DataInput.readDouble();
-+ this.zPosition = par1DataInput.readDouble();
-+ this.yaw = par1DataInput.readFloat();
-+ this.pitch = par1DataInput.readFloat();
-+ super.readPacketData(par1DataInput);
-+ }
-+
-+ /**
-+ * Abstract. Writes the raw packet data to the data stream.
-+ */
-+ public void writePacketData(DataOutput par1DataOutput) throws IOException {
-+ par1DataOutput.writeDouble(this.xPosition);
-+ par1DataOutput.writeDouble(this.yPosition);
-+ par1DataOutput.writeDouble(this.stance);
-+ par1DataOutput.writeDouble(this.zPosition);
-+ par1DataOutput.writeFloat(this.yaw);
-+ par1DataOutput.writeFloat(this.pitch);
-+ super.writePacketData(par1DataOutput);
-+ }
-+
-+ /**
-+ * Abstract. Return the size of the packet (not counting the header).
-+ */
- public int getPacketSize() {
- return 41;
- }
---- net/minecraft/src/EntityEgg.java
-+++ net/minecraft/src/EntityEgg.java
-@@ -1,30 +1,34 @@
- package net.minecraft.src;
-
- public class EntityEgg extends EntityThrowable {
-- public EntityEgg(World var1) {
-- super(var1);
-- }
--
-- public EntityEgg(World var1, EntityLivingBase var2) {
-- super(var1, var2);
-- }
--
-- public EntityEgg(World var1, double var2, double var4, double var6) {
-- super(var1, var2, var4, var6);
-- }
--
-- protected void onImpact(MovingObjectPosition var1) {
-- if(var1.entityHit != null) {
-- var1.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), 0.0F);
-+ public EntityEgg(World par1World) {
-+ super(par1World);
-+ }
-+
-+ public EntityEgg(World par1World, EntityLivingBase par2EntityLivingBase) {
-+ super(par1World, par2EntityLivingBase);
-+ }
-+
-+ public EntityEgg(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) {
-+ if (par1MovingObjectPosition.entityHit != null) {
-+ par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), 0.0F);
- }
-
-- if(!this.worldObj.isRemote && this.ab.nextInt(8) == 0) {
-+ if (!this.worldObj.isRemote && this.rand.nextInt(8) == 0) {
- byte var2 = 1;
-- if(this.ab.nextInt(32) == 0) {
-+
-+ if (this.rand.nextInt(32) == 0) {
- var2 = 4;
- }
-
-- for(int var3 = 0; var3 < var2; ++var3) {
-+ for (int var3 = 0; var3 < var2; ++var3) {
- EntityChicken var4 = new EntityChicken(this.worldObj);
- var4.setGrowingAge(-24000);
- var4.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F);
-@@ -32,13 +36,12 @@
- }
- }
-
-- for(int var5 = 0; var5 < 8; ++var5) {
-+ for (int var5 = 0; var5 < 8; ++var5) {
- this.worldObj.spawnParticle("snowballpoof", this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D);
- }
-
-- if(!this.worldObj.isRemote) {
-+ if (!this.worldObj.isRemote) {
- this.setDead();
- }
--
- }
- }
---- /dev/null
-+++ org/spoutcraft/client/gui/settings/controls/BetterGrassButton.java
-@@ -1,0 +1,62 @@
-+/*
-+ * This file is part of Spoutcraft.
-+ *
-+ * Copyright (c) 2011 SpoutcraftDev
-+ * Spoutcraft is licensed under the GNU Lesser General Public License.
-+ *
-+ * Spoutcraft is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation, either version 3 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Spoutcraft is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program. If not, see .
-+ */
-+package org.spoutcraft.client.gui.settings.controls;
-+
-+import com.prupe.mcpatcher.TexturePackChangeHandler;
-+
-+import net.minecraft.src.Minecraft;
-+
-+import org.spoutcraft.client.SpoutClient;
-+import org.spoutcraft.client.config.Configuration;
-+
-+public class BetterGrassButton extends AutomatedButton {
-+ public BetterGrassButton() {
-+ setTooltip("Better Grass / Snow\nOFF - default side grass texture, fastest\nFast - full side grass texture, slower\nFancy - dynamic side grass texture, slowest");
-+ }
-+
-+ @Override
-+ public String getText() {
-+ switch(Configuration.getBetterGrass()) {
-+ case 0: return "Better Grass / Snow: OFF";
-+ case 1: return "Better Grass / Snow: Fast";
-+ case 2: return "Better Grass / Snow: Fancy";
-+ }
-+ return "Unknown State: " + Configuration.getBetterGrass();
-+ }
-+
-+ @Override
-+ public void onButtonClick() {
-+ Configuration.setBetterGrass(Configuration.getBetterGrass() + 1);
-+ if (Configuration.getBetterGrass() > 2) {
-+ Configuration.setBetterGrass(0);
-+ }
-+ Configuration.write();
-+
-+ Minecraft game = SpoutClient.getHandle();
-+ TexturePackChangeHandler.earlyInitialize("com.prupe.mcpatcher.mob.CTMUtils", "reset");
-+ TexturePackChangeHandler.beforeChange1(true);
-+ game.refreshResources();
-+ TexturePackChangeHandler.afterChange1(true);
-+
-+ if (game.getMinecraft().theWorld != null) {
-+ game.renderGlobal.updateAllRenderers();
-+ }
-+ }
-+}
---- net/minecraft/src/ItemEmptyMap.java
-+++ net/minecraft/src/ItemEmptyMap.java
-@@ -1,31 +1,35 @@
- package net.minecraft.src;
-
- public class ItemEmptyMap extends ItemMapBase {
-- protected ItemEmptyMap(int var1) {
-- super(var1);
-+ protected ItemEmptyMap(int par1) {
-+ super(par1);
- this.setCreativeTab(CreativeTabs.tabMisc);
- }
-
-- public ItemStack onItemRightClick(ItemStack var1, World var2, EntityPlayer var3) {
-- ItemStack var4 = new ItemStack(Item.map, 1, var2.getUniqueDataId("map"));
-+ /**
-+ * 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) {
-+ ItemStack var4 = new ItemStack(Item.map, 1, par2World.getUniqueDataId("map"));
- String var5 = "map_" + var4.getItemDamage();
- MapData var6 = new MapData(var5);
-- var2.setItemData(var5, var6);
-+ par2World.setItemData(var5, var6);
- var6.scale = 0;
- int var7 = 128 * (1 << var6.scale);
-- var6.xCenter = (int)(Math.round(var3.posX / (double)var7) * (long)var7);
-- var6.zCenter = (int)(Math.round(var3.posZ / (double)var7) * (long)var7);
-- var6.dimension = (byte)var2.provider.dimensionId;
-+ var6.xCenter = (int)(Math.round(par3EntityPlayer.posX / (double)var7) * (long)var7);
-+ var6.zCenter = (int)(Math.round(par3EntityPlayer.posZ / (double)var7) * (long)var7);
-+ var6.dimension = (byte)par2World.provider.dimensionId;
- var6.markDirty();
-- --var1.stackSize;
-- if(var1.stackSize <= 0) {
-+ --par1ItemStack.stackSize;
-+
-+ if (par1ItemStack.stackSize <= 0) {
- return var4;
- } else {
-- if(!var3.inventory.addItemStackToInventory(var4.copy())) {
-- var3.dropPlayerItem(var4);
-+ if (!par3EntityPlayer.inventory.addItemStackToInventory(var4.copy())) {
-+ par3EntityPlayer.dropPlayerItem(var4);
- }
-
-- return var1;
-+ return par1ItemStack;
- }
- }
- }
---- /dev/null
-+++ org/spoutcraft/api/gui/Button.java
-@@ -1,0 +1,68 @@
-+/*
-+ * This file is part of Spoutcraft.
-+ *
-+ * Copyright (c) 2011 SpoutcraftDev
-+ * Spoutcraft is licensed under the GNU Lesser General Public License.
-+ *
-+ * Spoutcraft is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation, either version 3 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Spoutcraft is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program. If not, see .
-+ */
-+package org.spoutcraft.api.gui;
-+
-+import org.spoutcraft.api.UnsafeClass;
-+
-+@UnsafeClass
-+public interface Button extends Control, Label {
-+ /**
-+ * Gets the text that is displayed when the control is disabled
-+ *
-+ * @return disabled text
-+ */
-+ public String getDisabledText();
-+
-+ /**
-+ * Sets the text that is displayed when the control is disabled
-+ *
-+ * @param text to display
-+ * @return Button
-+ */
-+ public Button setDisabledText(String text);
-+
-+ /**
-+ * Gets the color of the control while the mouse is hovering over it
-+ *
-+ * @return color
-+ */
-+ public Color getHoverColor();
-+
-+ /**
-+ * Sets the color of the control while the mouse is hovering over it
-+ *
-+ * @param color
-+ * @return Button
-+ */
-+ public Button setHoverColor(Color color);
-+
-+ public Button setText(String text);
-+
-+ public Button setTextColor(Color color);
-+
-+ public Button setAuto(boolean auto);
-+
-+ public Button setAlign(WidgetAnchor align);
-+
-+ /**
-+ * Fires when this button is clicked on the screen.
-+ */
-+ public void onButtonClick();
-+}
---- /dev/null
-+++ org/spoutcraft/client/gui/minimap/MapCalculator.java
-@@ -1,0 +1,469 @@
-+/*
-+ * This file is part of Spoutcraft.
-+ *
-+ * Copyright (c) 2011 SpoutcraftDev
-+ * Spoutcraft is licensed under the GNU Lesser General Public License.
-+ *
-+ * Spoutcraft is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation, either version 3 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Spoutcraft is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program. If not, see .
-+ */
-+package org.spoutcraft.client.gui.minimap;
-+
-+import java.util.Random;
-+
-+import net.minecraft.src.Minecraft;
-+import net.minecraft.src.AxisAlignedBB;
-+import net.minecraft.src.Chunk;
-+import net.minecraft.src.EntityLiving;
-+import net.minecraft.src.Material;
-+import net.minecraft.src.World;
-+
-+import org.spoutcraft.api.Spoutcraft;
-+import org.spoutcraft.client.SpoutClient;
-+import org.spoutcraft.client.chunkcache.HeightMap;
-+
-+public class MapCalculator implements Runnable {
-+ /**
-+ * Multiply two colors by each other. Treats 0xff as 1.0.
-+ *
-+ * Yourself came up with the algorithm, I'm sure it makes sense to someone
-+ *
-+ * @param x
-+ * Color to multiply
-+ * @param y
-+ * Other color to multiply
-+ * @return multiplied color
-+ */
-+ public int colorMult(int x, int y) {
-+ int res = 0;
-+ for (int octet = 0; octet < 3; ++octet) {
-+ res |= (((x & 0xff) * (y & 0xff)) / 0xff) << (octet << 3);
-+ x >>= 8;
-+ y >>= 8;
-+ }
-+ return res;
-+ }
-+
-+ private final float distance(int x1, int y1, int x2, int y2) {
-+ return (float) Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));
-+ }
-+
-+ private final boolean blockIsSolid(Chunk chunk, int x, int y, int z) {
-+ if (y > 255)
-+ return false;
-+ if (y < 0)
-+ return true;
-+ try {
-+ int id = chunk.getBlockID(x, y, z);
-+ int meta = chunk.getBlockMetadata(x, y, z);
-+ return BlockColor.getBlockColor(id, meta).alpha > 0;
-+ } catch (Exception e) {
-+ return false;
-+ }
-+ }
-+
-+ private final int getBlockHeight(World world, int x, int z) {
-+ if (MinimapConfig.getInstance().isCavemap()) {
-+ Chunk chunk = world.getChunkFromBlockCoords(x, z);
-+ cmdist.setSeed((x & 0xffff) | ((z & 0xffff) << 16));
-+ float dist = distance((int) Minecraft.getMinecraft().thePlayer.posX, (int) Minecraft.getMinecraft().thePlayer.posZ, x, z);
-+ int y = (int) Minecraft.getMinecraft().thePlayer.posY;
-+ if (dist > 5)
-+ y -= (cmdist.nextInt((int) (dist)) - ((int) dist / 2));
-+ x &= 0xf;
-+ z &= 0xf;
-+
-+ if (y < 0) {
-+ y = 0;
-+ } else if (y > 255) {
-+ y = 255;
-+ }
-+
-+ if (blockIsSolid(chunk, x, y, z)) {
-+ int itery = y;
-+ while (true) {
-+ itery++;
-+ if (itery > y + 10)
-+ return y + 10;
-+ if (!blockIsSolid(chunk, x, itery, z)) {
-+ return itery - 1;
-+ }
-+ }
-+ }
-+ while (y > -1) {
-+ y--;
-+ if (blockIsSolid(chunk, x, y, z)) {
-+ return y;
-+ }
-+ }
-+ return -1;
-+ }
-+
-+ return world.getHeightValue(x, z) - 1;
-+
-+ // return world.b(x, z).b(x & 0xf, z & 0xf);
-+ /*
-+ * li chunk = world.b(x, z); int y = (int)(game.h.aM); // starty; x &=
-+ * 0xf; z &= 0xf;
-+ *
-+ * //while (y > 0) // {
-+ *
-+ *
-+ * if (getBlockColor(id, meta).alpha == 0) return -1; // y--; else return
-+ * y + 1; // what //}
-+ */
-+ // return -1;
-+ }
-+
-+ private int getBlockColor(World world, int x, int y, int z) {
-+ int color24 = 0;
-+
-+ try {
-+ if (MinimapConfig.getInstance().isColor() && !MinimapConfig.getInstance().isCavemap()) {
-+ if (x == (int) map.getPlayerX() && z == (int) map.getPlayerZ())
-+ return 0xff0000;
-+ if ((world.getBlockMaterial(x, y + 1, z) == Material.ice) || (world.getBlockMaterial(x, y + 1, z) == Material.snow)) {
-+ color24 = 0xffffff;
-+ } else {
-+ BlockColor col = BlockColor.getBlockColor(world.getBlockId(x, y, z), world.getBlockMetadata(x, y, z));
-+ color24 = col.color;
-+ }
-+ }
-+ } catch (Exception e) {
-+ return 0;
-+ }
-+
-+ return color24;
-+ }
-+
-+ private int getBlockHeightMap(World world, int x, int y, int z) {
-+ int height = y - 128;
-+ double sc = Math.log10(Math.abs(height) / 8.0D + 1.0D) / 1.3D;
-+ int result = 0x80;
-+
-+ if (height >= 0) {
-+ result = (int) (sc * (0xff - result)) + result;
-+ } else {
-+ height = Math.abs(height);
-+ result = result - (int) (sc * result);
-+ }
-+ return result;
-+ }
-+
-+ private int getBlockLight(World world, int x, int y, int z) {
-+ int light = world.getBlockLightValue_do(x, y + 1, z, false) * 17;
-+ int min = 32;
-+ if (light < min) {
-+ light = min;
-+ }
-+ if (MinimapConfig.getInstance().isLightmap()) {
-+ light *= 1.3f;
-+ } else if (MinimapConfig.getInstance().isCavemap()) {
-+ light *= 0.5;
-+ light += 64;
-+ }
-+
-+ if (light > 255) {
-+ light = 255;
-+ } else if (light < 0) {
-+ light = 0;
-+ }
-+
-+ return light;
-+ }
-+
-+ private void mapCalc() {
-+ if (Minecraft.getMinecraft().thePlayer == null || Minecraft.getMinecraft().theWorld == null)
-+ return;
-+ try {
-+ final boolean square = MinimapConfig.getInstance().isSquare();
-+ final World data = Minecraft.getMinecraft().theWorld;
-+ int renderSize;
-+ int startX;
-+ int startZ;
-+ synchronized (map) {
-+ if (map.zoom != MinimapConfig.getInstance().getZoom()) {
-+ map.zoom = MinimapConfig.getInstance().getZoom();
-+ switch (map.zoom) {
-+ case 0:
-+ map.renderSize = Map.ZOOM_0;
-+ break;
-+ case 1:
-+ map.renderSize = Map.ZOOM_1;
-+ break;
-+ case 2:
-+ map.renderSize = Map.ZOOM_2;
-+ break;
-+ default:
-+ map.renderSize = Map.ZOOM_2;
-+ break;
-+ }
-+ map.renderOff = map.renderSize / 2;
-+ map.clear();
-+ }
-+ map.square = square;
-+
-+ map.update(Minecraft.getMinecraft().thePlayer.posX, Minecraft.getMinecraft().thePlayer.posZ);
-+ renderSize = map.renderSize;
-+ startX = (int) (map.getPlayerX() - map.renderOff);
-+ startZ = (int) (map.getPlayerZ() - map.renderOff);
-+ }
-+
-+ for (int worldX = startX; worldX < startX + renderSize; worldX++) {
-+ for (int worldZ = startZ; worldZ < startZ + renderSize; worldZ++) {
-+ int worldY = getBlockHeight(data, worldX, worldZ);
-+
-+ int pixelX = worldX - startX;
-+ if (pixelX >= renderSize) {
-+ pixelX -= renderSize;
-+ }
-+
-+ int pixelZ = worldZ - startZ;
-+ pixelZ = renderSize - pixelZ;
-+ if (pixelZ >= renderSize) {
-+ pixelZ -= renderSize;
-+ }
-+
-+ if (square || MinimapUtils.insideCircle(startX + renderSize / 2, startZ + renderSize / 2, renderSize / 2, worldX, worldZ)) {
-+ int color = getBlockColor(data, worldX, worldY, worldZ);
-+ if (color == 0) {
-+ map.clearColorPixel(pixelX, pixelZ);
-+ } else {
-+ map.setColorPixel(pixelX, pixelZ, color);
-+ }
-+
-+ short height = (short) data.getHeightValue(worldX, worldZ);
-+ short reference = (short) data.getHeightValue(worldX + 1, worldZ + 1);
-+ map.heightimg.setARGB(pixelZ, pixelX, getHeightColor(height, reference));
-+ map.setLightPixel(pixelX, pixelZ, getBlockLight(data, worldX, worldY, worldZ));
-+
-+ } else {
-+ map.clearColorPixel(pixelX, pixelZ);
-+ map.heightimg.setARGB(pixelX, pixelZ, 0);
-+ map.setLightPixel(pixelX, pixelZ, 255);
-+ }
-+ }
-+ }
-+
-+ synchronized (map) {
-+ for (Waypoint pt : MinimapConfig.getInstance().getWaypoints(MinimapUtils.getWorldName())) {
-+ if (pt.enabled) {
-+ boolean render = false;
-+ if (square) {
-+ render = Math.abs(map.getPlayerX() - pt.x) < map.renderSize && Math.abs(map.getPlayerZ() - pt.z) < map.renderSize;
-+ } else {
-+ render = MinimapUtils.insideCircle(startX + map.renderSize / 2, startZ + map.renderSize / 2, map.renderSize / 2, pt.x, pt.z);
-+ }
-+ if (pt.deathpoint && !MinimapConfig.getInstance().isDeathpoints()) {
-+ render = false;
-+ }
-+ if (render) {
-+ int pixelX = pt.x - startX;
-+
-+ int pixelZ = pt.z - startZ;
-+ pixelZ = map.renderSize - pixelZ;
-+
-+ int scale = map.zoom + 2;
-+ if (map.zoom > 2) {
-+ scale += 2;
-+ }
-+ if (map.zoom > 1) {
-+ scale += 1;
-+ }
-+
-+ int color = 0xEE2C2C;
-+ if (pt == MinimapConfig.getInstance().getFocussedWaypoint()) {
-+ color = 0xff00ffff;
-+ }
-+ drawCircle(pixelX, pixelZ, scale + map.zoom + 1, pt.deathpoint ? color : 0);
-+ drawCircle(pixelX, pixelZ, scale, pt.deathpoint ? 0 : color);
-+ }
-+ }
-+ }
-+ for (Waypoint pt : MinimapConfig.getInstance().getServerWaypoints()) {
-+ boolean render = false;
-+ if (square) {
-+ render = Math.abs(map.getPlayerX() - pt.x) < map.renderSize && Math.abs(map.getPlayerZ() - pt.z) < map.renderSize;
-+ } else {
-+ render = MinimapUtils.insideCircle(startX + map.renderSize / 2, startZ + map.renderSize / 2, map.renderSize / 2, pt.x, pt.z);
-+ }
-+ if (render) {
-+ int pixelX = pt.x - startX;
-+
-+ int pixelZ = pt.z - startZ;
-+ pixelZ = map.renderSize - pixelZ;
-+
-+ int scale = map.zoom + 2;
-+ if (map.zoom > 2) {
-+ scale += 2;
-+ }
-+ if (map.zoom > 1) {
-+ scale += 1;
-+ }
-+
-+ int color = 0x3366CC;
-+ if (pt == MinimapConfig.getInstance().getFocussedWaypoint()) {
-+ color = 0xff00ffff;
-+ }
-+ drawCircle(pixelX, pixelZ, scale + map.zoom + 1, 0);
-+ drawCircle(pixelX, pixelZ, scale, color);
-+ }
-+ }
-+ }
-+ } catch (Throwable whatever) { }
-+ }
-+
-+ private void drawCircle(int x, int y, int radius, int color) {
-+ try {
-+ for (int dx = -radius; dx <= radius; dx++) {
-+ for (int dy = -radius; dy <= radius; dy++) {
-+ if (x + dx < map.renderSize && x + dx > 0 && y + dy < map.renderSize && y + dy > 0) {
-+ if (MinimapUtils.insideCircle(x, y, radius, x + dx, y + dy)) {
-+ map.setColorPixel(x + dx, y + dy, color);
-+ }
-+ }
-+ }
-+ }
-+ } catch (ArrayIndexOutOfBoundsException ignore) {
-+ } // happens with fast movement
-+ }
-+
-+ /**
-+ * Check if a render is necessary, and if so, do one.
-+ */
-+ private void tryARender() {
-+ if (Minecraft.getMinecraft().thePlayer == null || Minecraft.getMinecraft().theWorld == null)
-+ return;
-+ try {
-+ double x = Minecraft.getMinecraft().thePlayer.posX;
-+ double z = Minecraft.getMinecraft().thePlayer.posZ;
-+ if (MinimapConfig.getInstance().isEnabled() && map.isDirty(x, z)) {
-+// long start = System.currentTimeMillis();
-+ if (MinimapConfig.getInstance().getScanRadius() > 0) {
-+ int radius = MinimapConfig.getInstance().getScanRadius() << 4;
-+ for (int cx = (int) (x - radius); cx <= (int) (x + radius); cx += 16) {
-+ for (int cz = (int) (z - radius); cz <= (int) (z + radius); cz += 16) {
-+ Chunk chunk = Minecraft.getMinecraft().theWorld.getChunkFromBlockCoords((int) cx, (int) cz);
-+ org.spoutcraft.client.chunkcache.HeightMapAgent.scanChunk(chunk);
-+ }
-+ }
-+ }
-+ //long dur = System.currentTimeMillis() - start;
-+ //int chunks = (int) Math.pow(MinimapConfig.getInstance().getScanRadius() * 2, 2);
-+ //System.out.println("Took " + dur + "ms to scan " + chunks + " chunks.\nThat is " + (float) (dur/(float)chunks) + " per chunk!");
-+ mapCalc();
-+
-+ entityCalc();
-+ map.timer = 1;
-+ }
-+ } catch (RuntimeException e) {
-+ throw e;
-+ } finally {
-+ map.timer++;
-+ }
-+ }
-+
-+ private void entityCalc() {
-+ synchronized(map.watchedEntities) {
-+ map.watchedEntities.clear();
-+ if (!Spoutcraft.hasPermission("spout.plugin.minimap.showentities")) {
-+ return;
-+ }
-+ if (!MinimapConfig.getInstance().isShowingEntities()) {
-+ return;
-+ }
-+ int radius = map.renderSize / 2;
-+ double playerX = map.getPlayerX();
-+ double playerZ = map.getPlayerZ();
-+ for (Object ob:SpoutClient.getHandle().theWorld.getEntitiesWithinAABB(EntityLiving.class, AxisAlignedBB.getBoundingBox(playerX - radius, 0, playerZ - radius, playerX + radius, 256, playerZ + radius))) {
-+ net.minecraft.src.Entity e = (net.minecraft.src.Entity) ob;
-+ if (!MinimapConfig.getInstance().isEntityVisible(e.getClass())) {
-+ continue;
-+ }
-+ WatchedEntity w = new WatchedEntity(e);
-+ if (w.getTexture() != null) {
-+ map.watchedEntities.add(w);
-+ }
-+ }
-+ }
-+ }
-+
-+ /**
-+ * the run() to implement runnable - the main function of the other thread.
-+ * this simply idles and the actual work is done in onRenderTick().
-+ */
-+ public void run() {
-+ }
-+
-+ /**
-+ * Called each tick of the render.
-+ */
-+ void onRenderTick() {
-+ if (Minecraft.getMinecraft() != null && Minecraft.getMinecraft().theWorld != null) {
-+ tryARender();
-+ }
-+ }
-+
-+ /**
-+ * Random used to distort cave map
-+ */
-+ public Random cmdist = new Random();
-+
-+ private Map map;
-+
-+ /**
-+ * This constructor inits state, but does not start the thread.
-+ *
-+ * @param minimap
-+ * Minimap instance to initialize off
-+ */
-+ public MapCalculator(ZanMinimap minimap) {
-+ map = minimap.map;
-+ }
-+
-+ /**
-+ * Start up the other thread. The thread may return early at this point, as
-+ * there might not be a Minecraft instance available yet. if that occurs,
-+ * the thread will be restarted by the keep-alive in onRenderTick().
-+ */
-+ public void start() {
-+ }
-+
-+ public static int getHeightColor(short height, short reference) {
-+ int hdiff = height - reference;
-+ int color = 0x00000000;
-+ if (hdiff != 0 && reference != -1) {
-+ boolean ascending = hdiff < 0;
-+ hdiff *= 2;
-+ hdiff += 256;
-+ if (hdiff > 255) {
-+ hdiff = 255;
-+ }
-+ if (hdiff < 0) {
-+ hdiff = 0;
-+ }
-+ if (!ascending) {
-+ hdiff = 255 - hdiff;
-+ }
-+ color = 0x55000000 | ((hdiff << 16) + (hdiff << 8) + hdiff);
-+ }
-+ return color;
-+ }
-+
-+ public static int getHeightColor(int x, int z, HeightMap heightMap) {
-+ short height = heightMap.getHeight(x, z);
-+ short reference = heightMap.getHeight(x + 1, z + 1);
-+
-+ return getHeightColor(height, reference);
-+ }
-+}
---- /dev/null
-+++ org/spoutcraft/api/material/block/GenericCubeCustomBlock.java
-@@ -1,0 +1,61 @@
-+/*
-+ * This file is part of Spoutcraft.
-+ *
-+ * Copyright (c) 2011 SpoutcraftDev
-+ * Spoutcraft is licensed under the GNU Lesser General Public License.
-+ *
-+ * Spoutcraft is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation, either version 3 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Spoutcraft is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program. If not, see .
-+ */
-+package org.spoutcraft.api.material.block;
-+
-+import org.spoutcraft.api.block.design.GenericCubeBlockDesign;
-+
-+public abstract class GenericCubeCustomBlock extends GenericCustomBlock {
-+ /**
-+ * Creates a new cube block material
-+ *
-+ * @param plugin making the block
-+ * @param name of the block
-+ * @param isOpaque true if you want the block solid
-+ * @param design to use for the block
-+ */
-+ public GenericCubeCustomBlock(String addon, String name, boolean isOpaque, GenericCubeBlockDesign design) {
-+ super(addon, name, isOpaque, design);
-+ }
-+
-+ /**
-+ * Creates a new opaque/solid cube block material
-+ *
-+ * @param plugin making the block
-+ * @param name of the block
-+ * @param design to use for the block
-+ */
-+ public GenericCubeCustomBlock(String addon, String name, GenericCubeBlockDesign design) {
-+ super(addon, name);
-+ this.setBlockDesign(design);
-+ }
-+
-+ /**
-+ * Creates a new basic opaque/solid cube block material
-+ *
-+ * @param plugin making the block
-+ * @param name of the block
-+ * @param texture url to use for the block - must be a square PNG
-+ * @param textureSize width and height of the texture in pixels
-+ */
-+ public GenericCubeCustomBlock(String addon, String name, String texture, int textureSize) {
-+ super(addon, name);
-+ this.setBlockDesign(new GenericCubeBlockDesign(addon, texture, textureSize));
-+ }
-+}
---- net/minecraft/src/StructureStrongholdPieces.java
-+++ net/minecraft/src/StructureStrongholdPieces.java
-@@ -6,9 +6,9 @@
- import java.util.Random;
-
- public class StructureStrongholdPieces {
-- private static final StructureStrongholdPieceWeight[] pieceWeightArray = new StructureStrongholdPieceWeight[]{new StructureStrongholdPieceWeight(ComponentStrongholdStraight.class, 40, 0), new StructureStrongholdPieceWeight(ComponentStrongholdPrison.class, 5, 5), new StructureStrongholdPieceWeight(ComponentStrongholdLeftTurn.class, 20, 0), new StructureStrongholdPieceWeight(ComponentStrongholdRightTurn.class, 20, 0), new StructureStrongholdPieceWeight(ComponentStrongholdRoomCrossing.class, 10, 6), new StructureStrongholdPieceWeight(ComponentStrongholdStairsStraight.class, 5, 5), new StructureStrongholdPieceWeight(ComponentStrongholdStairs.class, 5, 5), new StructureStrongholdPieceWeight(ComponentStrongholdCrossing.class, 5, 4), new StructureStrongholdPieceWeight(ComponentStrongholdChestCorridor.class, 5, 4), new StructureStrongholdPieceWeight2(ComponentStrongholdLibrary.class, 10, 2), new StructureStrongholdPieceWeight3(ComponentStrongholdPortalRoom.class, 20, 1)};
-- private static List c;
-- private static Class d;
-+ private static final StructureStrongholdPieceWeight[] pieceWeightArray = new StructureStrongholdPieceWeight[] {new StructureStrongholdPieceWeight(ComponentStrongholdStraight.class, 40, 0), new StructureStrongholdPieceWeight(ComponentStrongholdPrison.class, 5, 5), new StructureStrongholdPieceWeight(ComponentStrongholdLeftTurn.class, 20, 0), new StructureStrongholdPieceWeight(ComponentStrongholdRightTurn.class, 20, 0), new StructureStrongholdPieceWeight(ComponentStrongholdRoomCrossing.class, 10, 6), new StructureStrongholdPieceWeight(ComponentStrongholdStairsStraight.class, 5, 5), new StructureStrongholdPieceWeight(ComponentStrongholdStairs.class, 5, 5), new StructureStrongholdPieceWeight(ComponentStrongholdCrossing.class, 5, 4), new StructureStrongholdPieceWeight(ComponentStrongholdChestCorridor.class, 5, 4), new StructureStrongholdPieceWeight2(ComponentStrongholdLibrary.class, 10, 2), new StructureStrongholdPieceWeight3(ComponentStrongholdPortalRoom.class, 20, 1)};
-+ private static List structurePieceList;
-+ private static Class strongComponentType;
- static int totalWeight;
- private static final StructureStrongholdStones strongholdStones = new StructureStrongholdStones((StructureStrongholdPieceWeight2)null);
-
-@@ -28,28 +28,32 @@
- MapGenStructureIO.func_143031_a(ComponentStrongholdStairsStraight.class, "SHSSD");
- }
-
-+ /**
-+ * sets up Arrays with the Structure pieces and their weights
-+ */
- public static void prepareStructurePieces() {
-- c = new ArrayList();
-+ structurePieceList = new ArrayList();
- StructureStrongholdPieceWeight[] var0 = pieceWeightArray;
- int var1 = var0.length;
-
-- for(int var2 = 0; var2 < var1; ++var2) {
-+ for (int var2 = 0; var2 < var1; ++var2) {
- StructureStrongholdPieceWeight var3 = var0[var2];
- var3.instancesSpawned = 0;
-- c.add(var3);
-+ structurePieceList.add(var3);
- }
-
-- d = null;
-+ strongComponentType = null;
- }
-
- private static boolean canAddStructurePieces() {
- boolean var0 = false;
- totalWeight = 0;
--
- StructureStrongholdPieceWeight var2;
-- for(Iterator var1 = c.iterator(); var1.hasNext(); totalWeight += var2.pieceWeight) {
-+
-+ for (Iterator var1 = structurePieceList.iterator(); var1.hasNext(); totalWeight += var2.pieceWeight) {
- var2 = (StructureStrongholdPieceWeight)var1.next();
-- if(var2.instancesLimit > 0 && var2.instancesSpawned < var2.instancesLimit) {
-+
-+ if (var2.instancesLimit > 0 && var2.instancesSpawned < var2.instancesLimit) {
- var0 = true;
- }
- }
-@@ -57,68 +61,76 @@
- return var0;
- }
-
-- private static ComponentStronghold getStrongholdComponentFromWeightedPiece(Class var0, List var1, Random var2, int var3, int var4, int var5, int var6, int var7) {
-+ /**
-+ * translates the PieceWeight class to the Component class
-+ */
-+ private static ComponentStronghold getStrongholdComponentFromWeightedPiece(Class par0Class, List par1List, Random par2Random, int par3, int par4, int par5, int par6, int par7) {
- Object var8 = null;
-- if(var0 == ComponentStrongholdStraight.class) {
-- var8 = ComponentStrongholdStraight.findValidPlacement(var1, var2, var3, var4, var5, var6, var7);
-- } else if(var0 == ComponentStrongholdPrison.class) {
-- var8 = ComponentStrongholdPrison.findValidPlacement(var1, var2, var3, var4, var5, var6, var7);
-- } else if(var0 == ComponentStrongholdLeftTurn.class) {
-- var8 = ComponentStrongholdLeftTurn.findValidPlacement(var1, var2, var3, var4, var5, var6, var7);
-- } else if(var0 == ComponentStrongholdRightTurn.class) {
-- var8 = ComponentStrongholdRightTurn.findValidPlacement(var1, var2, var3, var4, var5, var6, var7);
-- } else if(var0 == ComponentStrongholdRoomCrossing.class) {
-- var8 = ComponentStrongholdRoomCrossing.findValidPlacement(var1, var2, var3, var4, var5, var6, var7);
-- } else if(var0 == ComponentStrongholdStairsStraight.class) {
-- var8 = ComponentStrongholdStairsStraight.findValidPlacement(var1, var2, var3, var4, var5, var6, var7);
-- } else if(var0 == ComponentStrongholdStairs.class) {
-- var8 = ComponentStrongholdStairs.getStrongholdStairsComponent(var1, var2, var3, var4, var5, var6, var7);
-- } else if(var0 == ComponentStrongholdCrossing.class) {
-- var8 = ComponentStrongholdCrossing.findValidPlacement(var1, var2, var3, var4, var5, var6, var7);
-- } else if(var0 == ComponentStrongholdChestCorridor.class) {
-- var8 = ComponentStrongholdChestCorridor.findValidPlacement(var1, var2, var3, var4, var5, var6, var7);
-- } else if(var0 == ComponentStrongholdLibrary.class) {
-- var8 = ComponentStrongholdLibrary.findValidPlacement(var1, var2, var3, var4, var5, var6, var7);
-- } else if(var0 == ComponentStrongholdPortalRoom.class) {
-- var8 = ComponentStrongholdPortalRoom.findValidPlacement(var1, var2, var3, var4, var5, var6, var7);
-+
-+ if (par0Class == ComponentStrongholdStraight.class) {
-+ var8 = ComponentStrongholdStraight.findValidPlacement(par1List, par2Random, par3, par4, par5, par6, par7);
-+ } else if (par0Class == ComponentStrongholdPrison.class) {
-+ var8 = ComponentStrongholdPrison.findValidPlacement(par1List, par2Random, par3, par4, par5, par6, par7);
-+ } else if (par0Class == ComponentStrongholdLeftTurn.class) {
-+ var8 = ComponentStrongholdLeftTurn.findValidPlacement(par1List, par2Random, par3, par4, par5, par6, par7);
-+ } else if (par0Class == ComponentStrongholdRightTurn.class) {
-+ var8 = ComponentStrongholdRightTurn.findValidPlacement(par1List, par2Random, par3, par4, par5, par6, par7);
-+ } else if (par0Class == ComponentStrongholdRoomCrossing.class) {
-+ var8 = ComponentStrongholdRoomCrossing.findValidPlacement(par1List, par2Random, par3, par4, par5, par6, par7);
-+ } else if (par0Class == ComponentStrongholdStairsStraight.class) {
-+ var8 = ComponentStrongholdStairsStraight.findValidPlacement(par1List, par2Random, par3, par4, par5, par6, par7);
-+ } else if (par0Class == ComponentStrongholdStairs.class) {
-+ var8 = ComponentStrongholdStairs.getStrongholdStairsComponent(par1List, par2Random, par3, par4, par5, par6, par7);
-+ } else if (par0Class == ComponentStrongholdCrossing.class) {
-+ var8 = ComponentStrongholdCrossing.findValidPlacement(par1List, par2Random, par3, par4, par5, par6, par7);
-+ } else if (par0Class == ComponentStrongholdChestCorridor.class) {
-+ var8 = ComponentStrongholdChestCorridor.findValidPlacement(par1List, par2Random, par3, par4, par5, par6, par7);
-+ } else if (par0Class == ComponentStrongholdLibrary.class) {
-+ var8 = ComponentStrongholdLibrary.findValidPlacement(par1List, par2Random, par3, par4, par5, par6, par7);
-+ } else if (par0Class == ComponentStrongholdPortalRoom.class) {
-+ var8 = ComponentStrongholdPortalRoom.findValidPlacement(par1List, par2Random, par3, par4, par5, par6, par7);
- }
-
- return (ComponentStronghold)var8;
- }
-
-- private static ComponentStronghold getNextComponent(ComponentStrongholdStairs2 var0, List var1, Random var2, int var3, int var4, int var5, int var6, int var7) {
-- if(!canAddStructurePieces()) {
-+ private static ComponentStronghold getNextComponent(ComponentStrongholdStairs2 par0ComponentStrongholdStairs2, List par1List, Random par2Random, int par3, int par4, int par5, int par6, int par7) {
-+ if (!canAddStructurePieces()) {
- return null;
- } else {
-- if(d != null) {
-- ComponentStronghold var8 = getStrongholdComponentFromWeightedPiece(d, var1, var2, var3, var4, var5, var6, var7);
-- d = null;
-- if(var8 != null) {
-+ if (strongComponentType != null) {
-+ ComponentStronghold var8 = getStrongholdComponentFromWeightedPiece(strongComponentType, par1List, par2Random, par3, par4, par5, par6, par7);
-+ strongComponentType = null;
-+
-+ if (var8 != null) {
- return var8;
- }
- }
-
- int var13 = 0;
-
-- while(var13 < 5) {
-+ while (var13 < 5) {
- ++var13;
-- int var9 = var2.nextInt(totalWeight);
-- Iterator var10 = c.iterator();
-+ int var9 = par2Random.nextInt(totalWeight);
-+ Iterator var10 = structurePieceList.iterator();
-
-- while(var10.hasNext()) {
-+ while (var10.hasNext()) {
- StructureStrongholdPieceWeight var11 = (StructureStrongholdPieceWeight)var10.next();
- var9 -= var11.pieceWeight;
-- if(var9 < 0) {
-- if(!var11.canSpawnMoreStructuresOfType(var7) || var11 == var0.strongholdPieceWeight) {
-+
-+ if (var9 < 0) {
-+ if (!var11.canSpawnMoreStructuresOfType(par7) || var11 == par0ComponentStrongholdStairs2.strongholdPieceWeight) {
- break;
- }
-
-- ComponentStronghold var12 = getStrongholdComponentFromWeightedPiece(var11.a, var1, var2, var3, var4, var5, var6, var7);
-- if(var12 != null) {
-+ ComponentStronghold var12 = getStrongholdComponentFromWeightedPiece(var11.pieceClass, par1List, par2Random, par3, par4, par5, par6, par7);
-+
-+ if (var12 != null) {
- ++var11.instancesSpawned;
-- var0.strongholdPieceWeight = var11;
-- if(!var11.canSpawnMoreStructures()) {
-- c.remove(var11);
-+ par0ComponentStrongholdStairs2.strongholdPieceWeight = var11;
-+
-+ if (!var11.canSpawnMoreStructures()) {
-+ structurePieceList.remove(var11);
- }
-
- return var12;
-@@ -127,23 +139,25 @@
- }
- }
-
-- StructureBoundingBox var14 = ComponentStrongholdCorridor.func_74992_a(var1, var2, var3, var4, var5, var6);
-- if(var14 != null && var14.minY > 1) {
-- return new ComponentStrongholdCorridor(var7, var2, var14, var6);
-+ StructureBoundingBox var14 = ComponentStrongholdCorridor.func_74992_a(par1List, par2Random, par3, par4, par5, par6);
-+
-+ if (var14 != null && var14.minY > 1) {
-+ return new ComponentStrongholdCorridor(par7, par2Random, var14, par6);
- } else {
- return null;
- }
- }
- }
-
-- private static StructureComponent getNextValidComponent(ComponentStrongholdStairs2 var0, List var1, Random var2, int var3, int var4, int var5, int var6, int var7) {
-- if(var7 > 50) {
-+ private static StructureComponent getNextValidComponent(ComponentStrongholdStairs2 par0ComponentStrongholdStairs2, List par1List, Random par2Random, int par3, int par4, int par5, int par6, int par7) {
-+ if (par7 > 50) {
- return null;
-- } else if(Math.abs(var3 - var0.getBoundingBox().minX) <= 112 && Math.abs(var5 - var0.getBoundingBox().minZ) <= 112) {
-- ComponentStronghold var8 = getNextComponent(var0, var1, var2, var3, var4, var5, var6, var7 + 1);
-- if(var8 != null) {
-- var1.add(var8);
-- var0.c.add(var8);
-+ } else if (Math.abs(par3 - par0ComponentStrongholdStairs2.getBoundingBox().minX) <= 112 && Math.abs(par5 - par0ComponentStrongholdStairs2.getBoundingBox().minZ) <= 112) {
-+ ComponentStronghold var8 = getNextComponent(par0ComponentStrongholdStairs2, par1List, par2Random, par3, par4, par5, par6, par7 + 1);
-+
-+ if (var8 != null) {
-+ par1List.add(var8);
-+ par0ComponentStrongholdStairs2.field_75026_c.add(var8);
- }
-
- return var8;
-@@ -152,13 +166,13 @@
- }
- }
-
-- static StructureComponent getNextValidComponentAccess(ComponentStrongholdStairs2 var0, List var1, Random var2, int var3, int var4, int var5, int var6, int var7) {
-- return getNextValidComponent(var0, var1, var2, var3, var4, var5, var6, var7);
-+ static StructureComponent getNextValidComponentAccess(ComponentStrongholdStairs2 par0ComponentStrongholdStairs2, List par1List, Random par2Random, int par3, int par4, int par5, int par6, int par7) {
-+ return getNextValidComponent(par0ComponentStrongholdStairs2, par1List, par2Random, par3, par4, par5, par6, par7);
- }
-
-- static Class setComponentType(Class var0) {
-- d = var0;
-- return var0;
-+ static Class setComponentType(Class par0Class) {
-+ strongComponentType = par0Class;
-+ return par0Class;
- }
-
- static StructureStrongholdStones getStrongholdStones() {
---- net/minecraft/src/Packet200Statistic.java
-+++ net/minecraft/src/Packet200Statistic.java
-@@ -8,32 +8,47 @@
- public int statisticId;
- public int amount;
-
-- public Packet200Statistic() {
-- }
--
-- public Packet200Statistic(int var1, int var2) {
-- this.statisticId = var1;
-- this.amount = var2;
-- }
--
-- public void processPacket(NetHandler var1) {
-- var1.handleStatistic(this);
-- }
--
-- public void readPacketData(DataInput var1) throws IOException {
-- this.statisticId = var1.readInt();
-- this.amount = var1.readInt();
-- }
--
-- public void writePacketData(DataOutput var1) throws IOException {
-- var1.writeInt(this.statisticId);
-- var1.writeInt(this.amount);
-- }
--
-+ public Packet200Statistic() {}
-+
-+ public Packet200Statistic(int par1, int par2) {
-+ this.statisticId = par1;
-+ this.amount = par2;
-+ }
-+
-+ /**
-+ * Passes this Packet on to the NetHandler for processing.
-+ */
-+ public void processPacket(NetHandler par1NetHandler) {
-+ par1NetHandler.handleStatistic(this);
-+ }
-+
-+ /**
-+ * Abstract. Reads the raw packet data from the data stream.
-+ */
-+ public void readPacketData(DataInput par1DataInput) throws IOException {
-+ this.statisticId = par1DataInput.readInt();
-+ this.amount = par1DataInput.readInt();
-+ }
-+
-+ /**
-+ * Abstract. Writes the raw packet data to the data stream.
-+ */
-+ public void writePacketData(DataOutput par1DataOutput) throws IOException {
-+ par1DataOutput.writeInt(this.statisticId);
-+ par1DataOutput.writeInt(this.amount);
-+ }
-+
-+ /**
-+ * Abstract. Return the size of the packet (not counting the header).
-+ */
- public int getPacketSize() {
- return 6;
- }
-
-+ /**
-+ * If this returns true, the packet may be processed on any thread; otherwise it is queued for the main thread to
-+ * handle.
-+ */
- public boolean canProcessAsync() {
- return true;
- }
---- net/minecraft/src/RenderSnowball.java
-+++ net/minecraft/src/RenderSnowball.java
-@@ -7,26 +7,34 @@
- private Item field_94151_a;
- private int field_94150_f;
-
-- public RenderSnowball(Item var1, int var2) {
-- this.field_94151_a = var1;
-- this.field_94150_f = var2;
-- }
--
-- public RenderSnowball(Item var1) {
-- this(var1, 0);
-- }
--
-- public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) {
-+ public RenderSnowball(Item par1Item, int par2) {
-+ this.field_94151_a = par1Item;
-+ this.field_94150_f = par2;
-+ }
-+
-+ public RenderSnowball(Item par1Item) {
-+ this(par1Item, 0);
-+ }
-+
-+ /**
-+ * 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 var14 = (float)(var12 >> 8 & 255) / 255.0F;
- float var15 = (float)(var12 & 255) / 255.0F;
-@@ -43,26 +51,29 @@
- }
- }
-
-- protected ResourceLocation getEntityTexture(Entity var1) {
-+ /**
-+ * 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 TextureMap.locationItemsTexture;
- }
-
-- private void func_77026_a(Tessellator var1, Icon var2) {
-- float var3 = var2.getMinU();
-- float var4 = var2.getMaxU();
-- float var5 = var2.getMinV();
-- float var6 = var2.getMaxV();
-+ private void func_77026_a(Tessellator par1Tessellator, Icon par2Icon) {
-+ float var3 = par2Icon.getMinU();
-+ float var4 = par2Icon.getMaxU();
-+ float var5 = par2Icon.getMinV();
-+ float var6 = par2Icon.getMaxV();
- float var7 = 1.0F;
- float var8 = 0.5F;
- float var9 = 0.25F;
- GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
- GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
-- var1.startDrawingQuads();
-- var1.setNormal(0.0F, 1.0F, 0.0F);
-- var1.addVertexWithUV((double)(0.0F - var8), (double)(0.0F - var9), 0.0D, (double)var3, (double)var6);
-- var1.addVertexWithUV((double)(var7 - var8), (double)(0.0F - var9), 0.0D, (double)var4, (double)var6);
-- var1.addVertexWithUV((double)(var7 - var8), (double)(var7 - var9), 0.0D, (double)var4, (double)var5);
-- var1.addVertexWithUV((double)(0.0F - var8), (double)(var7 - var9), 0.0D, (double)var3, (double)var5);
-- var1.draw();
-+ par1Tessellator.startDrawingQuads();
-+ par1Tessellator.setNormal(0.0F, 1.0F, 0.0F);
-+ par1Tessellator.addVertexWithUV((double)(0.0F - var8), (double)(0.0F - var9), 0.0D, (double)var3, (double)var6);
-+ par1Tessellator.addVertexWithUV((double)(var7 - var8), (double)(0.0F - var9), 0.0D, (double)var4, (double)var6);
-+ par1Tessellator.addVertexWithUV((double)(var7 - var8), (double)(var7 - var9), 0.0D, (double)var4, (double)var5);
-+ par1Tessellator.addVertexWithUV((double)(0.0F - var8), (double)(var7 - var9), 0.0D, (double)var3, (double)var5);
-+ par1Tessellator.draw();
- }
- }
---- /dev/null
-+++ org/spoutcraft/client/gui/settings/controls/ChatColorAssistButton.java
-@@ -1,0 +1,37 @@
-+/*
-+ * This file is part of Spoutcraft.
-+ *
-+ * Copyright (c) 2011 SpoutcraftDev
-+ * Spoutcraft is licensed under the GNU Lesser General Public License.
-+ *
-+ * Spoutcraft is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation, either version 3 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Spoutcraft is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program. If not, see .
-+ */
-+package org.spoutcraft.client.gui.settings.controls;
-+
-+import org.spoutcraft.api.gui.GenericCheckBox;
-+import org.spoutcraft.client.config.Configuration;
-+
-+public class ChatColorAssistButton extends GenericCheckBox {
-+ public ChatColorAssistButton() {
-+ super("Chat Colors Assistant");
-+ setChecked(Configuration.isShowingChatColorAssist());
-+ setTooltip("Displays helpful guide for Chat formatting codes.");
-+ }
-+
-+ @Override
-+ public void onButtonClick() {
-+ Configuration.setChatColorAssist(!Configuration.isShowingChatColorAssist());
-+ Configuration.write();
-+ }
-+}
---- net/minecraft/src/CallableJVMFlags.java
-+++ net/minecraft/src/CallableJVMFlags.java
-@@ -7,12 +7,17 @@
- import java.util.concurrent.Callable;
-
- class CallableJVMFlags implements Callable {
-+
-+ /** Reference to the CrashReport object. */
- final CrashReport theCrashReport;
-
-- CallableJVMFlags(CrashReport var1) {
-- this.theCrashReport = var1;
-+ CallableJVMFlags(CrashReport par1CrashReport) {
-+ this.theCrashReport = par1CrashReport;
- }
-
-+ /**
-+ * Returns the number of JVM Flags along with the passed JVM Flags.
-+ */
- public String getJVMFlagsAsString() {
- RuntimeMXBean var1 = ManagementFactory.getRuntimeMXBean();
- List var2 = var1.getInputArguments();
-@@ -20,10 +25,11 @@
- StringBuilder var4 = new StringBuilder();
- Iterator var5 = var2.iterator();
-
-- while(var5.hasNext()) {
-+ while (var5.hasNext()) {
- String var6 = (String)var5.next();
-- if(var6.startsWith("-X")) {
-- if(var3++ > 0) {
-+
-+ if (var6.startsWith("-X")) {
-+ if (var3++ > 0) {
- var4.append(" ");
- }
-
-@@ -31,7 +37,7 @@
- }
- }
-
-- return String.format("%d total; %s", new Object[]{Integer.valueOf(var3), var4.toString()});
-+ return String.format("%d total; %s", new Object[] {Integer.valueOf(var3), var4.toString()});
- }
-
- public Object call() {
---- net/minecraft/src/NibbleArrayReader.java
-+++ net/minecraft/src/NibbleArrayReader.java
-@@ -5,14 +5,14 @@
- private final int depthBits;
- private final int depthBitsPlusFour;
-
-- public NibbleArrayReader(byte[] var1, int var2) {
-- this.data = var1;
-- this.depthBits = var2;
-- this.depthBitsPlusFour = var2 + 4;
-+ public NibbleArrayReader(byte[] par1ArrayOfByte, int par2) {
-+ this.data = par1ArrayOfByte;
-+ this.depthBits = par2;
-+ this.depthBitsPlusFour = par2 + 4;
- }
-
-- public int get(int var1, int var2, int var3) {
-- int var4 = var1 << this.depthBitsPlusFour | var3 << this.depthBits | var2;
-+ public int get(int par1, int par2, int par3) {
-+ int var4 = par1 << this.depthBitsPlusFour | par3 << this.depthBits | par2;
- int var5 = var4 >> 1;
- int var6 = var4 & 1;
- return var6 == 0 ? this.data[var5] & 15 : this.data[var5] >> 4 & 15;
---- net/minecraft/src/CommandException.java
-+++ net/minecraft/src/CommandException.java
-@@ -1,14 +1,14 @@
- package net.minecraft.src;
-
- public class CommandException extends RuntimeException {
-- private Object[] a;
-+ private Object[] errorObjects;
-
-- public CommandException(String var1, Object... var2) {
-- super(var1);
-- this.a = var2;
-+ public CommandException(String par1Str, Object ... par2ArrayOfObj) {
-+ super(par1Str);
-+ this.errorObjects = par2ArrayOfObj;
- }
-
- public Object[] getErrorOjbects() {
-- return this.a;
-+ return this.errorObjects;
- }
- }
---- net/minecraft/src/ContainerDispenser.java
-+++ net/minecraft/src/ContainerDispenser.java
-@@ -3,58 +3,68 @@
- public class ContainerDispenser extends Container {
- private TileEntityDispenser tileEntityDispenser;
-
-- public ContainerDispenser(IInventory var1, TileEntityDispenser var2) {
-- this.tileEntityDispenser = var2;
--
-+ public ContainerDispenser(IInventory par1IInventory, TileEntityDispenser par2TileEntityDispenser) {
-+ this.tileEntityDispenser = par2TileEntityDispenser;
- int var3;
- int var4;
-- for(var3 = 0; var3 < 3; ++var3) {
-- for(var4 = 0; var4 < 3; ++var4) {
-- this.addSlotToContainer(new Slot(var2, var4 + var3 * 3, 62 + var4 * 18, 17 + var3 * 18));
-- }
-- }
--
-- for(var3 = 0; var3 < 3; ++var3) {
-- for(var4 = 0; var4 < 9; ++var4) {
-- this.addSlotToContainer(new Slot(var1, var4 + var3 * 9 + 9, 8 + var4 * 18, 84 + var3 * 18));
-- }
-- }
--
-- for(var3 = 0; var3 < 9; ++var3) {
-- this.addSlotToContainer(new Slot(var1, var3, 8 + var3 * 18, 142));
-- }
--
-- }
--
-- public boolean canInteractWith(EntityPlayer var1) {
-- return this.tileEntityDispenser.isUseableByPlayer(var1);
-- }
--
-- public ItemStack transferStackInSlot(EntityPlayer var1, int var2) {
-+
-+ for (var3 = 0; var3 < 3; ++var3) {
-+ for (var4 = 0; var4 < 3; ++var4) {
-+ this.addSlotToContainer(new Slot(par2TileEntityDispenser, var4 + var3 * 3, 62 + var4 * 18, 17 + var3 * 18));
-+ }
-+ }
-+
-+ for (var3 = 0; var3 < 3; ++var3) {
-+ for (var4 = 0; var4 < 9; ++var4) {
-+ this.addSlotToContainer(new Slot(par1IInventory, var4 + var3 * 9 + 9, 8 + var4 * 18, 84 + var3 * 18));
-+ }
-+ }
-+
-+ for (var3 = 0; var3 < 9; ++var3) {
-+ this.addSlotToContainer(new Slot(par1IInventory, var3, 8 + var3 * 18, 142));
-+ }
-+ }
-+
-+ // Spout Start
-+ public IInventory getIInventory() {
-+ return tileEntityDispenser;
-+ }
-+ // Spout End
-+
-+ public boolean canInteractWith(EntityPlayer par1EntityPlayer) {
-+ 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.c.get(var2);
-- if(var4 != null && var4.getHasStack()) {
-+ Slot var4 = (Slot)this.inventorySlots.get(par2);
-+
-+ if (var4 != null && var4.getHasStack()) {
- ItemStack var5 = var4.getStack();
- var3 = var5.copy();
-- if(var2 < 9) {
-- if(!this.mergeItemStack(var5, 9, 45, true)) {
-+
-+ if (par2 < 9) {
-+ if (!this.mergeItemStack(var5, 9, 45, true)) {
- return null;
- }
-- } else if(!this.mergeItemStack(var5, 0, 9, false)) {
-+ } else if (!this.mergeItemStack(var5, 0, 9, false)) {
- return null;
- }
-
-- if(var5.stackSize == 0) {
-+ if (var5.stackSize == 0) {
- var4.putStack((ItemStack)null);
- } else {
- var4.onSlotChanged();
- }
-
-- if(var5.stackSize == var3.stackSize) {
-+ if (var5.stackSize == var3.stackSize) {
- return null;
- }
-
-- var4.onPickupFromSlot(var1, var5);
-+ var4.onPickupFromSlot(par1EntityPlayer, var5);
- }
-
- return var3;
---- net/minecraft/src/BlockOre.java
-+++ net/minecraft/src/BlockOre.java
-@@ -3,54 +3,71 @@
- import java.util.Random;
-
- public class BlockOre extends Block {
-- public BlockOre(int var1) {
-- super(var1, Material.rock);
-+ public BlockOre(int par1) {
-+ super(par1, Material.rock);
- this.setCreativeTab(CreativeTabs.tabBlock);
- }
-
-- public int idDropped(int var1, Random var2, int var3) {
-+ /**
-+ * Returns the ID of the items to drop on destruction.
-+ */
-+ public int idDropped(int par1, Random par2Random, int par3) {
- return this.blockID == Block.oreCoal.blockID ? Item.coal.itemID : (this.blockID == Block.oreDiamond.blockID ? Item.diamond.itemID : (this.blockID == Block.oreLapis.blockID ? Item.dyePowder.itemID : (this.blockID == Block.oreEmerald.blockID ? Item.emerald.itemID : (this.blockID == Block.oreNetherQuartz.blockID ? Item.netherQuartz.itemID : this.blockID))));
- }
-
-- public int quantityDropped(Random var1) {
-- return this.blockID == Block.oreLapis.blockID ? 4 + var1.nextInt(5) : 1;
-+ /**
-+ * Returns the quantity of items to drop on block destruction.
-+ */
-+ public int quantityDropped(Random par1Random) {
-+ return this.blockID == Block.oreLapis.blockID ? 4 + par1Random.nextInt(5) : 1;
- }
-
-- public int quantityDroppedWithBonus(int var1, Random var2) {
-- if(var1 > 0 && this.blockID != this.idDropped(0, var2, var1)) {
-- int var3 = var2.nextInt(var1 + 2) - 1;
-- if(var3 < 0) {
-+ /**
-+ * Returns the usual quantity dropped by the block plus a bonus of 1 to 'i' (inclusive).
-+ */
-+ public int quantityDroppedWithBonus(int par1, Random par2Random) {
-+ if (par1 > 0 && this.blockID != this.idDropped(0, par2Random, par1)) {
-+ int var3 = par2Random.nextInt(par1 + 2) - 1;
-+
-+ if (var3 < 0) {
- var3 = 0;
- }
-
-- return this.quantityDropped(var2) * (var3 + 1);
-+ return this.quantityDropped(par2Random) * (var3 + 1);
- } else {
-- return this.quantityDropped(var2);
-+ return this.quantityDropped(par2Random);
- }
- }
-
-- public void dropBlockAsItemWithChance(World var1, int var2, int var3, int var4, int var5, float var6, int var7) {
-- super.dropBlockAsItemWithChance(var1, var2, var3, var4, var5, var6, var7);
-- if(this.idDropped(var5, var1.s, var7) != this.blockID) {
-+ /**
-+ * 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);
-+
-+ if (this.idDropped(par5, par1World.rand, par7) != this.blockID) {
- int var8 = 0;
-- if(this.blockID == Block.oreCoal.blockID) {
-- var8 = MathHelper.getRandomIntegerInRange(var1.s, 0, 2);
-- } else if(this.blockID == Block.oreDiamond.blockID) {
-- var8 = MathHelper.getRandomIntegerInRange(var1.s, 3, 7);
-- } else if(this.blockID == Block.oreEmerald.blockID) {
-- var8 = MathHelper.getRandomIntegerInRange(var1.s, 3, 7);
-- } else if(this.blockID == Block.oreLapis.blockID) {
-- var8 = MathHelper.getRandomIntegerInRange(var1.s, 2, 5);
-- } else if(this.blockID == Block.oreNetherQuartz.blockID) {
-- var8 = MathHelper.getRandomIntegerInRange(var1.s, 2, 5);
-+
-+ if (this.blockID == Block.oreCoal.blockID) {
-+ var8 = MathHelper.getRandomIntegerInRange(par1World.rand, 0, 2);
-+ } else if (this.blockID == Block.oreDiamond.blockID) {
-+ var8 = MathHelper.getRandomIntegerInRange(par1World.rand, 3, 7);
-+ } else if (this.blockID == Block.oreEmerald.blockID) {
-+ var8 = MathHelper.getRandomIntegerInRange(par1World.rand, 3, 7);
-+ } else if (this.blockID == Block.oreLapis.blockID) {
-+ var8 = MathHelper.getRandomIntegerInRange(par1World.rand, 2, 5);
-+ } else if (this.blockID == Block.oreNetherQuartz.blockID) {
-+ var8 = MathHelper.getRandomIntegerInRange(par1World.rand, 2, 5);
- }
-
-- this.dropXpOnBlockBreak(var1, var2, var3, var4, var8);
-+ this.dropXpOnBlockBreak(par1World, par2, par3, par4, var8);
- }
--
- }
-
-- public int damageDropped(int var1) {
-+ /**
-+ * Determines the damage on the item the block drops. Used in cloth and wood.
-+ */
-+ public int damageDropped(int par1) {
- return this.blockID == Block.oreLapis.blockID ? 4 : 0;
- }
- }
---- net/minecraft/src/GuiScreenBackup.java
-+++ net/minecraft/src/GuiScreenBackup.java
-@@ -7,120 +7,129 @@
- public class GuiScreenBackup extends GuiScreen {
- private final GuiScreenConfigureWorld field_110380_a;
- private final long field_110377_b;
-- private List c = Collections.emptyList();
-+ 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 var1, long var2) {
-- this.field_110380_a = var1;
-- this.field_110377_b = var2;
-+ 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.i.clear();
-+ this.buttonList.clear();
- this.field_110375_d = new GuiScreenBackupSelectionList(this);
- (new GuiScreenBackupDownloadThread(this)).start();
- this.func_110369_g();
- }
-
- private void func_110369_g() {
-- this.i.add(new GuiButton(0, this.width / 2 + 6, this.height - 52, 153, 20, I18n.getString("gui.back")));
-- this.i.add(this.field_110379_p = new GuiButton(1, this.width / 2 - 154, this.height - 52, 153, 20, I18n.getString("mco.backup.button.restore")));
-+ 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();
- }
-
-- protected void actionPerformed(GuiButton var1) {
-- if(var1.enabled) {
-- if(var1.id == 1) {
-+ /**
-+ * 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(var1.id == 0) {
-+ } else if (par1GuiButton.id == 0) {
- this.mc.displayGuiScreen(this.field_110380_a);
- } else {
-- this.field_110375_d.actionPerformed(var1);
-+ this.field_110375_d.actionPerformed(par1GuiButton);
- }
--
- }
- }
-
-- public void confirmClicked(boolean var1, int var2) {
-- if(var1 && var2 == 1) {
-+ 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.c.size()) {
-- Backup var1 = (Backup)this.c.get(this.field_110376_e);
-+ 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);
- }
--
- }
-
-- public void drawScreen(int var1, int var2, float 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(var1, var2, var3);
-+ this.field_110375_d.drawScreen(par1, par2, par3);
- this.drawCenteredString(this.fontRenderer, I18n.getString("mco.backup.title"), this.width / 2, 20, 16777215);
-- super.drawScreen(var1, var2, var3);
-- }
--
-- static Minecraft func_110366_a(GuiScreenBackup var0) {
-- return var0.mc;
-- }
--
-- static List func_110373_a(GuiScreenBackup var0, List var1) {
-- return var0.c = var1;
-- }
--
-- static long func_110367_b(GuiScreenBackup var0) {
-- return var0.field_110377_b;
-- }
--
-- static Minecraft func_130030_c(GuiScreenBackup var0) {
-- return var0.mc;
-- }
--
-- static GuiScreenConfigureWorld func_130031_d(GuiScreenBackup var0) {
-- return var0.field_110380_a;
-- }
--
-- static Minecraft func_130035_e(GuiScreenBackup var0) {
-- return var0.mc;
-- }
--
-- static Minecraft func_130036_f(GuiScreenBackup var0) {
-- return var0.mc;
-- }
--
-- static List func_110370_e(GuiScreenBackup var0) {
-- return var0.c;
-- }
--
-- static int func_130029_a(GuiScreenBackup var0, int var1) {
-- return var0.field_110376_e = var1;
-- }
--
-- static int func_130034_h(GuiScreenBackup var0) {
-- return var0.field_110376_e;
-- }
--
-- static FontRenderer func_130032_i(GuiScreenBackup var0) {
-- return var0.fontRenderer;
-- }
--
-- static FontRenderer func_130033_j(GuiScreenBackup var0) {
-- return var0.fontRenderer;
-+ 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
-+++ org/spoutcraft/client/block/SpoutcraftChunk.java
-@@ -1,0 +1,156 @@
-+/*
-+ * This file is part of Spoutcraft.
-+ *
-+ * Copyright (c) 2011 SpoutcraftDev
-+ * Spoutcraft is licensed under the GNU Lesser General Public License.
-+ *
-+ * Spoutcraft is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation, either version 3 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Spoutcraft is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program. If not, see .
-+ */
-+package org.spoutcraft.client.block;
-+
-+import java.lang.ref.WeakReference;
-+import java.util.HashSet;
-+import java.util.Set;
-+
-+import org.apache.commons.lang3.builder.HashCodeBuilder;
-+
-+import net.minecraft.src.Minecraft;
-+
-+import org.spoutcraft.api.material.CustomBlock;
-+import org.spoutcraft.api.material.MaterialData;
-+
-+public class SpoutcraftChunk{
-+ public static final Set loadedChunks = new HashSet();
-+
-+ private WeakReference weakChunk;
-+ private net.minecraft.src.World world;
-+ private int x;
-+ private int z;
-+ private short[] customBlockData = null;
-+ private byte[] customBlockRotations = null;
-+ public SpoutcraftChunk(net.minecraft.src.Chunk chunk) {
-+ this.weakChunk = new WeakReference(chunk);
-+ world = chunk.worldObj;
-+ x = chunk.xPosition;
-+ z = chunk.zPosition;
-+ }
-+
-+ public net.minecraft.src.Chunk getHandle() {
-+ net.minecraft.src.Chunk c = weakChunk.get();
-+ if (c == null) {
-+ c = world.getChunkFromChunkCoords(x, z);
-+ weakChunk = new WeakReference(c);
-+ }
-+ return c;
-+ }
-+
-+ public int getX() {
-+ return x;
-+ }
-+
-+ public int getZ() {
-+ return z;
-+ }
-+
-+ public short getCustomBlockId(int x, int y, int z) {
-+ if (customBlockData != null) {
-+ int key = ((x & 0xF) << 12) | ((z & 0xF) << 8) | (y & 0xFF);
-+ return customBlockData[key];
-+ }
-+ return 0;
-+ }
-+
-+ public short setCustomBlockId(int x, int y, int z, short id) {
-+ if (customBlockData == null) {
-+ customBlockData = new short[16*16*256];
-+ }
-+ if (id < 0) id = 0;
-+ int key = ((x & 0xF) << 12) | ((z & 0xF) << 8) | (y & 0xFF);
-+ short old = customBlockData[key];
-+ customBlockData[key] = id;
-+ Minecraft.getMinecraft().theWorld.markBlockForRenderUpdate(x, y, z);
-+ return old;
-+ }
-+
-+ public short[] getCustomBlockIds() {
-+ return customBlockData;
-+ }
-+
-+ public void setCustomBlockIds(short[] ids) {
-+ customBlockData = ids;
-+ Minecraft.getMinecraft().theWorld.markBlockRangeForRenderUpdate(x * 16, 0, z * 16, x * 16 + 15, 255, z * 16 + 15);
-+ }
-+
-+ public CustomBlock setCustomBlockId(int x, int y, int z, CustomBlock block) {
-+ if (block == null) {
-+ throw new NullPointerException("Custom Block can not be null!");
-+ }
-+ short old = setCustomBlockId(x, y, z, (short) block.getCustomId());
-+ return MaterialData.getCustomBlock(old);
-+ }
-+
-+ public byte getCustomBlockData(int x, int y, int z) {
-+ if (customBlockRotations != null) {
-+ int key = ((x & 0xF) << 12) | ((z & 0xF) << 8) | (y & 0xFF);
-+ return customBlockRotations[key];
-+ }
-+ return 0;
-+ }
-+
-+ public byte setCustomBlockData(int x, int y, int z, byte rot) {
-+ if (customBlockRotations == null) {
-+ customBlockRotations = new byte[16*16*256];
-+ }
-+ if (rot < 0) rot = 0;
-+ int key = ((x & 0xF) << 12) | ((z & 0xF) << 8) | (y & 0xFF);
-+ byte old = customBlockRotations[key];
-+ customBlockRotations[key] = rot;
-+ Minecraft.getMinecraft().theWorld.markBlockForRenderUpdate(x, y, z);
-+ return old;
-+ }
-+
-+ public byte[] getCustomBlockData() {
-+ return customBlockRotations;
-+ }
-+
-+ public void setCustomBlockData(byte[] data) {
-+ customBlockRotations = data;
-+ Minecraft.getMinecraft().theWorld.markBlockRangeForRenderUpdate(x * 16, 0, z * 16, x * 16 + 15, 255, z * 16 + 15);
-+ }
-+
-+ public CustomBlock setCustomBlockId(int x, int y, int z, CustomBlock block, byte data) {
-+ if (block == null) {
-+ throw new NullPointerException("Custom Block can not be null!");
-+ }
-+ short old = setCustomBlockId(x, y, z, (short) block.getCustomId());
-+ setCustomBlockData(x, y, z, data);
-+ return MaterialData.getCustomBlock(old);
-+ }
-+
-+ public int hashCode() {
-+ return new HashCodeBuilder().append(x).append(z).hashCode();
-+ }
-+
-+ public boolean equals(Object obj) {
-+ if (obj instanceof SpoutcraftChunk) {
-+ SpoutcraftChunk other = (SpoutcraftChunk)obj;
-+ return x == other.x && z == other.z;
-+ }
-+ return false;
-+ }
-+
-+ public String toString() {
-+ return "SpoutcraftChunk (" + x + ", " + z + ") ";
-+ }
-+}
---- net/minecraft/src/WorldGenTallGrass.java
-+++ net/minecraft/src/WorldGenTallGrass.java
-@@ -3,33 +3,33 @@
- import java.util.Random;
-
- public class WorldGenTallGrass extends WorldGenerator {
-+
-+ /** Stores ID for WorldGenTallGrass */
- private int tallGrassID;
- private int tallGrassMetadata;
-
-- public WorldGenTallGrass(int var1, int var2) {
-- this.tallGrassID = var1;
-- this.tallGrassMetadata = var2;
-+ public WorldGenTallGrass(int par1, int par2) {
-+ this.tallGrassID = par1;
-+ this.tallGrassMetadata = par2;
- }
-
-- public boolean generate(World var1, Random var2, int var3, int var4, int var5) {
-- boolean var6 = false;
--
-- while(true) {
-- int var11 = var1.getBlockId(var3, var4, var5);
-- if(var11 != 0 && var11 != Block.leaves.blockID || var4 <= 0) {
-- for(int var7 = 0; var7 < 128; ++var7) {
-- int var8 = var3 + var2.nextInt(8) - var2.nextInt(8);
-- int var9 = var4 + var2.nextInt(4) - var2.nextInt(4);
-- int var10 = var5 + var2.nextInt(8) - var2.nextInt(8);
-- if(var1.isAirBlock(var8, var9, var10) && Block.blocksList[this.tallGrassID].canBlockStay(var1, var8, var9, var10)) {
-- var1.setBlock(var8, var9, var10, this.tallGrassID, this.tallGrassMetadata, 2);
-- }
-- }
--
-- return true;
-+ public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5) {
-+ int var11;
-+
-+ for (boolean var6 = false; ((var11 = par1World.getBlockId(par3, par4, par5)) == 0 || var11 == Block.leaves.blockID) && par4 > 0; --par4) {
-+ ;
-+ }
-+
-+ for (int var7 = 0; var7 < 128; ++var7) {
-+ int var8 = par3 + par2Random.nextInt(8) - par2Random.nextInt(8);
-+ int var9 = par4 + par2Random.nextInt(4) - par2Random.nextInt(4);
-+ int var10 = par5 + par2Random.nextInt(8) - par2Random.nextInt(8);
-+
-+ if (par1World.isAirBlock(var8, var9, var10) && Block.blocksList[this.tallGrassID].canBlockStay(par1World, var8, var9, var10)) {
-+ par1World.setBlock(var8, var9, var10, this.tallGrassID, this.tallGrassMetadata, 2);
- }
--
-- --var4;
- }
-+
-+ return true;
- }
- }
---- net/minecraft/src/Packet204ClientInfo.java
-+++ net/minecraft/src/Packet204ClientInfo.java
-@@ -5,53 +5,64 @@
- import java.io.IOException;
-
- public class Packet204ClientInfo extends Packet {
-- private String a;
-+ private String language;
- private int renderDistance;
- private int chatVisisble;
- private boolean chatColours;
- private int gameDifficulty;
- private boolean showCape;
-
-- public Packet204ClientInfo() {
-- }
--
-- public Packet204ClientInfo(String var1, int var2, int var3, boolean var4, int var5, boolean var6) {
-- this.a = var1;
-- this.renderDistance = var2;
-- this.chatVisisble = var3;
-- this.chatColours = var4;
-- this.gameDifficulty = var5;
-- this.showCape = var6;
-- }
--
-- public void readPacketData(DataInput var1) throws IOException {
-- this.a = readString(var1, 7);
-- this.renderDistance = var1.readByte();
-- byte var2 = var1.readByte();
-+ 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 {
-+ this.language = readString(par1DataInput, 7);
-+ this.renderDistance = par1DataInput.readByte();
-+ byte var2 = par1DataInput.readByte();
- this.chatVisisble = var2 & 7;
- this.chatColours = (var2 & 8) == 8;
-- this.gameDifficulty = var1.readByte();
-- this.showCape = var1.readBoolean();
-- }
--
-- public void writePacketData(DataOutput var1) throws IOException {
-- writeString(this.a, var1);
-- var1.writeByte(this.renderDistance);
-- var1.writeByte(this.chatVisisble | (this.chatColours ? 1 : 0) << 3);
-- var1.writeByte(this.gameDifficulty);
-- var1.writeBoolean(this.showCape);
-- }
--
-- public void processPacket(NetHandler var1) {
-- var1.handleClientInfo(this);
-- }
--
-+ this.gameDifficulty = par1DataInput.readByte();
-+ this.showCape = par1DataInput.readBoolean();
-+ }
-+
-+ /**
-+ * Abstract. Writes the raw packet data to the data stream.
-+ */
-+ public void writePacketData(DataOutput par1DataOutput) throws IOException {
-+ writeString(this.language, par1DataOutput);
-+ par1DataOutput.writeByte(this.renderDistance);
-+ par1DataOutput.writeByte(this.chatVisisble | (this.chatColours ? 1 : 0) << 3);
-+ par1DataOutput.writeByte(this.gameDifficulty);
-+ par1DataOutput.writeBoolean(this.showCape);
-+ }
-+
-+ /**
-+ * Passes this Packet on to the NetHandler for processing.
-+ */
-+ public void processPacket(NetHandler par1NetHandler) {
-+ par1NetHandler.handleClientInfo(this);
-+ }
-+
-+ /**
-+ * Abstract. Return the size of the packet (not counting the header).
-+ */
- public int getPacketSize() {
- return 7;
- }
-
- public String getLanguage() {
-- return this.a;
-+ return this.language;
- }
-
- public int getRenderDistance() {
-@@ -74,11 +85,18 @@
- return this.showCape;
- }
-
-+ /**
-+ * only false for the abstract Packet class, all real packets return true
-+ */
- public boolean isRealPacket() {
- return true;
- }
-
-- public boolean containsSameEntityIDAs(Packet var1) {
-+ /**
-+ * eg return packet30entity.entityId == entityId; WARNING : will throw if you compare a packet to a different packet
-+ * class
-+ */
-+ public boolean containsSameEntityIDAs(Packet par1Packet) {
- return true;
- }
- }
---- /dev/null
-+++ org/spoutcraft/client/packet/PacketSpawnTextEntity.java
-@@ -1,0 +1,92 @@
-+/*
-+ * This file is part of Spoutcraft.
-+ *
-+ * Copyright (c) 2011 SpoutcraftDev
-+ * Spoutcraft is licensed under the GNU Lesser General Public License.
-+ *
-+ * Spoutcraft is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation, either version 3 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Spoutcraft is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program. If not, see .
-+ */
-+package org.spoutcraft.client.packet;
-+
-+import java.io.IOException;
-+
-+import net.minecraft.src.Minecraft;
-+
-+import org.spoutcraft.api.io.SpoutInputStream;
-+import org.spoutcraft.api.io.SpoutOutputStream;
-+import org.spoutcraft.client.entity.EntityText;
-+
-+public class PacketSpawnTextEntity implements SpoutPacket {
-+ private String text;
-+ private double posX, posY, posZ, moveX, moveY, moveZ;
-+ private int duration;
-+ private float scale;
-+
-+ public PacketSpawnTextEntity() {
-+ }
-+
-+ @Override
-+ public void readData(SpoutInputStream input) throws IOException {
-+ text = input.readString();
-+ posX = input.readDouble();
-+ posY = input.readDouble();
-+ posZ = input.readDouble();
-+ scale = input.readFloat();
-+ duration = input.readInt();
-+ moveX = input.readDouble();
-+ moveY = input.readDouble();
-+ moveZ = input.readDouble();
-+ }
-+
-+ @Override
-+ public void writeData(SpoutOutputStream output) throws IOException {
-+ output.writeString(text);
-+ output.writeDouble(posX);
-+ output.writeDouble(posY);
-+ output.writeDouble(posZ);
-+ output.writeFloat(scale);
-+ output.writeInt(duration);
-+ output.writeDouble(moveX);
-+ output.writeDouble(moveY);
-+ output.writeDouble(moveZ);
-+ }
-+
-+ @Override
-+ public void run(int playerId) {
-+ EntityText entity = new EntityText(Minecraft.getMinecraft().theWorld);
-+ entity.setPosition(posX, posY, posZ);
-+ entity.setScale(scale);
-+ entity.setText(text);
-+ entity.setRotateWithPlayer(true);
-+ entity.motionX = moveX;
-+ entity.motionY = moveY;
-+ entity.motionZ = moveZ;
-+ entity.setDuration(duration);
-+ Minecraft.getMinecraft().theWorld.spawnEntityInWorld(entity);
-+ }
-+
-+ @Override
-+ public void failure(int playerId) {
-+ }
-+
-+ @Override
-+ public PacketType getPacketType() {
-+ return PacketType.PacketSpawnTextEntity;
-+ }
-+
-+ @Override
-+ public int getVersion() {
-+ return 0;
-+ }
-+}
---- /dev/null
-+++ org/spoutcraft/api/gui/GenericTextField.java
-@@ -1,0 +1,227 @@
-+/*
-+ * This file is part of Spoutcraft.
-+ *
-+ * Copyright (c) 2011 SpoutcraftDev
-+ * Spoutcraft is licensed under the GNU Lesser General Public License.
-+ *
-+ * Spoutcraft is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation, either version 3 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Spoutcraft is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program. If not, see .
-+ */
-+package org.spoutcraft.api.gui;
-+
-+import java.io.IOException;
-+
-+import org.spoutcraft.api.Spoutcraft;
-+import org.spoutcraft.api.UnsafeClass;
-+import org.spoutcraft.api.io.SpoutInputStream;
-+import org.spoutcraft.api.io.SpoutOutputStream;
-+
-+@UnsafeClass
-+public class GenericTextField extends GenericControl implements TextField {
-+ public static final int PADDING = 4;
-+ public static final int LINE_HEIGHT = 10;
-+ public static final int LINE_SPACING = 2;
-+ private static final char MASK_MAXLINES = 0x7F; // bits 1-7
-+ private static final char MASK_TABINDEX = 0x3F80; // bits 8-4
-+ private static final char FLAG_PASSWORD = 0x4000; // bit 15
-+ //private static final char FLAG_FOCUS = 0x8000; // bit 16 focus is already set in Control.
-+ protected boolean password = false;
-+ protected TextProcessor textProcessor;
-+ protected int tabIndex = 0;
-+ protected Color fieldColor = new Color(0, 0, 0);
-+ protected Color borderColor = new Color(0.625F, 0.625F, 0.625F);
-+ protected String placeholder = "";
-+
-+ public GenericTextField() {
-+ this.textProcessor = new GenericTextProcessor();
-+ }
-+
-+ @Override
-+ public int getVersion() {
-+ return super.getVersion() + 3;
-+ }
-+
-+ public String getActualText() {
-+ return textProcessor.getText().length() == 0 ? getPlaceholder() : textProcessor.getText();
-+ }
-+
-+ @Override
-+ public void readData(SpoutInputStream input) throws IOException {
-+ super.readData(input);
-+ setFieldColor(input.readColor());
-+ setBorderColor(input.readColor());
-+ char c = input.readChar();
-+ setPasswordField((c & FLAG_PASSWORD) > 0);
-+ setMaximumLines(c & MASK_MAXLINES);
-+ setTabIndex((c & MASK_TABINDEX) >>> 7);
-+ setCursorPosition(input.readChar());
-+ setMaximumCharacters(input.readChar());
-+ setText(input.readString());
-+ setPlaceholder(input.readString());
-+ }
-+
-+ @Override
-+ public void writeData(SpoutOutputStream output) throws IOException {
-+ super.writeData(output);
-+ output.writeColor(getFieldColor());
-+ output.writeColor( getBorderColor());
-+ output.writeChar((char) (getMaximumLines() & MASK_MAXLINES | (getTabIndex() << 7) & MASK_TABINDEX | (isPasswordField() ? FLAG_PASSWORD : 0)));
-+ output.writeChar((char) getCursorPosition());
-+ output.writeChar((char) getMaximumCharacters());
-+ output.writeString(getText());
-+ output.writeString(getPlaceholder());
-+ }
-+
-+ public int getCursorPosition() {
-+ return textProcessor.getCursor();
-+ }
-+
-+ public TextField setCursorPosition(int position) {
-+ textProcessor.setCursor(position);
-+ return this;
-+ }
-+
-+ public String getText() {
-+ return textProcessor.getText();
-+ }
-+
-+ public TextField setText(String text) {
-+ textProcessor.setText(text);
-+ return this;
-+ }
-+
-+ public int getMaximumCharacters() {
-+ return textProcessor.getMaximumCharacters();
-+ }
-+
-+ public TextField setMaximumCharacters(int max) {
-+ textProcessor.setMaximumCharacters(Math.max(0, max));
-+ return this;
-+ }
-+
-+ public Color getFieldColor() {
-+ return fieldColor;
-+ }
-+
-+ public TextField setFieldColor(Color color) {
-+ this.fieldColor = color;
-+ return this;
-+ }
-+
-+ public Color getBorderColor() {
-+ return borderColor;
-+ }
-+
-+ public TextField setBorderColor(Color color) {
-+ this.borderColor = color;
-+ return this;
-+ }
-+
-+ public WidgetType getType() {
-+ return WidgetType.TextField;
-+ }
-+
-+ public void render() {
-+ Spoutcraft.getClient().getRenderDelegate().render(this);
-+ }
-+
-+ public TextProcessor getTextProcessor() {
-+ return textProcessor;
-+ }
-+
-+ public TextField setTextProcessor(TextProcessor processor) {
-+ processor.setWidth(getTextProcessor().getWidth());
-+ processor.setText(getTextProcessor().getText());
-+ this.textProcessor = processor;
-+ return this;
-+ }
-+
-+ public int getMaximumLines() {
-+ return textProcessor.getMaximumLines();
-+ }
-+
-+ public TextField setMaximumLines(int max) {
-+ // if max equals 0 calculate how many lines this text field can hold
-+ textProcessor.setMaximumLines((max > 0) ? max : (int) Math.floor((getHeight() - (PADDING << 1) + LINE_SPACING) / (LINE_HEIGHT + LINE_SPACING)));
-+ return this;
-+ }
-+
-+ public int getTabIndex() {
-+ return tabIndex;
-+ }
-+
-+ public TextField setTabIndex(int index) {
-+ this.tabIndex = index;
-+ return this;
-+ }
-+
-+ public boolean isPasswordField() {
-+ return password;
-+ }
-+
-+ public TextField setPasswordField(boolean password) {
-+ if (this.password != password) {
-+ setTextProcessor((password) ? new PasswordTextProcessor() : new GenericTextProcessor());
-+ }
-+ this.password = password;
-+ return this;
-+ }
-+
-+ @Override
-+ public Widget setWidth(int width) {
-+ textProcessor.setWidth(Math.max(0, width - (PADDING << 1)));
-+ return super.setWidth(width);
-+ }
-+
-+ @Override
-+ public Control setFocus(boolean focus) {
-+ if (focus) {
-+ Keyboard.setRepeatingEvents(true);
-+ }
-+ return super.setFocus(focus);
-+ }
-+
-+ @Override
-+ public TextField copy() {
-+ // ignore focus parameter which would lead to strange behaviour!
-+ return ((TextField) super.copy()).setText(getText()).setCursorPosition(getCursorPosition()).setMaximumCharacters(getMaximumCharacters()).setFieldColor(getFieldColor()).setBorderColor(getBorderColor()).setMaximumLines(getMaximumLines()).setTabIndex(getTabIndex()).setPasswordField(isPasswordField()).setPlaceholder(getPlaceholder());
-+ }
-+
-+ public void onTypingFinished() {
-+ }
-+
-+ public TextField setPlaceholder(String text) {
-+ placeholder = text;
-+ return this;
-+ }
-+
-+ public String getPlaceholder() {
-+ return placeholder;
-+ }
-+
-+ @Override
-+ public Widget setGeometry(Rectangle geometry) {
-+ textProcessor.setWidth(geometry.getWidth());
-+ return super.setGeometry(geometry);
-+ }
-+
-+ @Override
-+ public Widget setGeometry(int x, int y, int width, int height) {
-+ textProcessor.setWidth(width);
-+ return super.setGeometry(x, y, width, height);
-+ }
-+
-+ @Override
-+ public void onTextFieldChange() {
-+ }
-+}
---- net/minecraft/src/CallableMPL1.java
-+++ net/minecraft/src/CallableMPL1.java
-@@ -3,12 +3,17 @@
- import java.util.concurrent.Callable;
-
- class CallableMPL1 implements Callable {
-+
-+ /** Reference to the WorldClient object. */
- final WorldClient theWorldClient;
-
-- CallableMPL1(WorldClient var1) {
-- this.theWorldClient = var1;
-+ 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();
- }
---- net/minecraft/src/ClippingHelperImpl.java
-+++ net/minecraft/src/ClippingHelperImpl.java
-@@ -1,37 +1,52 @@
- package net.minecraft.src;
-
- import java.nio.FloatBuffer;
--import org.lwjgl.opengl.GL11;
-+// Spout Start - Unused import
-+//import org.lwjgl.opengl.GL11;
-+// Spout End
-
- public class ClippingHelperImpl extends ClippingHelper {
- private static ClippingHelperImpl instance = new ClippingHelperImpl();
-- private FloatBuffer f = GLAllocation.createDirectFloatBuffer(16);
-- private FloatBuffer g = GLAllocation.createDirectFloatBuffer(16);
-- private FloatBuffer h = GLAllocation.createDirectFloatBuffer(16);
-+ 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;
- }
-
-- private void normalize(float[][] var1, int var2) {
-- float var3 = MathHelper.sqrt_float(var1[var2][0] * var1[var2][0] + var1[var2][1] * var1[var2][1] + var1[var2][2] * var1[var2][2]);
-- var1[var2][0] /= var3;
-- var1[var2][1] /= var3;
-- var1[var2][2] /= var3;
-- var1[var2][3] /= var3;
-+ /**
-+ * 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.f.clear();
-- this.g.clear();
-- this.h.clear();
-- GL11.glGetFloat(GL11.GL_PROJECTION_MATRIX, this.f);
-- GL11.glGetFloat(GL11.GL_MODELVIEW_MATRIX, this.g);
-- this.f.flip().limit(16);
-- this.f.get(this.projectionMatrix);
-- this.g.flip().limit(16);
-- this.g.get(this.modelviewMatrix);
-+ // Spout Start
-+ /*
-+ 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);
-+ */
-+ modelviewMatrixBuffer = ActiveRenderInfo.modelMatrix.duplicate();
-+ projectionMatrixBuffer = ActiveRenderInfo.projectionMatrix.duplicate();
-+ // Spout End
-+
-+ 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];
---- net/minecraft/src/ModelSheep2.java
-+++ net/minecraft/src/ModelSheep2.java
-@@ -13,14 +13,23 @@
- this.body.setRotationPoint(0.0F, 5.0F, 2.0F);
- }
-
-- public void setLivingAnimations(EntityLivingBase var1, float var2, float var3, float var4) {
-- super.setLivingAnimations(var1, var2, var3, var4);
-- this.head.rotationPointY = 6.0F + ((EntitySheep)var1).func_70894_j(var4) * 9.0F;
-- this.field_78153_i = ((EntitySheep)var1).func_70890_k(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);
-+ this.head.rotationPointY = 6.0F + ((EntitySheep)par1EntityLivingBase).func_70894_j(par4) * 9.0F;
-+ this.field_78153_i = ((EntitySheep)par1EntityLivingBase).func_70890_k(par4);
- }
-
-- public void setRotationAngles(float var1, float var2, float var3, float var4, float var5, float var6, Entity var7) {
-- super.setRotationAngles(var1, var2, var3, var4, var5, var6, var7);
-+ /**
-+ * 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
-+++ org/spoutcraft/client/gui/settings/controls/SnooperButton.java
-@@ -1,0 +1,41 @@
-+/*
-+ * This file is part of Spoutcraft.
-+ *
-+ * Copyright (c) 2011 SpoutcraftDev
-+ * Spoutcraft is licensed under the GNU Lesser General Public License.
-+ *
-+ * Spoutcraft is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation, either version 3 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Spoutcraft is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program. If not, see .
-+ */
-+package org.spoutcraft.client.gui.settings.controls;
-+
-+import net.minecraft.src.GuiScreen;
-+import net.minecraft.src.GuiSnooper;
-+
-+import org.spoutcraft.api.gui.GenericButton;
-+import org.spoutcraft.client.SpoutClient;
-+
-+public class SnooperButton extends GenericButton {
-+ GuiScreen parent;
-+
-+ public SnooperButton(GuiScreen parent) {
-+ super("Snooper Settings");
-+ this.parent = parent;
-+ }
-+
-+ @Override
-+ public void onButtonClick() {
-+ GuiSnooper snooperSettings = new GuiSnooper(parent, SpoutClient.getHandle().gameSettings);
-+ SpoutClient.getHandle().displayGuiScreen(snooperSettings);
-+ }
-+}
---- net/minecraft/src/BlockCauldron.java
-+++ net/minecraft/src/BlockCauldron.java
-@@ -8,100 +8,131 @@
- private Icon cauldronTopIcon;
- private Icon cauldronBottomIcon;
-
-- public BlockCauldron(int var1) {
-- super(var1, Material.iron);
-- }
--
-- public Icon getIcon(int var1, int var2) {
-- return var1 == 1 ? this.cauldronTopIcon : (var1 == 0 ? this.cauldronBottomIcon : this.blockIcon);
-- }
--
-- public void registerIcons(IconRegister var1) {
-- this.field_94378_a = var1.registerIcon(this.getTextureName() + "_" + "inner");
-- this.cauldronTopIcon = var1.registerIcon(this.getTextureName() + "_top");
-- this.cauldronBottomIcon = var1.registerIcon(this.getTextureName() + "_" + "bottom");
-- this.blockIcon = var1.registerIcon(this.getTextureName() + "_side");
-- }
--
-- public static Icon getCauldronIcon(String var0) {
-- return var0.equals("inner") ? Block.cauldron.field_94378_a : (var0.equals("bottom") ? Block.cauldron.cauldronBottomIcon : null);
-- }
--
-- public void addCollisionBoxesToList(World var1, int var2, int var3, int var4, AxisAlignedBB var5, List var6, Entity var7) {
-- this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 5.0F / 16.0F, 1.0F);
-- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7);
-- float var8 = 2.0F / 16.0F;
-+ 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) {
-+ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.3125F, 1.0F);
-+ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity);
-+ float var8 = 0.125F;
- this.setBlockBounds(0.0F, 0.0F, 0.0F, var8, 1.0F, 1.0F);
-- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7);
-+ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity);
- this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, var8);
-- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7);
-+ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity);
- this.setBlockBounds(1.0F - var8, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
-- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7);
-+ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity);
- this.setBlockBounds(0.0F, 0.0F, 1.0F - var8, 1.0F, 1.0F, 1.0F);
-- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7);
-+ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity);
- this.setBlockBoundsForItemRender();
- }
-
-+ /**
-+ * Sets the block's bounds for rendering it as an item
-+ */
- public void setBlockBoundsForItemRender() {
- this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
- }
-
-+ /**
-+ * 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;
- }
-
-+ /**
-+ * The type of render function that is called for this block
-+ */
- public int getRenderType() {
- return 24;
- }
-
-+ /**
-+ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc)
-+ */
- public boolean renderAsNormalBlock() {
- return false;
- }
-
-- public boolean onBlockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5, int var6, float var7, float var8, float var9) {
-- if(var1.isRemote) {
-+ /**
-+ * 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) {
- return true;
- } else {
-- ItemStack var10 = var5.inventory.getCurrentItem();
-- if(var10 == null) {
-+ ItemStack var10 = par5EntityPlayer.inventory.getCurrentItem();
-+
-+ if (var10 == null) {
- return true;
- } else {
-- int var11 = var1.getBlockMetadata(var2, var3, var4);
-+ int var11 = par1World.getBlockMetadata(par2, par3, par4);
- int var12 = func_111045_h_(var11);
-- if(var10.itemID == Item.bucketWater.itemID) {
-- if(var12 < 3) {
-- if(!var5.capabilities.isCreativeMode) {
-- var5.inventory.setInventorySlotContents(var5.inventory.currentItem, new ItemStack(Item.bucketEmpty));
-+
-+ if (var10.itemID == Item.bucketWater.itemID) {
-+ if (var12 < 3) {
-+ if (!par5EntityPlayer.capabilities.isCreativeMode) {
-+ par5EntityPlayer.inventory.setInventorySlotContents(par5EntityPlayer.inventory.currentItem, new ItemStack(Item.bucketEmpty));
- }
-
-- var1.setBlockMetadata(var2, var3, var4, 3, 2);
-- var1.func_96440_m(var2, var3, var4, this.blockID);
-+ par1World.setBlockMetadataWithNotify(par2, par3, par4, 3, 2);
-+ par1World.func_96440_m(par2, par3, par4, this.blockID);
- }
-
- return true;
- } else {
-- if(var10.itemID == Item.glassBottle.itemID) {
-- if(var12 > 0) {
-+ if (var10.itemID == Item.glassBottle.itemID) {
-+ if (var12 > 0) {
- ItemStack var13 = new ItemStack(Item.potion, 1, 0);
-- if(!var5.inventory.addItemStackToInventory(var13)) {
-- var1.spawnEntityInWorld(new EntityItem(var1, (double)var2 + 0.5D, (double)var3 + 1.5D, (double)var4 + 0.5D, var13));
-- } else if(var5 instanceof EntityPlayerMP) {
-- ((EntityPlayerMP)var5).sendContainerToPlayer(var5.inventoryContainer);
-+
-+ if (!par5EntityPlayer.inventory.addItemStackToInventory(var13)) {
-+ par1World.spawnEntityInWorld(new EntityItem(par1World, (double)par2 + 0.5D, (double)par3 + 1.5D, (double)par4 + 0.5D, var13));
-+ } else if (par5EntityPlayer instanceof EntityPlayerMP) {
-+ ((EntityPlayerMP)par5EntityPlayer).sendContainerToPlayer(par5EntityPlayer.inventoryContainer);
- }
-
- --var10.stackSize;
-- if(var10.stackSize <= 0) {
-- var5.inventory.setInventorySlotContents(var5.inventory.currentItem, (ItemStack)null);
-+
-+ if (var10.stackSize <= 0) {
-+ par5EntityPlayer.inventory.setInventorySlotContents(par5EntityPlayer.inventory.currentItem, (ItemStack)null);
- }
-
-- var1.setBlockMetadata(var2, var3, var4, var12 - 1, 2);
-- var1.func_96440_m(var2, var3, var4, this.blockID);
-+ 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) {
-+ } else if (var12 > 0 && var10.getItem() instanceof ItemArmor && ((ItemArmor)var10.getItem()).getArmorMaterial() == EnumArmorMaterial.CLOTH) {
- ItemArmor var14 = (ItemArmor)var10.getItem();
- var14.removeColor(var10);
-- var1.setBlockMetadata(var2, var3, var4, var12 - 1, 2);
-- var1.func_96440_m(var2, var3, var4, this.blockID);
-+ par1World.setBlockMetadataWithNotify(par2, par3, par4, var12 - 1, 2);
-+ par1World.func_96440_m(par2, par3, par4, this.blockID);
- return true;
- }
-
-@@ -111,34 +142,51 @@
- }
- }
-
-- public void fillWithRain(World var1, int var2, int var3, int var4) {
-- if(var1.s.nextInt(20) == 1) {
-- int var5 = var1.getBlockMetadata(var2, var3, var4);
-- if(var5 < 3) {
-- var1.setBlockMetadata(var2, var3, var4, var5 + 1, 2);
-+ /**
-+ * currently only used by BlockCauldron to incrament meta-data during rain
-+ */
-+ public void fillWithRain(World par1World, int par2, int par3, int par4) {
-+ if (par1World.rand.nextInt(20) == 1) {
-+ int var5 = par1World.getBlockMetadata(par2, par3, par4);
-+
-+ if (var5 < 3) {
-+ par1World.setBlockMetadataWithNotify(par2, par3, par4, var5 + 1, 2);
- }
--
- }
- }
-
-- public int idDropped(int var1, Random var2, int var3) {
-- return Item.cauldron.itemID;
-- }
--
-- public int idPicked(World var1, int var2, int var3, int var4) {
-- return Item.cauldron.itemID;
-- }
--
-+ /**
-+ * 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;
-+ }
-+
-+ /**
-+ * 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() {
- return true;
- }
-
-- public int getComparatorInputOverride(World var1, int var2, int var3, int var4, int var5) {
-- int var6 = var1.getBlockMetadata(var2, var3, var4);
-+ /**
-+ * If hasComparatorInputOverride returns true, the return value from this is used instead of the redstone signal
-+ * strength when this block inputs to a comparator.
-+ */
-+ public int getComparatorInputOverride(World par1World, int par2, int par3, int par4, int par5) {
-+ int var6 = par1World.getBlockMetadata(par2, par3, par4);
- return func_111045_h_(var6);
- }
-
-- public static int func_111045_h_(int var0) {
-- return var0;
-+ public static int func_111045_h_(int par0) {
-+ return par0;
- }
- }
---- net/minecraft/src/ChunkProviderFlat.java
-+++ net/minecraft/src/ChunkProviderFlat.java
-@@ -8,84 +8,95 @@
-
- public class ChunkProviderFlat implements IChunkProvider {
- private World worldObj;
-- private Random b;
-+ private Random random;
- private final byte[] cachedBlockIDs = new byte[256];
- private final byte[] cachedBlockMetadata = new byte[256];
- private final FlatGeneratorInfo flatWorldGenInfo;
-- private final List f = new ArrayList();
-+ private final List structureGenerators = new ArrayList();
- private final boolean hasDecoration;
- private final boolean hasDungeons;
- private WorldGenLakes waterLakeGenerator;
- private WorldGenLakes lavaLakeGenerator;
-
-- public ChunkProviderFlat(World var1, long var2, boolean var4, String var5) {
-- this.worldObj = var1;
-- this.b = new Random(var2);
-- this.flatWorldGenInfo = FlatGeneratorInfo.createFlatGeneratorFromString(var5);
-- if(var4) {
-+ public ChunkProviderFlat(World par1World, long par2, boolean par4, String par5Str) {
-+ this.worldObj = par1World;
-+ this.random = new Random(par2);
-+ this.flatWorldGenInfo = FlatGeneratorInfo.createFlatGeneratorFromString(par5Str);
-+
-+ if (par4) {
- Map var6 = this.flatWorldGenInfo.getWorldFeatures();
-- if(var6.containsKey("village")) {
-+
-+ if (var6.containsKey("village")) {
- Map var7 = (Map)var6.get("village");
-- if(!var7.containsKey("size")) {
-+
-+ if (!var7.containsKey("size")) {
- var7.put("size", "1");
- }
-
-- this.f.add(new MapGenVillage(var7));
-- }
--
-- if(var6.containsKey("biome_1")) {
-- this.f.add(new MapGenScatteredFeature((Map)var6.get("biome_1")));
-- }
--
-- if(var6.containsKey("mineshaft")) {
-- this.f.add(new MapGenMineshaft((Map)var6.get("mineshaft")));
-- }
--
-- if(var6.containsKey("stronghold")) {
-- this.f.add(new MapGenStronghold((Map)var6.get("stronghold")));
-+ this.structureGenerators.add(new MapGenVillage(var7));
-+ }
-+
-+ if (var6.containsKey("biome_1")) {
-+ this.structureGenerators.add(new MapGenScatteredFeature((Map)var6.get("biome_1")));
-+ }
-+
-+ if (var6.containsKey("mineshaft")) {
-+ this.structureGenerators.add(new MapGenMineshaft((Map)var6.get("mineshaft")));
-+ }
-+
-+ if (var6.containsKey("stronghold")) {
-+ this.structureGenerators.add(new MapGenStronghold((Map)var6.get("stronghold")));
- }
- }
-
- this.hasDecoration = this.flatWorldGenInfo.getWorldFeatures().containsKey("decoration");
-- if(this.flatWorldGenInfo.getWorldFeatures().containsKey("lake")) {
-+
-+ if (this.flatWorldGenInfo.getWorldFeatures().containsKey("lake")) {
- this.waterLakeGenerator = new WorldGenLakes(Block.waterStill.blockID);
- }
-
-- if(this.flatWorldGenInfo.getWorldFeatures().containsKey("lava_lake")) {
-+ if (this.flatWorldGenInfo.getWorldFeatures().containsKey("lava_lake")) {
- this.lavaLakeGenerator = new WorldGenLakes(Block.lavaStill.blockID);
- }
-
- this.hasDungeons = this.flatWorldGenInfo.getWorldFeatures().containsKey("dungeon");
- Iterator var9 = this.flatWorldGenInfo.getFlatLayers().iterator();
-
-- while(var9.hasNext()) {
-+ while (var9.hasNext()) {
- FlatLayerInfo var10 = (FlatLayerInfo)var9.next();
-
-- for(int var8 = var10.getMinY(); var8 < var10.getMinY() + var10.getLayerCount(); ++var8) {
-+ for (int var8 = var10.getMinY(); var8 < var10.getMinY() + var10.getLayerCount(); ++var8) {
- this.cachedBlockIDs[var8] = (byte)(var10.getFillBlock() & 255);
- this.cachedBlockMetadata[var8] = (byte)var10.getFillBlockMeta();
- }
- }
--
-- }
--
-- public Chunk loadChunk(int var1, int var2) {
-- return this.provideChunk(var1, var2);
-- }
--
-- public Chunk provideChunk(int var1, int var2) {
-- Chunk var3 = new Chunk(this.worldObj, var1, var2);
--
-- for(int var4 = 0; var4 < this.cachedBlockIDs.length; ++var4) {
-+ }
-+
-+ /**
-+ * loads or generates the chunk at the chunk location specified
-+ */
-+ public Chunk loadChunk(int par1, int par2) {
-+ return this.provideChunk(par1, par2);
-+ }
-+
-+ /**
-+ * 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 = new Chunk(this.worldObj, par1, par2);
-+
-+ for (int var4 = 0; var4 < this.cachedBlockIDs.length; ++var4) {
- int var5 = var4 >> 4;
- ExtendedBlockStorage var6 = var3.getBlockStorageArray()[var5];
-- if(var6 == null) {
-+
-+ if (var6 == null) {
- var6 = new ExtendedBlockStorage(var4, !this.worldObj.provider.hasNoSky);
- var3.getBlockStorageArray()[var5] = var6;
- }
-
-- for(int var7 = 0; var7 < 16; ++var7) {
-- for(int var8 = 0; var8 < 16; ++var8) {
-+ for (int var7 = 0; var7 < 16; ++var7) {
-+ for (int var8 = 0; var8 < 16; ++var8) {
- var6.setExtBlockID(var7, var4 & 15, var8, this.cachedBlockIDs[var4] & 255);
- var6.setExtBlockMetadata(var7, var4 & 15, var8, this.cachedBlockMetadata[var4]);
- }
-@@ -93,43 +104,50 @@
- }
-
- var3.generateSkylightMap();
-- BiomeGenBase[] var9 = this.worldObj.getWorldChunkManager().loadBlockGeneratorData((BiomeGenBase[])null, var1 * 16, var2 * 16, 16, 16);
-+ BiomeGenBase[] var9 = this.worldObj.getWorldChunkManager().loadBlockGeneratorData((BiomeGenBase[])null, par1 * 16, par2 * 16, 16, 16);
- byte[] var10 = var3.getBiomeArray();
-
-- for(int var11 = 0; var11 < var10.length; ++var11) {
-+ for (int var11 = 0; var11 < var10.length; ++var11) {
- var10[var11] = (byte)var9[var11].biomeID;
- }
-
-- Iterator var12 = this.f.iterator();
-+ Iterator var12 = this.structureGenerators.iterator();
-
-- while(var12.hasNext()) {
-+ while (var12.hasNext()) {
- MapGenStructure var13 = (MapGenStructure)var12.next();
-- var13.generate(this, this.worldObj, var1, var2, (byte[])null);
-+ var13.generate(this, this.worldObj, par1, par2, (byte[])null);
- }
-
- var3.generateSkylightMap();
- return var3;
- }
-
-- public boolean chunkExists(int var1, int var2) {
-+ /**
-+ * Checks to see if a chunk exists at x, y
-+ */
-+ public boolean chunkExists(int par1, int par2) {
- return true;
- }
-
-- public void populate(IChunkProvider var1, int var2, int var3) {
-- int var4 = var2 * 16;
-- int var5 = var3 * 16;
-+ /**
-+ * Populates chunk with ores etc etc
-+ */
-+ public void populate(IChunkProvider par1IChunkProvider, int par2, int par3) {
-+ int var4 = par2 * 16;
-+ int var5 = par3 * 16;
- BiomeGenBase var6 = this.worldObj.getBiomeGenForCoords(var4 + 16, var5 + 16);
- boolean var7 = false;
-- this.b.setSeed(this.worldObj.getSeed());
-- long var8 = this.b.nextLong() / 2L * 2L + 1L;
-- long var10 = this.b.nextLong() / 2L * 2L + 1L;
-- this.b.setSeed((long)var2 * var8 + (long)var3 * var10 ^ this.worldObj.getSeed());
-- Iterator var12 = this.f.iterator();
-+ this.random.setSeed(this.worldObj.getSeed());
-+ long var8 = this.random.nextLong() / 2L * 2L + 1L;
-+ long var10 = this.random.nextLong() / 2L * 2L + 1L;
-+ this.random.setSeed((long)par2 * var8 + (long)par3 * var10 ^ this.worldObj.getSeed());
-+ Iterator var12 = this.structureGenerators.iterator();
-
-- while(var12.hasNext()) {
-+ while (var12.hasNext()) {
- MapGenStructure var13 = (MapGenStructure)var12.next();
-- boolean var14 = var13.generateStructuresInChunk(this.worldObj, this.b, var2, var3);
-- if(var13 instanceof MapGenVillage) {
-+ boolean var14 = var13.generateStructuresInChunk(this.worldObj, this.random, par2, par3);
-+
-+ if (var13 instanceof MapGenVillage) {
- var7 |= var14;
- }
- }
-@@ -137,69 +155,93 @@
- int var16;
- int var17;
- int var18;
-- if(this.waterLakeGenerator != null && !var7 && this.b.nextInt(4) == 0) {
-- var16 = var4 + this.b.nextInt(16) + 8;
-- var17 = this.b.nextInt(128);
-- var18 = var5 + this.b.nextInt(16) + 8;
-- this.waterLakeGenerator.generate(this.worldObj, this.b, var16, var17, var18);
-- }
--
-- if(this.lavaLakeGenerator != null && !var7 && this.b.nextInt(8) == 0) {
-- var16 = var4 + this.b.nextInt(16) + 8;
-- var17 = this.b.nextInt(this.b.nextInt(120) + 8);
-- var18 = var5 + this.b.nextInt(16) + 8;
-- if(var17 < 63 || this.b.nextInt(10) == 0) {
-- this.lavaLakeGenerator.generate(this.worldObj, this.b, var16, var17, var18);
-- }
-- }
--
-- if(this.hasDungeons) {
-- for(var16 = 0; var16 < 8; ++var16) {
-- var17 = var4 + this.b.nextInt(16) + 8;
-- var18 = this.b.nextInt(128);
-- int var15 = var5 + this.b.nextInt(16) + 8;
-- (new WorldGenDungeons()).generate(this.worldObj, this.b, var17, var18, var15);
-- }
-- }
--
-- if(this.hasDecoration) {
-- var6.decorate(this.worldObj, this.b, var4, var5);
-- }
--
-+
-+ if (this.waterLakeGenerator != null && !var7 && this.random.nextInt(4) == 0) {
-+ var16 = var4 + this.random.nextInt(16) + 8;
-+ var17 = this.random.nextInt(128);
-+ var18 = var5 + this.random.nextInt(16) + 8;
-+ this.waterLakeGenerator.generate(this.worldObj, this.random, var16, var17, var18);
-+ }
-+
-+ if (this.lavaLakeGenerator != null && !var7 && this.random.nextInt(8) == 0) {
-+ var16 = var4 + this.random.nextInt(16) + 8;
-+ var17 = this.random.nextInt(this.random.nextInt(120) + 8);
-+ var18 = var5 + this.random.nextInt(16) + 8;
-+
-+ if (var17 < 63 || this.random.nextInt(10) == 0) {
-+ this.lavaLakeGenerator.generate(this.worldObj, this.random, var16, var17, var18);
-+ }
-+ }
-+
-+ if (this.hasDungeons) {
-+ for (var16 = 0; var16 < 8; ++var16) {
-+ var17 = var4 + this.random.nextInt(16) + 8;
-+ var18 = this.random.nextInt(128);
-+ int var15 = var5 + this.random.nextInt(16) + 8;
-+ (new WorldGenDungeons()).generate(this.worldObj, this.random, var17, var18, var15);
-+ }
-+ }
-+
-+ if (this.hasDecoration) {
-+ var6.decorate(this.worldObj, this.random, var4, var5);
-+ }
- }
-
-- public boolean saveChunks(boolean var1, IProgressUpdate var2) {
-+ /**
-+ * 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;
- }
-
-- public void saveExtraData() {
-- }
-+ /**
-+ * 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 true;
- }
-
-+ /**
-+ * Converts the instance data to a readable string.
-+ */
- public String makeString() {
- return "FlatLevelSource";
- }
-
-- public List getPossibleCreatures(EnumCreatureType var1, int var2, int var3, int var4) {
-- BiomeGenBase var5 = this.worldObj.getBiomeGenForCoords(var2, var4);
-- return var5 == null ? null : var5.getSpawnableList(var1);
-+ /**
-+ * 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) {
-+ BiomeGenBase var5 = this.worldObj.getBiomeGenForCoords(par2, par4);
-+ return var5 == null ? null : var5.getSpawnableList(par1EnumCreatureType);
- }
-
-- public ChunkPosition findClosestStructure(World var1, String var2, int var3, int var4, int var5) {
-- if("Stronghold".equals(var2)) {
-- Iterator var6 = this.f.iterator();
-+ /**
-+ * 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) {
-+ if ("Stronghold".equals(par2Str)) {
-+ Iterator var6 = this.structureGenerators.iterator();
-
-- while(var6.hasNext()) {
-+ while (var6.hasNext()) {
- MapGenStructure var7 = (MapGenStructure)var6.next();
-- if(var7 instanceof MapGenStronghold) {
-- return var7.getNearestInstance(var1, var3, var4, var5);
-+
-+ if (var7 instanceof MapGenStronghold) {
-+ return var7.getNearestInstance(par1World, par3, par4, par5);
- }
- }
- }
-@@ -211,13 +253,12 @@
- return 0;
- }
-
-- public void recreateStructures(int var1, int var2) {
-- Iterator var3 = this.f.iterator();
-+ public void recreateStructures(int par1, int par2) {
-+ Iterator var3 = this.structureGenerators.iterator();
-
-- while(var3.hasNext()) {
-+ while (var3.hasNext()) {
- MapGenStructure var4 = (MapGenStructure)var3.next();
-- var4.generate(this, this.worldObj, var1, var2, (byte[])null);
-+ var4.generate(this, this.worldObj, par1, par2, (byte[])null);
- }
--
- }
- }
---- net/minecraft/src/TextureManager.java
-+++ net/minecraft/src/TextureManager.java
-@@ -2,112 +2,152 @@
-
- import com.google.common.collect.Lists;
- import com.google.common.collect.Maps;
-+import com.prupe.mcpatcher.hd.CustomAnimation;
- import java.io.IOException;
- import java.util.Iterator;
- import java.util.List;
- import java.util.Map;
- import java.util.Map.Entry;
-+import org.lwjgl.opengl.GL11;
-+import org.lwjgl.opengl.GL12;
-
- public class TextureManager implements Tickable, ResourceManagerReloadListener {
-- private final Map a = Maps.newHashMap();
-- private final Map b = Maps.newHashMap();
-- private final List c = Lists.newArrayList();
-- private final Map d = Maps.newHashMap();
-+ public final Map mapTextureObjects = Maps.newHashMap();
-+ private final Map mapResourceLocations = Maps.newHashMap();
-+ private final List listTickables = Lists.newArrayList();
-+ private final Map mapTextureCounters = Maps.newHashMap();
- private ResourceManager theResourceManager;
-+ // Spout Start
-+ public int boundTexture;
-+ // Spout End
-
-- public TextureManager(ResourceManager var1) {
-- this.theResourceManager = var1;
-+ public TextureManager(ResourceManager par1ResourceManager) {
-+ this.theResourceManager = par1ResourceManager;
- }
-
-- public void bindTexture(ResourceLocation var1) {
-- Object var2 = (TextureObject)this.a.get(var1);
-- if(var2 == null) {
-- var2 = new SimpleTexture(var1);
-- this.loadTexture(var1, (TextureObject)var2);
-+ public void bindTexture(ResourceLocation par1ResourceLocation) {
-+ Object var2 = (TextureObject)this.mapTextureObjects.get(par1ResourceLocation);
-+
-+ if (var2 == null) {
-+ var2 = new SimpleTexture(par1ResourceLocation);
-+ this.loadTexture(par1ResourceLocation, (TextureObject)var2);
- }
-
- TextureUtil.bindTexture(((TextureObject)var2).getGlTextureId());
- }
-
-- public ResourceLocation getResourceLocation(int var1) {
-- return (ResourceLocation)this.b.get(Integer.valueOf(var1));
-- }
--
-- public boolean loadTextureMap(ResourceLocation var1, TextureMap var2) {
-- if(this.loadTickableTexture(var1, var2)) {
-- this.b.put(Integer.valueOf(var2.getTextureType()), var1);
-- return true;
-- } else {
-- return false;
-- }
-- }
--
-- public boolean loadTickableTexture(ResourceLocation var1, TickableTextureObject var2) {
-- if(this.loadTexture(var1, var2)) {
-- this.c.add(var2);
-- return true;
-- } else {
-- return false;
-- }
-- }
--
-- public boolean loadTexture(ResourceLocation var1, TextureObject var2) {
-+ public ResourceLocation getResourceLocation(int par1) {
-+ return (ResourceLocation)this.mapResourceLocations.get(Integer.valueOf(par1));
-+ }
-+
-+ public boolean loadTextureMap(ResourceLocation par1ResourceLocation, TextureMap par2TextureMap) {
-+ if (this.loadTickableTexture(par1ResourceLocation, par2TextureMap)) {
-+ this.mapResourceLocations.put(Integer.valueOf(par2TextureMap.getTextureType()), par1ResourceLocation);
-+ return true;
-+ } else {
-+ return false;
-+ }
-+ }
-+
-+ public boolean loadTickableTexture(ResourceLocation par1ResourceLocation, TickableTextureObject par2TickableTextureObject) {
-+ if (this.loadTexture(par1ResourceLocation, par2TickableTextureObject)) {
-+ this.listTickables.add(par2TickableTextureObject);
-+ return true;
-+ } else {
-+ return false;
-+ }
-+ }
-+
-+ public boolean loadTexture(ResourceLocation par1ResourceLocation, TextureObject par2TextureObject) {
- boolean var3 = true;
-
- try {
-- ((TextureObject)var2).loadTexture(this.theResourceManager);
-+ ((TextureObject)par2TextureObject).loadTexture(this.theResourceManager);
- } catch (IOException var8) {
-- Minecraft.getMinecraft().getLogAgent().logWarningException("Failed to load texture: " + var1, var8);
-- var2 = TextureUtil.missingTexture;
-- this.a.put(var1, var2);
-+ Minecraft.getMinecraft().getLogAgent().logWarningException("Failed to load texture: " + par1ResourceLocation, var8);
-+ par2TextureObject = TextureUtil.missingTexture;
-+ this.mapTextureObjects.put(par1ResourceLocation, par2TextureObject);
- var3 = false;
- } catch (Throwable var9) {
- CrashReport var5 = CrashReport.makeCrashReport(var9, "Registering texture");
- CrashReportCategory var6 = var5.makeCategory("Resource location being registered");
-- var6.addCrashSection("Resource location", var1);
-- var6.addCrashSectionCallable("Texture object class", new TextureManagerINNER1(this, (TextureObject)var2));
-+ var6.addCrashSection("Resource location", par1ResourceLocation);
-+ var6.addCrashSectionCallable("Texture object class", new TextureManagerINNER1(this, (TextureObject)par2TextureObject));
- throw new ReportedException(var5);
- }
-
-- this.a.put(var1, var2);
-+ this.mapTextureObjects.put(par1ResourceLocation, par2TextureObject);
- return var3;
- }
-
-- public TextureObject getTexture(ResourceLocation var1) {
-- return (TextureObject)this.a.get(var1);
-+ public TextureObject getTexture(ResourceLocation par1ResourceLocation) {
-+ return (TextureObject)this.mapTextureObjects.get(par1ResourceLocation);
- }
-
-- public ResourceLocation getDynamicTextureLocation(String var1, DynamicTexture var2) {
-- Integer var3 = (Integer)this.d.get(var1);
-- if(var3 == null) {
-+ public ResourceLocation getDynamicTextureLocation(String par1Str, DynamicTexture par2DynamicTexture) {
-+ Integer var3 = (Integer)this.mapTextureCounters.get(par1Str);
-+
-+ if (var3 == null) {
- var3 = Integer.valueOf(1);
- } else {
- var3 = Integer.valueOf(var3.intValue() + 1);
- }
-
-- this.d.put(var1, var3);
-- ResourceLocation var4 = new ResourceLocation(String.format("dynamic/%s_%d", new Object[]{var1, var3}));
-- this.loadTexture(var4, var2);
-+ this.mapTextureCounters.put(par1Str, var3);
-+ ResourceLocation var4 = new ResourceLocation(String.format("dynamic/%s_%d", new Object[] {par1Str, var3}));
-+ this.loadTexture(var4, par2DynamicTexture);
- return var4;
- }
-
- public void tick() {
-- Iterator var1 = this.c.iterator();
-+ Iterator var1 = this.listTickables.iterator();
-
-- while(var1.hasNext()) {
-+ while (var1.hasNext()) {
- Tickable var2 = (Tickable)var1.next();
- var2.tick();
- }
-
-+ CustomAnimation.updateAll();
- }
-
-- public void onResourceManagerReload(ResourceManager var1) {
-- Iterator var2 = this.a.entrySet().iterator();
-+ public void onResourceManagerReload(ResourceManager par1ResourceManager) {
-+ Iterator var2 = this.mapTextureObjects.entrySet().iterator();
-
-- while(var2.hasNext()) {
-+ while (var2.hasNext()) {
- Entry var3 = (Entry)var2.next();
- this.loadTexture((ResourceLocation)var3.getKey(), (TextureObject)var3.getValue());
- }
--
-+ }
-+
-+ // Spout Start
-+ public void bindTexture(int texture) {
-+ if (texture != this.boundTexture) {
-+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, texture);
-+ this.boundTexture = texture;
-+ }
-+ }
-+
-+ /**
-+ * Deletes a single GL texture
-+ */
-+ public void deleteTexture(int par1) {
-+ this.mapTextureObjects.remove(par1);
-+ GL11.glDeleteTextures(par1);
-+ }
-+
-+ public void resetBoundTexture() {
-+ this.boundTexture = -1;
-+ }
-+ // Spout End
-+
-+ public int getTextureId(ResourceLocation par1ResourceLocation) {
-+ Object var2 = (TextureObject)this.mapTextureObjects.get(par1ResourceLocation);
-+
-+ if (var2 == null) {
-+ var2 = new SimpleTexture(par1ResourceLocation);
-+ this.loadTexture(par1ResourceLocation, (TextureObject)var2);
-+ }
-+
-+ return ((TextureObject)var2).getGlTextureId();
- }
- }
---- net/minecraft/src/GLAllocation.java
-+++ net/minecraft/src/GLAllocation.java
-@@ -13,48 +13,63 @@
- import org.lwjgl.opengl.GL11;
-
- public class GLAllocation {
-- private static final Map a = new HashMap();
-- private static final List b = new ArrayList();
-+ private static final Map field_74531_a = new HashMap();
-+ private static final List field_74530_b = new ArrayList();
-
-- public static synchronized int generateDisplayLists(int var0) {
-- int var1 = GL11.glGenLists(var0);
-- a.put(Integer.valueOf(var1), Integer.valueOf(var0));
-+ /**
-+ * 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 var0) {
-- GL11.glDeleteLists(var0, ((Integer)a.remove(Integer.valueOf(var0))).intValue());
-+ 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 < b.size(); ++var0) {
-- GL11.glDeleteTextures(((Integer)b.get(var0)).intValue());
-+ for (int var0 = 0; var0 < field_74530_b.size(); ++var0) {
-+ GL11.glDeleteTextures(((Integer)field_74530_b.get(var0)).intValue());
- }
-
-- b.clear();
-+ 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 = a.entrySet().iterator();
-+ Iterator var0 = field_74531_a.entrySet().iterator();
-
-- while(var0.hasNext()) {
-+ while (var0.hasNext()) {
- Entry var1 = (Entry)var0.next();
- GL11.glDeleteLists(((Integer)var1.getKey()).intValue(), ((Integer)var1.getValue()).intValue());
- }
-
-- a.clear();
-+ field_74531_a.clear();
- func_98302_b();
- }
-
-- public static synchronized ByteBuffer createDirectByteBuffer(int var0) {
-- return ByteBuffer.allocateDirect(var0).order(ByteOrder.nativeOrder());
-- }
--
-- public static IntBuffer createDirectIntBuffer(int var0) {
-- return createDirectByteBuffer(var0 << 2).asIntBuffer();
-- }
--
-- public static FloatBuffer createDirectFloatBuffer(int var0) {
-- return createDirectByteBuffer(var0 << 2).asFloatBuffer();
-+ /**
-+ * 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();
- }
- }
---- net/minecraft/src/DispenserBehaviorFilledBucket.java
-+++ net/minecraft/src/DispenserBehaviorFilledBucket.java
-@@ -3,18 +3,22 @@
- final class DispenserBehaviorFilledBucket extends BehaviorDefaultDispenseItem {
- private final BehaviorDefaultDispenseItem defaultDispenserItemBehavior = new BehaviorDefaultDispenseItem();
-
-- public ItemStack dispenseStack(IBlockSource var1, ItemStack var2) {
-- ItemBucket var3 = (ItemBucket)var2.getItem();
-- int var4 = var1.getXInt();
-- int var5 = var1.getYInt();
-- int var6 = var1.getZInt();
-- EnumFacing var7 = BlockDispenser.getFacing(var1.getBlockMetadata());
-- if(var3.tryPlaceContainedLiquid(var1.getWorld(), var4 + var7.getFrontOffsetX(), var5 + var7.getFrontOffsetY(), var6 + var7.getFrontOffsetZ())) {
-- var2.itemID = Item.bucketEmpty.itemID;
-- var2.stackSize = 1;
-- return var2;
-+ /**
-+ * Dispense the specified stack, play the dispense sound and spawn particles.
-+ */
-+ public ItemStack dispenseStack(IBlockSource par1IBlockSource, ItemStack par2ItemStack) {
-+ ItemBucket var3 = (ItemBucket)par2ItemStack.getItem();
-+ int var4 = par1IBlockSource.getXInt();
-+ int var5 = par1IBlockSource.getYInt();
-+ int var6 = par1IBlockSource.getZInt();
-+ EnumFacing var7 = BlockDispenser.getFacing(par1IBlockSource.getBlockMetadata());
-+
-+ if (var3.tryPlaceContainedLiquid(par1IBlockSource.getWorld(), var4 + var7.getFrontOffsetX(), var5 + var7.getFrontOffsetY(), var6 + var7.getFrontOffsetZ())) {
-+ par2ItemStack.itemID = Item.bucketEmpty.itemID;
-+ par2ItemStack.stackSize = 1;
-+ return par2ItemStack;
- } else {
-- return this.defaultDispenserItemBehavior.dispense(var1, var2);
-+ return this.defaultDispenserItemBehavior.dispense(par1IBlockSource, par2ItemStack);
- }
- }
- }
---- net/minecraft/src/CommandNotFoundException.java
-+++ net/minecraft/src/CommandNotFoundException.java
-@@ -5,7 +5,7 @@
- this("commands.generic.notFound", new Object[0]);
- }
-
-- public CommandNotFoundException(String var1, Object... var2) {
-- super(var1, var2);
-+ public CommandNotFoundException(String par1Str, Object ... par2ArrayOfObj) {
-+ super(par1Str, par2ArrayOfObj);
- }
- }
---- net/minecraft/src/RequestGet.java
-+++ net/minecraft/src/RequestGet.java
-@@ -1,19 +1,19 @@
- package net.minecraft.src;
-
- public class RequestGet extends Request {
-- public RequestGet(String var1, int var2, int var3) {
-- super(var1, var2, var3);
-+ public RequestGet(String par1Str, int par2, int par3) {
-+ super(par1Str, par2, par3);
- }
-
- public RequestGet func_96371_f() {
- try {
-- this.a.setDoInput(true);
-- this.a.setDoOutput(true);
-- this.a.setUseCaches(false);
-- this.a.setRequestMethod("GET");
-+ this.field_96367_a.setDoInput(true);
-+ this.field_96367_a.setDoOutput(true);
-+ this.field_96367_a.setUseCaches(false);
-+ this.field_96367_a.setRequestMethod("GET");
- return this;
- } catch (Exception var2) {
-- throw new ExceptionMcoHttp("Failed URL: " + this.b, var2);
-+ throw new ExceptionMcoHttp("Failed URL: " + this.field_96365_b, var2);
- }
- }
-
---- /dev/null
-+++ org/spoutcraft/client/gui/settings/controls/ControlsButton.java
-@@ -1,0 +1,40 @@
-+/*
-+ * This file is part of Spoutcraft.
-+ *
-+ * Copyright (c) 2011 SpoutcraftDev
-+ * Spoutcraft is licensed under the GNU Lesser General Public License.
-+ *
-+ * Spoutcraft is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation, either version 3 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Spoutcraft is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program. If not, see .
-+ */
-+package org.spoutcraft.client.gui.settings.controls;
-+
-+import net.minecraft.src.Minecraft;
-+import net.minecraft.src.GuiScreen;
-+
-+import org.spoutcraft.api.gui.GenericButton;
-+import org.spoutcraft.client.gui.controls.GuiControls;
-+
-+public class ControlsButton extends GenericButton {
-+ GuiScreen parent;
-+ public ControlsButton(GuiScreen parent) {
-+ super("Controls");
-+ setTooltip("Controls\nAdd, modify, or remove keybindings");
-+ this.parent = parent;
-+ }
-+
-+ @Override
-+ public void onButtonClick() {
-+ Minecraft.getMinecraft().displayGuiScreen(new GuiControls(parent), false);
-+ }
-+}
---- net/minecraft/src/IServer.java
-+++ net/minecraft/src/IServer.java
-@@ -1,43 +1,98 @@
- package net.minecraft.src;
-
- public interface IServer {
-+
-+ /**
-+ * Gets an integer property. If it does not exist, set it to the specified value.
-+ */
- int getIntProperty(String var1, int var2);
-
-+ /**
-+ * Gets a string property. If it does not exist, set it to the specified value.
-+ */
- String getStringProperty(String var1, String var2);
-
-+ /**
-+ * Saves an Object with the given property name.
-+ */
- void setProperty(String var1, Object var2);
-
-+ /**
-+ * Saves all of the server properties to the properties file.
-+ */
- void saveProperties();
-
-+ /**
-+ * Returns the filename where server properties are stored
-+ */
- String getSettingsFilename();
-
-+ /**
-+ * Returns the server's hostname.
-+ */
- String getHostname();
-
-+ /**
-+ * Never used, but "getServerPort" is already taken.
-+ */
- int getPort();
-
-- String getMotd();
-+ /**
-+ * Returns the server message of the day
-+ */
-+ String getServerMOTD();
-
-+ /**
-+ * Returns the server's Minecraft version as string.
-+ */
- String getMinecraftVersion();
-
-+ /**
-+ * Returns the number of players currently on the server.
-+ */
- int getCurrentPlayerCount();
-
-+ /**
-+ * Returns the maximum number of players allowed on the server.
-+ */
- int getMaxPlayers();
-
-+ /**
-+ * Returns an array of the usernames of all the connected players.
-+ */
- String[] getAllUsernames();
-
- String getFolderName();
-
-+ /**
-+ * 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 handleRConCommand(String var1);
-+ String executeCommand(String var1);
-
-+ /**
-+ * Returns true if debugging is enabled, false otherwise.
-+ */
- boolean isDebuggingEnabled();
-
-+ /**
-+ * Logs the message with a level of INFO.
-+ */
- void logInfo(String var1);
-
-+ /**
-+ * Logs the message with a level of WARN.
-+ */
- void logWarning(String var1);
-
-+ /**
-+ * Logs the error message with a level of SEVERE.
-+ */
- void logSevere(String var1);
-
-+ /**
-+ * If isDebuggingEnabled(), logs the message with a level of INFO.
-+ */
- void logDebug(String var1);
- }
---- net/minecraft/src/Request.java
-+++ net/minecraft/src/Request.java
-@@ -6,42 +6,42 @@
- import java.net.URL;
-
- public abstract class Request {
-- protected HttpURLConnection a;
-+ protected HttpURLConnection field_96367_a;
- private boolean field_96366_c;
-- protected String b;
-+ protected String field_96365_b;
-
-- public Request(String var1, int var2, int var3) {
-+ public Request(String par1Str, int par2, int par3) {
- try {
-- this.b = var1;
-- this.a = (HttpURLConnection)(new URL(var1)).openConnection(Minecraft.getMinecraft().getProxy());
-- this.a.setConnectTimeout(var2);
-- this.a.setReadTimeout(var3);
-+ this.field_96365_b = par1Str;
-+ this.field_96367_a = (HttpURLConnection)(new URL(par1Str)).openConnection(Minecraft.getMinecraft().getProxy());
-+ this.field_96367_a.setConnectTimeout(par2);
-+ this.field_96367_a.setReadTimeout(par3);
- } catch (Exception var5) {
-- throw new ExceptionMcoHttp("Failed URL: " + var1, var5);
-+ throw new ExceptionMcoHttp("Failed URL: " + par1Str, var5);
- }
- }
-
-- public void func_100006_a(String var1, String var2) {
-- String var3 = this.a.getRequestProperty("Cookie");
-- if(var3 == null) {
-- this.a.setRequestProperty("Cookie", var1 + "=" + var2);
-+ public void func_100006_a(String par1Str, String par2Str) {
-+ String var3 = this.field_96367_a.getRequestProperty("Cookie");
-+
-+ if (var3 == null) {
-+ this.field_96367_a.setRequestProperty("Cookie", par1Str + "=" + par2Str);
- } else {
-- this.a.setRequestProperty("Cookie", var3 + ";" + var1 + "=" + var2);
-+ this.field_96367_a.setRequestProperty("Cookie", var3 + ";" + par1Str + "=" + par2Str);
- }
--
- }
-
- public int func_96362_a() {
- try {
- this.func_96354_d();
-- return this.a.getResponseCode();
-+ return this.field_96367_a.getResponseCode();
- } catch (Exception var2) {
-- throw new ExceptionMcoHttp("Failed URL: " + this.b, var2);
-+ throw new ExceptionMcoHttp("Failed URL: " + this.field_96365_b, var2);
- }
- }
-
- public int func_111221_b() {
-- String var1 = this.a.getHeaderField("Retry-After");
-+ String var1 = this.field_96367_a.getHeaderField("Retry-After");
-
- try {
- return Integer.valueOf(var1).intValue();
-@@ -53,21 +53,21 @@
- public String func_96364_c() {
- try {
- this.func_96354_d();
-- String var1 = this.func_96362_a() >= 400 ? this.func_96352_a(this.a.getErrorStream()) : this.func_96352_a(this.a.getInputStream());
-+ String var1 = this.func_96362_a() >= 400 ? this.func_96352_a(this.field_96367_a.getErrorStream()) : this.func_96352_a(this.field_96367_a.getInputStream());
- this.func_96360_f();
- return var1;
- } catch (IOException var2) {
-- throw new ExceptionMcoHttp("Failed URL: " + this.b, var2);
-+ throw new ExceptionMcoHttp("Failed URL: " + this.field_96365_b, var2);
- }
- }
-
-- private String func_96352_a(InputStream var1) throws IOException {
-- if(var1 == null) {
-+ private String func_96352_a(InputStream par1InputStream) throws IOException {
-+ if (par1InputStream == null) {
- throw new IOException("No response (null)");
- } else {
- StringBuilder var2 = new StringBuilder();
-
-- for(int var3 = var1.read(); var3 != -1; var3 = var1.read()) {
-+ for (int var3 = par1InputStream.read(); var3 != -1; var3 = par1InputStream.read()) {
- var2.append((char)var3);
- }
-
-@@ -77,39 +77,37 @@
-
- private void func_96360_f() {
- byte[] var1 = new byte[1024];
--
- InputStream var3;
-+
- try {
- boolean var2 = false;
-- var3 = this.a.getInputStream();
-+ var3 = this.field_96367_a.getInputStream();
-
-- while(true) {
-- int var7 = var3.read(var1);
-- if(var7 <= 0) {
-+ while (true) {
-+ if (var3.read(var1) <= 0) {
- var3.close();
- break;
- }
- }
- } catch (Exception var6) {
- try {
-- var3 = this.a.getErrorStream();
-+ var3 = this.field_96367_a.getErrorStream();
- boolean var4 = false;
-
-- while(true) {
-- int var8 = var3.read(var1);
-- if(var8 <= 0) {
-+ while (true) {
-+ if (var3.read(var1) <= 0) {
- var3.close();
- break;
- }
- }
- } catch (IOException var5) {
-+ ;
- }
- }
--
- }
-
- protected Request func_96354_d() {
-- if(!this.field_96366_c) {
-+ if (!this.field_96366_c) {
- Request var1 = this.func_96359_e();
- this.field_96366_c = true;
- return var1;
-@@ -120,32 +118,32 @@
-
- protected abstract Request func_96359_e();
-
-- public static Request func_96358_a(String var0) {
-- return new RequestGet(var0, 5000, 10000);
-- }
--
-- public static Request func_96361_b(String var0, String var1) {
-- return new RequestPost(var0, var1.getBytes(), 5000, 10000);
-- }
--
-- public static Request func_104064_a(String var0, String var1, int var2, int var3) {
-- return new RequestPost(var0, var1.getBytes(), var2, var3);
-- }
--
-- public static Request func_96355_b(String var0) {
-- return new RequestDelete(var0, 5000, 10000);
-- }
--
-- public static Request func_96363_c(String var0, String var1) {
-- return new RequestPut(var0, var1.getBytes(), 5000, 10000);
-- }
--
-- public static Request func_96353_a(String var0, String var1, int var2, int var3) {
-- return new RequestPut(var0, var1.getBytes(), var2, var3);
-+ public static Request func_96358_a(String par0Str) {
-+ return new RequestGet(par0Str, 5000, 10000);
-+ }
-+
-+ public static Request func_96361_b(String par0Str, String par1Str) {
-+ return new RequestPost(par0Str, par1Str.getBytes(), 5000, 10000);
-+ }
-+
-+ public static Request func_104064_a(String par0Str, String par1Str, int par2, int par3) {
-+ return new RequestPost(par0Str, par1Str.getBytes(), par2, par3);
-+ }
-+
-+ public static Request func_96355_b(String par0Str) {
-+ return new RequestDelete(par0Str, 5000, 10000);
-+ }
-+
-+ public static Request func_96363_c(String par0Str, String par1Str) {
-+ return new RequestPut(par0Str, par1Str.getBytes(), 5000, 10000);
-+ }
-+
-+ public static Request func_96353_a(String par0Str, String par1Str, int par2, int par3) {
-+ return new RequestPut(par0Str, par1Str.getBytes(), par2, par3);
- }
-
- public int func_130110_g() {
-- String var1 = this.a.getHeaderField("Error-Code");
-+ String var1 = this.field_96367_a.getHeaderField("Error-Code");
-
- try {
- return Integer.valueOf(var1).intValue();
---- /dev/null
-+++ org/spoutcraft/api/gui/WidgetManager.java
-@@ -1,0 +1,26 @@
-+/*
-+ * This file is part of Spoutcraft.
-+ *
-+ * Copyright (c) 2011 SpoutcraftDev
-+ * Spoutcraft is licensed under the GNU Lesser General Public License.
-+ *
-+ * Spoutcraft is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation, either version 3 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Spoutcraft is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program. If not, see .
-+ */
-+package org.spoutcraft.api.gui;
-+
-+public interface WidgetManager {
-+ public void sendWidgetUpdate(Widget widget);
-+
-+ public void sendFocusUpdate(Control control, boolean focus);
-+}
---- net/minecraft/src/ItemEnderEye.java
-+++ net/minecraft/src/ItemEnderEye.java
-@@ -1,31 +1,36 @@
- package net.minecraft.src;
-
- public class ItemEnderEye extends Item {
-- public ItemEnderEye(int var1) {
-- super(var1);
-+ public ItemEnderEye(int par1) {
-+ super(par1);
- this.setCreativeTab(CreativeTabs.tabMisc);
- }
-
-- public boolean onItemUse(ItemStack var1, EntityPlayer var2, World var3, int var4, int var5, int var6, int var7, float var8, float var9, float var10) {
-- int var11 = var3.getBlockId(var4, var5, var6);
-- int var12 = var3.getBlockMetadata(var4, var5, var6);
-- if(var2.canPlayerEdit(var4, var5, var6, var7, var1) && var11 == Block.endPortalFrame.blockID && !BlockEndPortalFrame.isEnderEyeInserted(var12)) {
-- if(var3.isRemote) {
-+ /**
-+ * 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) {
-+ int var11 = par3World.getBlockId(par4, par5, par6);
-+ int var12 = par3World.getBlockMetadata(par4, par5, par6);
-+
-+ if (par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack) && var11 == Block.endPortalFrame.blockID && !BlockEndPortalFrame.isEnderEyeInserted(var12)) {
-+ if (par3World.isRemote) {
- return true;
- } else {
-- var3.setBlockMetadata(var4, var5, var6, var12 + 4, 2);
-- var3.func_96440_m(var4, var5, var6, Block.endPortalFrame.blockID);
-- --var1.stackSize;
--
-+ 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) {
-- double var14 = (double)((float)var4 + (5.0F + f.nextFloat() * 6.0F) / 16.0F);
-- double var16 = (double)((float)var5 + 13.0F / 16.0F);
-- double var18 = (double)((float)var6 + (5.0F + f.nextFloat() * 6.0F) / 16.0F);
-+
-+ for (var13 = 0; var13 < 16; ++var13) {
-+ double var14 = (double)((float)par4 + (5.0F + itemRand.nextFloat() * 6.0F) / 16.0F);
-+ double var16 = (double)((float)par5 + 0.8125F);
-+ double var18 = (double)((float)par6 + (5.0F + itemRand.nextFloat() * 6.0F) / 16.0F);
- double var20 = 0.0D;
- double var22 = 0.0D;
- double var24 = 0.0D;
-- var3.spawnParticle("smoke", var14, var16, var18, var20, var22, var24);
-+ par3World.spawnParticle("smoke", var14, var16, var18, var20, var22, var24);
- }
-
- var13 = var12 & 3;
-@@ -33,69 +38,74 @@
- int var15 = 0;
- boolean var27 = false;
- boolean var17 = true;
-- int var28 = Direction.enderEyeMetaToDirection[var13];
--
-+ int var28 = Direction.rotateRight[var13];
- int var19;
- int var21;
- int var23;
- int var29;
- int var30;
-- for(var19 = -2; var19 <= 2; ++var19) {
-- var29 = var4 + Direction.offsetX[var28] * var19;
-- var21 = var6 + Direction.offsetZ[var28] * var19;
-- var30 = var3.getBlockId(var29, var5, var21);
-- if(var30 == Block.endPortalFrame.blockID) {
-- var23 = var3.getBlockMetadata(var29, var5, var21);
-- if(!BlockEndPortalFrame.isEnderEyeInserted(var23)) {
-+
-+ for (var19 = -2; var19 <= 2; ++var19) {
-+ var29 = par4 + Direction.offsetX[var28] * var19;
-+ var21 = par6 + Direction.offsetZ[var28] * var19;
-+ var30 = par3World.getBlockId(var29, par5, var21);
-+
-+ if (var30 == Block.endPortalFrame.blockID) {
-+ var23 = par3World.getBlockMetadata(var29, par5, var21);
-+
-+ if (!BlockEndPortalFrame.isEnderEyeInserted(var23)) {
- var17 = false;
- break;
- }
-
- var15 = var19;
-- if(!var27) {
-+
-+ if (!var27) {
- var26 = var19;
- var27 = true;
- }
- }
- }
-
-- if(var17 && var15 == var26 + 2) {
-- for(var19 = var26; var19 <= var15; ++var19) {
-- var29 = var4 + Direction.offsetX[var28] * var19;
-- var21 = var6 + Direction.offsetZ[var28] * var19;
-+ if (var17 && var15 == var26 + 2) {
-+ for (var19 = var26; var19 <= var15; ++var19) {
-+ var29 = par4 + Direction.offsetX[var28] * var19;
-+ var21 = par6 + Direction.offsetZ[var28] * var19;
- var29 += Direction.offsetX[var13] * 4;
- var21 += Direction.offsetZ[var13] * 4;
-- var30 = var3.getBlockId(var29, var5, var21);
-- var23 = var3.getBlockMetadata(var29, var5, var21);
-- if(var30 != Block.endPortalFrame.blockID || !BlockEndPortalFrame.isEnderEyeInserted(var23)) {
-+ var30 = par3World.getBlockId(var29, par5, var21);
-+ var23 = par3World.getBlockMetadata(var29, par5, var21);
-+
-+ if (var30 != Block.endPortalFrame.blockID || !BlockEndPortalFrame.isEnderEyeInserted(var23)) {
- var17 = false;
- break;
- }
- }
-
-- for(var19 = var26 - 1; var19 <= var15 + 1; var19 += 4) {
-- for(var29 = 1; var29 <= 3; ++var29) {
-- var21 = var4 + Direction.offsetX[var28] * var19;
-- var30 = var6 + Direction.offsetZ[var28] * var19;
-+ for (var19 = var26 - 1; var19 <= var15 + 1; var19 += 4) {
-+ for (var29 = 1; var29 <= 3; ++var29) {
-+ var21 = par4 + Direction.offsetX[var28] * var19;
-+ var30 = par6 + Direction.offsetZ[var28] * var19;
- var21 += Direction.offsetX[var13] * var29;
- var30 += Direction.offsetZ[var13] * var29;
-- var23 = var3.getBlockId(var21, var5, var30);
-- int var31 = var3.getBlockMetadata(var21, var5, var30);
-- if(var23 != Block.endPortalFrame.blockID || !BlockEndPortalFrame.isEnderEyeInserted(var31)) {
-+ var23 = par3World.getBlockId(var21, par5, var30);
-+ int var31 = par3World.getBlockMetadata(var21, par5, var30);
-+
-+ if (var23 != Block.endPortalFrame.blockID || !BlockEndPortalFrame.isEnderEyeInserted(var31)) {
- var17 = false;
- break;
- }
- }
- }
-
-- if(var17) {
-- for(var19 = var26; var19 <= var15; ++var19) {
-- for(var29 = 1; var29 <= 3; ++var29) {
-- var21 = var4 + Direction.offsetX[var28] * var19;
-- var30 = var6 + Direction.offsetZ[var28] * var19;
-+ if (var17) {
-+ for (var19 = var26; var19 <= var15; ++var19) {
-+ for (var29 = 1; var29 <= 3; ++var29) {
-+ var21 = par4 + Direction.offsetX[var28] * var19;
-+ var30 = par6 + Direction.offsetZ[var28] * var19;
- var21 += Direction.offsetX[var13] * var29;
- var30 += Direction.offsetZ[var13] * var29;
-- var3.setBlock(var21, var5, var30, Block.endPortal.blockID, 0, 2);
-+ par3World.setBlock(var21, par5, var30, Block.endPortal.blockID, 0, 2);
- }
- }
- }
-@@ -108,29 +118,36 @@
- }
- }
-
-- public ItemStack onItemRightClick(ItemStack var1, World var2, EntityPlayer var3) {
-- MovingObjectPosition var4 = this.getMovingObjectPositionFromPlayer(var2, var3, false);
-- if(var4 != null && var4.typeOfHit == EnumMovingObjectType.TILE) {
-- int var5 = var2.getBlockId(var4.blockX, var4.blockY, var4.blockZ);
-- if(var5 == Block.endPortalFrame.blockID) {
-- return var1;
-+ /**
-+ * 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, false);
-+
-+ if (var4 != null && var4.typeOfHit == EnumMovingObjectType.TILE) {
-+ int var5 = par2World.getBlockId(var4.blockX, var4.blockY, var4.blockZ);
-+
-+ if (var5 == Block.endPortalFrame.blockID) {
-+ return par1ItemStack;
- }
- }
-
-- if(!var2.isRemote) {
-- ChunkPosition var7 = var2.findClosestStructure("Stronghold", (int)var3.posX, (int)var3.posY, (int)var3.posZ);
-- if(var7 != null) {
-- EntityEnderEye var6 = new EntityEnderEye(var2, var3.posX, var3.posY + 1.62D - (double)var3.yOffset, var3.posZ);
-+ if (!par2World.isRemote) {
-+ ChunkPosition var7 = par2World.findClosestStructure("Stronghold", (int)par3EntityPlayer.posX, (int)par3EntityPlayer.posY, (int)par3EntityPlayer.posZ);
-+
-+ if (var7 != null) {
-+ EntityEnderEye var6 = new EntityEnderEye(par2World, par3EntityPlayer.posX, par3EntityPlayer.posY + 1.62D - (double)par3EntityPlayer.yOffset, par3EntityPlayer.posZ);
- var6.moveTowards((double)var7.x, var7.y, (double)var7.z);
-- var2.spawnEntityInWorld(var6);
-- var2.playSoundAtEntity(var3, "random.bow", 0.5F, 0.4F / (f.nextFloat() * 0.4F + 0.8F));
-- var2.playAuxSFXAtEntity((EntityPlayer)null, 1002, (int)var3.posX, (int)var3.posY, (int)var3.posZ, 0);
-- if(!var3.capabilities.isCreativeMode) {
-- --var1.stackSize;
-+ par2World.spawnEntityInWorld(var6);
-+ par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
-+ par2World.playAuxSFXAtEntity((EntityPlayer)null, 1002, (int)par3EntityPlayer.posX, (int)par3EntityPlayer.posY, (int)par3EntityPlayer.posZ, 0);
-+
-+ if (!par3EntityPlayer.capabilities.isCreativeMode) {
-+ --par1ItemStack.stackSize;
- }
- }
- }
-
-- return var1;
-+ return par1ItemStack;
- }
- }
---- net/minecraft/src/IWorldAccess.java
-+++ net/minecraft/src/IWorldAccess.java
-@@ -1,27 +1,68 @@
- package net.minecraft.src;
-
-+import org.newdawn.slick.opengl.Texture;
-+
- public interface IWorldAccess {
-+
-+ /**
-+ * On the client, re-renders the block. On the server, sends the block to the client (which will re-render it),
-+ * including the tile entity description packet if applicable. Args: x, y, z
-+ */
- void markBlockForUpdate(int var1, int var2, int var3);
-
-+ /**
-+ * On the client, re-renders this block. On the server, does nothing. Used for lighting updates.
-+ */
- void markBlockForRenderUpdate(int var1, int var2, int var3);
-
-+ /**
-+ * On the client, re-renders all blocks in this range, inclusive. On the server, does nothing. Args: min x, min y, min
-+ * z, max x, max y, max z
-+ */
- void markBlockRangeForRenderUpdate(int var1, int var2, int var3, int var4, int var5, int var6);
-
-+ /**
-+ * Plays the specified sound. Arg: soundName, x, y, z, volume, pitch
-+ */
- void playSound(String var1, double var2, double var4, double var6, float var8, float var9);
-
-+ /**
-+ * Plays sound to all near players except the player reference given
-+ */
- void playSoundToNearExcept(EntityPlayer var1, String var2, double var3, double var5, double var7, float var9, float var10);
-
-- void spawnParticle(String var1, double var2, double var4, double var6, double var8, double var10, double var12);
-+ /**
-+ * Spawns a particle. Arg: particleType, x, y, z, velX, velY, velZ
-+ */
-+ void spawnParticle(String var1, double var2, double var4, double var6, double var8, double var10, double var12, Texture texture);
-
-+ /**
-+ * Called on all IWorldAccesses when an entity is created or loaded. On client worlds, starts downloading any necessary
-+ * textures. On server worlds, adds the entity to the entity tracker.
-+ */
- void onEntityCreate(Entity var1);
-
-+ /**
-+ * Called on all IWorldAccesses when an entity is unloaded or destroyed. On client worlds, releases any downloaded
-+ * textures. On server worlds, removes the entity from the entity tracker.
-+ */
- void onEntityDestroy(Entity var1);
-
-+ /**
-+ * Plays the specified record. Arg: recordName, x, y, z
-+ */
- void playRecord(String var1, int var2, int var3, int var4);
-
- void broadcastSound(int var1, int var2, int var3, int var4, int var5);
-
-+ /**
-+ * Plays a pre-canned sound effect along with potentially auxiliary data-driven one-shot behaviour (particles, etc).
-+ */
- void playAuxSFX(EntityPlayer var1, int var2, int var3, int var4, int var5, int var6);
-
-+ /**
-+ * Starts (or continues) destroying a block with given ID at the given coordinates for the given partially destroyed
-+ * value
-+ */
- void destroyBlockPartially(int var1, int var2, int var3, int var4, int var5);
- }
---- net/minecraft/src/MapGenVillage.java
-+++ net/minecraft/src/MapGenVillage.java
-@@ -8,7 +8,11 @@
- import java.util.Map.Entry;
-
- public class MapGenVillage extends MapGenStructure {
-- public static final List e = Arrays.asList(new BiomeGenBase[]{BiomeGenBase.plains, BiomeGenBase.desert});
-+
-+ /** A list of all the biomes villages can spawn in. */
-+ public static final List villageSpawnBiomes = Arrays.asList(new BiomeGenBase[] {BiomeGenBase.plains, BiomeGenBase.desert});
-+
-+ /** World terrain type, 0 for normal, 1 for flat map */
- private int terrainType;
- private int field_82665_g;
- private int field_82666_h;
-@@ -18,46 +22,49 @@
- this.field_82666_h = 8;
- }
-
-- public MapGenVillage(Map var1) {
-+ public MapGenVillage(Map par1Map) {
- this();
-- Iterator var2 = var1.entrySet().iterator();
-+ Iterator var2 = par1Map.entrySet().iterator();
-
-- while(var2.hasNext()) {
-+ while (var2.hasNext()) {
- Entry var3 = (Entry)var2.next();
-- if(((String)var3.getKey()).equals("size")) {
-+
-+ if (((String)var3.getKey()).equals("size")) {
- this.terrainType = MathHelper.parseIntWithDefaultAndMax((String)var3.getValue(), this.terrainType, 0);
-- } else if(((String)var3.getKey()).equals("distance")) {
-+ } else if (((String)var3.getKey()).equals("distance")) {
- this.field_82665_g = MathHelper.parseIntWithDefaultAndMax((String)var3.getValue(), this.field_82665_g, this.field_82666_h + 1);
- }
- }
--
- }
-
- public String func_143025_a() {
- return "Village";
- }
-
-- protected boolean canSpawnStructureAtCoords(int var1, int var2) {
-- int var3 = var1;
-- int var4 = var2;
-- if(var1 < 0) {
-- var1 -= this.field_82665_g - 1;
-- }
--
-- if(var2 < 0) {
-- var2 -= this.field_82665_g - 1;
-- }
--
-- int var5 = var1 / this.field_82665_g;
-- int var6 = var2 / this.field_82665_g;
-+ protected boolean canSpawnStructureAtCoords(int par1, int par2) {
-+ int var3 = par1;
-+ int var4 = par2;
-+
-+ if (par1 < 0) {
-+ par1 -= this.field_82665_g - 1;
-+ }
-+
-+ if (par2 < 0) {
-+ par2 -= this.field_82665_g - 1;
-+ }
-+
-+ int var5 = par1 / this.field_82665_g;
-+ int var6 = par2 / this.field_82665_g;
- Random var7 = this.worldObj.setRandomSeed(var5, var6, 10387312);
- var5 *= this.field_82665_g;
- var6 *= this.field_82665_g;
- var5 += var7.nextInt(this.field_82665_g - this.field_82666_h);
- var6 += var7.nextInt(this.field_82665_g - this.field_82666_h);
-- if(var3 == var5 && var4 == var6) {
-- boolean var8 = this.worldObj.getWorldChunkManager().areBiomesViable(var3 * 16 + 8, var4 * 16 + 8, 0, e);
-- if(var8) {
-+
-+ if (var3 == var5 && var4 == var6) {
-+ boolean var8 = this.worldObj.getWorldChunkManager().areBiomesViable(var3 * 16 + 8, var4 * 16 + 8, 0, villageSpawnBiomes);
-+
-+ if (var8) {
- return true;
- }
- }
-@@ -65,7 +72,7 @@
- return false;
- }
-
-- protected StructureStart getStructureStart(int var1, int var2) {
-- return new StructureVillageStart(this.worldObj, this.b, var1, var2, this.terrainType);
-+ protected StructureStart getStructureStart(int par1, int par2) {
-+ return new StructureVillageStart(this.worldObj, this.rand, par1, par2, this.terrainType);
- }
- }
---- net/minecraft/src/RenderManager.java
-+++ net/minecraft/src/RenderManager.java
-@@ -3,22 +3,42 @@
- import java.util.HashMap;
- import java.util.Iterator;
- import java.util.Map;
-+
- import org.lwjgl.opengl.GL11;
-
-+import org.spoutcraft.client.entity.EntityText;
-+import org.spoutcraft.client.entity.EntityTexture;
-+import org.spoutcraft.client.entity.RenderText;
-+import org.spoutcraft.client.entity.RenderTexture;
-+
- public class RenderManager {
-- private Map q = new HashMap();
-+
-+ /** A map of entity classes and the associated renderer. */
-+ // Spout Start - private to public
-+ public Map entityRenderMap = new HashMap();
-+ // Spout End
-+
-+ /** The static instance of RenderManager. */
- public static RenderManager instance = new RenderManager();
-+
-+ /** Renders fonts */
- private FontRenderer fontRenderer;
- public static double renderPosX;
- public static double renderPosY;
- public static double renderPosZ;
- public TextureManager renderEngine;
- public ItemRenderer itemRenderer;
-+
-+ /** Reference to the World object. */
- public World worldObj;
-+
-+ /** Rendermanager's variable for the player */
- public EntityLivingBase livingPlayer;
- public EntityLivingBase field_96451_i;
- public float playerViewY;
- public float playerViewX;
-+
-+ /** Reference to the GameSettings object. */
- public GameSettings options;
- public double viewerPosX;
- public double viewerPosY;
-@@ -26,126 +46,140 @@
- public static boolean field_85095_o;
-
- private RenderManager() {
-- this.q.put(EntityCaveSpider.class, new RenderCaveSpider());
-- this.q.put(EntitySpider.class, new RenderSpider());
-- this.q.put(EntityPig.class, new RenderPig(new ModelPig(), new ModelPig(0.5F), 0.7F));
-- this.q.put(EntitySheep.class, new RenderSheep(new ModelSheep2(), new ModelSheep1(), 0.7F));
-- this.q.put(EntityCow.class, new RenderCow(new ModelCow(), 0.7F));
-- this.q.put(EntityMooshroom.class, new RenderMooshroom(new ModelCow(), 0.7F));
-- this.q.put(EntityWolf.class, new RenderWolf(new ModelWolf(), new ModelWolf(), 0.5F));
-- this.q.put(EntityChicken.class, new RenderChicken(new ModelChicken(), 0.3F));
-- this.q.put(EntityOcelot.class, new RenderOcelot(new ModelOcelot(), 0.4F));
-- this.q.put(EntitySilverfish.class, new RenderSilverfish());
-- this.q.put(EntityCreeper.class, new RenderCreeper());
-- this.q.put(EntityEnderman.class, new RenderEnderman());
-- this.q.put(EntitySnowman.class, new RenderSnowMan());
-- this.q.put(EntitySkeleton.class, new RenderSkeleton());
-- this.q.put(EntityWitch.class, new RenderWitch());
-- this.q.put(EntityBlaze.class, new RenderBlaze());
-- this.q.put(EntityZombie.class, new RenderZombie());
-- this.q.put(EntitySlime.class, new RenderSlime(new ModelSlime(16), new ModelSlime(0), 0.25F));
-- this.q.put(EntityMagmaCube.class, new RenderMagmaCube());
-- this.q.put(EntityPlayer.class, new RenderPlayer());
-- this.q.put(EntityGiantZombie.class, new RenderGiantZombie(new ModelZombie(), 0.5F, 6.0F));
-- this.q.put(EntityGhast.class, new RenderGhast());
-- this.q.put(EntitySquid.class, new RenderSquid(new ModelSquid(), 0.7F));
-- this.q.put(EntityVillager.class, new RenderVillager());
-- this.q.put(EntityIronGolem.class, new RenderIronGolem());
-- this.q.put(EntityBat.class, new RenderBat());
-- this.q.put(EntityDragon.class, new RenderDragon());
-- this.q.put(EntityEnderCrystal.class, new RenderEnderCrystal());
-- this.q.put(EntityWither.class, new RenderWither());
-- this.q.put(Entity.class, new RenderEntity());
-- this.q.put(EntityPainting.class, new RenderPainting());
-- this.q.put(EntityItemFrame.class, new RenderItemFrame());
-- this.q.put(EntityLeashKnot.class, new RenderLeashKnot());
-- this.q.put(EntityArrow.class, new RenderArrow());
-- this.q.put(EntitySnowball.class, new RenderSnowball(Item.snowball));
-- this.q.put(EntityEnderPearl.class, new RenderSnowball(Item.enderPearl));
-- this.q.put(EntityEnderEye.class, new RenderSnowball(Item.eyeOfEnder));
-- this.q.put(EntityEgg.class, new RenderSnowball(Item.egg));
-- this.q.put(EntityPotion.class, new RenderSnowball(Item.potion, 16384));
-- this.q.put(EntityExpBottle.class, new RenderSnowball(Item.expBottle));
-- this.q.put(EntityFireworkRocket.class, new RenderSnowball(Item.firework));
-- this.q.put(EntityLargeFireball.class, new RenderFireball(2.0F));
-- this.q.put(EntitySmallFireball.class, new RenderFireball(0.5F));
-- this.q.put(EntityWitherSkull.class, new RenderWitherSkull());
-- this.q.put(EntityItem.class, new RenderItem());
-- this.q.put(EntityXPOrb.class, new RenderXPOrb());
-- this.q.put(EntityTNTPrimed.class, new RenderTNTPrimed());
-- this.q.put(EntityFallingSand.class, new RenderFallingSand());
-- this.q.put(EntityMinecartTNT.class, new RenderTntMinecart());
-- this.q.put(EntityMinecartMobSpawner.class, new RenderMinecartMobSpawner());
-- this.q.put(EntityMinecart.class, new RenderMinecart());
-- this.q.put(EntityBoat.class, new RenderBoat());
-- this.q.put(EntityFishHook.class, new RenderFish());
-- this.q.put(EntityHorse.class, new RenderHorse(new ModelHorse(), 12.0F / 16.0F));
-- this.q.put(EntityLightningBolt.class, new RenderLightningBolt());
-- Iterator var1 = this.q.values().iterator();
-+ this.entityRenderMap.put(EntityCaveSpider.class, new RenderCaveSpider());
-+ this.entityRenderMap.put(EntitySpider.class, new RenderSpider());
-+ this.entityRenderMap.put(EntityPig.class, new RenderPig(new ModelPig(), new ModelPig(0.5F), 0.7F));
-+ this.entityRenderMap.put(EntitySheep.class, new RenderSheep(new ModelSheep2(), new ModelSheep1(), 0.7F));
-+ this.entityRenderMap.put(EntityCow.class, new RenderCow(new ModelCow(), 0.7F));
-+ this.entityRenderMap.put(EntityMooshroom.class, new RenderMooshroom(new ModelCow(), 0.7F));
-+ this.entityRenderMap.put(EntityWolf.class, new RenderWolf(new ModelWolf(), new ModelWolf(), 0.5F));
-+ this.entityRenderMap.put(EntityChicken.class, new RenderChicken(new ModelChicken(), 0.3F));
-+ this.entityRenderMap.put(EntityOcelot.class, new RenderOcelot(new ModelOcelot(), 0.4F));
-+ this.entityRenderMap.put(EntitySilverfish.class, new RenderSilverfish());
-+ this.entityRenderMap.put(EntityCreeper.class, new RenderCreeper());
-+ this.entityRenderMap.put(EntityEnderman.class, new RenderEnderman());
-+ this.entityRenderMap.put(EntitySnowman.class, new RenderSnowMan());
-+ this.entityRenderMap.put(EntitySkeleton.class, new RenderSkeleton());
-+ this.entityRenderMap.put(EntityWitch.class, new RenderWitch());
-+ this.entityRenderMap.put(EntityBlaze.class, new RenderBlaze());
-+ this.entityRenderMap.put(EntityZombie.class, new RenderZombie());
-+ this.entityRenderMap.put(EntitySlime.class, new RenderSlime(new ModelSlime(16), new ModelSlime(0), 0.25F));
-+ this.entityRenderMap.put(EntityMagmaCube.class, new RenderMagmaCube());
-+ this.entityRenderMap.put(EntityPlayer.class, new RenderPlayer());
-+ this.entityRenderMap.put(EntityGiantZombie.class, new RenderGiantZombie(new ModelZombie(), 0.5F, 6.0F));
-+ this.entityRenderMap.put(EntityGhast.class, new RenderGhast());
-+ this.entityRenderMap.put(EntitySquid.class, new RenderSquid(new ModelSquid(), 0.7F));
-+ this.entityRenderMap.put(EntityVillager.class, new RenderVillager());
-+ this.entityRenderMap.put(EntityIronGolem.class, new RenderIronGolem());
-+ this.entityRenderMap.put(EntityBat.class, new RenderBat());
-+ this.entityRenderMap.put(EntityDragon.class, new RenderDragon());
-+ this.entityRenderMap.put(EntityEnderCrystal.class, new RenderEnderCrystal());
-+ this.entityRenderMap.put(EntityWither.class, new RenderWither());
-+ this.entityRenderMap.put(Entity.class, new RenderEntity());
-+ this.entityRenderMap.put(EntityPainting.class, new RenderPainting());
-+ this.entityRenderMap.put(EntityItemFrame.class, new RenderItemFrame());
-+ this.entityRenderMap.put(EntityLeashKnot.class, new RenderLeashKnot());
-+ this.entityRenderMap.put(EntityArrow.class, new RenderArrow());
-+ this.entityRenderMap.put(EntitySnowball.class, new RenderSnowball(Item.snowball));
-+ this.entityRenderMap.put(EntityEnderPearl.class, new RenderSnowball(Item.enderPearl));
-+ this.entityRenderMap.put(EntityEnderEye.class, new RenderSnowball(Item.eyeOfEnder));
-+ this.entityRenderMap.put(EntityEgg.class, new RenderSnowball(Item.egg));
-+ this.entityRenderMap.put(EntityPotion.class, new RenderSnowball(Item.potion, 16384));
-+ this.entityRenderMap.put(EntityExpBottle.class, new RenderSnowball(Item.expBottle));
-+ this.entityRenderMap.put(EntityFireworkRocket.class, new RenderSnowball(Item.firework));
-+ this.entityRenderMap.put(EntityLargeFireball.class, new RenderFireball(2.0F));
-+ this.entityRenderMap.put(EntitySmallFireball.class, new RenderFireball(0.5F));
-+ this.entityRenderMap.put(EntityWitherSkull.class, new RenderWitherSkull());
-+ this.entityRenderMap.put(EntityItem.class, new RenderItem());
-+ this.entityRenderMap.put(EntityXPOrb.class, new RenderXPOrb());
-+ this.entityRenderMap.put(EntityTNTPrimed.class, new RenderTNTPrimed());
-+ this.entityRenderMap.put(EntityFallingSand.class, new RenderFallingSand());
-+ this.entityRenderMap.put(EntityMinecartTNT.class, new RenderTntMinecart());
-+ this.entityRenderMap.put(EntityMinecartMobSpawner.class, new RenderMinecartMobSpawner());
-+ this.entityRenderMap.put(EntityMinecart.class, new RenderMinecart());
-+ this.entityRenderMap.put(EntityBoat.class, new RenderBoat());
-+ this.entityRenderMap.put(EntityFishHook.class, new RenderFish());
-+ this.entityRenderMap.put(EntityHorse.class, new RenderHorse(new ModelHorse(), 0.75F));
-+ this.entityRenderMap.put(EntityLightningBolt.class, new RenderLightningBolt());
-+ // Spout Start
-+ this.entityRenderMap.put(EntityText.class, new RenderText());
-+ this.entityRenderMap.put(EntityTexture.class, new RenderTexture());
-+ // Spout End
-+ Iterator var1 = this.entityRenderMap.values().iterator();
-
-- while(var1.hasNext()) {
-+ while (var1.hasNext()) {
- Render var2 = (Render)var1.next();
- var2.setRenderManager(this);
- }
--
- }
-
-- public Render getEntityClassRenderObject(Class var1) {
-- Render var2 = (Render)this.q.get(var1);
-- if(var2 == null && var1 != Entity.class) {
-- var2 = this.getEntityClassRenderObject(var1.getSuperclass());
-- this.q.put(var1, var2);
-+ public Render getEntityClassRenderObject(Class par1Class) {
-+ Render var2 = (Render)this.entityRenderMap.get(par1Class);
-+
-+ if (var2 == null && par1Class != Entity.class) {
-+ var2 = this.getEntityClassRenderObject(par1Class.getSuperclass());
-+ this.entityRenderMap.put(par1Class, var2);
- }
-
- return var2;
- }
-
-- public Render getEntityRenderObject(Entity var1) {
-- return this.getEntityClassRenderObject(var1.getClass());
-+ public Render getEntityRenderObject(Entity par1Entity) {
-+ return this.getEntityClassRenderObject(par1Entity.getClass());
- }
-
-- public void cacheActiveRenderInfo(World var1, TextureManager var2, FontRenderer var3, EntityLivingBase var4, EntityLivingBase var5, GameSettings var6, float var7) {
-- this.worldObj = var1;
-- this.renderEngine = var2;
-- this.options = var6;
-- this.livingPlayer = var4;
-- this.field_96451_i = var5;
-- this.fontRenderer = var3;
-- if(var4.isPlayerSleeping()) {
-- int var8 = var1.getBlockId(MathHelper.floor_double(var4.posX), MathHelper.floor_double(var4.posY), MathHelper.floor_double(var4.posZ));
-- if(var8 == Block.bed.blockID) {
-- int var9 = var1.getBlockMetadata(MathHelper.floor_double(var4.posX), MathHelper.floor_double(var4.posY), MathHelper.floor_double(var4.posZ));
-+ /**
-+ * Caches the current frame's active render info, including the current World, RenderEngine, GameSettings and
-+ * FontRenderer settings, as well as interpolated player position, pitch and yaw.
-+ */
-+ public void cacheActiveRenderInfo(World par1World, TextureManager par2TextureManager, FontRenderer par3FontRenderer, EntityLivingBase par4EntityLivingBase, EntityLivingBase par5EntityLivingBase, GameSettings par6GameSettings, float par7) {
-+ this.worldObj = par1World;
-+ this.renderEngine = par2TextureManager;
-+ this.options = par6GameSettings;
-+ this.livingPlayer = par4EntityLivingBase;
-+ this.field_96451_i = par5EntityLivingBase;
-+ this.fontRenderer = par3FontRenderer;
-+
-+ if (par4EntityLivingBase.isPlayerSleeping()) {
-+ int var8 = par1World.getBlockId(MathHelper.floor_double(par4EntityLivingBase.posX), MathHelper.floor_double(par4EntityLivingBase.posY), MathHelper.floor_double(par4EntityLivingBase.posZ));
-+
-+ if (var8 == Block.bed.blockID) {
-+ int var9 = par1World.getBlockMetadata(MathHelper.floor_double(par4EntityLivingBase.posX), MathHelper.floor_double(par4EntityLivingBase.posY), MathHelper.floor_double(par4EntityLivingBase.posZ));
- int var10 = var9 & 3;
- this.playerViewY = (float)(var10 * 90 + 180);
- this.playerViewX = 0.0F;
- }
- } else {
-- this.playerViewY = var4.prevRotationYaw + (var4.rotationYaw - var4.prevRotationYaw) * var7;
-- this.playerViewX = var4.prevRotationPitch + (var4.rotationPitch - var4.prevRotationPitch) * var7;
-+ this.playerViewY = par4EntityLivingBase.prevRotationYaw + (par4EntityLivingBase.rotationYaw - par4EntityLivingBase.prevRotationYaw) * par7;
-+ this.playerViewX = par4EntityLivingBase.prevRotationPitch + (par4EntityLivingBase.rotationPitch - par4EntityLivingBase.prevRotationPitch) * par7;
- }
-
-- if(var6.thirdPersonView == 2) {
-+ if (par6GameSettings.thirdPersonView == 2) {
- this.playerViewY += 180.0F;
- }
-
-- this.viewerPosX = var4.lastTickPosX + (var4.posX - var4.lastTickPosX) * (double)var7;
-- this.viewerPosY = var4.lastTickPosY + (var4.posY - var4.lastTickPosY) * (double)var7;
-- this.viewerPosZ = var4.lastTickPosZ + (var4.posZ - var4.lastTickPosZ) * (double)var7;
-+ this.viewerPosX = par4EntityLivingBase.lastTickPosX + (par4EntityLivingBase.posX - par4EntityLivingBase.lastTickPosX) * (double)par7;
-+ this.viewerPosY = par4EntityLivingBase.lastTickPosY + (par4EntityLivingBase.posY - par4EntityLivingBase.lastTickPosY) * (double)par7;
-+ this.viewerPosZ = par4EntityLivingBase.lastTickPosZ + (par4EntityLivingBase.posZ - par4EntityLivingBase.lastTickPosZ) * (double)par7;
- }
-
-- public void renderEntity(Entity var1, float var2) {
-- if(var1.ticksExisted == 0) {
-- var1.lastTickPosX = var1.posX;
-- var1.lastTickPosY = var1.posY;
-- var1.lastTickPosZ = var1.posZ;
-+ /**
-+ * Will render the specified entity at the specified partial tick time. Args: entity, partialTickTime
-+ */
-+ public void renderEntity(Entity par1Entity, float par2) {
-+ if (par1Entity.ticksExisted == 0) {
-+ par1Entity.lastTickPosX = par1Entity.posX;
-+ par1Entity.lastTickPosY = par1Entity.posY;
-+ par1Entity.lastTickPosZ = par1Entity.posZ;
- }
-
-- double var3 = var1.lastTickPosX + (var1.posX - var1.lastTickPosX) * (double)var2;
-- double var5 = var1.lastTickPosY + (var1.posY - var1.lastTickPosY) * (double)var2;
-- double var7 = var1.lastTickPosZ + (var1.posZ - var1.lastTickPosZ) * (double)var2;
-- float var9 = var1.prevRotationYaw + (var1.rotationYaw - var1.prevRotationYaw) * var2;
-- int var10 = var1.getBrightnessForRender(var2);
-- if(var1.isBurning()) {
-+ double var3 = par1Entity.lastTickPosX + (par1Entity.posX - par1Entity.lastTickPosX) * (double)par2;
-+ double var5 = par1Entity.lastTickPosY + (par1Entity.posY - par1Entity.lastTickPosY) * (double)par2;
-+ double var7 = par1Entity.lastTickPosZ + (par1Entity.posZ - par1Entity.lastTickPosZ) * (double)par2;
-+ float var9 = par1Entity.prevRotationYaw + (par1Entity.rotationYaw - par1Entity.prevRotationYaw) * par2;
-+ int var10 = par1Entity.getBrightnessForRender(par2);
-+
-+ if (par1Entity.isBurning()) {
- var10 = 15728880;
- }
-
-@@ -153,50 +187,67 @@
- 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);
-- this.renderEntityWithPosYaw(var1, var3 - renderPosX, var5 - renderPosY, var7 - renderPosZ, var9, var2);
-+ this.renderEntityWithPosYaw(par1Entity, var3 - renderPosX, var5 - renderPosY, var7 - renderPosZ, var9, par2);
- }
-
-- public void renderEntityWithPosYaw(Entity var1, double var2, double var4, double var6, float var8, float var9) {
-+ /**
-+ * Renders the specified entity with the passed in position, yaw, and partialTickTime. Args: entity, x, y, z, yaw,
-+ * partialTickTime
-+ */
-+ public void renderEntityWithPosYaw(Entity par1Entity, double par2, double par4, double par6, float par8, float par9) {
- Render var10 = null;
-
- try {
-- var10 = this.getEntityRenderObject(var1);
-- if(var10 != null && this.renderEngine != null) {
-- if(field_85095_o && !var1.isInvisible()) {
-+ var10 = this.getEntityRenderObject(par1Entity);
-+
-+ if (var10 != null && this.renderEngine != null) {
-+ if (field_85095_o && !par1Entity.isInvisible()) {
- try {
-- this.func_85094_b(var1, var2, var4, var6, var8, var9);
-+ this.func_85094_b(par1Entity, par2, par4, par6, par8, par9);
- } catch (Throwable var17) {
- throw new ReportedException(CrashReport.makeCrashReport(var17, "Rendering entity hitbox in world"));
- }
- }
-
-+ // Spout Start
-+ var10.setRenderManager(this);
-+ // Spout End
-+
- try {
-- var10.doRender(var1, var2, var4, var6, var8, var9);
-+ var10.doRender(par1Entity, par2, par4, par6, par8, par9);
-+ // Spout Start - Ignore NullPointerExceptions, the old way
-+ } catch(NullPointerException ignore) {
-+ // Spout End
- } catch (Throwable var16) {
- throw new ReportedException(CrashReport.makeCrashReport(var16, "Rendering entity in world"));
- }
-
- try {
-- var10.doRenderShadowAndFire(var1, var2, var4, var6, var8, var9);
-+ var10.doRenderShadowAndFire(par1Entity, par2, par4, par6, par8, par9);
-+ // Spout Start - Ignore NullPointerExceptions, the old way
-+ } catch(NullPointerException ignore) {
-+ // Spout End
- } catch (Throwable var15) {
- throw new ReportedException(CrashReport.makeCrashReport(var15, "Post-rendering entity in world"));
- }
- }
--
-+ // Spout Start - Ignore NullPointerExceptions, the old way
-+ } catch(NullPointerException ignore) {
-+ // Spout End
- } catch (Throwable var18) {
- CrashReport var12 = CrashReport.makeCrashReport(var18, "Rendering entity in world");
- CrashReportCategory var13 = var12.makeCategory("Entity being rendered");
-- var1.addEntityCrashInfo(var13);
-+ par1Entity.addEntityCrashInfo(var13);
- CrashReportCategory var14 = var12.makeCategory("Renderer details");
- var14.addCrashSection("Assigned renderer", var10);
-- var14.addCrashSection("Location", CrashReportCategory.func_85074_a(var2, var4, var6));
-- var14.addCrashSection("Rotation", Float.valueOf(var8));
-- var14.addCrashSection("Delta", Float.valueOf(var9));
-+ var14.addCrashSection("Location", CrashReportCategory.func_85074_a(par2, par4, par6));
-+ var14.addCrashSection("Rotation", Float.valueOf(par8));
-+ var14.addCrashSection("Delta", Float.valueOf(par9));
- throw new ReportedException(var12);
- }
- }
-
-- private void func_85094_b(Entity var1, double var2, double var4, double var6, float var8, float var9) {
-+ private void func_85094_b(Entity par1Entity, double par2, double par4, double par6, float par8, float par9) {
- GL11.glDepthMask(false);
- GL11.glDisable(GL11.GL_TEXTURE_2D);
- GL11.glDisable(GL11.GL_LIGHTING);
-@@ -206,31 +257,31 @@
- Tessellator var10 = Tessellator.instance;
- var10.startDrawingQuads();
- var10.setColorRGBA(255, 255, 255, 32);
-- double var11 = (double)(-var1.width / 2.0F);
-- double var13 = (double)(-var1.width / 2.0F);
-- double var15 = (double)(var1.width / 2.0F);
-- double var17 = (double)(-var1.width / 2.0F);
-- double var19 = (double)(-var1.width / 2.0F);
-- double var21 = (double)(var1.width / 2.0F);
-- double var23 = (double)(var1.width / 2.0F);
-- double var25 = (double)(var1.width / 2.0F);
-- double var27 = (double)var1.height;
-- var10.addVertex(var2 + var11, var4 + var27, var6 + var13);
-- var10.addVertex(var2 + var11, var4, var6 + var13);
-- var10.addVertex(var2 + var15, var4, var6 + var17);
-- var10.addVertex(var2 + var15, var4 + var27, var6 + var17);
-- var10.addVertex(var2 + var23, var4 + var27, var6 + var25);
-- var10.addVertex(var2 + var23, var4, var6 + var25);
-- var10.addVertex(var2 + var19, var4, var6 + var21);
-- var10.addVertex(var2 + var19, var4 + var27, var6 + var21);
-- var10.addVertex(var2 + var15, var4 + var27, var6 + var17);
-- var10.addVertex(var2 + var15, var4, var6 + var17);
-- var10.addVertex(var2 + var23, var4, var6 + var25);
-- var10.addVertex(var2 + var23, var4 + var27, var6 + var25);
-- var10.addVertex(var2 + var19, var4 + var27, var6 + var21);
-- var10.addVertex(var2 + var19, var4, var6 + var21);
-- var10.addVertex(var2 + var11, var4, var6 + var13);
-- var10.addVertex(var2 + var11, var4 + var27, var6 + var13);
-+ double var11 = (double)(-par1Entity.width / 2.0F);
-+ double var13 = (double)(-par1Entity.width / 2.0F);
-+ double var15 = (double)(par1Entity.width / 2.0F);
-+ double var17 = (double)(-par1Entity.width / 2.0F);
-+ double var19 = (double)(-par1Entity.width / 2.0F);
-+ double var21 = (double)(par1Entity.width / 2.0F);
-+ double var23 = (double)(par1Entity.width / 2.0F);
-+ double var25 = (double)(par1Entity.width / 2.0F);
-+ double var27 = (double)par1Entity.height;
-+ var10.addVertex(par2 + var11, par4 + var27, par6 + var13);
-+ var10.addVertex(par2 + var11, par4, par6 + var13);
-+ var10.addVertex(par2 + var15, par4, par6 + var17);
-+ var10.addVertex(par2 + var15, par4 + var27, par6 + var17);
-+ var10.addVertex(par2 + var23, par4 + var27, par6 + var25);
-+ var10.addVertex(par2 + var23, par4, par6 + var25);
-+ var10.addVertex(par2 + var19, par4, par6 + var21);
-+ var10.addVertex(par2 + var19, par4 + var27, par6 + var21);
-+ var10.addVertex(par2 + var15, par4 + var27, par6 + var17);
-+ var10.addVertex(par2 + var15, par4, par6 + var17);
-+ var10.addVertex(par2 + var23, par4, par6 + var25);
-+ var10.addVertex(par2 + var23, par4 + var27, par6 + var25);
-+ var10.addVertex(par2 + var19, par4 + var27, par6 + var21);
-+ var10.addVertex(par2 + var19, par4, par6 + var21);
-+ var10.addVertex(par2 + var11, par4, par6 + var13);
-+ var10.addVertex(par2 + var11, par4 + var27, par6 + var13);
- var10.draw();
- GL11.glPopMatrix();
- GL11.glEnable(GL11.GL_TEXTURE_2D);
-@@ -240,28 +291,33 @@
- GL11.glDepthMask(true);
- }
-
-- public void set(World var1) {
-- this.worldObj = var1;
-+ /**
-+ * World sets this RenderManager's worldObj to the world provided
-+ */
-+ public void set(World par1World) {
-+ this.worldObj = par1World;
- }
-
-- public double getDistanceToCamera(double var1, double var3, double var5) {
-- double var7 = var1 - this.viewerPosX;
-- double var9 = var3 - this.viewerPosY;
-- double var11 = var5 - this.viewerPosZ;
-+ public double getDistanceToCamera(double par1, double par3, double par5) {
-+ double var7 = par1 - this.viewerPosX;
-+ double var9 = par3 - this.viewerPosY;
-+ double var11 = par5 - this.viewerPosZ;
- return var7 * var7 + var9 * var9 + var11 * var11;
- }
-
-+ /**
-+ * Returns the font renderer
-+ */
- public FontRenderer getFontRenderer() {
- return this.fontRenderer;
- }
-
-- public void updateIcons(IconRegister var1) {
-- Iterator var2 = this.q.values().iterator();
-+ public void updateIcons(IconRegister par1IconRegister) {
-+ Iterator var2 = this.entityRenderMap.values().iterator();
-
-- while(var2.hasNext()) {
-+ while (var2.hasNext()) {
- Render var3 = (Render)var2.next();
-- var3.updateIcons(var1);
-+ var3.updateIcons(par1IconRegister);
- }
--
- }
- }
---- /dev/null
-+++ org/spoutcraft/client/gui/controls/GuiCommandsSlot.java
-@@ -1,0 +1,87 @@
-+/*
-+ * This file is part of Spoutcraft.
-+ *
-+ * Copyright (c) 2011 SpoutcraftDev
-+ * Spoutcraft is licensed under the GNU Lesser General Public License.
-+ *
-+ * Spoutcraft is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation, either version 3 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Spoutcraft is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program. If not, see .
-+ */
-+package org.spoutcraft.client.gui.controls;
-+
-+import net.minecraft.src.FontRenderer;
-+
-+import org.spoutcraft.api.gui.GenericListWidget;
-+import org.spoutcraft.api.gui.ListWidget;
-+import org.spoutcraft.api.gui.ListWidgetItem;
-+import org.spoutcraft.client.SpoutClient;
-+import org.spoutcraft.client.controls.Shortcut;
-+
-+public class GuiCommandsSlot extends GenericListWidget {
-+ GuiEditShortcut parent;
-+ Shortcut shortcut;
-+
-+ public GuiCommandsSlot(GuiEditShortcut parent) {
-+ this.parent = parent;
-+ this.shortcut = parent.getShortcut();
-+ updateItems();
-+ }
-+
-+ public void updateItems() {
-+ clear();
-+ for (String cmd:shortcut.getCommands()) {
-+ addItem(new CommandLWI(cmd));
-+ }
-+ }
-+
-+ @Override
-+ public void onSelected(int item, boolean doubleClick) {
-+ if (doubleClick) {
-+ parent.editCommand(item);
-+ }
-+ parent.updateButtons();
-+ }
-+
-+ private class CommandLWI implements ListWidgetItem {
-+ ListWidget widget;
-+ String cmd;
-+ public CommandLWI(String cmd) {
-+ this.cmd = cmd;
-+ }
-+
-+ public void setListWidget(ListWidget widget) {
-+ this.widget = widget;
-+ }
-+
-+ public ListWidget getListWidget() {
-+ return widget;
-+ }
-+
-+ public int getHeight() {
-+ return 23;
-+ }
-+
-+ public void render(int x, int y, int width, int height) {
-+ FontRenderer font = SpoutClient.getHandle().fontRenderer;
-+ parent.drawString(font, cmd, x + 2, y + 2, 0xffffff);
-+ if (cmd.startsWith("/")) {
-+ parent.drawString(font, "Command", x + 2, y + 13, 0xaaaaaa);
-+ } else {
-+ parent.drawString(font, "Chat Message", x + 2, y + 13, 0xaaaaaa);
-+ }
-+ }
-+
-+ public void onClick(int x, int y, boolean d) {
-+ }
-+ }
-+}
---- /dev/null
-+++ org/spoutcraft/client/packet/PacketBlockData.java
-@@ -1,0 +1,136 @@
-+/*
-+ * This file is part of Spoutcraft.
-+ *
-+ * Copyright (c) 2011 SpoutcraftDev
-+ * Spoutcraft is licensed under the GNU Lesser General Public License.
-+ *
-+ * Spoutcraft is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation, either version 3 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Spoutcraft is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program. If not, see .
-+ */
-+package org.spoutcraft.client.packet;
-+
-+import java.io.IOException;
-+import java.nio.ByteBuffer;
-+import java.util.zip.DataFormatException;
-+import java.util.zip.Deflater;
-+import java.util.zip.Inflater;
-+
-+import org.apache.commons.io.output.ByteArrayOutputStream;
-+
-+import org.spoutcraft.api.io.SpoutInputStream;
-+import org.spoutcraft.api.io.SpoutOutputStream;
-+import org.spoutcraft.api.material.Block;
-+import org.spoutcraft.api.material.MaterialData;
-+
-+public class PacketBlockData implements CompressablePacket {
-+ byte[] data;
-+ boolean compressed = false;
-+ public PacketBlockData() {
-+ }
-+
-+ public void compress() {
-+ if (!compressed) {
-+ Deflater deflater = new Deflater();
-+ deflater.setInput(data);
-+ deflater.setLevel(Deflater.BEST_COMPRESSION);
-+ deflater.finish();
-+ ByteArrayOutputStream bos = new ByteArrayOutputStream(data.length);
-+ byte[] buffer = new byte[1024];
-+ while (!deflater.finished()) {
-+ int bytesCompressed = deflater.deflate(buffer);
-+ bos.write(buffer, 0, bytesCompressed);
-+ }
-+ try {
-+ bos.close();
-+ } catch (IOException e) {
-+ e.printStackTrace();
-+ }
-+ data = bos.toByteArray();
-+ compressed = true;
-+ }
-+ }
-+
-+ public void decompress() {
-+ if (compressed) {
-+ Inflater decompressor = new Inflater();
-+ decompressor.setInput(data);
-+
-+ ByteArrayOutputStream bos = new ByteArrayOutputStream(data.length);
-+
-+ byte[] buf = new byte[1024];
-+ while (!decompressor.finished()) {
-+ try {
-+ int count = decompressor.inflate(buf);
-+ bos.write(buf, 0, count);
-+ } catch (DataFormatException e) {
-+ }
-+ }
-+ try {
-+ bos.close();
-+ } catch (IOException e) {
-+ }
-+
-+ data = bos.toByteArray();
-+ }
-+ }
-+
-+ public boolean isCompressed() {
-+ return compressed;
-+ }
-+
-+ public void readData(SpoutInputStream input) throws IOException {
-+ int size = input.readInt();
-+ compressed = input.readBoolean();
-+ if (size > 0) {
-+ data = new byte[size];
-+ input.read(data);
-+ }
-+ }
-+
-+ public void writeData(SpoutOutputStream output) throws IOException {
-+ output.writeInt(data == null ? 0 : data.length);
-+ output.writeBoolean(compressed);
-+ if (data != null) {
-+ output.write(data);
-+ }
-+ }
-+
-+ public void run(int playerId) {
-+ if (data != null) {
-+ ByteBuffer result = ByteBuffer.allocate(data.length).put(data);
-+ for (int i = 0; i < data.length / 15; i++) {
-+ int index = i * 15;
-+ int id = result.get(index);
-+ short rawData = result.get(index+1);
-+ Block block = MaterialData.getBlock(id, rawData);
-+ if (block != null) {
-+ block.setHardness(result.getFloat(index+2));
-+ block.setLightLevel(result.getInt(index+6));
-+ block.setFriction(result.getFloat(index+10));
-+ block.setOpaque(result.get(index+14) != 0);
-+ }
-+ }
-+ }
-+ }
-+
-+ public void failure(int playerId) {
-+ }
-+
-+ public PacketType getPacketType() {
-+ return PacketType.PacketBlockData;
-+ }
-+
-+ public int getVersion() {
-+ return 0;
-+ }
-+}
---- net/minecraft/src/Packet103SetSlot.java
-+++ net/minecraft/src/Packet103SetSlot.java
-@@ -5,35 +5,52 @@
- import java.io.IOException;
-
- public class Packet103SetSlot extends Packet {
-+
-+ /** The window which is being updated. 0 for player inventory */
- public int windowId;
-+
-+ /** Slot that should be updated */
- public int itemSlot;
-+
-+ /** Item stack */
- public ItemStack myItemStack;
-
-- public Packet103SetSlot() {
-- }
--
-- public Packet103SetSlot(int var1, int var2, ItemStack var3) {
-- this.windowId = var1;
-- this.itemSlot = var2;
-- this.myItemStack = var3 == null ? var3 : var3.copy();
-- }
--
-- public void processPacket(NetHandler var1) {
-- var1.handleSetSlot(this);
-- }
--
-- public void readPacketData(DataInput var1) throws IOException {
-- this.windowId = var1.readByte();
-- this.itemSlot = var1.readShort();
-- this.myItemStack = readItemStack(var1);
-- }
--
-- public void writePacketData(DataOutput var1) throws IOException {
-- var1.writeByte(this.windowId);
-- var1.writeShort(this.itemSlot);
-- writeItemStack(this.myItemStack, var1);
-- }
--
-+ public Packet103SetSlot() {}
-+
-+ public Packet103SetSlot(int par1, int par2, ItemStack par3ItemStack) {
-+ this.windowId = par1;
-+ this.itemSlot = par2;
-+ this.myItemStack = par3ItemStack == null ? par3ItemStack : par3ItemStack.copy();
-+ }
-+
-+ /**
-+ * Passes this Packet on to the NetHandler for processing.
-+ */
-+ public void processPacket(NetHandler par1NetHandler) {
-+ par1NetHandler.handleSetSlot(this);
-+ }
-+
-+ /**
-+ * Abstract. Reads the raw packet data from the data stream.
-+ */
-+ public void readPacketData(DataInput par1DataInput) throws IOException {
-+ this.windowId = par1DataInput.readByte();
-+ this.itemSlot = par1DataInput.readShort();
-+ this.myItemStack = readItemStack(par1DataInput);
-+ }
-+
-+ /**
-+ * Abstract. Writes the raw packet data to the data stream.
-+ */
-+ public void writePacketData(DataOutput par1DataOutput) throws IOException {
-+ par1DataOutput.writeByte(this.windowId);
-+ par1DataOutput.writeShort(this.itemSlot);
-+ writeItemStack(this.myItemStack, par1DataOutput);
-+ }
-+
-+ /**
-+ * Abstract. Return the size of the packet (not counting the header).
-+ */
- public int getPacketSize() {
- return 8;
- }
---- net/minecraft/src/BlockEndPortalFrame.java
-+++ net/minecraft/src/BlockEndPortalFrame.java
-@@ -7,67 +7,106 @@
- private Icon field_94400_a;
- private Icon field_94399_b;
-
-- public BlockEndPortalFrame(int var1) {
-- super(var1, Material.rock);
-- }
--
-- public Icon getIcon(int var1, int var2) {
-- return var1 == 1 ? this.field_94400_a : (var1 == 0 ? Block.whiteStone.getBlockTextureFromSide(var1) : this.blockIcon);
-- }
--
-- public void registerIcons(IconRegister var1) {
-- this.blockIcon = var1.registerIcon(this.getTextureName() + "_side");
-- this.field_94400_a = var1.registerIcon(this.getTextureName() + "_top");
-- this.field_94399_b = var1.registerIcon(this.getTextureName() + "_eye");
-+ 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() {
- return false;
- }
-
-+ /**
-+ * The type of render function that is called for this block
-+ */
- public int getRenderType() {
- return 26;
- }
-
-+ /**
-+ * Sets the block's bounds for rendering it as an item
-+ */
- public void setBlockBoundsForItemRender() {
-- this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 13.0F / 16.0F, 1.0F);
-+ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.8125F, 1.0F);
- }
-
-- public void addCollisionBoxesToList(World var1, int var2, int var3, int var4, AxisAlignedBB var5, List var6, Entity var7) {
-- this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 13.0F / 16.0F, 1.0F);
-- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7);
-- int var8 = var1.getBlockMetadata(var2, var3, var4);
-- if(isEnderEyeInserted(var8)) {
-- this.setBlockBounds(5.0F / 16.0F, 13.0F / 16.0F, 5.0F / 16.0F, 11.0F / 16.0F, 1.0F, 11.0F / 16.0F);
-- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7);
-+ /**
-+ * 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) {
-+ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.8125F, 1.0F);
-+ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity);
-+ int var8 = par1World.getBlockMetadata(par2, par3, par4);
-+
-+ if (isEnderEyeInserted(var8)) {
-+ this.setBlockBounds(0.3125F, 0.8125F, 0.3125F, 0.6875F, 1.0F, 0.6875F);
-+ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity);
- }
-
- this.setBlockBoundsForItemRender();
- }
-
-- public static boolean isEnderEyeInserted(int var0) {
-- return (var0 & 4) != 0;
-+ /**
-+ * checks if an ender eye has been inserted into the frame block. parameters: metadata
-+ */
-+ public static boolean isEnderEyeInserted(int par0) {
-+ return (par0 & 4) != 0;
- }
-
-- public int idDropped(int var1, Random var2, int var3) {
-+ /**
-+ * Returns the ID of the items to drop on destruction.
-+ */
-+ public int idDropped(int par1, Random par2Random, int par3) {
- return 0;
- }
-
-- public void onBlockPlacedBy(World var1, int var2, int var3, int var4, EntityLivingBase var5, ItemStack var6) {
-- int var7 = ((MathHelper.floor_double((double)(var5.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3) + 2) % 4;
-- var1.setBlockMetadata(var2, var3, var4, var7, 2);
-+ /**
-+ * 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.
-+ */
- public boolean hasComparatorInputOverride() {
- return true;
- }
-
-- public int getComparatorInputOverride(World var1, int var2, int var3, int var4, int var5) {
-- int var6 = var1.getBlockMetadata(var2, var3, var4);
-+ /**
-+ * If hasComparatorInputOverride returns true, the return value from this is used instead of the redstone signal
-+ * strength when this block inputs to a comparator.
-+ */
-+ public int getComparatorInputOverride(World par1World, int par2, int par3, int par4, int par5) {
-+ int var6 = par1World.getBlockMetadata(par2, par3, par4);
- return isEnderEyeInserted(var6) ? 15 : 0;
- }
- }
---- net/minecraft/src/EntityAICreeperSwell.java
-+++ net/minecraft/src/EntityAICreeperSwell.java
-@@ -1,34 +1,52 @@
- package net.minecraft.src;
-
- public class EntityAICreeperSwell extends EntityAIBase {
-+
-+ /** The creeper that is swelling. */
- EntityCreeper swellingCreeper;
-+
-+ /**
-+ * The creeper's attack target. This is used for the changing of the creeper's state.
-+ */
- EntityLivingBase creeperAttackTarget;
-
-- public EntityAICreeperSwell(EntityCreeper var1) {
-- this.swellingCreeper = var1;
-+ public EntityAICreeperSwell(EntityCreeper par1EntityCreeper) {
-+ this.swellingCreeper = par1EntityCreeper;
- this.setMutexBits(1);
- }
-
-+ /**
-+ * Returns whether the EntityAIBase should begin execution.
-+ */
- public boolean shouldExecute() {
- EntityLivingBase var1 = this.swellingCreeper.getAttackTarget();
- return this.swellingCreeper.getCreeperState() > 0 || var1 != null && this.swellingCreeper.getDistanceSqToEntity(var1) < 9.0D;
- }
-
-+ /**
-+ * Execute a one shot task or start executing a continuous task
-+ */
- public void startExecuting() {
- this.swellingCreeper.getNavigator().clearPathEntity();
- this.creeperAttackTarget = this.swellingCreeper.getAttackTarget();
- }
-
-+ /**
-+ * Resets the task
-+ */
- public void resetTask() {
- this.creeperAttackTarget = null;
- }
-
-+ /**
-+ * Updates the task
-+ */
- public void updateTask() {
-- if(this.creeperAttackTarget == null) {
-- this.swellingCreeper.setCreeperState(-1);
-- } else if(this.swellingCreeper.getDistanceSqToEntity(this.creeperAttackTarget) > 49.0D) {
-- this.swellingCreeper.setCreeperState(-1);
-- } else if(!this.swellingCreeper.getEntitySenses().canSee(this.creeperAttackTarget)) {
-+ if (this.creeperAttackTarget == null) {
-+ this.swellingCreeper.setCreeperState(-1);
-+ } else if (this.swellingCreeper.getDistanceSqToEntity(this.creeperAttackTarget) > 49.0D) {
-+ this.swellingCreeper.setCreeperState(-1);
-+ } else if (!this.swellingCreeper.getEntitySenses().canSee(this.creeperAttackTarget)) {
- this.swellingCreeper.setCreeperState(-1);
- } else {
- this.swellingCreeper.setCreeperState(1);
---- net/minecraft/src/VillageCollection.java
-+++ net/minecraft/src/VillageCollection.java
-@@ -6,46 +6,56 @@
-
- public class VillageCollection extends WorldSavedData {
- private World worldObj;
-- private final List b = new ArrayList();
-- private final List c = new ArrayList();
-- private final List d = new ArrayList();
-+
-+ /**
-+ * This is a black hole. You can add data to this list through a public interface, but you can't query that information
-+ * in any way and it's not used internally either.
-+ */
-+ private final List villagerPositionsList = new ArrayList();
-+ private final List newDoors = new ArrayList();
-+ private final List villageList = new ArrayList();
- private int tickCounter;
-
-- public VillageCollection(String var1) {
-- super(var1);
-+ public VillageCollection(String par1Str) {
-+ super(par1Str);
- }
-
-- public VillageCollection(World var1) {
-+ public VillageCollection(World par1World) {
- super("villages");
-- this.worldObj = var1;
-+ this.worldObj = par1World;
- this.markDirty();
- }
-
-- public void func_82566_a(World var1) {
-- this.worldObj = var1;
-- Iterator var2 = this.d.iterator();
-+ public void func_82566_a(World par1World) {
-+ this.worldObj = par1World;
-+ Iterator var2 = this.villageList.iterator();
-
-- while(var2.hasNext()) {
-+ while (var2.hasNext()) {
- Village var3 = (Village)var2.next();
-- var3.func_82691_a(var1);
-+ var3.func_82691_a(par1World);
- }
--
- }
-
-- public void addVillagerPosition(int var1, int var2, int var3) {
-- if(this.b.size() <= 64) {
-- if(!this.isVillagerPositionPresent(var1, var2, var3)) {
-- this.b.add(new ChunkCoordinates(var1, var2, var3));
-+ /**
-+ * This is a black hole. You can add data to this list through a public interface, but you can't query that information
-+ * in any way and it's not used internally either.
-+ */
-+ public void addVillagerPosition(int par1, int par2, int par3) {
-+ if (this.villagerPositionsList.size() <= 64) {
-+ if (!this.isVillagerPositionPresent(par1, par2, par3)) {
-+ this.villagerPositionsList.add(new ChunkCoordinates(par1, par2, par3));
- }
--
- }
- }
-
-+ /**
-+ * Runs a single tick for the village collection
-+ */
- public void tick() {
- ++this.tickCounter;
-- Iterator var1 = this.d.iterator();
-+ Iterator var1 = this.villageList.iterator();
-
-- while(var1.hasNext()) {
-+ while (var1.hasNext()) {
- Village var2 = (Village)var1.next();
- var2.tick(this.tickCounter);
- }
-@@ -53,40 +63,48 @@
- this.removeAnnihilatedVillages();
- this.dropOldestVillagerPosition();
- this.addNewDoorsToVillageOrCreateVillage();
-- if(this.tickCounter % 400 == 0) {
-+
-+ if (this.tickCounter % 400 == 0) {
- this.markDirty();
- }
--
- }
-
- private void removeAnnihilatedVillages() {
-- Iterator var1 = this.d.iterator();
-+ Iterator var1 = this.villageList.iterator();
-
-- while(var1.hasNext()) {
-+ while (var1.hasNext()) {
- Village var2 = (Village)var1.next();
-- if(var2.isAnnihilated()) {
-+
-+ if (var2.isAnnihilated()) {
- var1.remove();
- this.markDirty();
- }
- }
--
- }
-
-+ /**
-+ * Get a list of villages.
-+ */
- public List getVillageList() {
-- return this.d;
-+ return this.villageList;
- }
-
-- public Village findNearestVillage(int var1, int var2, int var3, int var4) {
-+ /**
-+ * Finds the nearest village, but only the given coordinates are withing it's bounding box plus the given the distance.
-+ */
-+ public Village findNearestVillage(int par1, int par2, int par3, int par4) {
- Village var5 = null;
- float var6 = Float.MAX_VALUE;
-- Iterator var7 = this.d.iterator();
-+ Iterator var7 = this.villageList.iterator();
-
-- while(var7.hasNext()) {
-+ while (var7.hasNext()) {
- Village var8 = (Village)var7.next();
-- float var9 = var8.getCenter().getDistanceSquared(var1, var2, var3);
-- if(var9 < var6) {
-- float var10 = (float)(var4 + var8.getVillageRadius());
-- if(var9 <= var10 * var10) {
-+ float var9 = var8.getCenter().getDistanceSquared(par1, par2, par3);
-+
-+ if (var9 < var6) {
-+ float var10 = (float)(par4 + var8.getVillageRadius());
-+
-+ if (var9 <= var10 * var10) {
- var5 = var8;
- var6 = var9;
- }
-@@ -97,50 +115,60 @@
- }
-
- private void dropOldestVillagerPosition() {
-- if(!this.b.isEmpty()) {
-- this.addUnassignedWoodenDoorsAroundToNewDoorsList((ChunkCoordinates)this.b.remove(0));
-+ if (!this.villagerPositionsList.isEmpty()) {
-+ this.addUnassignedWoodenDoorsAroundToNewDoorsList((ChunkCoordinates)this.villagerPositionsList.remove(0));
- }
- }
-
- private void addNewDoorsToVillageOrCreateVillage() {
-- for(int var1 = 0; var1 < this.c.size(); ++var1) {
-- VillageDoorInfo var2 = (VillageDoorInfo)this.c.get(var1);
-+ int var1 = 0;
-+
-+ while (var1 < this.newDoors.size()) {
-+ VillageDoorInfo var2 = (VillageDoorInfo)this.newDoors.get(var1);
- boolean var3 = false;
-- Iterator var4 = this.d.iterator();
--
-- while(var4.hasNext()) {
-- Village var5 = (Village)var4.next();
-- int var6 = (int)var5.getCenter().getDistanceSquared(var2.posX, var2.posY, var2.posZ);
-- int var7 = 32 + var5.getVillageRadius();
-- if(var6 <= var7 * var7) {
-+ Iterator var4 = this.villageList.iterator();
-+
-+ while (true) {
-+ if (var4.hasNext()) {
-+ Village var5 = (Village)var4.next();
-+ int var6 = (int)var5.getCenter().getDistanceSquared(var2.posX, var2.posY, var2.posZ);
-+ int var7 = 32 + var5.getVillageRadius();
-+
-+ if (var6 > var7 * var7) {
-+ continue;
-+ }
-+
- var5.addVillageDoorInfo(var2);
- var3 = true;
-- break;
-- }
-- }
--
-- if(!var3) {
-- Village var8 = new Village(this.worldObj);
-- var8.addVillageDoorInfo(var2);
-- this.d.add(var8);
-- this.markDirty();
-+ }
-+
-+ if (!var3) {
-+ Village var8 = new Village(this.worldObj);
-+ var8.addVillageDoorInfo(var2);
-+ this.villageList.add(var8);
-+ this.markDirty();
-+ }
-+
-+ ++var1;
-+ break;
- }
- }
-
-- this.c.clear();
-+ this.newDoors.clear();
- }
-
-- private void addUnassignedWoodenDoorsAroundToNewDoorsList(ChunkCoordinates var1) {
-+ private void addUnassignedWoodenDoorsAroundToNewDoorsList(ChunkCoordinates par1ChunkCoordinates) {
- byte var2 = 16;
- byte var3 = 4;
- byte var4 = 16;
-
-- for(int var5 = var1.posX - var2; var5 < var1.posX + var2; ++var5) {
-- for(int var6 = var1.posY - var3; var6 < var1.posY + var3; ++var6) {
-- for(int var7 = var1.posZ - var4; var7 < var1.posZ + var4; ++var7) {
-- if(this.isWoodenDoorAt(var5, var6, var7)) {
-+ for (int var5 = par1ChunkCoordinates.posX - var2; var5 < par1ChunkCoordinates.posX + var2; ++var5) {
-+ for (int var6 = par1ChunkCoordinates.posY - var3; var6 < par1ChunkCoordinates.posY + var3; ++var6) {
-+ for (int var7 = par1ChunkCoordinates.posZ - var4; var7 < par1ChunkCoordinates.posZ + var4; ++var7) {
-+ if (this.isWoodenDoorAt(var5, var6, var7)) {
- VillageDoorInfo var8 = this.getVillageDoorAt(var5, var6, var7);
-- if(var8 == null) {
-+
-+ if (var8 == null) {
- this.addDoorToNewListIfAppropriate(var5, var6, var7);
- } else {
- var8.lastActivityTimestamp = this.tickCounter;
-@@ -149,125 +177,129 @@
- }
- }
- }
--
- }
-
-- private VillageDoorInfo getVillageDoorAt(int var1, int var2, int var3) {
-- Iterator var4 = this.c.iterator();
--
-+ private VillageDoorInfo getVillageDoorAt(int par1, int par2, int par3) {
-+ Iterator var4 = this.newDoors.iterator();
- VillageDoorInfo var5;
-- do {
-- if(!var4.hasNext()) {
-- var4 = this.d.iterator();
-
-+ do {
-+ if (!var4.hasNext()) {
-+ var4 = this.villageList.iterator();
- VillageDoorInfo var6;
-+
- do {
-- if(!var4.hasNext()) {
-+ if (!var4.hasNext()) {
- return null;
- }
-
- Village var7 = (Village)var4.next();
-- var6 = var7.getVillageDoorAt(var1, var2, var3);
-- } while(var6 == null);
-+ var6 = var7.getVillageDoorAt(par1, par2, par3);
-+ } while (var6 == null);
-
- return var6;
- }
-
- var5 = (VillageDoorInfo)var4.next();
-- } while(var5.posX != var1 || var5.posZ != var3 || Math.abs(var5.posY - var2) > 1);
-+ } while (var5.posX != par1 || var5.posZ != par3 || Math.abs(var5.posY - par2) > 1);
-
- return var5;
- }
-
-- private void addDoorToNewListIfAppropriate(int var1, int var2, int var3) {
-- int var4 = ((BlockDoor)Block.doorWood).getDoorOrientation(this.worldObj, var1, var2, var3);
-+ private void addDoorToNewListIfAppropriate(int par1, int par2, int par3) {
-+ int var4 = ((BlockDoor)Block.doorWood).getDoorOrientation(this.worldObj, par1, par2, par3);
- int var5;
- int var6;
-- if(var4 != 0 && var4 != 2) {
-+
-+ if (var4 != 0 && var4 != 2) {
- var5 = 0;
-
-- for(var6 = -5; var6 < 0; ++var6) {
-- if(this.worldObj.canBlockSeeTheSky(var1, var2, var3 + var6)) {
-+ for (var6 = -5; var6 < 0; ++var6) {
-+ if (this.worldObj.canBlockSeeTheSky(par1, par2, par3 + var6)) {
- --var5;
- }
- }
-
-- for(var6 = 1; var6 <= 5; ++var6) {
-- if(this.worldObj.canBlockSeeTheSky(var1, var2, var3 + var6)) {
-+ for (var6 = 1; var6 <= 5; ++var6) {
-+ if (this.worldObj.canBlockSeeTheSky(par1, par2, par3 + var6)) {
- ++var5;
- }
- }
-
-- if(var5 != 0) {
-- this.c.add(new VillageDoorInfo(var1, var2, var3, 0, var5 > 0 ? -2 : 2, this.tickCounter));
-+ if (var5 != 0) {
-+ this.newDoors.add(new VillageDoorInfo(par1, par2, par3, 0, var5 > 0 ? -2 : 2, this.tickCounter));
- }
- } else {
- var5 = 0;
-
-- for(var6 = -5; var6 < 0; ++var6) {
-- if(this.worldObj.canBlockSeeTheSky(var1 + var6, var2, var3)) {
-+ for (var6 = -5; var6 < 0; ++var6) {
-+ if (this.worldObj.canBlockSeeTheSky(par1 + var6, par2, par3)) {
- --var5;
- }
- }
-
-- for(var6 = 1; var6 <= 5; ++var6) {
-- if(this.worldObj.canBlockSeeTheSky(var1 + var6, var2, var3)) {
-+ for (var6 = 1; var6 <= 5; ++var6) {
-+ if (this.worldObj.canBlockSeeTheSky(par1 + var6, par2, par3)) {
- ++var5;
- }
- }
-
-- if(var5 != 0) {
-- this.c.add(new VillageDoorInfo(var1, var2, var3, var5 > 0 ? -2 : 2, 0, this.tickCounter));
-+ if (var5 != 0) {
-+ this.newDoors.add(new VillageDoorInfo(par1, par2, par3, var5 > 0 ? -2 : 2, 0, this.tickCounter));
- }
- }
--
- }
-
-- private boolean isVillagerPositionPresent(int var1, int var2, int var3) {
-- Iterator var4 = this.b.iterator();
--
-+ private boolean isVillagerPositionPresent(int par1, int par2, int par3) {
-+ Iterator var4 = this.villagerPositionsList.iterator();
- ChunkCoordinates var5;
-+
- do {
-- if(!var4.hasNext()) {
-+ if (!var4.hasNext()) {
- return false;
- }
-
- var5 = (ChunkCoordinates)var4.next();
-- } while(var5.posX != var1 || var5.posY != var2 || var5.posZ != var3);
-+ } while (var5.posX != par1 || var5.posY != par2 || var5.posZ != par3);
-
- return true;
- }
-
-- private boolean isWoodenDoorAt(int var1, int var2, int var3) {
-- int var4 = this.worldObj.getBlockId(var1, var2, var3);
-+ private boolean isWoodenDoorAt(int par1, int par2, int par3) {
-+ int var4 = this.worldObj.getBlockId(par1, par2, par3);
- return var4 == Block.doorWood.blockID;
- }
-
-- public void readFromNBT(NBTTagCompound var1) {
-- this.tickCounter = var1.getInteger("Tick");
-- NBTTagList var2 = var1.getTagList("Villages");
-+ /**
-+ * reads in data from the NBTTagCompound into this MapDataBase
-+ */
-+ public void readFromNBT(NBTTagCompound par1NBTTagCompound) {
-+ this.tickCounter = par1NBTTagCompound.getInteger("Tick");
-+ NBTTagList var2 = par1NBTTagCompound.getTagList("Villages");
-
-- for(int var3 = 0; var3 < var2.tagCount(); ++var3) {
-+ for (int var3 = 0; var3 < var2.tagCount(); ++var3) {
- NBTTagCompound var4 = (NBTTagCompound)var2.tagAt(var3);
- Village var5 = new Village();
- var5.readVillageDataFromNBT(var4);
-- this.d.add(var5);
-+ this.villageList.add(var5);
- }
--
- }
-
-- public void writeToNBT(NBTTagCompound var1) {
-- var1.setInteger("Tick", this.tickCounter);
-+ /**
-+ * write data to NBTTagCompound from this MapDataBase, similar to Entities and TileEntities
-+ */
-+ public void writeToNBT(NBTTagCompound par1NBTTagCompound) {
-+ par1NBTTagCompound.setInteger("Tick", this.tickCounter);
- NBTTagList var2 = new NBTTagList("Villages");
-- Iterator var3 = this.d.iterator();
-+ Iterator var3 = this.villageList.iterator();
-
-- while(var3.hasNext()) {
-+ while (var3.hasNext()) {
- Village var4 = (Village)var3.next();
- NBTTagCompound var5 = new NBTTagCompound("Village");
- var4.writeVillageDataToNBT(var5);
- var2.appendTag(var5);
- }
-
-- var1.setTag("Villages", var2);
-+ par1NBTTagCompound.setTag("Villages", var2);
- }
- }
---- net/minecraft/src/WorldGenHugeTrees.java
-+++ net/minecraft/src/WorldGenHugeTrees.java
-@@ -3,40 +3,50 @@
- import java.util.Random;
-
- public class WorldGenHugeTrees extends WorldGenerator {
-+
-+ /** The base height of the tree */
- private final int baseHeight;
-+
-+ /** Sets the metadata for the wood blocks used */
- private final int woodMetadata;
-+
-+ /** Sets the metadata for the leaves used in huge trees */
- private final int leavesMetadata;
-
-- public WorldGenHugeTrees(boolean var1, int var2, int var3, int var4) {
-- super(var1);
-- this.baseHeight = var2;
-- this.woodMetadata = var3;
-- this.leavesMetadata = var4;
-+ public WorldGenHugeTrees(boolean par1, int par2, int par3, int par4) {
-+ super(par1);
-+ this.baseHeight = par2;
-+ this.woodMetadata = par3;
-+ this.leavesMetadata = par4;
- }
-
-- public boolean generate(World var1, Random var2, int var3, int var4, int var5) {
-- int var6 = var2.nextInt(3) + this.baseHeight;
-+ public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5) {
-+ int var6 = par2Random.nextInt(3) + this.baseHeight;
- boolean var7 = true;
-- if(var4 >= 1 && var4 + var6 + 1 <= 256) {
-+
-+ if (par4 >= 1 && par4 + var6 + 1 <= 256) {
- int var8;
- int var10;
- int var11;
- int var12;
-- for(var8 = var4; var8 <= var4 + 1 + var6; ++var8) {
-+
-+ for (var8 = par4; var8 <= par4 + 1 + var6; ++var8) {
- byte var9 = 2;
-- if(var8 == var4) {
-+
-+ if (var8 == par4) {
- var9 = 1;
- }
-
-- if(var8 >= var4 + 1 + var6 - 2) {
-+ if (var8 >= par4 + 1 + var6 - 2) {
- var9 = 2;
- }
-
-- for(var10 = var3 - var9; var10 <= var3 + var9 && var7; ++var10) {
-- for(var11 = var5 - var9; var11 <= var5 + var9 && var7; ++var11) {
-- if(var8 >= 0 && var8 < 256) {
-- var12 = var1.getBlockId(var10, var8, var11);
-- if(var12 != 0 && var12 != Block.leaves.blockID && var12 != Block.grass.blockID && var12 != Block.dirt.blockID && var12 != Block.wood.blockID && var12 != Block.sapling.blockID) {
-+ for (var10 = par3 - var9; var10 <= par3 + var9 && var7; ++var10) {
-+ for (var11 = par5 - var9; var11 <= par5 + var9 && var7; ++var11) {
-+ if (var8 >= 0 && var8 < 256) {
-+ var12 = par1World.getBlockId(var10, var8, var11);
-+
-+ if (var12 != 0 && var12 != Block.leaves.blockID && var12 != Block.grass.blockID && var12 != Block.dirt.blockID && var12 != Block.wood.blockID && var12 != Block.sapling.blockID) {
- var7 = false;
- }
- } else {
-@@ -46,84 +56,93 @@
- }
- }
-
-- if(!var7) {
-+ if (!var7) {
- return false;
- } else {
-- var8 = var1.getBlockId(var3, var4 - 1, var5);
-- if((var8 == Block.grass.blockID || var8 == Block.dirt.blockID) && var4 < 256 - var6 - 1) {
-- var1.setBlock(var3, var4 - 1, var5, Block.dirt.blockID, 0, 2);
-- var1.setBlock(var3 + 1, var4 - 1, var5, Block.dirt.blockID, 0, 2);
-- var1.setBlock(var3, var4 - 1, var5 + 1, Block.dirt.blockID, 0, 2);
-- var1.setBlock(var3 + 1, var4 - 1, var5 + 1, Block.dirt.blockID, 0, 2);
-- this.growLeaves(var1, var3, var5, var4 + var6, 2, var2);
--
-- for(int var14 = var4 + var6 - 2 - var2.nextInt(4); var14 > var4 + var6 / 2; var14 -= 2 + var2.nextInt(4)) {
-- float var15 = var2.nextFloat() * (float)Math.PI * 2.0F;
-- var11 = var3 + (int)(0.5F + MathHelper.cos(var15) * 4.0F);
-- var12 = var5 + (int)(0.5F + MathHelper.sin(var15) * 4.0F);
-- this.growLeaves(var1, var11, var12, var14, 0, var2);
--
-- for(int var13 = 0; var13 < 5; ++var13) {
-- var11 = var3 + (int)(1.5F + MathHelper.cos(var15) * (float)var13);
-- var12 = var5 + (int)(1.5F + MathHelper.sin(var15) * (float)var13);
-- this.setBlockAndMetadata(var1, var11, var14 - 3 + var13 / 2, var12, Block.wood.blockID, this.woodMetadata);
-+ var8 = par1World.getBlockId(par3, par4 - 1, par5);
-+
-+ if ((var8 == Block.grass.blockID || var8 == Block.dirt.blockID) && par4 < 256 - var6 - 1) {
-+ par1World.setBlock(par3, par4 - 1, par5, Block.dirt.blockID, 0, 2);
-+ par1World.setBlock(par3 + 1, par4 - 1, par5, Block.dirt.blockID, 0, 2);
-+ par1World.setBlock(par3, par4 - 1, par5 + 1, Block.dirt.blockID, 0, 2);
-+ par1World.setBlock(par3 + 1, par4 - 1, par5 + 1, Block.dirt.blockID, 0, 2);
-+ this.growLeaves(par1World, par3, par5, par4 + var6, 2, par2Random);
-+
-+ for (int var14 = par4 + var6 - 2 - par2Random.nextInt(4); var14 > par4 + var6 / 2; var14 -= 2 + par2Random.nextInt(4)) {
-+ float var15 = par2Random.nextFloat() * (float)Math.PI * 2.0F;
-+ var11 = par3 + (int)(0.5F + MathHelper.cos(var15) * 4.0F);
-+ var12 = par5 + (int)(0.5F + MathHelper.sin(var15) * 4.0F);
-+ this.growLeaves(par1World, var11, var12, var14, 0, par2Random);
-+
-+ for (int var13 = 0; var13 < 5; ++var13) {
-+ var11 = par3 + (int)(1.5F + MathHelper.cos(var15) * (float)var13);
-+ var12 = par5 + (int)(1.5F + MathHelper.sin(var15) * (float)var13);
-+ this.setBlockAndMetadata(par1World, var11, var14 - 3 + var13 / 2, var12, Block.wood.blockID, this.woodMetadata);
- }
- }
-
-- for(var10 = 0; var10 < var6; ++var10) {
-- var11 = var1.getBlockId(var3, var4 + var10, var5);
-- if(var11 == 0 || var11 == Block.leaves.blockID) {
-- this.setBlockAndMetadata(var1, var3, var4 + var10, var5, Block.wood.blockID, this.woodMetadata);
-- if(var10 > 0) {
-- if(var2.nextInt(3) > 0 && var1.isAirBlock(var3 - 1, var4 + var10, var5)) {
-- this.setBlockAndMetadata(var1, var3 - 1, var4 + var10, var5, Block.vine.blockID, 8);
-+ for (var10 = 0; var10 < var6; ++var10) {
-+ var11 = par1World.getBlockId(par3, par4 + var10, par5);
-+
-+ if (var11 == 0 || var11 == Block.leaves.blockID) {
-+ this.setBlockAndMetadata(par1World, par3, par4 + var10, par5, Block.wood.blockID, this.woodMetadata);
-+
-+ if (var10 > 0) {
-+ if (par2Random.nextInt(3) > 0 && par1World.isAirBlock(par3 - 1, par4 + var10, par5)) {
-+ this.setBlockAndMetadata(par1World, par3 - 1, par4 + var10, par5, Block.vine.blockID, 8);
- }
-
-- if(var2.nextInt(3) > 0 && var1.isAirBlock(var3, var4 + var10, var5 - 1)) {
-- this.setBlockAndMetadata(var1, var3, var4 + var10, var5 - 1, Block.vine.blockID, 1);
-+ if (par2Random.nextInt(3) > 0 && par1World.isAirBlock(par3, par4 + var10, par5 - 1)) {
-+ this.setBlockAndMetadata(par1World, par3, par4 + var10, par5 - 1, Block.vine.blockID, 1);
- }
- }
- }
-
-- if(var10 < var6 - 1) {
-- var11 = var1.getBlockId(var3 + 1, var4 + var10, var5);
-- if(var11 == 0 || var11 == Block.leaves.blockID) {
-- this.setBlockAndMetadata(var1, var3 + 1, var4 + var10, var5, Block.wood.blockID, this.woodMetadata);
-- if(var10 > 0) {
-- if(var2.nextInt(3) > 0 && var1.isAirBlock(var3 + 2, var4 + var10, var5)) {
-- this.setBlockAndMetadata(var1, var3 + 2, var4 + var10, var5, Block.vine.blockID, 2);
-- }
--
-- if(var2.nextInt(3) > 0 && var1.isAirBlock(var3 + 1, var4 + var10, var5 - 1)) {
-- this.setBlockAndMetadata(var1, var3 + 1, var4 + var10, var5 - 1, Block.vine.blockID, 1);
-- }
-- }
-- }
--
-- var11 = var1.getBlockId(var3 + 1, var4 + var10, var5 + 1);
-- if(var11 == 0 || var11 == Block.leaves.blockID) {
-- this.setBlockAndMetadata(var1, var3 + 1, var4 + var10, var5 + 1, Block.wood.blockID, this.woodMetadata);
-- if(var10 > 0) {
-- if(var2.nextInt(3) > 0 && var1.isAirBlock(var3 + 2, var4 + var10, var5 + 1)) {
-- this.setBlockAndMetadata(var1, var3 + 2, var4 + var10, var5 + 1, Block.vine.blockID, 2);
-- }
--
-- if(var2.nextInt(3) > 0 && var1.isAirBlock(var3 + 1, var4 + var10, var5 + 2)) {
-- this.setBlockAndMetadata(var1, var3 + 1, var4 + var10, var5 + 2, Block.vine.blockID, 4);
-- }
-- }
-- }
--
-- var11 = var1.getBlockId(var3, var4 + var10, var5 + 1);
-- if(var11 == 0 || var11 == Block.leaves.blockID) {
-- this.setBlockAndMetadata(var1, var3, var4 + var10, var5 + 1, Block.wood.blockID, this.woodMetadata);
-- if(var10 > 0) {
-- if(var2.nextInt(3) > 0 && var1.isAirBlock(var3 - 1, var4 + var10, var5 + 1)) {
-- this.setBlockAndMetadata(var1, var3 - 1, var4 + var10, var5 + 1, Block.vine.blockID, 8);
-- }
--
-- if(var2.nextInt(3) > 0 && var1.isAirBlock(var3, var4 + var10, var5 + 2)) {
-- this.setBlockAndMetadata(var1, var3, var4 + var10, var5 + 2, Block.vine.blockID, 4);
-+ if (var10 < var6 - 1) {
-+ var11 = par1World.getBlockId(par3 + 1, par4 + var10, par5);
-+
-+ if (var11 == 0 || var11 == Block.leaves.blockID) {
-+ this.setBlockAndMetadata(par1World, par3 + 1, par4 + var10, par5, Block.wood.blockID, this.woodMetadata);
-+
-+ if (var10 > 0) {
-+ if (par2Random.nextInt(3) > 0 && par1World.isAirBlock(par3 + 2, par4 + var10, par5)) {
-+ this.setBlockAndMetadata(par1World, par3 + 2, par4 + var10, par5, Block.vine.blockID, 2);
-+ }
-+
-+ if (par2Random.nextInt(3) > 0 && par1World.isAirBlock(par3 + 1, par4 + var10, par5 - 1)) {
-+ this.setBlockAndMetadata(par1World, par3 + 1, par4 + var10, par5 - 1, Block.vine.blockID, 1);
-+ }
-+ }
-+ }
-+
-+ var11 = par1World.getBlockId(par3 + 1, par4 + var10, par5 + 1);
-+
-+ if (var11 == 0 || var11 == Block.leaves.blockID) {
-+ this.setBlockAndMetadata(par1World, par3 + 1, par4 + var10, par5 + 1, Block.wood.blockID, this.woodMetadata);
-+
-+ if (var10 > 0) {
-+ if (par2Random.nextInt(3) > 0 && par1World.isAirBlock(par3 + 2, par4 + var10, par5 + 1)) {
-+ this.setBlockAndMetadata(par1World, par3 + 2, par4 + var10, par5 + 1, Block.vine.blockID, 2);
-+ }
-+
-+ if (par2Random.nextInt(3) > 0 && par1World.isAirBlock(par3 + 1, par4 + var10, par5 + 2)) {
-+ this.setBlockAndMetadata(par1World, par3 + 1, par4 + var10, par5 + 2, Block.vine.blockID, 4);
-+ }
-+ }
-+ }
-+
-+ var11 = par1World.getBlockId(par3, par4 + var10, par5 + 1);
-+
-+ if (var11 == 0 || var11 == Block.leaves.blockID) {
-+ this.setBlockAndMetadata(par1World, par3, par4 + var10, par5 + 1, Block.wood.blockID, this.woodMetadata);
-+
-+ if (var10 > 0) {
-+ if (par2Random.nextInt(3) > 0 && par1World.isAirBlock(par3 - 1, par4 + var10, par5 + 1)) {
-+ this.setBlockAndMetadata(par1World, par3 - 1, par4 + var10, par5 + 1, Block.vine.blockID, 8);
-+ }
-+
-+ if (par2Random.nextInt(3) > 0 && par1World.isAirBlock(par3, par4 + var10, par5 + 2)) {
-+ this.setBlockAndMetadata(par1World, par3, par4 + var10, par5 + 2, Block.vine.blockID, 4);
- }
- }
- }
-@@ -140,27 +159,28 @@
- }
- }
-
-- private void growLeaves(World var1, int var2, int var3, int var4, int var5, Random var6) {
-+ private void growLeaves(World par1World, int par2, int par3, int par4, int par5, Random par6Random) {
- byte var7 = 2;
-
-- for(int var8 = var4 - var7; var8 <= var4; ++var8) {
-- int var9 = var8 - var4;
-- int var10 = var5 + 1 - var9;
--
-- for(int var11 = var2 - var10; var11 <= var2 + var10 + 1; ++var11) {
-- int var12 = var11 - var2;
--
-- for(int var13 = var3 - var10; var13 <= var3 + var10 + 1; ++var13) {
-- int var14 = var13 - var3;
-- if((var12 >= 0 || var14 >= 0 || var12 * var12 + var14 * var14 <= var10 * var10) && (var12 <= 0 && var14 <= 0 || var12 * var12 + var14 * var14 <= (var10 + 1) * (var10 + 1)) && (var6.nextInt(4) != 0 || var12 * var12 + var14 * var14 <= (var10 - 1) * (var10 - 1))) {
-- int var15 = var1.getBlockId(var11, var8, var13);
-- if(var15 == 0 || var15 == Block.leaves.blockID) {
-- this.setBlockAndMetadata(var1, var11, var8, var13, Block.leaves.blockID, this.leavesMetadata);
-+ for (int var8 = par4 - var7; var8 <= par4; ++var8) {
-+ int var9 = var8 - par4;
-+ int var10 = par5 + 1 - var9;
-+
-+ for (int var11 = par2 - var10; var11 <= par2 + var10 + 1; ++var11) {
-+ int var12 = var11 - par2;
-+
-+ for (int var13 = par3 - var10; var13 <= par3 + var10 + 1; ++var13) {
-+ int var14 = var13 - par3;
-+
-+ if ((var12 >= 0 || var14 >= 0 || var12 * var12 + var14 * var14 <= var10 * var10) && (var12 <= 0 && var14 <= 0 || var12 * var12 + var14 * var14 <= (var10 + 1) * (var10 + 1)) && (par6Random.nextInt(4) != 0 || var12 * var12 + var14 * var14 <= (var10 - 1) * (var10 - 1))) {
-+ int var15 = par1World.getBlockId(var11, var8, var13);
-+
-+ if (var15 == 0 || var15 == Block.leaves.blockID) {
-+ this.setBlockAndMetadata(par1World, var11, var8, var13, Block.leaves.blockID, this.leavesMetadata);
- }
- }
- }
- }
- }
--
- }
- }
---- net/minecraft/src/TextureOffset.java
-+++ net/minecraft/src/TextureOffset.java
-@@ -1,11 +1,15 @@
- package net.minecraft.src;
-
- public class TextureOffset {
-+
-+ /** The x coordinate offset of the texture */
- public final int textureOffsetX;
-+
-+ /** The y coordinate offset of the texture */
- public final int textureOffsetY;
-
-- public TextureOffset(int var1, int var2) {
-- this.textureOffsetX = var1;
-- this.textureOffsetY = var2;
-+ public TextureOffset(int par1, int par2) {
-+ this.textureOffsetX = par1;
-+ this.textureOffsetY = par2;
- }
- }
---- net/minecraft/src/CommandEffect.java
-+++ net/minecraft/src/CommandEffect.java
-@@ -8,76 +8,87 @@
- return "effect";
- }
-
-+ /**
-+ * Return the required permission level for this command.
-+ */
- public int getRequiredPermissionLevel() {
- return 2;
- }
-
-- public String getCommandUsage(ICommandSender var1) {
-+ public String getCommandUsage(ICommandSender par1ICommandSender) {
- return "commands.effect.usage";
- }
-
-- public void processCommand(ICommandSender var1, String[] var2) {
-- if(var2.length < 2) {
-+ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) {
-+ if (par2ArrayOfStr.length < 2) {
- throw new WrongUsageException("commands.effect.usage", new Object[0]);
- } else {
-- EntityPlayerMP var3 = getPlayer(var1, var2[0]);
-- if(var2[1].equals("clear")) {
-- if(var3.getActivePotionEffects().isEmpty()) {
-- throw new CommandException("commands.effect.failure.notActive.all", new Object[]{var3.getEntityName()});
-+ EntityPlayerMP var3 = getPlayer(par1ICommandSender, par2ArrayOfStr[0]);
-+
-+ if (par2ArrayOfStr[1].equals("clear")) {
-+ if (var3.getActivePotionEffects().isEmpty()) {
-+ throw new CommandException("commands.effect.failure.notActive.all", new Object[] {var3.getEntityName()});
- }
-
- var3.clearActivePotions();
-- notifyAdmins(var1, "commands.effect.success.removed.all", new Object[]{var3.getEntityName()});
-+ notifyAdmins(par1ICommandSender, "commands.effect.success.removed.all", new Object[] {var3.getEntityName()});
- } else {
-- int var4 = parseIntWithMin(var1, var2[1], 1);
-+ int var4 = parseIntWithMin(par1ICommandSender, par2ArrayOfStr[1], 1);
- int var5 = 600;
- int var6 = 30;
- int var7 = 0;
-- if(var4 < 0 || var4 >= Potion.potionTypes.length || Potion.potionTypes[var4] == null) {
-- throw new NumberInvalidException("commands.effect.notFound", new Object[]{Integer.valueOf(var4)});
-+
-+ if (var4 < 0 || var4 >= Potion.potionTypes.length || Potion.potionTypes[var4] == null) {
-+ throw new NumberInvalidException("commands.effect.notFound", new Object[] {Integer.valueOf(var4)});
- }
-
-- if(var2.length >= 3) {
-- var6 = parseIntBounded(var1, var2[2], 0, 1000000);
-- if(Potion.potionTypes[var4].isInstant()) {
-+ if (par2ArrayOfStr.length >= 3) {
-+ var6 = parseIntBounded(par1ICommandSender, par2ArrayOfStr[2], 0, 1000000);
-+
-+ if (Potion.potionTypes[var4].isInstant()) {
- var5 = var6;
- } else {
- var5 = var6 * 20;
- }
-- } else if(Potion.potionTypes[var4].isInstant()) {
-+ } else if (Potion.potionTypes[var4].isInstant()) {
- var5 = 1;
- }
-
-- if(var2.length >= 4) {
-- var7 = parseIntBounded(var1, var2[3], 0, 255);
-+ if (par2ArrayOfStr.length >= 4) {
-+ var7 = parseIntBounded(par1ICommandSender, par2ArrayOfStr[3], 0, 255);
- }
-
-- if(var6 == 0) {
-- if(!var3.isPotionActive(var4)) {
-- throw new CommandException("commands.effect.failure.notActive", new Object[]{ChatMessageComponent.createFromTranslationKey(Potion.potionTypes[var4].getName()), var3.getEntityName()});
-+ if (var6 == 0) {
-+ if (!var3.isPotionActive(var4)) {
-+ throw new CommandException("commands.effect.failure.notActive", new Object[] {ChatMessageComponent.createFromTranslationKey(Potion.potionTypes[var4].getName()), var3.getEntityName()});
- }
-
- var3.removePotionEffect(var4);
-- notifyAdmins(var1, "commands.effect.success.removed", new Object[]{ChatMessageComponent.createFromTranslationKey(Potion.potionTypes[var4].getName()), var3.getEntityName()});
-+ notifyAdmins(par1ICommandSender, "commands.effect.success.removed", new Object[] {ChatMessageComponent.createFromTranslationKey(Potion.potionTypes[var4].getName()), var3.getEntityName()});
- } else {
- PotionEffect var8 = new PotionEffect(var4, var5, var7);
- var3.addPotionEffect(var8);
-- notifyAdmins(var1, "commands.effect.success", new Object[]{ChatMessageComponent.createFromTranslationKey(var8.getEffectName()), Integer.valueOf(var4), Integer.valueOf(var7), var3.getEntityName(), Integer.valueOf(var6)});
-+ notifyAdmins(par1ICommandSender, "commands.effect.success", new Object[] {ChatMessageComponent.createFromTranslationKey(var8.getEffectName()), Integer.valueOf(var4), Integer.valueOf(var7), var3.getEntityName(), Integer.valueOf(var6)});
- }
- }
--
- }
- }
-
-- public List addTabCompletionOptions(ICommandSender var1, String[] var2) {
-- return var2.length == 1 ? getListOfStringsMatchingLastWord(var2, this.getAllUsernames()) : null;
-+ /**
-+ * Adds the strings available in this command to the given list of tab completion options.
-+ */
-+ public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) {
-+ return par2ArrayOfStr.length == 1 ? getListOfStringsMatchingLastWord(par2ArrayOfStr, this.getAllUsernames()) : null;
- }
-
- protected String[] getAllUsernames() {
- return MinecraftServer.getServer().getAllUsernames();
- }
-
-- public boolean isUsernameIndex(String[] var1, int var2) {
-- return var2 == 0;
-+ /**
-+ * Return whether the specified command parameter index is a username parameter.
-+ */
-+ public boolean isUsernameIndex(String[] par1ArrayOfStr, int par2) {
-+ return par2 == 0;
- }
- }
---- net/minecraft/src/EntityFireworkOverlayFX.java
-+++ net/minecraft/src/EntityFireworkOverlayFX.java
-@@ -1,25 +1,25 @@
- package net.minecraft.src;
-
- public class EntityFireworkOverlayFX extends EntityFX {
-- protected EntityFireworkOverlayFX(World var1, double var2, double var4, double var6) {
-- super(var1, var2, var4, var6);
-+ protected EntityFireworkOverlayFX(World par1World, double par2, double par4, double par6) {
-+ super(par1World, par2, par4, par6);
- this.particleMaxAge = 4;
- }
-
-- public void renderParticle(Tessellator var1, float var2, float var3, float var4, float var5, float var6, float var7) {
-+ 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 = 2.0F / 16.0F;
-+ float var10 = 0.125F;
- float var11 = var10 + 0.25F;
-- float var12 = 7.1F * MathHelper.sin(((float)this.particleAge + var2 - 1.0F) * 0.25F * (float)Math.PI);
-- this.particleAlpha = 0.6F - ((float)this.particleAge + var2 - 1.0F) * 0.25F * 0.5F;
-- float var13 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)var2 - interpPosX);
-- float var14 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)var2 - interpPosY);
-- float var15 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)var2 - interpPosZ);
-- var1.setColorRGBA_F(this.particleRed, this.particleGreen, this.particleBlue, this.particleAlpha);
-- var1.addVertexWithUV((double)(var13 - var3 * var12 - var6 * var12), (double)(var14 - var4 * var12), (double)(var15 - var5 * var12 - var7 * var12), (double)var9, (double)var11);
-- var1.addVertexWithUV((double)(var13 - var3 * var12 + var6 * var12), (double)(var14 + var4 * var12), (double)(var15 - var5 * var12 + var7 * var12), (double)var9, (double)var10);
-- var1.addVertexWithUV((double)(var13 + var3 * var12 + var6 * var12), (double)(var14 + var4 * var12), (double)(var15 + var5 * var12 + var7 * var12), (double)var8, (double)var10);
-- var1.addVertexWithUV((double)(var13 + var3 * var12 - var6 * var12), (double)(var14 - var4 * var12), (double)(var15 + var5 * var12 - var7 * var12), (double)var8, (double)var11);
-+ 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);
- }
- }
---- net/minecraft/src/EnchantmentKnockback.java
-+++ net/minecraft/src/EnchantmentKnockback.java
-@@ -1,19 +1,28 @@
- package net.minecraft.src;
-
- public class EnchantmentKnockback extends Enchantment {
-- protected EnchantmentKnockback(int var1, int var2) {
-- super(var1, var2, EnumEnchantmentType.weapon);
-+ protected EnchantmentKnockback(int par1, int par2) {
-+ super(par1, par2, EnumEnchantmentType.weapon);
- this.setName("knockback");
- }
-
-- public int getMinEnchantability(int var1) {
-- return 5 + 20 * (var1 - 1);
-- }
--
-- public int getMaxEnchantability(int var1) {
-- return super.getMinEnchantability(var1) + 50;
-- }
--
-+ /**
-+ * Returns the minimal value of enchantability needed on the enchantment level passed.
-+ */
-+ public int getMinEnchantability(int par1) {
-+ return 5 + 20 * (par1 - 1);
-+ }
-+
-+ /**
-+ * Returns the maximum value of enchantability nedded on the enchantment level passed.
-+ */
-+ public int getMaxEnchantability(int par1) {
-+ return super.getMinEnchantability(par1) + 50;
-+ }
-+
-+ /**
-+ * Returns the maximum level that the enchantment can have.
-+ */
- public int getMaxLevel() {
- return 2;
- }
---- net/minecraft/src/TextureCompass.java
-+++ net/minecraft/src/TextureCompass.java
-@@ -1,53 +1,64 @@
- package net.minecraft.src;
-
- public class TextureCompass extends TextureAtlasSprite {
-+
-+ /** Current compass heading in radians */
- public double currentAngle;
-+
-+ /** Speed and direction of compass rotation */
- public double angleDelta;
-
-- public TextureCompass(String var1) {
-- super(var1);
-+ public TextureCompass(String par1Str) {
-+ super(par1Str);
- }
-
- public void updateAnimation() {
- Minecraft var1 = Minecraft.getMinecraft();
-- if(var1.theWorld != null && var1.thePlayer != null) {
-+
-+ if (var1.theWorld != null && var1.thePlayer != null) {
- this.updateCompass(var1.theWorld, var1.thePlayer.posX, var1.thePlayer.posZ, (double)var1.thePlayer.rotationYaw, false, false);
- } else {
- this.updateCompass((World)null, 0.0D, 0.0D, 0.0D, true, false);
- }
--
- }
-
-- public void updateCompass(World var1, double var2, double var4, double var6, boolean var8, boolean var9) {
-- if(!this.a.isEmpty()) {
-+ /**
-+ * Updates the compass based on the given x,z coords and camera direction
-+ */
-+ public void updateCompass(World par1World, double par2, double par4, double par6, boolean par8, boolean par9) {
-+ if (!this.framesTextureData.isEmpty()) {
- double var10 = 0.0D;
-- if(var1 != null && !var8) {
-- ChunkCoordinates var12 = var1.getSpawnPoint();
-- double var13 = (double)var12.posX - var2;
-- double var15 = (double)var12.posZ - var4;
-- var6 %= 360.0D;
-- var10 = -((var6 - 90.0D) * Math.PI / 180.0D - Math.atan2(var15, var13));
-- if(!var1.provider.isSurfaceWorld()) {
-- var10 = Math.random() * (double)((float)Math.PI) * 2.0D;
-+
-+ if (par1World != null && !par8) {
-+ ChunkCoordinates var12 = par1World.getSpawnPoint();
-+ double var13 = (double)var12.posX - par2;
-+ double var15 = (double)var12.posZ - par4;
-+ par6 %= 360.0D;
-+ var10 = -((par6 - 90.0D) * Math.PI / 180.0D - Math.atan2(var15, var13));
-+
-+ if (!par1World.provider.isSurfaceWorld()) {
-+ var10 = Math.random() * Math.PI * 2.0D;
- }
- }
-
-- if(var9) {
-+ if (par9) {
- this.currentAngle = var10;
- } else {
- double var17;
-- for(var17 = var10 - this.currentAngle; var17 < -Math.PI; var17 += Math.PI * 2.0D) {
-- }
--
-- while(var17 >= Math.PI) {
-- var17 -= Math.PI * 2.0D;
-- }
--
-- if(var17 < -1.0D) {
-+
-+ for (var17 = var10 - this.currentAngle; var17 < -Math.PI; var17 += (Math.PI * 2D)) {
-+ ;
-+ }
-+
-+ while (var17 >= Math.PI) {
-+ var17 -= (Math.PI * 2D);
-+ }
-+
-+ if (var17 < -1.0D) {
- var17 = -1.0D;
- }
-
-- if(var17 > 1.0D) {
-+ if (var17 > 1.0D) {
- var17 = 1.0D;
- }
-
-@@ -57,14 +68,15 @@
- }
-
- int var18;
-- for(var18 = (int)((this.currentAngle / (Math.PI * 2.0D) + 1.0D) * (double)this.a.size()) % this.a.size(); var18 < 0; var18 = (var18 + this.a.size()) % this.a.size()) {
-+
-+ for (var18 = (int)((this.currentAngle / (Math.PI * 2D) + 1.0D) * (double)this.framesTextureData.size()) % this.framesTextureData.size(); var18 < 0; var18 = (var18 + this.framesTextureData.size()) % this.framesTextureData.size()) {
-+ ;
- }
-
-- if(var18 != this.frameCounter) {
-+ if (var18 != this.frameCounter) {
- this.frameCounter = var18;
-- TextureUtil.uploadTextureSub((int[])this.a.get(this.frameCounter), this.width, this.height, this.originX, this.originY, false, false);
-+ TextureUtil.uploadTextureSub((int[])this.framesTextureData.get(this.frameCounter), this.width, this.height, this.originX, this.originY, false, false);
- }
--
- }
- }
- }
---- net/minecraft/src/Teleporter.java
-+++ net/minecraft/src/Teleporter.java
-@@ -7,31 +7,43 @@
-
- public class Teleporter {
- private final WorldServer worldServerInstance;
-- private final Random b;
-+
-+ /** A private Random() function in Teleporter */
-+ private final Random random;
-+
-+ /** Stores successful portal placement locations for rapid lookup. */
- private final LongHashMap destinationCoordinateCache = new LongHashMap();
-- private final List d = new ArrayList();
--
-- public Teleporter(WorldServer var1) {
-- this.worldServerInstance = var1;
-- this.b = new Random(var1.getSeed());
-+
-+ /**
-+ * A list of valid keys for the destinationCoordainteCache. These are based on the X & Z of the players initial
-+ * location.
-+ */
-+ private final List destinationCoordinateKeys = new ArrayList();
-+
-+ public Teleporter(WorldServer par1WorldServer) {
-+ this.worldServerInstance = par1WorldServer;
-+ this.random = new Random(par1WorldServer.getSeed());
- }
-
-- public void placeInPortal(Entity var1, double var2, double var4, double var6, float var8) {
-- if(this.worldServerInstance.provider.dimensionId != 1) {
-- if(!this.placeInExistingPortal(var1, var2, var4, var6, var8)) {
-- this.makePortal(var1);
-- this.placeInExistingPortal(var1, var2, var4, var6, var8);
-+ /**
-+ * Place an entity in a nearby portal, creating one if necessary.
-+ */
-+ public void placeInPortal(Entity par1Entity, double par2, double par4, double par6, float par8) {
-+ if (this.worldServerInstance.provider.dimensionId != 1) {
-+ if (!this.placeInExistingPortal(par1Entity, par2, par4, par6, par8)) {
-+ this.makePortal(par1Entity);
-+ this.placeInExistingPortal(par1Entity, par2, par4, par6, par8);
- }
- } else {
-- int var9 = MathHelper.floor_double(var1.posX);
-- int var10 = MathHelper.floor_double(var1.posY) - 1;
-- int var11 = MathHelper.floor_double(var1.posZ);
-+ int var9 = MathHelper.floor_double(par1Entity.posX);
-+ int var10 = MathHelper.floor_double(par1Entity.posY) - 1;
-+ int var11 = MathHelper.floor_double(par1Entity.posZ);
- byte var12 = 1;
- byte var13 = 0;
-
-- for(int var14 = -2; var14 <= 2; ++var14) {
-- for(int var15 = -2; var15 <= 2; ++var15) {
-- for(int var16 = -1; var16 < 3; ++var16) {
-+ for (int var14 = -2; var14 <= 2; ++var14) {
-+ for (int var15 = -2; var15 <= 2; ++var15) {
-+ for (int var16 = -1; var16 < 3; ++var16) {
- int var17 = var9 + var15 * var12 + var14 * var13;
- int var18 = var10 + var16;
- int var19 = var11 + var15 * var13 - var14 * var12;
-@@ -41,24 +53,28 @@
- }
- }
-
-- var1.setLocationAndAngles((double)var9, (double)var10, (double)var11, var1.rotationYaw, 0.0F);
-- var1.motionX = var1.motionY = var1.motionZ = 0.0D;
-+ par1Entity.setLocationAndAngles((double)var9, (double)var10, (double)var11, par1Entity.rotationYaw, 0.0F);
-+ par1Entity.motionX = par1Entity.motionY = par1Entity.motionZ = 0.0D;
- }
- }
-
-- public boolean placeInExistingPortal(Entity var1, double var2, double var4, double var6, float var8) {
-+ /**
-+ * Place an entity in a nearby portal which already exists.
-+ */
-+ public boolean placeInExistingPortal(Entity par1Entity, double par2, double par4, double par6, float par8) {
- short var9 = 128;
- double var10 = -1.0D;
- int var12 = 0;
- int var13 = 0;
- int var14 = 0;
-- int var15 = MathHelper.floor_double(var1.posX);
-- int var16 = MathHelper.floor_double(var1.posZ);
-+ int var15 = MathHelper.floor_double(par1Entity.posX);
-+ int var16 = MathHelper.floor_double(par1Entity.posZ);
- long var17 = ChunkCoordIntPair.chunkXZ2Int(var15, var16);
- boolean var19 = true;
- double var27;
- int var48;
-- if(this.destinationCoordinateCache.containsItem(var17)) {
-+
-+ if (this.destinationCoordinateCache.containsItem(var17)) {
- PortalPosition var20 = (PortalPosition)this.destinationCoordinateCache.getValueByKey(var17);
- var10 = 0.0D;
- var12 = var20.posX;
-@@ -67,21 +83,22 @@
- var20.lastUpdateTime = this.worldServerInstance.getTotalWorldTime();
- var19 = false;
- } else {
-- for(var48 = var15 - var9; var48 <= var15 + var9; ++var48) {
-- double var21 = (double)var48 + 0.5D - var1.posX;
--
-- for(int var23 = var16 - var9; var23 <= var16 + var9; ++var23) {
-- double var24 = (double)var23 + 0.5D - var1.posZ;
--
-- for(int var26 = this.worldServerInstance.getActualHeight() - 1; var26 >= 0; --var26) {
-- if(this.worldServerInstance.getBlockId(var48, var26, var23) == Block.portal.blockID) {
-- while(this.worldServerInstance.getBlockId(var48, var26 - 1, var23) == Block.portal.blockID) {
-+ for (var48 = var15 - var9; var48 <= var15 + var9; ++var48) {
-+ double var21 = (double)var48 + 0.5D - par1Entity.posX;
-+
-+ for (int var23 = var16 - var9; var23 <= var16 + var9; ++var23) {
-+ double var24 = (double)var23 + 0.5D - par1Entity.posZ;
-+
-+ for (int var26 = this.worldServerInstance.getActualHeight() - 1; var26 >= 0; --var26) {
-+ if (this.worldServerInstance.getBlockId(var48, var26, var23) == Block.portal.blockID) {
-+ while (this.worldServerInstance.getBlockId(var48, var26 - 1, var23) == Block.portal.blockID) {
- --var26;
- }
-
-- var27 = (double)var26 + 0.5D - var1.posY;
-+ var27 = (double)var26 + 0.5D - par1Entity.posY;
- double var29 = var21 * var21 + var27 * var27 + var24 * var24;
-- if(var10 < 0.0D || var29 < var10) {
-+
-+ if (var10 < 0.0D || var29 < var10) {
- var10 = var29;
- var12 = var48;
- var13 = var26;
-@@ -93,34 +110,36 @@
- }
- }
-
-- if(var10 >= 0.0D) {
-- if(var19) {
-+ if (var10 >= 0.0D) {
-+ if (var19) {
- this.destinationCoordinateCache.add(var17, new PortalPosition(this, var12, var13, var14, this.worldServerInstance.getTotalWorldTime()));
-- this.d.add(Long.valueOf(var17));
-+ this.destinationCoordinateKeys.add(Long.valueOf(var17));
- }
-
- double var49 = (double)var12 + 0.5D;
- double var25 = (double)var13 + 0.5D;
- var27 = (double)var14 + 0.5D;
- int var50 = -1;
-- if(this.worldServerInstance.getBlockId(var12 - 1, var13, var14) == Block.portal.blockID) {
-+
-+ if (this.worldServerInstance.getBlockId(var12 - 1, var13, var14) == Block.portal.blockID) {
- var50 = 2;
- }
-
-- if(this.worldServerInstance.getBlockId(var12 + 1, var13, var14) == Block.portal.blockID) {
-+ if (this.worldServerInstance.getBlockId(var12 + 1, var13, var14) == Block.portal.blockID) {
- var50 = 0;
- }
-
-- if(this.worldServerInstance.getBlockId(var12, var13, var14 - 1) == Block.portal.blockID) {
-+ if (this.worldServerInstance.getBlockId(var12, var13, var14 - 1) == Block.portal.blockID) {
- var50 = 3;
- }
-
-- if(this.worldServerInstance.getBlockId(var12, var13, var14 + 1) == Block.portal.blockID) {
-+ if (this.worldServerInstance.getBlockId(var12, var13, var14 + 1) == Block.portal.blockID) {
- var50 = 1;
- }
-
-- int var30 = var1.getTeleportDirection();
-- if(var50 > -1) {
-+ int var30 = par1Entity.getTeleportDirection();
-+
-+ if (var50 > -1) {
- int var31 = Direction.rotateLeft[var50];
- int var32 = Direction.offsetX[var50];
- int var33 = Direction.offsetZ[var50];
-@@ -128,7 +147,8 @@
- int var35 = Direction.offsetZ[var31];
- boolean var36 = !this.worldServerInstance.isAirBlock(var12 + var32 + var34, var13, var14 + var33 + var35) || !this.worldServerInstance.isAirBlock(var12 + var32 + var34, var13 + 1, var14 + var33 + var35);
- boolean var37 = !this.worldServerInstance.isAirBlock(var12 + var32, var13, var14 + var33) || !this.worldServerInstance.isAirBlock(var12 + var32, var13 + 1, var14 + var33);
-- if(var36 && var37) {
-+
-+ if (var36 && var37) {
- var50 = Direction.rotateOpposite[var50];
- var31 = Direction.rotateOpposite[var31];
- var32 = Direction.offsetX[var50];
-@@ -145,11 +165,12 @@
-
- float var38 = 0.5F;
- float var39 = 0.5F;
-- if(!var36 && var37) {
-+
-+ if (!var36 && var37) {
- var38 = 1.0F;
-- } else if(var36 && !var37) {
-+ } else if (var36 && !var37) {
- var38 = 0.0F;
-- } else if(var36 && var37) {
-+ } else if (var36 && var37) {
- var39 = 0.0F;
- }
-
-@@ -159,13 +180,14 @@
- float var41 = 0.0F;
- float var42 = 0.0F;
- float var43 = 0.0F;
-- if(var50 == var30) {
-+
-+ if (var50 == var30) {
- var40 = 1.0F;
- var41 = 1.0F;
-- } else if(var50 == Direction.rotateOpposite[var30]) {
-+ } else if (var50 == Direction.rotateOpposite[var30]) {
- var40 = -1.0F;
- var41 = -1.0F;
-- } else if(var50 == Direction.enderEyeMetaToDirection[var30]) {
-+ } else if (var50 == Direction.rotateRight[var30]) {
- var42 = 1.0F;
- var43 = -1.0F;
- } else {
-@@ -173,34 +195,33 @@
- var43 = 1.0F;
- }
-
-- double var44 = var1.motionX;
-- double var46 = var1.motionZ;
-- var1.motionX = var44 * (double)var40 + var46 * (double)var43;
-- var1.motionZ = var44 * (double)var42 + var46 * (double)var41;
-- var1.rotationYaw = var8 - (float)(var30 * 90) + (float)(var50 * 90);
-+ double var44 = par1Entity.motionX;
-+ double var46 = par1Entity.motionZ;
-+ par1Entity.motionX = var44 * (double)var40 + var46 * (double)var43;
-+ par1Entity.motionZ = var44 * (double)var42 + var46 * (double)var41;
-+ par1Entity.rotationYaw = par8 - (float)(var30 * 90) + (float)(var50 * 90);
- } else {
-- var1.motionX = var1.motionY = var1.motionZ = 0.0D;
-+ par1Entity.motionX = par1Entity.motionY = par1Entity.motionZ = 0.0D;
- }
-
-- var1.setLocationAndAngles(var49, var25, var27, var1.rotationYaw, var1.rotationPitch);
-+ par1Entity.setLocationAndAngles(var49, var25, var27, par1Entity.rotationYaw, par1Entity.rotationPitch);
- return true;
- } else {
- return false;
- }
- }
-
-- public boolean makePortal(Entity var1) {
-+ public boolean makePortal(Entity par1Entity) {
- byte var2 = 16;
- double var3 = -1.0D;
-- int var5 = MathHelper.floor_double(var1.posX);
-- int var6 = MathHelper.floor_double(var1.posY);
-- int var7 = MathHelper.floor_double(var1.posZ);
-+ int var5 = MathHelper.floor_double(par1Entity.posX);
-+ int var6 = MathHelper.floor_double(par1Entity.posY);
-+ int var7 = MathHelper.floor_double(par1Entity.posZ);
- int var8 = var5;
- int var9 = var6;
- int var10 = var7;
- int var11 = 0;
-- int var12 = this.b.nextInt(4);
--
-+ int var12 = this.random.nextInt(4);
- int var13;
- double var14;
- int var16;
-@@ -216,43 +237,47 @@
- int var27;
- double var31;
- double var32;
-- for(var13 = var5 - var2; var13 <= var5 + var2; ++var13) {
-- var14 = (double)var13 + 0.5D - var1.posX;
--
-- for(var16 = var7 - var2; var16 <= var7 + var2; ++var16) {
-- var17 = (double)var16 + 0.5D - var1.posZ;
--
-- label296:
-- for(var19 = this.worldServerInstance.getActualHeight() - 1; var19 >= 0; --var19) {
-- if(this.worldServerInstance.isAirBlock(var13, var19, var16)) {
-- while(var19 > 0 && this.worldServerInstance.isAirBlock(var13, var19 - 1, var16)) {
-+
-+ for (var13 = var5 - var2; var13 <= var5 + var2; ++var13) {
-+ var14 = (double)var13 + 0.5D - par1Entity.posX;
-+
-+ for (var16 = var7 - var2; var16 <= var7 + var2; ++var16) {
-+ var17 = (double)var16 + 0.5D - par1Entity.posZ;
-+ label274:
-+
-+ for (var19 = this.worldServerInstance.getActualHeight() - 1; var19 >= 0; --var19) {
-+ if (this.worldServerInstance.isAirBlock(var13, var19, var16)) {
-+ while (var19 > 0 && this.worldServerInstance.isAirBlock(var13, var19 - 1, var16)) {
- --var19;
- }
-
-- for(var20 = var12; var20 < var12 + 4; ++var20) {
-+ for (var20 = var12; var20 < var12 + 4; ++var20) {
- var21 = var20 % 2;
- var22 = 1 - var21;
-- if(var20 % 4 >= 2) {
-+
-+ if (var20 % 4 >= 2) {
- var21 = -var21;
- var22 = -var22;
- }
-
-- for(var23 = 0; var23 < 3; ++var23) {
-- for(var24 = 0; var24 < 4; ++var24) {
-- for(var25 = -1; var25 < 4; ++var25) {
-+ for (var23 = 0; var23 < 3; ++var23) {
-+ for (var24 = 0; var24 < 4; ++var24) {
-+ for (var25 = -1; var25 < 4; ++var25) {
- var26 = var13 + (var24 - 1) * var21 + var23 * var22;
- var27 = var19 + var25;
- int var28 = var16 + (var24 - 1) * var22 - var23 * var21;
-- if(var25 < 0 && !this.worldServerInstance.getBlockMaterial(var26, var27, var28).isSolid() || var25 >= 0 && !this.worldServerInstance.isAirBlock(var26, var27, var28)) {
-- continue label296;
-+
-+ if (var25 < 0 && !this.worldServerInstance.getBlockMaterial(var26, var27, var28).isSolid() || var25 >= 0 && !this.worldServerInstance.isAirBlock(var26, var27, var28)) {
-+ continue label274;
- }
- }
- }
- }
-
-- var31 = (double)var19 + 0.5D - var1.posY;
-+ var31 = (double)var19 + 0.5D - par1Entity.posY;
- var32 = var14 * var14 + var31 * var31 + var17 * var17;
-- if(var3 < 0.0D || var32 < var3) {
-+
-+ if (var3 < 0.0D || var32 < var3) {
- var3 = var32;
- var8 = var13;
- var9 = var19;
-@@ -265,38 +290,40 @@
- }
- }
-
-- if(var3 < 0.0D) {
-- for(var13 = var5 - var2; var13 <= var5 + var2; ++var13) {
-- var14 = (double)var13 + 0.5D - var1.posX;
--
-- for(var16 = var7 - var2; var16 <= var7 + var2; ++var16) {
-- var17 = (double)var16 + 0.5D - var1.posZ;
--
-- label234:
-- for(var19 = this.worldServerInstance.getActualHeight() - 1; var19 >= 0; --var19) {
-- if(this.worldServerInstance.isAirBlock(var13, var19, var16)) {
-- while(var19 > 0 && this.worldServerInstance.isAirBlock(var13, var19 - 1, var16)) {
-+ if (var3 < 0.0D) {
-+ for (var13 = var5 - var2; var13 <= var5 + var2; ++var13) {
-+ var14 = (double)var13 + 0.5D - par1Entity.posX;
-+
-+ for (var16 = var7 - var2; var16 <= var7 + var2; ++var16) {
-+ var17 = (double)var16 + 0.5D - par1Entity.posZ;
-+ label222:
-+
-+ for (var19 = this.worldServerInstance.getActualHeight() - 1; var19 >= 0; --var19) {
-+ if (this.worldServerInstance.isAirBlock(var13, var19, var16)) {
-+ while (var19 > 0 && this.worldServerInstance.isAirBlock(var13, var19 - 1, var16)) {
- --var19;
- }
-
-- for(var20 = var12; var20 < var12 + 2; ++var20) {
-+ for (var20 = var12; var20 < var12 + 2; ++var20) {
- var21 = var20 % 2;
- var22 = 1 - var21;
-
-- for(var23 = 0; var23 < 4; ++var23) {
-- for(var24 = -1; var24 < 4; ++var24) {
-+ for (var23 = 0; var23 < 4; ++var23) {
-+ for (var24 = -1; var24 < 4; ++var24) {
- var25 = var13 + (var23 - 1) * var21;
- var26 = var19 + var24;
- var27 = var16 + (var23 - 1) * var22;
-- if(var24 < 0 && !this.worldServerInstance.getBlockMaterial(var25, var26, var27).isSolid() || var24 >= 0 && !this.worldServerInstance.isAirBlock(var25, var26, var27)) {
-- continue label234;
-+
-+ if (var24 < 0 && !this.worldServerInstance.getBlockMaterial(var25, var26, var27).isSolid() || var24 >= 0 && !this.worldServerInstance.isAirBlock(var25, var26, var27)) {
-+ continue label222;
- }
- }
- }
-
-- var31 = (double)var19 + 0.5D - var1.posY;
-+ var31 = (double)var19 + 0.5D - par1Entity.posY;
- var32 = var14 * var14 + var31 * var31 + var17 * var17;
-- if(var3 < 0.0D || var32 < var3) {
-+
-+ if (var3 < 0.0D || var32 < var3) {
- var3 = var32;
- var8 = var13;
- var9 = var19;
-@@ -315,26 +342,28 @@
- var16 = var10;
- int var30 = var11 % 2;
- int var18 = 1 - var30;
-- if(var11 % 4 >= 2) {
-+
-+ if (var11 % 4 >= 2) {
- var30 = -var30;
- var18 = -var18;
- }
-
- boolean var33;
-- if(var3 < 0.0D) {
-- if(var9 < 70) {
-+
-+ if (var3 < 0.0D) {
-+ if (var9 < 70) {
- var9 = 70;
- }
-
-- if(var9 > this.worldServerInstance.getActualHeight() - 10) {
-+ if (var9 > this.worldServerInstance.getActualHeight() - 10) {
- var9 = this.worldServerInstance.getActualHeight() - 10;
- }
-
- var15 = var9;
-
-- for(var19 = -1; var19 <= 1; ++var19) {
-- for(var20 = 1; var20 < 3; ++var20) {
-- for(var21 = -1; var21 < 3; ++var21) {
-+ for (var19 = -1; var19 <= 1; ++var19) {
-+ for (var20 = 1; var20 < 3; ++var20) {
-+ for (var21 = -1; var21 < 3; ++var21) {
- var22 = var29 + (var20 - 1) * var30 + var19 * var18;
- var23 = var15 + var21;
- var24 = var16 + (var20 - 1) * var18 - var19 * var30;
-@@ -345,9 +374,9 @@
- }
- }
-
-- for(var19 = 0; var19 < 4; ++var19) {
-- for(var20 = 0; var20 < 4; ++var20) {
-- for(var21 = -1; var21 < 4; ++var21) {
-+ for (var19 = 0; var19 < 4; ++var19) {
-+ for (var20 = 0; var20 < 4; ++var20) {
-+ for (var21 = -1; var21 < 4; ++var21) {
- var22 = var29 + (var20 - 1) * var30;
- var23 = var15 + var21;
- var24 = var16 + (var20 - 1) * var18;
-@@ -356,8 +385,8 @@
- }
- }
-
-- for(var20 = 0; var20 < 4; ++var20) {
-- for(var21 = -1; var21 < 4; ++var21) {
-+ for (var20 = 0; var20 < 4; ++var20) {
-+ for (var21 = -1; var21 < 4; ++var21) {
- var22 = var29 + (var20 - 1) * var30;
- var23 = var15 + var21;
- var24 = var16 + (var20 - 1) * var18;
-@@ -369,25 +398,23 @@
- return true;
- }
-
-- public void removeStalePortalLocations(long var1) {
-- if(var1 % 100L == 0L) {
-- Iterator var3 = this.d.iterator();
-- long var4 = var1 - 600L;
--
-- while(true) {
-- Long var6;
-- PortalPosition var7;
-- do {
-- if(!var3.hasNext()) {
-- return;
-- }
--
-- var6 = (Long)var3.next();
-- var7 = (PortalPosition)this.destinationCoordinateCache.getValueByKey(var6.longValue());
-- } while(var7 != null && var7.lastUpdateTime >= var4);
--
-- var3.remove();
-- this.destinationCoordinateCache.remove(var6.longValue());
-+ /**
-+ * called periodically to remove out-of-date portal locations from the cache list. Argument par1 is a
-+ * WorldServer.getTotalWorldTime() value.
-+ */
-+ public void removeStalePortalLocations(long par1) {
-+ if (par1 % 100L == 0L) {
-+ Iterator var3 = this.destinationCoordinateKeys.iterator();
-+ long var4 = par1 - 600L;
-+
-+ while (var3.hasNext()) {
-+ Long var6 = (Long)var3.next();
-+ PortalPosition var7 = (PortalPosition)this.destinationCoordinateCache.getValueByKey(var6.longValue());
-+
-+ if (var7 == null || var7.lastUpdateTime < var4) {
-+ var3.remove();
-+ this.destinationCoordinateCache.remove(var6.longValue());
-+ }
- }
- }
- }
---- net/minecraft/src/BlockTorch.java
-+++ net/minecraft/src/BlockTorch.java
-@@ -3,123 +3,158 @@
- import java.util.Random;
-
- public class BlockTorch extends Block {
-- protected BlockTorch(int var1) {
-- super(var1, Material.circuits);
-+ protected BlockTorch(int par1) {
-+ super(par1, Material.circuits);
- this.setTickRandomly(true);
- this.setCreativeTab(CreativeTabs.tabDecorations);
- }
-
-- public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) {
-+ /**
-+ * 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;
- }
-
-+ /**
-+ * 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;
- }
-
-+ /**
-+ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc)
-+ */
- public boolean renderAsNormalBlock() {
- return false;
- }
-
-+ /**
-+ * The type of render function that is called for this block
-+ */
- public int getRenderType() {
- return 2;
- }
-
-- private boolean canPlaceTorchOn(World var1, int var2, int var3, int var4) {
-- if(var1.doesBlockHaveSolidTopSurface(var2, var3, var4)) {
-+ /**
-+ * Gets if we can place a torch on a block.
-+ */
-+ private boolean canPlaceTorchOn(World par1World, int par2, int par3, int par4) {
-+ if (par1World.doesBlockHaveSolidTopSurface(par2, par3, par4)) {
- return true;
- } else {
-- int var5 = var1.getBlockId(var2, var3, var4);
-+ int var5 = par1World.getBlockId(par2, par3, par4);
- return var5 == Block.fence.blockID || var5 == Block.netherFence.blockID || var5 == Block.glass.blockID || var5 == Block.cobblestoneWall.blockID;
- }
- }
-
-- public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) {
-- return var1.isBlockNormalCubeDefault(var2 - 1, var3, var4, true) ? true : (var1.isBlockNormalCubeDefault(var2 + 1, var3, var4, true) ? true : (var1.isBlockNormalCubeDefault(var2, var3, var4 - 1, true) ? true : (var1.isBlockNormalCubeDefault(var2, var3, var4 + 1, true) ? true : this.canPlaceTorchOn(var1, var2, var3 - 1, var4))));
-+ /**
-+ * 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.isBlockNormalCubeDefault(par2 - 1, par3, par4, true) ? true : (par1World.isBlockNormalCubeDefault(par2 + 1, par3, par4, true) ? true : (par1World.isBlockNormalCubeDefault(par2, par3, par4 - 1, true) ? true : (par1World.isBlockNormalCubeDefault(par2, par3, par4 + 1, true) ? true : this.canPlaceTorchOn(par1World, par2, par3 - 1, par4))));
- }
-
-- public int onBlockPlaced(World var1, int var2, int var3, int var4, int var5, float var6, float var7, float var8, int var9) {
-- int var10 = var9;
-- if(var5 == 1 && this.canPlaceTorchOn(var1, var2, var3 - 1, var4)) {
-+ /**
-+ * 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) {
-+ int var10 = par9;
-+
-+ if (par5 == 1 && this.canPlaceTorchOn(par1World, par2, par3 - 1, par4)) {
- var10 = 5;
- }
-
-- if(var5 == 2 && var1.isBlockNormalCubeDefault(var2, var3, var4 + 1, true)) {
-+ if (par5 == 2 && par1World.isBlockNormalCubeDefault(par2, par3, par4 + 1, true)) {
- var10 = 4;
- }
-
-- if(var5 == 3 && var1.isBlockNormalCubeDefault(var2, var3, var4 - 1, true)) {
-+ if (par5 == 3 && par1World.isBlockNormalCubeDefault(par2, par3, par4 - 1, true)) {
- var10 = 3;
- }
-
-- if(var5 == 4 && var1.isBlockNormalCubeDefault(var2 + 1, var3, var4, true)) {
-+ if (par5 == 4 && par1World.isBlockNormalCubeDefault(par2 + 1, par3, par4, true)) {
- var10 = 2;
- }
-
-- if(var5 == 5 && var1.isBlockNormalCubeDefault(var2 - 1, var3, var4, true)) {
-+ if (par5 == 5 && par1World.isBlockNormalCubeDefault(par2 - 1, par3, par4, true)) {
- var10 = 1;
- }
-
- return var10;
- }
-
-- public void updateTick(World var1, int var2, int var3, int var4, Random var5) {
-- super.updateTick(var1, var2, var3, var4, var5);
-- if(var1.getBlockMetadata(var2, var3, var4) == 0) {
-- this.onBlockAdded(var1, var2, var3, var4);
-+ /**
-+ * Ticks the block if it's been scheduled
-+ */
-+ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) {
-+ super.updateTick(par1World, par2, par3, par4, par5Random);
-+
-+ if (par1World.getBlockMetadata(par2, par3, par4) == 0) {
-+ this.onBlockAdded(par1World, par2, par3, par4);
- }
--
- }
-
-- public void onBlockAdded(World var1, int var2, int var3, int var4) {
-- if(var1.getBlockMetadata(var2, var3, var4) == 0) {
-- if(var1.isBlockNormalCubeDefault(var2 - 1, var3, var4, true)) {
-- var1.setBlockMetadata(var2, var3, var4, 1, 2);
-- } else if(var1.isBlockNormalCubeDefault(var2 + 1, var3, var4, true)) {
-- var1.setBlockMetadata(var2, var3, var4, 2, 2);
-- } else if(var1.isBlockNormalCubeDefault(var2, var3, var4 - 1, true)) {
-- var1.setBlockMetadata(var2, var3, var4, 3, 2);
-- } else if(var1.isBlockNormalCubeDefault(var2, var3, var4 + 1, true)) {
-- var1.setBlockMetadata(var2, var3, var4, 4, 2);
-- } else if(this.canPlaceTorchOn(var1, var2, var3 - 1, var4)) {
-- var1.setBlockMetadata(var2, var3, var4, 5, 2);
-+ /**
-+ * 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) {
-+ 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(var1, var2, var3, var4);
-- }
--
-- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) {
-- this.func_94397_d(var1, var2, var3, var4, var5);
-- }
--
-- protected boolean func_94397_d(World var1, int var2, int var3, int var4, int var5) {
-- if(this.dropTorchIfCantStay(var1, var2, var3, var4)) {
-- int var6 = var1.getBlockMetadata(var2, var3, var4);
-+ this.dropTorchIfCantStay(par1World, par2, par3, par4);
-+ }
-+
-+ /**
-+ * 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) {
-+ this.func_94397_d(par1World, par2, par3, par4, par5);
-+ }
-+
-+ protected boolean func_94397_d(World par1World, int par2, int par3, int par4, int par5) {
-+ if (this.dropTorchIfCantStay(par1World, par2, par3, par4)) {
-+ int var6 = par1World.getBlockMetadata(par2, par3, par4);
- boolean var7 = false;
-- if(!var1.isBlockNormalCubeDefault(var2 - 1, var3, var4, true) && var6 == 1) {
-- var7 = true;
-- }
--
-- if(!var1.isBlockNormalCubeDefault(var2 + 1, var3, var4, true) && var6 == 2) {
-- var7 = true;
-- }
--
-- if(!var1.isBlockNormalCubeDefault(var2, var3, var4 - 1, true) && var6 == 3) {
-- var7 = true;
-- }
--
-- if(!var1.isBlockNormalCubeDefault(var2, var3, var4 + 1, true) && var6 == 4) {
-- var7 = true;
-- }
--
-- if(!this.canPlaceTorchOn(var1, var2, var3 - 1, var4) && var6 == 5) {
-- var7 = true;
-- }
--
-- if(var7) {
-- this.dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4), 0);
-- var1.setBlockToAir(var2, var3, var4);
-+
-+ if (!par1World.isBlockNormalCubeDefault(par2 - 1, par3, par4, true) && var6 == 1) {
-+ var7 = true;
-+ }
-+
-+ if (!par1World.isBlockNormalCubeDefault(par2 + 1, par3, par4, true) && var6 == 2) {
-+ var7 = true;
-+ }
-+
-+ if (!par1World.isBlockNormalCubeDefault(par2, par3, par4 - 1, true) && var6 == 3) {
-+ var7 = true;
-+ }
-+
-+ if (!par1World.isBlockNormalCubeDefault(par2, par3, par4 + 1, true) && var6 == 4) {
-+ var7 = true;
-+ }
-+
-+ if (!this.canPlaceTorchOn(par1World, par2, par3 - 1, par4) && var6 == 5) {
-+ var7 = true;
-+ }
-+
-+ if (var7) {
-+ this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0);
-+ par1World.setBlockToAir(par2, par3, par4);
- return true;
- } else {
- return false;
-@@ -129,11 +164,15 @@
- }
- }
-
-- protected boolean dropTorchIfCantStay(World var1, int var2, int var3, int var4) {
-- if(!this.canPlaceBlockAt(var1, var2, var3, var4)) {
-- if(var1.getBlockId(var2, var3, var4) == this.blockID) {
-- this.dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4), 0);
-- var1.setBlockToAir(var2, var3, var4);
-+ /**
-+ * Tests if the block can remain at its current location and will drop as an item if it is unable to stay. Returns True
-+ * if it can stay and False if it drops. Args: world, x, y, z
-+ */
-+ protected boolean dropTorchIfCantStay(World par1World, int par2, int par3, int par4) {
-+ if (!this.canPlaceBlockAt(par1World, par2, par3, par4)) {
-+ if (par1World.getBlockId(par2, par3, par4) == this.blockID) {
-+ this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0);
-+ par1World.setBlockToAir(par2, par3, par4);
- }
-
- return false;
-@@ -142,48 +181,62 @@
- }
- }
-
-- public MovingObjectPosition collisionRayTrace(World var1, int var2, int var3, int var4, Vec3 var5, Vec3 var6) {
-- int var7 = var1.getBlockMetadata(var2, var3, var4) & 7;
-+ /**
-+ * Ray traces through the blocks collision from start vector to end vector returning a ray trace hit. Args: world, x,
-+ * y, z, startVec, endVec
-+ */
-+ public MovingObjectPosition collisionRayTrace(World par1World, int par2, int par3, int par4, Vec3 par5Vec3, Vec3 par6Vec3) {
-+ int var7 = par1World.getBlockMetadata(par2, par3, par4) & 7;
- float var8 = 0.15F;
-- if(var7 == 1) {
-+
-+ if (var7 == 1) {
- this.setBlockBounds(0.0F, 0.2F, 0.5F - var8, var8 * 2.0F, 0.8F, 0.5F + var8);
-- } else if(var7 == 2) {
-+ } else if (var7 == 2) {
- this.setBlockBounds(1.0F - var8 * 2.0F, 0.2F, 0.5F - var8, 1.0F, 0.8F, 0.5F + var8);
-- } else if(var7 == 3) {
-+ } else if (var7 == 3) {
- this.setBlockBounds(0.5F - var8, 0.2F, 0.0F, 0.5F + var8, 0.8F, var8 * 2.0F);
-- } else if(var7 == 4) {
-+ } else if (var7 == 4) {
- this.setBlockBounds(0.5F - var8, 0.2F, 1.0F - var8 * 2.0F, 0.5F + var8, 0.8F, 1.0F);
- } else {
- var8 = 0.1F;
- this.setBlockBounds(0.5F - var8, 0.0F, 0.5F - var8, 0.5F + var8, 0.6F, 0.5F + var8);
- }
-
-- return super.collisionRayTrace(var1, var2, var3, var4, var5, var6);
-+ return super.collisionRayTrace(par1World, par2, par3, par4, par5Vec3, par6Vec3);
- }
-
-- public void randomDisplayTick(World var1, int var2, int var3, int var4, Random var5) {
-- int var6 = var1.getBlockMetadata(var2, var3, var4);
-- double var7 = (double)((float)var2 + 0.5F);
-- double var9 = (double)((float)var3 + 0.7F);
-- double var11 = (double)((float)var4 + 0.5F);
-- double var13 = (double)0.22F;
-- double var15 = (double)0.27F;
-- if(var6 == 1) {
-- var1.spawnParticle("smoke", var7 - var15, var9 + var13, var11, 0.0D, 0.0D, 0.0D);
-- var1.spawnParticle("flame", var7 - var15, var9 + var13, var11, 0.0D, 0.0D, 0.0D);
-- } else if(var6 == 2) {
-- var1.spawnParticle("smoke", var7 + var15, var9 + var13, var11, 0.0D, 0.0D, 0.0D);
-- var1.spawnParticle("flame", var7 + var15, var9 + var13, var11, 0.0D, 0.0D, 0.0D);
-- } else if(var6 == 3) {
-- var1.spawnParticle("smoke", var7, var9 + var13, var11 - var15, 0.0D, 0.0D, 0.0D);
-- var1.spawnParticle("flame", var7, var9 + var13, var11 - var15, 0.0D, 0.0D, 0.0D);
-- } else if(var6 == 4) {
-- var1.spawnParticle("smoke", var7, var9 + var13, var11 + var15, 0.0D, 0.0D, 0.0D);
-- var1.spawnParticle("flame", var7, var9 + var13, var11 + var15, 0.0D, 0.0D, 0.0D);
-+ /**
-+ * 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) {
-+ // Spout Start - Custom blocks
-+ Chunk c = par1World.getChunkFromBlockCoords(par2, par4);
-+ if (c.spoutChunk.getCustomBlockId(par2, par3, par4) > 0) {
-+ return;
-+ }
-+ // Spout End
-+ 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 {
-- var1.spawnParticle("smoke", var7, var9, var11, 0.0D, 0.0D, 0.0D);
-- var1.spawnParticle("flame", var7, var9, var11, 0.0D, 0.0D, 0.0D);
-+ par1World.spawnParticle("smoke", var7, var9, var11, 0.0D, 0.0D, 0.0D);
-+ par1World.spawnParticle("flame", var7, var9, var11, 0.0D, 0.0D, 0.0D);
- }
--
- }
- }
---- net/minecraft/src/ProfilerResult.java
-+++ net/minecraft/src/ProfilerResult.java
-@@ -3,23 +3,23 @@
- public final class ProfilerResult implements Comparable {
- public double field_76332_a;
- public double field_76330_b;
-- public String c;
-+ public String field_76331_c;
-
-- public ProfilerResult(String var1, double var2, double var4) {
-- this.c = var1;
-- this.field_76332_a = var2;
-- this.field_76330_b = var4;
-+ public ProfilerResult(String par1Str, double par2, double par4) {
-+ this.field_76331_c = par1Str;
-+ this.field_76332_a = par2;
-+ this.field_76330_b = par4;
- }
-
-- public int func_76328_a(ProfilerResult var1) {
-- return var1.field_76332_a < this.field_76332_a ? -1 : (var1.field_76332_a > this.field_76332_a ? 1 : var1.c.compareTo(this.c));
-+ 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.c.hashCode() & 11184810) + 4473924;
-+ return (this.field_76331_c.hashCode() & 11184810) + 4473924;
- }
-
-- public int compareTo(Object var1) {
-- return this.func_76328_a((ProfilerResult)var1);
-+ public int compareTo(Object par1Obj) {
-+ return this.func_76328_a((ProfilerResult)par1Obj);
- }
- }
---- net/minecraft/src/StructureNetherBridgePieceWeight.java
-+++ net/minecraft/src/StructureNetherBridgePieceWeight.java
-@@ -1,24 +1,26 @@
- package net.minecraft.src;
-
- class StructureNetherBridgePieceWeight {
-- public Class a;
-+
-+ /** The class of the StructureComponent to which this weight corresponds. */
-+ public Class weightClass;
- public final int field_78826_b;
- public int field_78827_c;
- public int field_78824_d;
- public boolean field_78825_e;
-
-- public StructureNetherBridgePieceWeight(Class var1, int var2, int var3, boolean var4) {
-- this.a = var1;
-- this.field_78826_b = var2;
-- this.field_78824_d = var3;
-- this.field_78825_e = var4;
-- }
--
-- public StructureNetherBridgePieceWeight(Class var1, int var2, int var3) {
-- this(var1, var2, var3, false);
-- }
--
-- public boolean func_78822_a(int var1) {
-+ public StructureNetherBridgePieceWeight(Class par1Class, int par2, int par3, boolean par4) {
-+ this.weightClass = par1Class;
-+ this.field_78826_b = par2;
-+ this.field_78824_d = par3;
-+ this.field_78825_e = par4;
-+ }
-+
-+ public StructureNetherBridgePieceWeight(Class par1Class, int par2, int par3) {
-+ this(par1Class, par2, par3, false);
-+ }
-+
-+ public boolean func_78822_a(int par1) {
- return this.field_78824_d == 0 || this.field_78827_c < this.field_78824_d;
- }
-
---- net/minecraft/src/StructureStrongholdPieceWeight3.java
-+++ net/minecraft/src/StructureStrongholdPieceWeight3.java
-@@ -1,11 +1,11 @@
- package net.minecraft.src;
-
- final class StructureStrongholdPieceWeight3 extends StructureStrongholdPieceWeight {
-- StructureStrongholdPieceWeight3(Class var1, int var2, int var3) {
-- super(var1, var2, var3);
-+ StructureStrongholdPieceWeight3(Class par1Class, int par2, int par3) {
-+ super(par1Class, par2, par3);
- }
-
-- public boolean canSpawnMoreStructuresOfType(int var1) {
-- return super.canSpawnMoreStructuresOfType(var1) && var1 > 5;
-+ public boolean canSpawnMoreStructuresOfType(int par1) {
-+ return super.canSpawnMoreStructuresOfType(par1) && par1 > 5;
- }
- }
---- net/minecraft/src/ScoreDummyCriteria.java
-+++ net/minecraft/src/ScoreDummyCriteria.java
-@@ -3,18 +3,18 @@
- import java.util.List;
-
- public class ScoreDummyCriteria implements ScoreObjectiveCriteria {
-- private final String g;
-+ private final String field_96644_g;
-
-- public ScoreDummyCriteria(String var1) {
-- this.g = var1;
-- ScoreObjectiveCriteria.a.put(var1, this);
-+ public ScoreDummyCriteria(String par1Str) {
-+ this.field_96644_g = par1Str;
-+ ScoreObjectiveCriteria.field_96643_a.put(par1Str, this);
- }
-
- public String func_96636_a() {
-- return this.g;
-+ return this.field_96644_g;
- }
-
-- public int func_96635_a(List var1) {
-+ public int func_96635_a(List par1List) {
- return 0;
- }
-
---- net/minecraft/src/RenderEnderman.java
-+++ net/minecraft/src/RenderEnderman.java
-@@ -1,78 +1,103 @@
- package net.minecraft.src;
-
- import java.util.Random;
-+
- import org.lwjgl.opengl.GL11;
- import org.lwjgl.opengl.GL12;
-
-+import com.prupe.mcpatcher.mob.MobRandomizer;
-+
-+import org.spoutcraft.client.config.Configuration;
- public class RenderEnderman extends RenderLiving {
- private static final ResourceLocation endermanEyesTexture = new ResourceLocation("textures/entity/enderman/enderman_eyes.png");
- private static final ResourceLocation endermanTextures = new ResourceLocation("textures/entity/enderman/enderman.png");
-- private ModelEnderman endermanModel = (ModelEnderman)this.mainModel;
-- private Random h = new Random();
-+
-+ /** The model of the enderman */
-+ private ModelEnderman endermanModel;
-+ private Random rnd = new Random();
-
- public RenderEnderman() {
- super(new ModelEnderman(), 0.5F);
-+ this.endermanModel = (ModelEnderman)super.mainModel;
- this.setRenderPassModel(this.endermanModel);
- }
-
-- public void renderEnderman(EntityEnderman var1, double var2, double var4, double var6, float var8, float var9) {
-- this.endermanModel.isCarrying = var1.getCarried() > 0;
-- this.endermanModel.isAttacking = var1.isScreaming();
-- if(var1.isScreaming()) {
-+ /**
-+ * Renders the enderman
-+ */
-+ public void renderEnderman(EntityEnderman par1EntityEnderman, double par2, double par4, double par6, float par8, float par9) {
-+ this.endermanModel.isCarrying = par1EntityEnderman.getCarried() > 0;
-+ this.endermanModel.isAttacking = par1EntityEnderman.isScreaming();
-+
-+ if (par1EntityEnderman.isScreaming()) {
- double var10 = 0.02D;
-- var2 += this.h.nextGaussian() * var10;
-- var6 += this.h.nextGaussian() * var10;
-+ par2 += this.rnd.nextGaussian() * var10;
-+ par6 += this.rnd.nextGaussian() * var10;
- }
-
-- super.doRenderLiving(var1, var2, var4, var6, var8, var9);
-+ super.doRenderLiving(par1EntityEnderman, par2, par4, par6, par8, par9);
- }
--
-- protected ResourceLocation getEndermanTextures(EntityEnderman var1) {
-+
-+ protected ResourceLocation getEndermanTextures(EntityEnderman par1EntityEnderman) {
- return endermanTextures;
- }
-
-- protected void renderCarrying(EntityEnderman var1, float var2) {
-- super.renderEquippedItems(var1, var2);
-- if(var1.getCarried() > 0) {
-+ /**
-+ * 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, 11.0F / 16.0F, -(12.0F / 16.0F));
-+ 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 = var1.getBrightnessForRender(var2);
-+ 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[var1.getCarried()], var1.getCarryingData(), 1.0F);
-+ this.renderBlocks.renderBlockAsItem(Block.blocksList[par1EntityEnderman.getCarried()], par1EntityEnderman.getCarryingData(), 1.0F);
- GL11.glPopMatrix();
- GL11.glDisable(GL12.GL_RESCALE_NORMAL);
- }
--
- }
-
-- protected int renderEyes(EntityEnderman var1, int var2, float var3) {
-- if(var2 != 0) {
-+ /**
-+ * Render the endermans eyes
-+ */
-+ protected int renderEyes(EntityEnderman par1EntityEnderman, int par2, float par3) {
-+ if (par2 != 0) {
- return -1;
- } else {
-- this.bindTexture(endermanEyesTexture);
-+ // Spout Start
-+ if (Configuration.isRandomMobTextures()) {
-+ this.bindTexture(MobRandomizer.randomTexture((EntityLivingBase)par1EntityEnderman, endermanEyesTexture));
-+ } else {
-+ // ToDO: Fix this.
-+ //loadTexture(par1EntityEnderman.getCustomTexture(org.spoutcraft.api.entity.EntitySkinType.ENDERMAN_EYES, "/mob/enderman_eyes.png"));
-+ }
-+ // Spout End
- 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(var1.isInvisible()) {
-+
-+ if (par1EntityEnderman.isInvisible()) {
- GL11.glDepthMask(false);
- } else {
- GL11.glDepthMask(true);
- }
-
-- char var5 = '\uf0f0';
-+ char var5 = 61680;
- int var6 = var5 % 65536;
- int var7 = var5 / 65536;
- OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)var6 / 1.0F, (float)var7 / 1.0F);
-@@ -83,27 +108,39 @@
- }
- }
-
-- public void doRenderLiving(EntityLiving var1, double var2, double var4, double var6, float var8, float var9) {
-- this.renderEnderman((EntityEnderman)var1, var2, var4, var6, var8, var9);
-- }
--
-- protected int shouldRenderPass(EntityLivingBase var1, int var2, float var3) {
-- return this.renderEyes((EntityEnderman)var1, var2, var3);
-- }
--
-- protected void renderEquippedItems(EntityLivingBase var1, float var2) {
-- this.renderCarrying((EntityEnderman)var1, var2);
-- }
--
-- public void renderPlayer(EntityLivingBase var1, double var2, double var4, double var6, float var8, float var9) {
-- this.renderEnderman((EntityEnderman)var1, var2, var4, var6, var8, var9);
-- }
--
-- protected ResourceLocation getEntityTexture(Entity var1) {
-- return this.getEndermanTextures((EntityEnderman)var1);
-- }
--
-- public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) {
-- this.renderEnderman((EntityEnderman)var1, var2, var4, var6, var8, var9);
-+ 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= 0) {
-+ public BlockDragonEgg(int par1) {
-+ super(par1, Material.dragonEgg);
-+ this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 1.0F, 0.9375F);
-+ }
-+
-+ /**
-+ * 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) {
-+ par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, this.tickRate(par1World));
-+ }
-+
-+ /**
-+ * 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) {
-+ par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, this.tickRate(par1World));
-+ }
-+
-+ /**
-+ * Ticks the block if it's been scheduled
-+ */
-+ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) {
-+ this.fallIfPossible(par1World, par2, par3, par4);
-+ }
-+
-+ /**
-+ * Checks if the dragon egg can fall down, and if so, makes it fall.
-+ */
-+ private void fallIfPossible(World par1World, int par2, int par3, int par4) {
-+ if (BlockSand.canFallBelow(par1World, par2, par3 - 1, par4) && par3 >= 0) {
- byte var5 = 32;
-- if(!BlockSand.fallInstantly && var1.checkChunksExist(var2 - var5, var3 - var5, var4 - var5, var2 + var5, var3 + var5, var4 + var5)) {
-- EntityFallingSand var6 = new EntityFallingSand(var1, (double)((float)var2 + 0.5F), (double)((float)var3 + 0.5F), (double)((float)var4 + 0.5F), this.blockID);
-- var1.spawnEntityInWorld(var6);
-+
-+ if (!BlockSand.fallInstantly && par1World.checkChunksExist(par2 - var5, par3 - var5, par4 - var5, par2 + var5, par3 + var5, par4 + var5)) {
-+ EntityFallingSand var6 = new EntityFallingSand(par1World, (double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), this.blockID);
-+ par1World.spawnEntityInWorld(var6);
- } else {
-- var1.setBlockToAir(var2, var3, var4);
-+ par1World.setBlockToAir(par2, par3, par4);
-
-- while(BlockSand.canFallBelow(var1, var2, var3 - 1, var4) && var3 > 0) {
-- --var3;
-+ while (BlockSand.canFallBelow(par1World, par2, par3 - 1, par4) && par3 > 0) {
-+ --par3;
- }
-
-- if(var3 > 0) {
-- var1.setBlock(var2, var3, var4, this.blockID, 0, 2);
-+ if (par3 > 0) {
-+ par1World.setBlock(par2, par3, par4, this.blockID, 0, 2);
- }
- }
- }
--
- }
-
-- public boolean onBlockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5, int var6, float var7, float var8, float var9) {
-- this.teleportNearby(var1, var2, var3, var4);
-+ /**
-+ * 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) {
-+ this.teleportNearby(par1World, par2, par3, par4);
- return true;
- }
-
-- public void onBlockClicked(World var1, int var2, int var3, int var4, EntityPlayer var5) {
-- this.teleportNearby(var1, var2, var3, var4);
-+ /**
-+ * 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.teleportNearby(par1World, par2, par3, par4);
- }
-
-- private void teleportNearby(World var1, int var2, int var3, int var4) {
-- if(var1.getBlockId(var2, var3, var4) == this.blockID) {
-- for(int var5 = 0; var5 < 1000; ++var5) {
-- int var6 = var2 + var1.s.nextInt(16) - var1.s.nextInt(16);
-- int var7 = var3 + var1.s.nextInt(8) - var1.s.nextInt(8);
-- int var8 = var4 + var1.s.nextInt(16) - var1.s.nextInt(16);
-- if(var1.getBlockId(var6, var7, var8) == 0) {
-- if(!var1.isRemote) {
-- var1.setBlock(var6, var7, var8, this.blockID, var1.getBlockMetadata(var2, var3, var4), 2);
-- var1.setBlockToAir(var2, var3, var4);
-+ /**
-+ * Teleports the dragon egg somewhere else in a 31x19x31 area centered on the egg.
-+ */
-+ private void teleportNearby(World par1World, int par2, int par3, int par4) {
-+ if (par1World.getBlockId(par2, par3, par4) == this.blockID) {
-+ for (int var5 = 0; var5 < 1000; ++var5) {
-+ int var6 = par2 + par1World.rand.nextInt(16) - par1World.rand.nextInt(16);
-+ int var7 = par3 + par1World.rand.nextInt(8) - par1World.rand.nextInt(8);
-+ int var8 = par4 + par1World.rand.nextInt(16) - par1World.rand.nextInt(16);
-+
-+ if (par1World.getBlockId(var6, var7, var8) == 0) {
-+ if (!par1World.isRemote) {
-+ par1World.setBlock(var6, var7, var8, this.blockID, par1World.getBlockMetadata(par2, par3, par4), 2);
-+ par1World.setBlockToAir(par2, par3, par4);
- } else {
- short var9 = 128;
-
-- for(int var10 = 0; var10 < var9; ++var10) {
-- double var11 = var1.s.nextDouble();
-- float var13 = (var1.s.nextFloat() - 0.5F) * 0.2F;
-- float var14 = (var1.s.nextFloat() - 0.5F) * 0.2F;
-- float var15 = (var1.s.nextFloat() - 0.5F) * 0.2F;
-- double var16 = (double)var6 + (double)(var2 - var6) * var11 + (var1.s.nextDouble() - 0.5D) * 1.0D + 0.5D;
-- double var18 = (double)var7 + (double)(var3 - var7) * var11 + var1.s.nextDouble() * 1.0D - 0.5D;
-- double var20 = (double)var8 + (double)(var4 - var8) * var11 + (var1.s.nextDouble() - 0.5D) * 1.0D + 0.5D;
-- var1.spawnParticle("portal", var16, var18, var20, (double)var13, (double)var14, (double)var15);
-+ for (int var10 = 0; var10 < var9; ++var10) {
-+ double var11 = par1World.rand.nextDouble();
-+ float var13 = (par1World.rand.nextFloat() - 0.5F) * 0.2F;
-+ float var14 = (par1World.rand.nextFloat() - 0.5F) * 0.2F;
-+ float var15 = (par1World.rand.nextFloat() - 0.5F) * 0.2F;
-+ double var16 = (double)var6 + (double)(par2 - var6) * var11 + (par1World.rand.nextDouble() - 0.5D) * 1.0D + 0.5D;
-+ double var18 = (double)var7 + (double)(par3 - var7) * var11 + par1World.rand.nextDouble() * 1.0D - 0.5D;
-+ double var20 = (double)var8 + (double)(par4 - var8) * var11 + (par1World.rand.nextDouble() - 0.5D) * 1.0D + 0.5D;
-+ par1World.spawnParticle("portal", var16, var18, var20, (double)var13, (double)var14, (double)var15);
- }
- }
-
- return;
- }
- }
--
- }
- }
-
-- public int tickRate(World var1) {
-+ /**
-+ * How many world ticks before ticking
-+ */
-+ public int tickRate(World par1World) {
- return 5;
- }
-
-+ /**
-+ * 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;
- }
-
-+ /**
-+ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc)
-+ */
- public boolean renderAsNormalBlock() {
- return false;
- }
-
-- public boolean shouldSideBeRendered(IBlockAccess var1, int var2, int var3, int var4, int var5) {
-+ /**
-+ * 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;
- }
-
-- public int idPicked(World var1, int var2, int var3, int var4) {
-+ /**
-+ * 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;
- }
- }
---- /dev/null
-+++ com/prupe/mcpatcher/Config$VersionEntry.java
-@@ -1,0 +1,9 @@
-+package com.prupe.mcpatcher;
-+
-+import com.prupe.mcpatcher.Config$ModEntry;
-+import java.util.LinkedHashMap;
-+
-+class Config$VersionEntry {
-+ String original;
-+ LinkedHashMap mods = new LinkedHashMap();
-+}
---- net/minecraft/src/BiomeGenDesert.java
-+++ net/minecraft/src/BiomeGenDesert.java
-@@ -3,9 +3,9 @@
- import java.util.Random;
-
- public class BiomeGenDesert extends BiomeGenBase {
-- public BiomeGenDesert(int var1) {
-- super(var1);
-- this.K.clear();
-+ public BiomeGenDesert(int par1) {
-+ super(par1);
-+ this.spawnableCreatureList.clear();
- this.topBlock = (byte)Block.sand.blockID;
- this.fillerBlock = (byte)Block.sand.blockID;
- this.theBiomeDecorator.treesPerChunk = -999;
-@@ -14,14 +14,14 @@
- this.theBiomeDecorator.cactiPerChunk = 10;
- }
-
-- public void decorate(World var1, Random var2, int var3, int var4) {
-- super.decorate(var1, var2, var3, var4);
-- if(var2.nextInt(1000) == 0) {
-- int var5 = var3 + var2.nextInt(16) + 8;
-- int var6 = var4 + var2.nextInt(16) + 8;
-+ public void decorate(World par1World, Random par2Random, int par3, int par4) {
-+ super.decorate(par1World, par2Random, par3, par4);
-+
-+ if (par2Random.nextInt(1000) == 0) {
-+ int var5 = par3 + par2Random.nextInt(16) + 8;
-+ int var6 = par4 + par2Random.nextInt(16) + 8;
- WorldGenDesertWells var7 = new WorldGenDesertWells();
-- var7.generate(var1, var2, var5, var1.getHeightValue(var5, var6) + 1, var6);
-+ var7.generate(par1World, par2Random, var5, par1World.getHeightValue(var5, var6) + 1, var6);
- }
--
- }
- }
---- net/minecraft/src/ModelEnderCrystal.java
-+++ net/minecraft/src/ModelEnderCrystal.java
-@@ -3,42 +3,52 @@
- 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 var1, boolean var2) {
-+ 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(var2) {
-+
-+ if (par2) {
- this.base = new ModelRenderer(this, "base");
- this.base.setTextureOffset(0, 16).addBox(-6.0F, 0.0F, -6.0F, 12, 4, 12);
- }
--
- }
-
-- public void render(Entity var1, float var2, float var3, float var4, float var5, float var6, float var7) {
-+ /**
-+ * 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(var7);
-+
-+ if (this.base != null) {
-+ this.base.render(par7);
- }
-
-- GL11.glRotatef(var3, 0.0F, 1.0F, 0.0F);
-- GL11.glTranslatef(0.0F, 0.8F + var4, 0.0F);
-- GL11.glRotatef(60.0F, 0.7071F, 0.0F, 0.7071F);
-- this.glass.render(var7);
-- float var8 = 14.0F / 16.0F;
-- GL11.glScalef(var8, var8, var8);
-- GL11.glRotatef(60.0F, 0.7071F, 0.0F, 0.7071F);
-- GL11.glRotatef(var3, 0.0F, 1.0F, 0.0F);
-- this.glass.render(var7);
-- GL11.glScalef(var8, var8, var8);
-- GL11.glRotatef(60.0F, 0.7071F, 0.0F, 0.7071F);
-- GL11.glRotatef(var3, 0.0F, 1.0F, 0.0F);
-- this.cube.render(var7);
-+ 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
-+++ org/spoutcraft/client/gui/minimap/ScaleToggleCheckBox.java
-@@ -1,0 +1,35 @@
-+/*
-+ * This file is part of Spoutcraft.
-+ *
-+ * Copyright (c) 2011 SpoutcraftDev
-+ * Spoutcraft is licensed under the GNU Lesser General Public License.
-+ *
-+ * Spoutcraft is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation, either version 3 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Spoutcraft is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program. If not, see .
-+ */
-+package org.spoutcraft.client.gui.minimap;
-+
-+import org.spoutcraft.api.gui.GenericCheckBox;
-+
-+public class ScaleToggleCheckBox extends GenericCheckBox {
-+ public ScaleToggleCheckBox() {
-+ super("Scale Minimap");
-+ setChecked(MinimapConfig.getInstance().isScale());
-+ setTooltip("Scale Minimap\nThe minimap will resize itself based on the \ndimensions of your screen.");
-+ }
-+
-+ @Override
-+ public void onButtonClick() {
-+ MinimapConfig.getInstance().setScale(isChecked());
-+ }
-+}
---- net/minecraft/src/RenderPlayer.java
-+++ net/minecraft/src/RenderPlayer.java
-@@ -2,43 +2,64 @@
-
- import org.lwjgl.opengl.GL11;
-
--public class RenderPlayer extends RendererLivingEntity {
-+import org.bukkit.ChatColor;
-+import org.spoutcraft.client.SpoutClient;
-+import org.spoutcraft.client.player.accessories.AccessoryHandler;
-+import org.spoutcraft.client.player.accessories.AccessoryType;
-+import org.spoutcraft.client.special.VIP;
-+import org.spoutcraft.client.special.Resources;
-+
-+public class RenderPlayer extends RenderLiving {
- private static final ResourceLocation steveTextures = new ResourceLocation("textures/entity/steve.png");
-- private ModelBiped modelBipedMain = (ModelBiped)this.mainModel;
-- private ModelBiped modelArmorChestplate = new ModelBiped(1.0F);
-- private ModelBiped modelArmor = new ModelBiped(0.5F);
-+
-+ // Spout Start - private to public
-+ public ModelBiped modelBipedMain;
-+ // Spout End
-+ private ModelBiped modelArmorChestplate;
-+ private ModelBiped modelArmor;
-
- public RenderPlayer() {
- super(new ModelBiped(0.0F), 0.5F);
-+ this.modelBipedMain = (ModelBiped)this.mainModel;
-+ this.modelArmorChestplate = new ModelBiped(1.0F);
-+ this.modelArmor = new ModelBiped(0.5F);
- }
-
-- protected int setArmorModel(AbstractClientPlayer var1, int var2, float var3) {
-- ItemStack var4 = var1.inventory.armorItemInSlot(3 - var2);
-- if(var4 != null) {
-+ /**
-+ * Set the specified armor model as the player model. Args: player, armorSlot, partialTick
-+ */
-+
-+ protected int setArmorModel(AbstractClientPlayer par1AbstractClientPlayer, int par2, float par3) {
-+ ItemStack var4 = par1AbstractClientPlayer.inventory.armorItemInSlot(3 - par2);
-+
-+ if (var4 != null) {
- Item var5 = var4.getItem();
-- if(var5 instanceof ItemArmor) {
-+
-+ if (var5 instanceof ItemArmor) {
- ItemArmor var6 = (ItemArmor)var5;
-- this.bindTexture(RenderBiped.func_110857_a(var6, var2));
-- ModelBiped var7 = var2 == 2 ? this.modelArmor : this.modelArmorChestplate;
-- var7.bipedHead.showModel = var2 == 0;
-- var7.bipedHeadwear.showModel = var2 == 0;
-- var7.bipedBody.showModel = var2 == 1 || var2 == 2;
-- var7.bipedRightArm.showModel = var2 == 1;
-- var7.bipedLeftArm.showModel = var2 == 1;
-- var7.bipedRightLeg.showModel = var2 == 2 || var2 == 3;
-- var7.bipedLeftLeg.showModel = var2 == 2 || var2 == 3;
-+ this.bindTexture(RenderBiped.func_110857_a(var6, par2));
-+ ModelBiped var7 = par2 == 2 ? this.modelArmor : this.modelArmorChestplate;
-+ var7.bipedHead.showModel = par2 == 0;
-+ var7.bipedHeadwear.showModel = par2 == 0;
-+ var7.bipedBody.showModel = par2 == 1 || par2 == 2;
-+ var7.bipedRightArm.showModel = par2 == 1;
-+ var7.bipedLeftArm.showModel = par2 == 1;
-+ var7.bipedRightLeg.showModel = par2 == 2 || par2 == 3;
-+ var7.bipedLeftLeg.showModel = par2 == 2 || par2 == 3;
- this.setRenderPassModel(var7);
- var7.onGround = this.mainModel.onGround;
- var7.isRiding = this.mainModel.isRiding;
- var7.isChild = this.mainModel.isChild;
- float var8 = 1.0F;
-- if(var6.getArmorMaterial() == EnumArmorMaterial.CLOTH) {
-+
-+ if (var6.getArmorMaterial() == EnumArmorMaterial.CLOTH) {
- int var9 = var6.getColor(var4);
- float var10 = (float)(var9 >> 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()) {
-+
-+ if (var4.isItemEnchanted()) {
- return 31;
- }
-
-@@ -46,7 +67,8 @@
- }
-
- GL11.glColor3f(var8, var8, var8);
-- if(var4.isItemEnchanted()) {
-+
-+ if (var4.isItemEnchanted()) {
- return 15;
- }
-
-@@ -57,73 +79,90 @@
- return -1;
- }
-
-- protected void func_130220_b(AbstractClientPlayer var1, int var2, float var3) {
-- ItemStack var4 = var1.inventory.armorItemInSlot(3 - var2);
-- if(var4 != null) {
-+ protected void func_130220_b(AbstractClientPlayer par1AbstractClientPlayer, int par2, float par3) {
-+ ItemStack var4 = par1AbstractClientPlayer.inventory.armorItemInSlot(3 - par2);
-+
-+ if (var4 != null) {
- Item var5 = var4.getItem();
-- if(var5 instanceof ItemArmor) {
-- this.bindTexture(RenderBiped.func_110858_a((ItemArmor)var5, var2, "overlay"));
-+
-+ if (var5 instanceof ItemArmor) {
-+ this.bindTexture(RenderBiped.func_110858_a((ItemArmor)var5, par2, "overlay"));
- float var6 = 1.0F;
- GL11.glColor3f(var6, var6, var6);
- }
- }
--
- }
-
-- public void func_130009_a(AbstractClientPlayer var1, double var2, double var4, double var6, float var8, float var9) {
-+ //ToDo: Missing from this method (renderPlayer) is the Accessorize Code
-+ public void func_130009_a(AbstractClientPlayer par1AbstractClientPlayer, double par2, double par4, double par6, float par8, float par9) {
- float var10 = 1.0F;
- GL11.glColor3f(var10, var10, var10);
-- ItemStack var11 = var1.inventory.getCurrentItem();
-+ ItemStack var11 = par1AbstractClientPlayer.inventory.getCurrentItem();
- this.modelArmorChestplate.heldItemRight = this.modelArmor.heldItemRight = this.modelBipedMain.heldItemRight = var11 != null ? 1 : 0;
-- if(var11 != null && var1.getItemInUseCount() > 0) {
-+
-+ if (var11 != null && par1AbstractClientPlayer.getItemInUseCount() > 0) {
- EnumAction var12 = var11.getItemUseAction();
-- if(var12 == EnumAction.block) {
-+
-+ if (var12 == EnumAction.block) {
- this.modelArmorChestplate.heldItemRight = this.modelArmor.heldItemRight = this.modelBipedMain.heldItemRight = 3;
-- } else if(var12 == EnumAction.bow) {
-+ } else if (var12 == EnumAction.bow) {
- this.modelArmorChestplate.aimedBow = this.modelArmor.aimedBow = this.modelBipedMain.aimedBow = true;
- }
- }
-
-- this.modelArmorChestplate.isSneak = this.modelArmor.isSneak = this.modelBipedMain.isSneak = var1.isSneaking();
-- double var14 = var4 - (double)var1.yOffset;
-- if(var1.isSneaking() && !(var1 instanceof EntityPlayerSP)) {
-+ this.modelArmorChestplate.isSneak = this.modelArmor.isSneak = this.modelBipedMain.isSneak = par1AbstractClientPlayer.isSneaking();
-+ double var14 = par4 - (double)par1AbstractClientPlayer.yOffset;
-+
-+ if (par1AbstractClientPlayer.isSneaking() && !(par1AbstractClientPlayer instanceof EntityPlayerSP)) {
- var14 -= 0.125D;
- }
--
-- super.doRenderLiving(var1, var2, var14, var6, var8, var9);
-+
-+ // Spout Start - VIP
-+ if (!AccessoryHandler.isHandled(par1AbstractClientPlayer.username)) {
-+ AccessoryHandler.addVIPAccessoriesFor(par1AbstractClientPlayer);
-+ }
-+ // Spout End - VIP
-+ super.doRenderLiving(par1AbstractClientPlayer, par2, var14, par6, par8, par9);
- this.modelArmorChestplate.aimedBow = this.modelArmor.aimedBow = this.modelBipedMain.aimedBow = false;
- this.modelArmorChestplate.isSneak = this.modelArmor.isSneak = this.modelBipedMain.isSneak = false;
- this.modelArmorChestplate.heldItemRight = this.modelArmor.heldItemRight = this.modelBipedMain.heldItemRight = 0;
- }
-
-- protected ResourceLocation func_110817_a(AbstractClientPlayer var1) {
-- return var1.getLocationSkin();
-+ protected ResourceLocation func_110817_a(AbstractClientPlayer par1AbstractClientPlayer) {
-+ return par1AbstractClientPlayer.getLocationSkin();
- }
--
-- protected void renderSpecials(AbstractClientPlayer var1, float var2) {
-+
-+ /**
-+ * Method for adding special render rules
-+ */
-+
-+ protected void renderSpecials(AbstractClientPlayer par1AbstractClientPlayer, float par2) {
- float var3 = 1.0F;
- GL11.glColor3f(var3, var3, var3);
-- super.renderEquippedItems(var1, var2);
-- super.renderArrowsStuckInEntity(var1, var2);
-- ItemStack var4 = var1.inventory.armorItemInSlot(3);
-- if(var4 != null) {
-+ super.renderEquippedItems(par1AbstractClientPlayer, par2);
-+ super.renderArrowsStuckInEntity(par1AbstractClientPlayer, par2);
-+ ItemStack var4 = par1AbstractClientPlayer.inventory.armorItemInSlot(3);
-+
-+ if (var4 != null) {
- GL11.glPushMatrix();
-- this.modelBipedMain.bipedHead.postRender(1.0F / 16.0F);
-+ this.modelBipedMain.bipedHead.postRender(0.0625F);
- float var5;
-- if(var4.getItem().itemID < 256) {
-- if(RenderBlocks.renderItemIn3d(Block.blocksList[var4.itemID].getRenderType())) {
-- var5 = 10.0F / 16.0F;
-+
-+ if (var4.getItem().itemID < 256) {
-+ if (RenderBlocks.renderItemIn3d(Block.blocksList[var4.itemID].getRenderType())) {
-+ var5 = 0.625F;
- GL11.glTranslatef(0.0F, -0.25F, 0.0F);
- GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
- GL11.glScalef(var5, -var5, -var5);
- }
-
-- this.renderManager.itemRenderer.renderItem(var1, var4, 0);
-- } else if(var4.getItem().itemID == Item.skull.itemID) {
-+ this.renderManager.itemRenderer.renderItem(par1AbstractClientPlayer, var4, 0);
-+ } else if (var4.getItem().itemID == Item.skull.itemID) {
- var5 = 1.0625F;
- GL11.glScalef(var5, -var5, -var5);
- String var6 = "";
-- if(var4.hasTagCompound() && var4.getTagCompound().hasKey("SkullOwner")) {
-+
-+ if (var4.hasTagCompound() && var4.getTagCompound().hasKey("SkullOwner")) {
- var6 = var4.getTagCompound().getString("SkullOwner");
- }
-
-@@ -132,59 +171,69 @@
-
- GL11.glPopMatrix();
- }
--
-- if(var1.getCommandSenderName().equals("deadmau5") && var1.getTextureSkin().isTextureUploaded()) {
-- this.bindTexture(var1.getLocationSkin());
--
-- for(int var23 = 0; var23 < 2; ++var23) {
-- float var25 = var1.prevRotationYaw + (var1.rotationYaw - var1.prevRotationYaw) * var2 - (var1.prevRenderYawOffset + (var1.renderYawOffset - var1.prevRenderYawOffset) * var2);
-- float var7 = var1.prevRotationPitch + (var1.rotationPitch - var1.prevRotationPitch) * var2;
-+
-+ // Spout Start
-+ if (!par1AbstractClientPlayer.isInvisible()){
-+ AccessoryHandler.renderAllAccessories(par1AbstractClientPlayer, 0.0625F, par2);
-+ }
-+ // Spout End
-+
-+ if (par1AbstractClientPlayer.getCommandSenderName().equals("deadmau5") && par1AbstractClientPlayer.getTextureSkin().isTextureUploaded()) {
-+ this.bindTexture(par1AbstractClientPlayer.getLocationSkin());
-+
-+ for (int var23 = 0; var23 < 2; ++var23) {
-+ float var27 = par1AbstractClientPlayer.prevRotationYaw + (par1AbstractClientPlayer.rotationYaw - par1AbstractClientPlayer.prevRotationYaw) * par2 - (par1AbstractClientPlayer.prevRenderYawOffset + (par1AbstractClientPlayer.renderYawOffset - par1AbstractClientPlayer.prevRenderYawOffset) * par2);
-+ float var7 = par1AbstractClientPlayer.prevRotationPitch + (par1AbstractClientPlayer.rotationPitch - par1AbstractClientPlayer.prevRotationPitch) * par2;
- GL11.glPushMatrix();
-- GL11.glRotatef(var25, 0.0F, 1.0F, 0.0F);
-+ GL11.glRotatef(var27, 0.0F, 1.0F, 0.0F);
- GL11.glRotatef(var7, 1.0F, 0.0F, 0.0F);
-- GL11.glTranslatef(6.0F / 16.0F * (float)(var23 * 2 - 1), 0.0F, 0.0F);
-- GL11.glTranslatef(0.0F, -(6.0F / 16.0F), 0.0F);
-+ GL11.glTranslatef(0.375F * (float)(var23 * 2 - 1), 0.0F, 0.0F);
-+ GL11.glTranslatef(0.0F, -0.375F, 0.0F);
- GL11.glRotatef(-var7, 1.0F, 0.0F, 0.0F);
-- GL11.glRotatef(-var25, 0.0F, 1.0F, 0.0F);
-- float var8 = 4.0F / 3.0F;
-+ GL11.glRotatef(-var27, 0.0F, 1.0F, 0.0F);
-+ float var8 = 1.3333334F;
- GL11.glScalef(var8, var8, var8);
-- this.modelBipedMain.renderEars(1.0F / 16.0F);
-+ this.modelBipedMain.renderEars(0.0625F);
- GL11.glPopMatrix();
- }
- }
-
-- boolean var24 = var1.getTextureCape().isTextureUploaded();
-- boolean var26 = !var1.isInvisible();
-- boolean var27 = !var1.getHideCape();
-+ boolean var24 = par1AbstractClientPlayer.getTextureCape().isTextureUploaded();
-+ boolean var25 = !par1AbstractClientPlayer.isInvisible();
-+ boolean var26 = !par1AbstractClientPlayer.getHideCape();
- float var14;
-- if(var24 && var26 && var27) {
-- this.bindTexture(var1.getLocationCape());
-+
-+ if (var24 && var25 && var26) {
-+ this.bindTexture(par1AbstractClientPlayer.getLocationCape());
- GL11.glPushMatrix();
-- GL11.glTranslatef(0.0F, 0.0F, 2.0F / 16.0F);
-- double var28 = var1.field_71091_bM + (var1.field_71094_bP - var1.field_71091_bM) * (double)var2 - (var1.prevPosX + (var1.posX - var1.prevPosX) * (double)var2);
-- double var10 = var1.field_71096_bN + (var1.field_71095_bQ - var1.field_71096_bN) * (double)var2 - (var1.prevPosY + (var1.posY - var1.prevPosY) * (double)var2);
-- double var12 = var1.field_71097_bO + (var1.field_71085_bR - var1.field_71097_bO) * (double)var2 - (var1.prevPosZ + (var1.posZ - var1.prevPosZ) * (double)var2);
-- var14 = var1.prevRenderYawOffset + (var1.renderYawOffset - var1.prevRenderYawOffset) * var2;
-+ GL11.glTranslatef(0.0F, 0.0F, 0.125F);
-+ double var29 = par1AbstractClientPlayer.field_71091_bM + (par1AbstractClientPlayer.field_71094_bP - par1AbstractClientPlayer.field_71091_bM) * (double)par2 - (par1AbstractClientPlayer.prevPosX + (par1AbstractClientPlayer.posX - par1AbstractClientPlayer.prevPosX) * (double)par2);
-+ double var10 = par1AbstractClientPlayer.field_71096_bN + (par1AbstractClientPlayer.field_71095_bQ - par1AbstractClientPlayer.field_71096_bN) * (double)par2 - (par1AbstractClientPlayer.prevPosY + (par1AbstractClientPlayer.posY - par1AbstractClientPlayer.prevPosY) * (double)par2);
-+ double var12 = par1AbstractClientPlayer.field_71097_bO + (par1AbstractClientPlayer.field_71085_bR - par1AbstractClientPlayer.field_71097_bO) * (double)par2 - (par1AbstractClientPlayer.prevPosZ + (par1AbstractClientPlayer.posZ - par1AbstractClientPlayer.prevPosZ) * (double)par2);
-+ var14 = par1AbstractClientPlayer.prevRenderYawOffset + (par1AbstractClientPlayer.renderYawOffset - par1AbstractClientPlayer.prevRenderYawOffset) * par2;
- double var15 = (double)MathHelper.sin(var14 * (float)Math.PI / 180.0F);
- double var17 = (double)(-MathHelper.cos(var14 * (float)Math.PI / 180.0F));
- float var19 = (float)var10 * 10.0F;
-- if(var19 < -6.0F) {
-+
-+ if (var19 < -6.0F) {
- var19 = -6.0F;
- }
-
-- if(var19 > 32.0F) {
-+ if (var19 > 32.0F) {
- var19 = 32.0F;
- }
-
-- float var20 = (float)(var28 * var15 + var12 * var17) * 100.0F;
-- float var21 = (float)(var28 * var17 - var12 * var15) * 100.0F;
-- if(var20 < 0.0F) {
-+ float var20 = (float)(var29 * var15 + var12 * var17) * 100.0F;
-+ float var21 = (float)(var29 * var17 - var12 * var15) * 100.0F;
-+
-+ if (var20 < 0.0F) {
- var20 = 0.0F;
- }
-
-- float var22 = var1.prevCameraYaw + (var1.cameraYaw - var1.prevCameraYaw) * var2;
-- var19 += MathHelper.sin((var1.prevDistanceWalkedModified + (var1.distanceWalkedModified - var1.prevDistanceWalkedModified) * var2) * 6.0F) * 32.0F * var22;
-- if(var1.isSneaking()) {
-+ float var22 = par1AbstractClientPlayer.prevCameraYaw + (par1AbstractClientPlayer.cameraYaw - par1AbstractClientPlayer.prevCameraYaw) * par2;
-+ var19 += MathHelper.sin((par1AbstractClientPlayer.prevDistanceWalkedModified + (par1AbstractClientPlayer.distanceWalkedModified - par1AbstractClientPlayer.prevDistanceWalkedModified) * par2) * 6.0F) * 32.0F * var22;
-+
-+ if (par1AbstractClientPlayer.isSneaking()) {
- var19 += 25.0F;
- }
-
-@@ -192,181 +241,219 @@
- GL11.glRotatef(var21 / 2.0F, 0.0F, 0.0F, 1.0F);
- GL11.glRotatef(-var21 / 2.0F, 0.0F, 1.0F, 0.0F);
- GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F);
-- this.modelBipedMain.renderCloak(1.0F / 16.0F);
-+ this.modelBipedMain.renderCloak(0.0625F);
- GL11.glPopMatrix();
- }
-
-- ItemStack var29 = var1.inventory.getCurrentItem();
-- if(var29 != null) {
-+ ItemStack var28 = par1AbstractClientPlayer.inventory.getCurrentItem();
-+
-+ if (var28 != null) {
- GL11.glPushMatrix();
-- this.modelBipedMain.bipedRightArm.postRender(1.0F / 16.0F);
-- GL11.glTranslatef(-(1.0F / 16.0F), 7.0F / 16.0F, 1.0F / 16.0F);
-- if(var1.fishEntity != null) {
-- var29 = new ItemStack(Item.stick);
-+ this.modelBipedMain.bipedRightArm.postRender(0.0625F);
-+ GL11.glTranslatef(-0.0625F, 0.4375F, 0.0625F);
-+
-+ if (par1AbstractClientPlayer.fishEntity != null) {
-+ var28 = new ItemStack(Item.stick);
- }
-
- EnumAction var9 = null;
-- if(var1.getItemInUseCount() > 0) {
-- var9 = var29.getItemUseAction();
-+
-+ if (par1AbstractClientPlayer.getItemInUseCount() > 0) {
-+ var9 = var28.getItemUseAction();
- }
-
-- float var30;
-- if(var29.itemID < 256 && RenderBlocks.renderItemIn3d(Block.blocksList[var29.itemID].getRenderType())) {
-- var30 = 0.5F;
-- GL11.glTranslatef(0.0F, 3.0F / 16.0F, -(5.0F / 16.0F));
-- var30 *= 12.0F / 16.0F;
-+ float var31;
-+
-+ if (var28.itemID < 256 && RenderBlocks.renderItemIn3d(Block.blocksList[var28.itemID].getRenderType())) {
-+ var31 = 0.5F;
-+ GL11.glTranslatef(0.0F, 0.1875F, -0.3125F);
-+ var31 *= 0.75F;
- GL11.glRotatef(20.0F, 1.0F, 0.0F, 0.0F);
- GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F);
-- GL11.glScalef(-var30, -var30, var30);
-- } else if(var29.itemID == Item.bow.itemID) {
-- var30 = 10.0F / 16.0F;
-- GL11.glTranslatef(0.0F, 2.0F / 16.0F, 5.0F / 16.0F);
-+ GL11.glScalef(-var31, -var31, var31);
-+ } else if (var28.itemID == Item.bow.itemID) {
-+ var31 = 0.625F;
-+ GL11.glTranslatef(0.0F, 0.125F, 0.3125F);
- GL11.glRotatef(-20.0F, 0.0F, 1.0F, 0.0F);
-- GL11.glScalef(var30, -var30, var30);
-+ GL11.glScalef(var31, -var31, var31);
- GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F);
- GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F);
-- } else if(Item.itemsList[var29.itemID].isFull3D()) {
-- var30 = 10.0F / 16.0F;
-- if(Item.itemsList[var29.itemID].shouldRotateAroundWhenRendering()) {
-+ } else if (Item.itemsList[var28.itemID].isFull3D()) {
-+ var31 = 0.625F;
-+
-+ if (Item.itemsList[var28.itemID].shouldRotateAroundWhenRendering()) {
- GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
-- GL11.glTranslatef(0.0F, -(2.0F / 16.0F), 0.0F);
-+ GL11.glTranslatef(0.0F, -0.125F, 0.0F);
- }
-
-- if(var1.getItemInUseCount() > 0 && var9 == EnumAction.block) {
-+ if (par1AbstractClientPlayer.getItemInUseCount() > 0 && var9 == EnumAction.block) {
- GL11.glTranslatef(0.05F, 0.0F, -0.1F);
- GL11.glRotatef(-50.0F, 0.0F, 1.0F, 0.0F);
- GL11.glRotatef(-10.0F, 1.0F, 0.0F, 0.0F);
- GL11.glRotatef(-60.0F, 0.0F, 0.0F, 1.0F);
- }
-
-- GL11.glTranslatef(0.0F, 3.0F / 16.0F, 0.0F);
-- GL11.glScalef(var30, -var30, var30);
-+ GL11.glTranslatef(0.0F, 0.1875F, 0.0F);
-+ GL11.glScalef(var31, -var31, var31);
- GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F);
- GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F);
- } else {
-- var30 = 6.0F / 16.0F;
-- GL11.glTranslatef(0.25F, 3.0F / 16.0F, -(3.0F / 16.0F));
-- GL11.glScalef(var30, var30, var30);
-+ var31 = 0.375F;
-+ GL11.glTranslatef(0.25F, 0.1875F, -0.1875F);
-+ GL11.glScalef(var31, var31, var31);
- 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);
- }
-
- float var13;
-- int var32;
-- float var33;
-- if(var29.getItem().requiresMultipleRenderPasses()) {
-- for(var32 = 0; var32 <= 1; ++var32) {
-- int var31 = var29.getItem().getColorFromItemStack(var29, var32);
-- var33 = (float)(var31 >> 16 & 255) / 255.0F;
-- var13 = (float)(var31 >> 8 & 255) / 255.0F;
-- var14 = (float)(var31 & 255) / 255.0F;
-- GL11.glColor4f(var33, var13, var14, 1.0F);
-- this.renderManager.itemRenderer.renderItem(var1, var29, var32);
-+ float var32;
-+ int var33;
-+
-+ if (var28.getItem().requiresMultipleRenderPasses()) {
-+ for (var33 = 0; var33 <= 1; ++var33) {
-+ int var11 = var28.getItem().getColorFromItemStack(var28, var33);
-+ var32 = (float)(var11 >> 16 & 255) / 255.0F;
-+ var13 = (float)(var11 >> 8 & 255) / 255.0F;
-+ var14 = (float)(var11 & 255) / 255.0F;
-+ GL11.glColor4f(var32, var13, var14, 1.0F);
-+ this.renderManager.itemRenderer.renderItem(par1AbstractClientPlayer, var28, var33);
- }
- } else {
-- var32 = var29.getItem().getColorFromItemStack(var29, 0);
-- float var11 = (float)(var32 >> 16 & 255) / 255.0F;
-- var33 = (float)(var32 >> 8 & 255) / 255.0F;
-- var13 = (float)(var32 & 255) / 255.0F;
-- GL11.glColor4f(var11, var33, var13, 1.0F);
-- this.renderManager.itemRenderer.renderItem(var1, var29, 0);
-+ var33 = var28.getItem().getColorFromItemStack(var28, 0);
-+ float var30 = (float)(var33 >> 16 & 255) / 255.0F;
-+ var32 = (float)(var33 >> 8 & 255) / 255.0F;
-+ var13 = (float)(var33 & 255) / 255.0F;
-+ GL11.glColor4f(var30, var32, var13, 1.0F);
-+ this.renderManager.itemRenderer.renderItem(par1AbstractClientPlayer, var28, 0);
- }
-
- GL11.glPopMatrix();
- }
--
- }
-
-- protected void renderPlayerScale(AbstractClientPlayer var1, float var2) {
-- float var3 = 15.0F / 16.0F;
-+ protected void renderPlayerScale(AbstractClientPlayer par1AbstractClientPlayer, float par2) {
-+ float var3 = 0.9375F;
-+ // Spout Start
-+ String cleanUserName = ChatColor.stripColor(par1AbstractClientPlayer.getEntityName());
-+ VIP vip = Resources.getVIP(cleanUserName);
-+
-+ if (vip != null) {
-+ var3 = vip.getScale();
-+ }
-+ // Spout End
- GL11.glScalef(var3, var3, var3);
- }
-
-- protected void func_96450_a(AbstractClientPlayer var1, double var2, double var4, double var6, String var8, float var9, double var10) {
-- if(var10 < 100.0D) {
-- Scoreboard var12 = var1.getWorldScoreboard();
-+ protected void func_96450_a(AbstractClientPlayer par1AbstractClientPlayer, double par2, double par4, double par6, String par8Str, float par9, double par10) {
-+ if (par10 < 100.0D) {
-+ Scoreboard var12 = par1AbstractClientPlayer.getWorldScoreboard();
- ScoreObjective var13 = var12.func_96539_a(2);
-- if(var13 != null) {
-- Score var14 = var12.func_96529_a(var1.getEntityName(), var13);
-- if(var1.isPlayerSleeping()) {
-- this.renderLivingLabel(var1, var14.getScorePoints() + " " + var13.getDisplayName(), var2, var4 - 1.5D, var6, 64);
-+
-+ if (var13 != null) {
-+ Score var14 = var12.func_96529_a(par1AbstractClientPlayer.getEntityName(), var13);
-+
-+ if (par1AbstractClientPlayer.isPlayerSleeping()) {
-+ this.renderLivingLabel(par1AbstractClientPlayer, var14.getScorePoints() + " " + var13.getDisplayName(), par2, par4 - 1.5D, par6, 64);
- } else {
-- this.renderLivingLabel(var1, var14.getScorePoints() + " " + var13.getDisplayName(), var2, var4, var6, 64);
-+ this.renderLivingLabel(par1AbstractClientPlayer, var14.getScorePoints() + " " + var13.getDisplayName(), par2, par4, par6, 64);
- }
-
-- var4 += (double)((float)this.getFontRendererFromRenderManager().FONT_HEIGHT * 1.15F * var9);
-+ par4 += (double)((float)this.getFontRendererFromRenderManager().FONT_HEIGHT * 1.15F * par9);
- }
- }
-
-- super.func_96449_a(var1, var2, var4, var6, var8, var9, var10);
-+ super.func_96449_a(par1AbstractClientPlayer, par2, par4, par6, par8Str, par9, par10);
- }
-
-- public void renderFirstPersonArm(EntityPlayer var1) {
-+ public void renderFirstPersonArm(EntityPlayer par1EntityPlayer) {
- float var2 = 1.0F;
- GL11.glColor3f(var2, var2, var2);
- this.modelBipedMain.onGround = 0.0F;
-- this.modelBipedMain.setRotationAngles(0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 1.0F / 16.0F, var1);
-- this.modelBipedMain.bipedRightArm.render(1.0F / 16.0F);
-+ this.modelBipedMain.setRotationAngles(0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, par1EntityPlayer);
-+ this.modelBipedMain.bipedRightArm.render(0.0625F);
- }
-
-- protected void renderPlayerSleep(AbstractClientPlayer var1, double var2, double var4, double var6) {
-- if(var1.isEntityAlive() && var1.isPlayerSleeping()) {
-- super.renderLivingAt(var1, var2 + (double)var1.field_71079_bU, var4 + (double)var1.field_71082_cx, var6 + (double)var1.field_71089_bV);
-+ /**
-+ * Renders player with sleeping offset if sleeping
-+ */
-+ protected void renderPlayerSleep(AbstractClientPlayer par1AbstractClientPlayer, double par2, double par4, double par6) {
-+ if (par1AbstractClientPlayer.isEntityAlive() && par1AbstractClientPlayer.isPlayerSleeping()) {
-+ super.renderLivingAt(par1AbstractClientPlayer, par2 + (double)par1AbstractClientPlayer.field_71079_bU, par4 + (double)par1AbstractClientPlayer.field_71082_cx, par6 + (double)par1AbstractClientPlayer.field_71089_bV);
- } else {
-- super.renderLivingAt(var1, var2, var4, var6);
-+ super.renderLivingAt(par1AbstractClientPlayer, par2, par4, par6);
- }
--
- }
-
-- protected void rotatePlayer(AbstractClientPlayer var1, float var2, float var3, float var4) {
-- if(var1.isEntityAlive() && var1.isPlayerSleeping()) {
-- GL11.glRotatef(var1.getBedOrientationInDegrees(), 0.0F, 1.0F, 0.0F);
-- GL11.glRotatef(this.getDeathMaxRotation(var1), 0.0F, 0.0F, 1.0F);
-+ /**
-+ * Rotates the player if the player is sleeping. This method is called in rotateCorpse.
-+ */
-+ protected void rotatePlayer(AbstractClientPlayer par1AbstractClientPlayer, float par2, float par3, float par4) {
-+ if (par1AbstractClientPlayer.isEntityAlive() && par1AbstractClientPlayer.isPlayerSleeping()) {
-+ GL11.glRotatef(par1AbstractClientPlayer.getBedOrientationInDegrees(), 0.0F, 1.0F, 0.0F);
-+ GL11.glRotatef(this.getDeathMaxRotation(par1AbstractClientPlayer), 0.0F, 0.0F, 1.0F);
- GL11.glRotatef(270.0F, 0.0F, 1.0F, 0.0F);
- } else {
-- super.rotateCorpse(var1, var2, var3, var4);
-+ super.rotateCorpse(par1AbstractClientPlayer, par2, par3, par4);
- }
--
-- }
--
-- protected void func_96449_a(EntityLivingBase var1, double var2, double var4, double var6, String var8, float var9, double var10) {
-- this.func_96450_a((AbstractClientPlayer)var1, var2, var4, var6, var8, var9, var10);
-- }
--
-- protected void preRenderCallback(EntityLivingBase var1, float var2) {
-- this.renderPlayerScale((AbstractClientPlayer)var1, var2);
-- }
--
-- protected void func_82408_c(EntityLivingBase var1, int var2, float var3) {
-- this.func_130220_b((AbstractClientPlayer)var1, var2, var3);
-- }
--
-- protected int shouldRenderPass(EntityLivingBase var1, int var2, float var3) {
-- return this.setArmorModel((AbstractClientPlayer)var1, var2, var3);
-- }
--
-- protected void renderEquippedItems(EntityLivingBase var1, float var2) {
-- this.renderSpecials((AbstractClientPlayer)var1, var2);
-- }
--
-- protected void rotateCorpse(EntityLivingBase var1, float var2, float var3, float var4) {
-- this.rotatePlayer((AbstractClientPlayer)var1, var2, var3, var4);
-- }
--
-- protected void renderLivingAt(EntityLivingBase var1, double var2, double var4, double var6) {
-- this.renderPlayerSleep((AbstractClientPlayer)var1, var2, var4, var6);
-- }
--
-- public void doRenderLiving(EntityLivingBase var1, double var2, double var4, double var6, float var8, float var9) {
-- this.func_130009_a((AbstractClientPlayer)var1, var2, var4, var6, var8, var9);
-- }
--
-- protected ResourceLocation getEntityTexture(Entity var1) {
-- return this.func_110817_a((AbstractClientPlayer)var1);
-- }
--
-- public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) {
-- this.func_130009_a((AbstractClientPlayer)var1, var2, var4, var6, var8, var9);
-+ }
-+
-+ protected void func_96449_a(EntityLivingBase par1EntityLivingBase, double par2, double par4, double par6, String par8Str, float par9, double par10) {
-+ this.func_96450_a((AbstractClientPlayer)par1EntityLivingBase, par2, par4, par6, par8Str, par9, par10);
-+ }
-+
-+ /**
-+ * 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.renderPlayerScale((AbstractClientPlayer)par1EntityLivingBase, par2);
-+ }
-+
-+ protected void func_82408_c(EntityLivingBase par1EntityLivingBase, int par2, float par3) {
-+ this.func_130220_b((AbstractClientPlayer)par1EntityLivingBase, par2, par3);
-+ }
-+
-+ /**
-+ * Queries whether should render the specified pass or not.
-+ */
-+ protected int shouldRenderPass(EntityLivingBase par1EntityLivingBase, int par2, float par3) {
-+ return this.setArmorModel((AbstractClientPlayer)par1EntityLivingBase, par2, par3);
-+ }
-+
-+ protected void renderEquippedItems(EntityLivingBase par1EntityLivingBase, float par2) {
-+ this.renderSpecials((AbstractClientPlayer)par1EntityLivingBase, par2);
-+ }
-+
-+ protected void rotateCorpse(EntityLivingBase par1EntityLivingBase, float par2, float par3, float par4) {
-+ this.rotatePlayer((AbstractClientPlayer)par1EntityLivingBase, par2, par3, par4);
-+ }
-+
-+ /**
-+ * Sets a simple glTranslate on a LivingEntity.
-+ */
-+ protected void renderLivingAt(EntityLivingBase par1EntityLivingBase, double par2, double par4, double par6) {
-+ this.renderPlayerSleep((AbstractClientPlayer)par1EntityLivingBase, par2, par4, par6);
-+ }
-+
-+ public void doRenderLiving(EntityLivingBase par1EntityLivingBase, double par2, double par4, double par6, float par8, float par9) {
-+ this.func_130009_a((AbstractClientPlayer)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_110817_a((AbstractClientPlayer)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
-+ * Spoutcraft is licensed under the GNU Lesser General Public License.
-+ *
-+ * Spoutcraft is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation, either version 3 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Spoutcraft is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program. If not, see .
-+ */
-+package org.spoutcraft.client.packet;
-+
-+import java.io.IOException;
-+
-+import net.minecraft.src.GuiYesNo;
-+
-+import org.spoutcraft.api.io.SpoutInputStream;
-+import org.spoutcraft.api.io.SpoutOutputStream;
-+import org.spoutcraft.client.SpoutClient;
-+import org.spoutcraft.client.gui.CustomScreen;
-+import org.spoutcraft.client.gui.precache.GuiPrecache;
-+import org.spoutcraft.client.io.FileDownloadThread;
-+
-+public class PacketPreCacheCompleted implements SpoutPacket {
-+ public PacketPreCacheCompleted() {
-+ System.out.println("[Spoutcraft Cache Manager] Completed: " + System.currentTimeMillis());
-+ }
-+
-+ public int getNumBytes() {
-+ return 0;
-+ }
-+
-+ public void readData(SpoutInputStream input) throws IOException {
-+ }
-+
-+ public void writeData(SpoutOutputStream output) throws IOException {
-+ }
-+
-+ public void run(int playerId) {
-+ FileDownloadThread.preCacheCompleted.set(System.currentTimeMillis());
-+ SpoutClient.getInstance().getPacketManager().sendSpoutPacket(this);
-+ if (!(SpoutClient.getHandle().currentScreen instanceof CustomScreen) && !(SpoutClient.getHandle().currentScreen instanceof GuiYesNo)) {
-+ // Closes downloading terrain
-+ SpoutClient.getHandle().displayGuiScreen(null, false);
-+ // Prevent closing a plugin created menu from opening the downloading terrain
-+ SpoutClient.getHandle().clearPreviousScreen();
-+ }
-+ if (SpoutClient.getHandle().currentScreen instanceof GuiPrecache) {
-+ // Closes downloading terrain
-+ SpoutClient.getHandle().displayGuiScreen(null, false);
-+ // Prevent closing a plugin created menu from opening the downloading terrain
-+ SpoutClient.getHandle().clearPreviousScreen();
-+ }
-+ }
-+
-+ public void failure(int playerId) {
-+ }
-+
-+ public PacketType getPacketType() {
-+ return PacketType.PacketPreCacheCompleted;
-+ }
-+
-+ public int getVersion() {
-+ return 0;
-+ }
-+}
---- /dev/null
-+++ org/spoutcraft/api/gui/GenericItemWidget.java
-@@ -1,0 +1,115 @@
-+/*
-+ * This file is part of Spoutcraft.
-+ *
-+ * Copyright (c) 2011 SpoutcraftDev
-+ * Spoutcraft is licensed under the GNU Lesser General Public License.
-+ *
-+ * Spoutcraft is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation, either version 3 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Spoutcraft is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program. If not, see .
-+ */
-+package org.spoutcraft.api.gui;
-+
-+import java.io.IOException;
-+
-+import org.spoutcraft.api.Spoutcraft;
-+import org.spoutcraft.api.UnsafeClass;
-+import org.spoutcraft.api.inventory.ItemStack;
-+import org.spoutcraft.api.io.SpoutInputStream;
-+import org.spoutcraft.api.io.SpoutOutputStream;
-+
-+@UnsafeClass
-+public class GenericItemWidget extends GenericWidget implements ItemWidget {
-+ protected int material = -1;
-+ protected short data = -1;
-+ protected int depth = 8;
-+ protected ItemStack toRender = null;
-+
-+ public GenericItemWidget() {
-+ this(new ItemStack(0));
-+ }
-+
-+ public GenericItemWidget(ItemStack item) {
-+ this.material = item.getTypeId();
-+ this.data = item.getDurability();
-+ }
-+
-+ public int getVersion() {
-+ return super.getVersion() + 0;
-+ }
-+
-+ @Override
-+ public void readData(SpoutInputStream input) throws IOException {
-+ super.readData(input);
-+ this.setTypeId(input.readInt());
-+ this.setData(input.readShort());
-+ this.setDepth(input.readInt());
-+ }
-+
-+ @Override
-+ public void writeData(SpoutOutputStream output) throws IOException {
-+ super.writeData(output);
-+ output.writeInt(getTypeId());
-+ output.writeShort(getData());
-+ output.writeInt(getDepth());
-+ }
-+
-+ public ItemWidget setTypeId(int id) {
-+ this.material = id;
-+ return this;
-+ }
-+
-+ public int getTypeId() {
-+ return material;
-+ }
-+
-+ public ItemWidget setData(short data) {
-+ this.data = data;
-+ return this;
-+ }
-+
-+ public short getData() {
-+ return data;
-+ }
-+
-+ public ItemWidget setDepth(int depth) {
-+ this.depth = depth;
-+ return this;
-+ }
-+
-+ public int getDepth() {
-+ return depth;
-+ }
-+
-+ public ItemWidget setHeight(int height) {
-+ super.setHeight(height);
-+ return this;
-+ }
-+
-+ public ItemWidget setWidth(int width) {
-+ super.setWidth(width);
-+ return this;
-+ }
-+
-+ public WidgetType getType() {
-+ return WidgetType.ItemWidget;
-+ }
-+
-+ @Override
-+ public ItemWidget copy() {
-+ return ((ItemWidget)super.copy()).setTypeId(getTypeId()).setData(getData()).setDepth(getDepth());
-+ }
-+
-+ public void render() {
-+ Spoutcraft.getClient().getRenderDelegate().render(this);
-+ }
-+}
---- net/minecraft/src/SaveHandler.java
-+++ net/minecraft/src/SaveHandler.java
-@@ -9,29 +9,43 @@
- import net.minecraft.server.MinecraftServer;
-
- public class SaveHandler implements ISaveHandler, IPlayerFileData {
-- private final File a;
-- private final File b;
-- private final File c;
-- private final long initializationTime = MinecraftServer.getCurrentTimeMillis();
-- private final String e;
--
-- public SaveHandler(File var1, String var2, boolean var3) {
-- this.a = new File(var1, var2);
-- this.a.mkdirs();
-- this.b = new File(this.a, "players");
-- this.c = new File(this.a, "data");
-- this.c.mkdirs();
-- this.e = var2;
-- if(var3) {
-- this.b.mkdirs();
-+
-+ /** The directory in which to save world data. */
-+ private final File worldDirectory;
-+
-+ /** The directory in which to save player data. */
-+ private final File playersDirectory;
-+ private final File mapDataDir;
-+
-+ /**
-+ * The time in milliseconds when this field was initialized. Stored in the session lock file.
-+ */
-+ private final long initializationTime = MinecraftServer.getSystemTimeMillis();
-+
-+ /** The directory name of the world */
-+ private final String saveDirectoryName;
-+
-+ public SaveHandler(File par1File, String par2Str, boolean par3) {
-+ this.worldDirectory = new File(par1File, par2Str);
-+ this.worldDirectory.mkdirs();
-+ this.playersDirectory = new File(this.worldDirectory, "players");
-+ this.mapDataDir = new File(this.worldDirectory, "data");
-+ this.mapDataDir.mkdirs();
-+ this.saveDirectoryName = par2Str;
-+
-+ if (par3) {
-+ this.playersDirectory.mkdirs();
- }
-
- this.setSessionLock();
- }
-
-+ /**
-+ * Creates a session lock file for this process
-+ */
- private void setSessionLock() {
- try {
-- File var1 = new File(this.a, "session.lock");
-+ File var1 = new File(this.worldDirectory, "session.lock");
- DataOutputStream var2 = new DataOutputStream(new FileOutputStream(var1));
-
- try {
-@@ -39,44 +53,55 @@
- } finally {
- var2.close();
- }
--
- } catch (IOException var7) {
- var7.printStackTrace();
- throw new RuntimeException("Failed to check session lock, aborting");
- }
- }
-
-+ /**
-+ * Gets the File object corresponding to the base directory of this world.
-+ */
- protected File getWorldDirectory() {
-- return this.a;
-+ return this.worldDirectory;
- }
-
-+ /**
-+ * Checks the session lock to prevent save collisions
-+ */
- public void checkSessionLock() throws MinecraftException {
- try {
-- File var1 = new File(this.a, "session.lock");
-+ File var1 = new File(this.worldDirectory, "session.lock");
- DataInputStream var2 = new DataInputStream(new FileInputStream(var1));
-
- try {
-- if(var2.readLong() != this.initializationTime) {
-+ if (var2.readLong() != this.initializationTime) {
- throw new MinecraftException("The save is being accessed from another location, aborting");
- }
- } finally {
- var2.close();
- }
--
- } catch (IOException var7) {
- throw new MinecraftException("Failed to check session lock, aborting");
- }
- }
-
-- public IChunkLoader getChunkLoader(WorldProvider var1) {
-+ /**
-+ * Returns the chunk loader with the provided world provider
-+ */
-+ public IChunkLoader getChunkLoader(WorldProvider par1WorldProvider) {
- throw new RuntimeException("Old Chunk Storage is no longer supported.");
- }
-
-+ /**
-+ * Loads and returns the world info
-+ */
- public WorldInfo loadWorldInfo() {
-- File var1 = new File(this.a, "level.dat");
-+ File var1 = new File(this.worldDirectory, "level.dat");
- NBTTagCompound var2;
- NBTTagCompound var3;
-- if(var1.exists()) {
-+
-+ if (var1.exists()) {
- try {
- var2 = CompressedStreamTools.readCompressed(new FileInputStream(var1));
- var3 = var2.getCompoundTag("Data");
-@@ -86,8 +111,9 @@
- }
- }
-
-- var1 = new File(this.a, "level.dat_old");
-- if(var1.exists()) {
-+ var1 = new File(this.worldDirectory, "level.dat_old");
-+
-+ if (var1.exists()) {
- try {
- var2 = CompressedStreamTools.readCompressed(new FileInputStream(var1));
- var3 = var2.getCompoundTag("Data");
-@@ -100,113 +126,140 @@
- return null;
- }
-
-- public void saveWorldInfoWithPlayer(WorldInfo var1, NBTTagCompound var2) {
-- NBTTagCompound var3 = var1.cloneNBTCompound(var2);
-+ /**
-+ * Saves the given World Info with the given NBTTagCompound as the Player.
-+ */
-+ public void saveWorldInfoWithPlayer(WorldInfo par1WorldInfo, NBTTagCompound par2NBTTagCompound) {
-+ NBTTagCompound var3 = par1WorldInfo.cloneNBTCompound(par2NBTTagCompound);
- NBTTagCompound var4 = new NBTTagCompound();
- var4.setTag("Data", var3);
-
- try {
-- File var5 = new File(this.a, "level.dat_new");
-- File var6 = new File(this.a, "level.dat_old");
-- File var7 = new File(this.a, "level.dat");
-+ File var5 = new File(this.worldDirectory, "level.dat_new");
-+ File var6 = new File(this.worldDirectory, "level.dat_old");
-+ File var7 = new File(this.worldDirectory, "level.dat");
- CompressedStreamTools.writeCompressed(var4, new FileOutputStream(var5));
-- if(var6.exists()) {
-+
-+ if (var6.exists()) {
- var6.delete();
- }
-
- var7.renameTo(var6);
-- if(var7.exists()) {
-+
-+ if (var7.exists()) {
- var7.delete();
- }
-
- var5.renameTo(var7);
-- if(var5.exists()) {
-+
-+ if (var5.exists()) {
- var5.delete();
- }
- } catch (Exception var8) {
- var8.printStackTrace();
- }
--
- }
-
-- public void saveWorldInfo(WorldInfo var1) {
-- NBTTagCompound var2 = var1.getNBTTagCompound();
-+ /**
-+ * Saves the passed in world info.
-+ */
-+ public void saveWorldInfo(WorldInfo par1WorldInfo) {
-+ NBTTagCompound var2 = par1WorldInfo.getNBTTagCompound();
- NBTTagCompound var3 = new NBTTagCompound();
- var3.setTag("Data", var2);
-
- try {
-- File var4 = new File(this.a, "level.dat_new");
-- File var5 = new File(this.a, "level.dat_old");
-- File var6 = new File(this.a, "level.dat");
-+ File var4 = new File(this.worldDirectory, "level.dat_new");
-+ File var5 = new File(this.worldDirectory, "level.dat_old");
-+ File var6 = new File(this.worldDirectory, "level.dat");
- CompressedStreamTools.writeCompressed(var3, new FileOutputStream(var4));
-- if(var5.exists()) {
-+
-+ if (var5.exists()) {
- var5.delete();
- }
-
- var6.renameTo(var5);
-- if(var6.exists()) {
-+
-+ if (var6.exists()) {
- var6.delete();
- }
-
- var4.renameTo(var6);
-- if(var4.exists()) {
-+
-+ if (var4.exists()) {
- var4.delete();
- }
- } catch (Exception var7) {
- var7.printStackTrace();
- }
--
- }
-
-- public void writePlayerData(EntityPlayer var1) {
-+ /**
-+ * Writes the player data to disk from the specified PlayerEntityMP.
-+ */
-+ public void writePlayerData(EntityPlayer par1EntityPlayer) {
- try {
- NBTTagCompound var2 = new NBTTagCompound();
-- var1.writeToNBT(var2);
-- File var3 = new File(this.b, var1.getCommandSenderName() + ".dat.tmp");
-- File var4 = new File(this.b, var1.getCommandSenderName() + ".dat");
-+ par1EntityPlayer.writeToNBT(var2);
-+ File var3 = new File(this.playersDirectory, par1EntityPlayer.getCommandSenderName() + ".dat.tmp");
-+ File var4 = new File(this.playersDirectory, par1EntityPlayer.getCommandSenderName() + ".dat");
- CompressedStreamTools.writeCompressed(var2, new FileOutputStream(var3));
-- if(var4.exists()) {
-+
-+ if (var4.exists()) {
- var4.delete();
- }
-
- var3.renameTo(var4);
- } catch (Exception var5) {
-- MinecraftServer.getServer().getLogAgent().logWarning("Failed to save player data for " + var1.getCommandSenderName());
-+ MinecraftServer.getServer().getLogAgent().logWarning("Failed to save player data for " + par1EntityPlayer.getCommandSenderName());
- }
--
- }
-
-- public NBTTagCompound readPlayerData(EntityPlayer var1) {
-- NBTTagCompound var2 = this.getPlayerData(var1.getCommandSenderName());
-- if(var2 != null) {
-- var1.readFromNBT(var2);
-+ /**
-+ * Reads the player data from disk into the specified PlayerEntityMP.
-+ */
-+ public NBTTagCompound readPlayerData(EntityPlayer par1EntityPlayer) {
-+ NBTTagCompound var2 = this.getPlayerData(par1EntityPlayer.getCommandSenderName());
-+
-+ if (var2 != null) {
-+ par1EntityPlayer.readFromNBT(var2);
- }
-
- return var2;
- }
-
-- public NBTTagCompound getPlayerData(String var1) {
-+ /**
-+ * Gets the player data for the given playername as a NBTTagCompound.
-+ */
-+ public NBTTagCompound getPlayerData(String par1Str) {
- try {
-- File var2 = new File(this.b, var1 + ".dat");
-- if(var2.exists()) {
-+ File var2 = new File(this.playersDirectory, par1Str + ".dat");
-+
-+ if (var2.exists()) {
- return CompressedStreamTools.readCompressed(new FileInputStream(var2));
- }
- } catch (Exception var3) {
-- MinecraftServer.getServer().getLogAgent().logWarning("Failed to load player data for " + var1);
-+ MinecraftServer.getServer().getLogAgent().logWarning("Failed to load player data for " + par1Str);
- }
-
- return null;
- }
-
-- public IPlayerFileData getPlayerNBTManager() {
-+ /**
-+ * returns null if no saveHandler is relevent (eg. SMP)
-+ */
-+ public IPlayerFileData getSaveHandler() {
- return this;
- }
-
-+ /**
-+ * Returns an array of usernames for which player.dat exists for.
-+ */
- public String[] getAvailablePlayerDat() {
-- String[] var1 = this.b.list();
-+ String[] var1 = this.playersDirectory.list();
-
-- for(int var2 = 0; var2 < var1.length; ++var2) {
-- if(var1[var2].endsWith(".dat")) {
-+ for (int var2 = 0; var2 < var1.length; ++var2) {
-+ if (var1[var2].endsWith(".dat")) {
- var1[var2] = var1[var2].substring(0, var1[var2].length() - 4);
- }
- }
-@@ -214,14 +267,22 @@
- return var1;
- }
-
-- public void flush() {
-- }
--
-- public File getMapFileFromName(String var1) {
-- return new File(this.c, var1 + ".dat");
-- }
--
-+ /**
-+ * Called to flush all changes to disk, waiting for them to complete.
-+ */
-+ public void flush() {}
-+
-+ /**
-+ * Gets the file location of the given map
-+ */
-+ public File getMapFileFromName(String par1Str) {
-+ return new File(this.mapDataDir, par1Str + ".dat");
-+ }
-+
-+ /**
-+ * Returns the name of the directory where world information is saved.
-+ */
- public String getWorldDirectoryName() {
-- return this.e;
-+ return this.saveDirectoryName;
- }
- }
---- /dev/null
-+++ org/spoutcraft/client/gui/server/MinecraftServiceListener.java
-@@ -1,0 +1,65 @@
-+/*
-+ * This file is part of Spoutcraft.
-+ *
-+ * Copyright (c) 2011 SpoutcraftDev
-+ * Spoutcraft is licensed under the GNU Lesser General Public License.
-+ *
-+ * Spoutcraft is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation, either version 3 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Spoutcraft is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program. If not, see .
-+ */
-+package org.spoutcraft.client.gui.server;
-+
-+import java.net.InetAddress;
-+import java.util.Timer;
-+import java.util.TimerTask;
-+
-+import javax.jmdns.ServiceEvent;
-+import javax.jmdns.ServiceListener;
-+
-+public class MinecraftServiceListener implements ServiceListener {
-+ private LANModel model;
-+ private Timer timer;
-+
-+ public MinecraftServiceListener(LANModel lanModel) {
-+ this.model = lanModel;
-+ this.timer = new Timer();
-+ }
-+
-+ @Override
-+ public void serviceAdded(final ServiceEvent arg0) {
-+ //System.out.println("Service Added " + arg0);
-+ timer.schedule(new TimerTask() {
-+ @Override
-+ public void run() {
-+ model.dns.requestServiceInfo(arg0.getType(), arg0.getName(), 5000);
-+ }
-+ }, 200);
-+ }
-+
-+ @Override
-+ public void serviceRemoved(ServiceEvent arg0) {
-+ //System.out.println("Service Removed " + arg0);
-+ model.removeItem(arg0.getName());
-+ }
-+
-+ @Override
-+ public void serviceResolved(ServiceEvent arg0) {
-+ //System.out.println("Service Resolved " + arg0);
-+ InetAddress[] addresses = arg0.getInfo().getInetAddresses();
-+ if (addresses.length > 0) {
-+ InetAddress address = addresses[0];
-+ ServerItem item = new ServerItem(arg0.getName(), address.getHostAddress(), arg0.getInfo().getPort(), -1);
-+ model.addItem(item);
-+ }
-+ }
-+}
---- /dev/null
-+++ com/prupe/mcpatcher/ctm/TileOverrideImpl.java
-@@ -1,0 +1,4 @@
-+package com.prupe.mcpatcher.ctm;
-+
-+class TileOverrideImpl {
-+}
---- /dev/null
-+++ org/spoutcraft/api/gui/ArmorBar.java
-@@ -1,0 +1,152 @@
-+/*
-+ * This file is part of Spoutcraft.
-+ *
-+ * Copyright (c) 2011 SpoutcraftDev
-+ * Spoutcraft is licensed under the GNU Lesser General Public License.
-+ *
-+ * Spoutcraft is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation, either version 3 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Spoutcraft is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program. If not, see .
-+ */
-+package org.spoutcraft.api.gui;
-+
-+import java.io.IOException;
-+import java.util.UUID;
-+
-+import org.spoutcraft.api.Spoutcraft;
-+import org.spoutcraft.api.UnsafeClass;
-+import org.spoutcraft.api.io.SpoutInputStream;
-+import org.spoutcraft.api.io.SpoutOutputStream;
-+
-+@UnsafeClass
-+public class ArmorBar extends GenericWidget {
-+ private int icons = 10;
-+ private boolean alwaysVisible = false;
-+ private int iconOffset = 8;
-+
-+ public ArmorBar() {
-+ super();
-+ setX(427 / 2 - 91); // 122
-+ setY(191);
-+ setAnchor(WidgetAnchor.BOTTOM_CENTER);
-+ }
-+
-+ @Override
-+ public void readData(SpoutInputStream input) throws IOException {
-+ super.readData(input);
-+ setMaxNumShields(input.readInt());
-+ setAlwaysVisible(input.readBoolean());
-+ setIconOffset(input.readInt());
-+ }
-+
-+ @Override
-+ public void writeData(SpoutOutputStream output) throws IOException {
-+ super.writeData(output);
-+ output.writeInt(getMaxNumShields());
-+ output.writeBoolean(isAlwaysVisible());
-+ output.writeInt(getIconOffset());
-+ }
-+
-+ public WidgetType getType() {
-+ return WidgetType.ArmorBar;
-+ }
-+
-+ @Override
-+ public double getScreenX() {
-+ double mid = getScreen() != null ? getScreen().getWidth() / 2 : 427 / 2D;
-+ double diff = super.getScreenX() - mid - 31;
-+ return getScreen() != null ? getScreen().getWidth() / 2D - diff : this.getX();
-+ }
-+
-+ @Override
-+ public double getScreenY() {
-+ int diff = (int) (240 - this.getY());
-+ return getScreen() != null ? getScreen().getHeight() - diff : this.getY();
-+ }
-+
-+ public UUID getId() {
-+ return new UUID(0, 0);
-+ }
-+
-+ /**
-+ * Gets the maximum number of shields displayed on the HUD.
-+ *
-+ * Armor is scaled to fit the number of shields appropriately.
-+ *
-+ * @return shields displayed
-+ */
-+ public int getMaxNumShields() {
-+ return icons;
-+ }
-+
-+ /**
-+ * Sets the maximum number of shields displayed on the HUD.
-+ *
-+ * Armor is scaled to fit the number of shields appropriately.
-+ *
-+ * @param shields to display
-+ * @return this
-+ */
-+ public ArmorBar setMaxNumShields(int icons) {
-+ this.icons = icons;
-+ return this;
-+ }
-+
-+ /**
-+ * True if the armor bar will appear even when the player has no armor equipped.
-+ *
-+ * @return always visible
-+ */
-+ public boolean isAlwaysVisible() {
-+ return alwaysVisible;
-+ }
-+
-+ /**
-+ * Forces the armor bar to appear, even when the player has no armor equipped.
-+ *
-+ * @param visible
-+ * @return this
-+ */
-+ public ArmorBar setAlwaysVisible(boolean visible) {
-+ alwaysVisible = visible;
-+ return this;
-+ }
-+
-+ /**
-+ * Gets the number of pixels each shield is offset when drawing the next shield.
-+ *
-+ * @return pixel offset
-+ */
-+ public int getIconOffset() {
-+ return iconOffset;
-+ }
-+
-+ /**
-+ * Sets the number of pixels each shield is offset when drawing the next shield.
-+ *
-+ * @param offset when drawing shields
-+ * @return this
-+ */
-+ public ArmorBar setIconOffset(int offset) {
-+ iconOffset = offset;
-+ return this;
-+ }
-+
-+ public void render() {
-+ Spoutcraft.getClient().getRenderDelegate().render(this);
-+ }
-+
-+ @Override
-+ public int getVersion() {
-+ return super.getVersion() + 1;
-+ }
-+}
---- net/minecraft/src/RenderSkeleton.java
-+++ net/minecraft/src/RenderSkeleton.java
-@@ -10,30 +10,36 @@
- super(new ModelSkeleton(), 0.5F);
- }
-
-- protected void scaleSkeleton(EntitySkeleton var1, float var2) {
-- if(var1.getSkeletonType() == 1) {
-+ protected void scaleSkeleton(EntitySkeleton par1EntitySkeleton, float par2) {
-+ if (par1EntitySkeleton.getSkeletonType() == 1) {
- GL11.glScalef(1.2F, 1.2F, 1.2F);
- }
--
- }
-
- protected void func_82422_c() {
-- GL11.glTranslatef(0.09375F, 3.0F / 16.0F, 0.0F);
-- }
--
-- protected ResourceLocation func_110860_a(EntitySkeleton var1) {
-- return var1.getSkeletonType() == 1 ? witherSkeletonTextures : skeletonTextures;
-- }
--
-- protected ResourceLocation func_110856_a(EntityLiving var1) {
-- return this.func_110860_a((EntitySkeleton)var1);
-- }
--
-- protected void preRenderCallback(EntityLivingBase var1, float var2) {
-- this.scaleSkeleton((EntitySkeleton)var1, var2);
-- }
--
-- protected ResourceLocation getEntityTexture(Entity var1) {
-- return this.func_110860_a((EntitySkeleton)var1);
-+ GL11.glTranslatef(0.09375F, 0.1875F, 0.0F);
-+ }
-+
-+ protected ResourceLocation func_110860_a(EntitySkeleton par1EntitySkeleton) {
-+ return par1EntitySkeleton.getSkeletonType() == 1 ? witherSkeletonTextures : skeletonTextures;
-+ }
-+
-+ protected ResourceLocation func_110856_a(EntityLiving par1EntityLiving) {
-+ return this.func_110860_a((EntitySkeleton)par1EntityLiving);
-+ }
-+
-+ /**
-+ * 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.scaleSkeleton((EntitySkeleton)par1EntityLivingBase, par2);
-+ }
-+
-+ /**
-+ * 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_110860_a((EntitySkeleton)par1Entity);
- }
- }
---- /dev/null
-+++ org/spoutcraft/client/inventory/CraftInventory.java
-@@ -1,0 +1,376 @@
-+/*
-+ * This file is part of Spoutcraft.
-+ *
-+ * Copyright (c) 2011 SpoutcraftDev
-+ * Spoutcraft is licensed under the GNU Lesser General Public License.
-+ *
-+ * Spoutcraft is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation, either version 3 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Spoutcraft is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program. If not, see .
-+ */
-+package org.spoutcraft.client.inventory;
-+
-+import java.util.HashMap;
-+
-+import net.minecraft.src.IInventory;
-+
-+import org.spoutcraft.api.inventory.Inventory;
-+import org.spoutcraft.api.inventory.ItemStack;
-+import org.spoutcraft.api.material.Material;
-+
-+public class CraftInventory implements Inventory {
-+ protected IInventory inventory;
-+
-+ private static net.minecraft.src.ItemStack[] getContents(IInventory inventory) {
-+ net.minecraft.src.ItemStack[] contents = new net.minecraft.src.ItemStack[inventory.getSizeInventory()];
-+ for (int i = 0; i < inventory.getSizeInventory(); i++) {
-+ contents[i] = inventory.getStackInSlot(i);
-+ }
-+ return contents;
-+ }
-+
-+ public CraftInventory(IInventory inventory) {
-+ this.inventory = inventory;
-+ }
-+
-+ public IInventory getInventory() {
-+ return inventory;
-+ }
-+
-+ public int getSize() {
-+ return getInventory().getSizeInventory();
-+ }
-+
-+ public String getName() {
-+ return getInventory().getInvName();
-+ }
-+
-+ public ItemStack getItem(int index) {
-+ return new CraftItemStack(getInventory().getStackInSlot(index));
-+ }
-+
-+ public ItemStack[] getContents() {
-+ ItemStack[] items = new ItemStack[getSize()];
-+ net.minecraft.src.ItemStack[] mcItems = getContents(getInventory());
-+
-+ for (int i = 0; i < mcItems.length; i++) {
-+ items[i] = mcItems[i] == null ? null : new CraftItemStack(mcItems[i]);
-+ }
-+
-+ return items;
-+ }
-+
-+ public void setContents(ItemStack[] items) {
-+ net.minecraft.src.ItemStack[] mcItems = getContents(getInventory());
-+ if (mcItems.length != items.length) {
-+ throw new IllegalArgumentException("Invalid inventory size; expected " + mcItems.length);
-+ }
-+
-+ for (int i = 0; i < items.length; i++) {
-+ ItemStack item = items[i];
-+ if (item == null || item.getTypeId() <= 0) {
-+ getInventory().setInventorySlotContents(i, null);
-+ } else {
-+ getInventory().setInventorySlotContents(i, new net.minecraft.src.ItemStack(item.getTypeId(), item.getAmount(), item.getDurability()));
-+ }
-+ }
-+ }
-+
-+ public void setItem(int index, ItemStack item) {
-+ getInventory().setInventorySlotContents(index, (item == null ? null : new net.minecraft.src.ItemStack(item.getTypeId(), item.getAmount(), item.getDurability())));
-+ }
-+
-+ public boolean contains(int materialId) {
-+ for (ItemStack item: getContents()) {
-+ if (item != null && item.getTypeId() == materialId) {
-+ return true;
-+ }
-+ }
-+ return false;
-+ }
-+
-+ public boolean contains(Material material) {
-+ return contains(material.getRawId());
-+ }
-+
-+ public boolean contains(ItemStack item) {
-+ if (item == null) {
-+ return false;
-+ }
-+ for (ItemStack i: getContents()) {
-+ if (item.equals(i)) {
-+ return true;
-+ }
-+ }
-+ return false;
-+ }
-+
-+ public boolean contains(int materialId, int amount) {
-+ int amt = 0;
-+ for (ItemStack item: getContents()) {
-+ if (item != null && item.getTypeId() == materialId) {
-+ amt += item.getAmount();
-+ }
-+ }
-+ return amt >= amount;
-+ }
-+
-+ public boolean contains(Material material, int amount) {
-+ return contains(material.getRawId(), amount);
-+ }
-+
-+ public boolean contains(ItemStack item, int amount) {
-+ if (item == null) {
-+ return false;
-+ }
-+ int amt = 0;
-+ for (ItemStack i: getContents()) {
-+ if (item.equals(i)) {
-+ amt += item.getAmount();
-+ }
-+ }
-+ return amt >= amount;
-+ }
-+
-+ public HashMap all(int materialId) {
-+ HashMap slots = new HashMap();
-+
-+ ItemStack[] inventory = getContents();
-+ for (int i = 0; i < inventory.length; i++) {
-+ ItemStack item = inventory[i];
-+ if (item != null && item.getTypeId() == materialId) {
-+ slots.put(i, item);
-+ }
-+ }
-+ return slots;
-+ }
-+
-+ public HashMap all(Material material) {
-+ return all(material.getRawId());
-+ }
-+
-+ public HashMap all(ItemStack item) {
-+ HashMap slots = new HashMap();
-+ if (item != null) {
-+ ItemStack[] inventory = getContents();
-+ for (int i = 0; i < inventory.length; i++) {
-+ if (item.equals(inventory[i])) {
-+ slots.put(i, inventory[i]);
-+ }
-+ }
-+ }
-+ return slots;
-+ }
-+
-+ public int first(int materialId) {
-+ ItemStack[] inventory = getContents();
-+ for (int i = 0; i < inventory.length; i++) {
-+ ItemStack item = inventory[i];
-+ if (item != null && item.getTypeId() == materialId) {
-+ return i;
-+ }
-+ }
-+ return -1;
-+ }
-+
-+ public int first(Material material) {
-+ return first(material.getRawId());
-+ }
-+
-+ public int first(ItemStack item) {
-+ if (item == null) {
-+ return -1;
-+ }
-+ ItemStack[] inventory = getContents();
-+ for (int i = 0; i < inventory.length; i++) {
-+ if (item.equals(inventory[i])) {
-+ return i;
-+ }
-+ }
-+ return -1;
-+ }
-+
-+ public int firstEmpty() {
-+ ItemStack[] inventory = getContents();
-+ for (int i = 0; i < inventory.length; i++) {
-+ if (inventory[i] == null) {
-+ return i;
-+ }
-+ }
-+ return -1;
-+ }
-+
-+ public int firstPartial(int materialId) {
-+ ItemStack[] inventory = getContents();
-+ for (int i = 0; i < inventory.length; i++) {
-+ ItemStack item = inventory[i];
-+ if (item != null && item.getTypeId() == materialId && item.getAmount() < item.getMaxStackSize()) {
-+ return i;
-+ }
-+ }
-+ return -1;
-+ }
-+
-+ public int firstPartial(Material material) {
-+ return firstPartial(material.getRawId());
-+ }
-+
-+ public int firstPartial(ItemStack item) {
-+ ItemStack[] inventory = getContents();
-+ if (item == null) {
-+ return -1;
-+ }
-+ for (int i = 0; i < inventory.length; i++) {
-+ ItemStack cItem = inventory[i];
-+ if (cItem != null && cItem.getTypeId() == item.getTypeId() && cItem.getAmount() < cItem.getMaxStackSize() && cItem.getDurability() == item.getDurability()) {
-+ return i;
-+ }
-+ }
-+ return -1;
-+ }
-+
-+ public HashMap addItem(ItemStack... items) {
-+ HashMap leftover = new HashMap();
-+
-+ /* TODO some optimization
-+ * - Create a 'firstPartial' with a 'fromIndex'
-+ * - Record the lastPartial per Material
-+ * - Cache firstEmpty result
-+ */
-+
-+ for (int i = 0; i < items.length; i++) {
-+ ItemStack item = items[i];
-+ while (true) {
-+ // Do we already have a stack of it?
-+ int firstPartial = firstPartial(item);
-+
-+ // Drat! no partial stack
-+ if (firstPartial == -1) {
-+ // Find a free spot!
-+ int firstFree = firstEmpty();
-+
-+ if (firstFree == -1) {
-+ // No space at all!
-+ leftover.put(i, item);
-+ break;
-+ } else {
-+ // More than a single stack!
-+ if (item.getAmount() > getMaxItemStack()) {
-+ setItem(firstFree, new CraftItemStack(item.getTypeId(), getMaxItemStack(), item.getDurability()));
-+ item.setAmount(item.getAmount() - getMaxItemStack());
-+ } else {
-+ // Just store it
-+ setItem(firstFree, item);
-+ break;
-+ }
-+ }
-+ } else {
-+ // So, apparently it might only partially fit, well lets do just that
-+ ItemStack partialItem = getItem(firstPartial);
-+
-+ int amount = item.getAmount();
-+ int partialAmount = partialItem.getAmount();
-+ int maxAmount = partialItem.getMaxStackSize();
-+
-+ // Check if it fully fits
-+ if (amount + partialAmount <= maxAmount) {
-+ partialItem.setAmount(amount + partialAmount);
-+ break;
-+ }
-+
-+ // It fits partially
-+ partialItem.setAmount(maxAmount);
-+ item.setAmount(amount + partialAmount - maxAmount);
-+ }
-+ }
-+ }
-+ return leftover;
-+ }
-+
-+ public HashMap removeItem(ItemStack... items) {
-+ HashMap leftover = new HashMap();
-+
-+ // TODO Optimization
-+
-+ for (int i = 0; i < items.length; i++) {
-+ ItemStack item = items[i];
-+ int toDelete = item.getAmount();
-+
-+ while (true) {
-+ int first = first(item.getType());
-+
-+ // Drat! we don't have this type in the inventory
-+ if (first == -1) {
-+ item.setAmount(toDelete);
-+ leftover.put(i, item);
-+ break;
-+ } else {
-+ ItemStack itemStack = getItem(first);
-+ int amount = itemStack.getAmount();
-+
-+ if (amount <= toDelete) {
-+ toDelete -= amount;
-+ // clear the slot, all used up
-+ clear(first);
-+ } else {
-+ // split the stack and store
-+ itemStack.setAmount(amount - toDelete);
-+ setItem(first, itemStack);
-+ toDelete = 0;
-+ }
-+ }
-+
-+ // Bail when done
-+ if (toDelete <= 0) {
-+ break;
-+ }
-+ }
-+ }
-+ return leftover;
-+ }
-+
-+ private int getMaxItemStack() {
-+ return getInventory().getInventoryStackLimit();
-+ }
-+
-+ public void remove(int materialId) {
-+ ItemStack[] items = getContents();
-+ for (int i = 0; i < items.length; i++) {
-+ if (items[i] != null && items[i].getTypeId() == materialId) {
-+ clear(i);
-+ }
-+ }
-+ }
-+
-+ public void remove(Material material) {
-+ remove(material.getRawId());
-+ }
-+
-+ public void remove(ItemStack item) {
-+ ItemStack[] items = getContents();
-+ for (int i = 0; i < items.length; i++) {
-+ if (items[i] != null && items[i].equals(item)) {
-+ clear(i);
-+ }
-+ }
-+ }
-+
-+ public void clear(int index) {
-+ setItem(index, null);
-+ }
-+
-+ public void clear() {
-+ for (int i = 0; i < getSize(); i++) {
-+ clear(i);
-+ }
-+ }
-+}
---- /dev/null
-+++ org/spoutcraft/api/inventory/ShapelessRecipe.java
-@@ -1,0 +1,92 @@
-+/*
-+ * This file is part of Spoutcraft.
-+ *
-+ * Copyright (c) 2011 SpoutcraftDev
-+ * Spoutcraft is licensed under the GNU Lesser General Public License.
-+ *
-+ * Spoutcraft is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation, either version 3 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Spoutcraft is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program. If not, see .
-+ */
-+package org.spoutcraft.api.inventory;
-+
-+import java.util.ArrayList;
-+
-+import org.spoutcraft.api.material.Material;
-+
-+public class ShapelessRecipe implements Recipe {
-+ private ItemStack output;
-+ private ArrayList ingredients = new ArrayList();
-+
-+ /**
-+ * Create a shapeless recipe to craft the specified ItemStack. The constructor merely determines the
-+ * result and type; to set the actual recipe, you'll need to call the appropriate methods.
-+ * @param result The item you want the recipe to create.
-+ * @see ShapelessRecipe#addIngredient(Material)
-+ * @see ShapelessRecipe#addIngredient(MaterialData)
-+ */
-+ public ShapelessRecipe(ItemStack result) {
-+ this.output = result;
-+ }
-+
-+ /**
-+ * Adds the specified ingredient.
-+ * @param ingredient The ingredient to add.
-+ * @return The changed recipe, so you can chain calls.
-+ */
-+ public ShapelessRecipe addIngredient(Material ingredient) {
-+ return addIngredient(1, ingredient);
-+ }
-+
-+ /**
-+ * Adds multiples of the specified ingredient.
-+ * @param count How many to add (can't be more than 9!)
-+ * @param ingredient The ingredient to add.
-+ * @return The changed recipe, so you can chain calls.
-+ */
-+ public ShapelessRecipe addIngredient(int count, Material ingredient) {
-+ if (ingredients.size() + count > 9) {
-+ throw new IllegalArgumentException("Shapeless recipes cannot have more than 9 ingredients");
-+ }
-+ while (count-- > 0) {
-+ ingredients.add(ingredient);
-+ }
-+ return this;
-+ }
-+
-+ /**
-+ * Removes an ingredient from the list. If the ingredient occurs multiple times,
-+ * only one instance of it is removed.
-+ * @param ingredient The ingredient to remove
-+ * @return The changed recipe.
-+ */
-+ public ShapelessRecipe removeIngredient(Material ingredient) {
-+ this.ingredients.remove(ingredient);
-+ return this;
-+ }
-+
-+ /**
-+ * Get the result of this recipe.
-+ * @return The result stack.
-+ */
-+ public ItemStack getResult() {
-+ return output;
-+ }
-+
-+ /**
-+ * Get the list of ingredients used for this recipe.
-+ * @return The input list
-+ */
-+ public ArrayList getIngredientList() {
-+ return ingredients;
-+ }
-+}
---- net/minecraft/src/GuiScreenCreateOnlineWorld.java
-+++ net/minecraft/src/GuiScreenCreateOnlineWorld.java
-@@ -8,79 +8,90 @@
- private GuiScreen field_96260_a;
- private GuiTextField field_96257_c;
- private GuiTextField field_96255_b;
-- private String d;
-- private String e;
-+ 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 t = "You must enter a name!";
-+ private String field_96254_s = "You must enter a name!";
- private WorldTemplate field_110356_u;
-
-- public GuiScreenCreateOnlineWorld(GuiScreen var1) {
-- super.i = Collections.synchronizedList(new ArrayList());
-- this.field_96260_a = var1;
-+ 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.d = this.field_96257_c.getText();
-+ this.field_98108_c = this.field_96257_c.getText();
- this.field_96255_b.updateCursorCounter();
-- this.e = this.field_96255_b.getText();
-+ 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.i.clear();
-- this.i.add(new GuiButton(field_96253_d, this.width / 2 - 100, this.height / 4 + 120 + 17, 97, 20, I18n.getString("mco.create.world")));
-- this.i.add(new GuiButton(field_96261_n, this.width / 2 + 5, this.height / 4 + 120 + 17, 95, 20, I18n.getString("gui.cancel")));
-+ 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.d != null) {
-- this.field_96257_c.setText(this.d);
-+
-+ 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.e != null) {
-- this.field_96255_b.setText(this.e);
-+
-+ if (this.field_98109_n != null) {
-+ this.field_96255_b.setText(this.field_98109_n);
- }
-
-- if(this.field_110356_u == null) {
-- this.i.add(new GuiButton(field_110357_r, this.width / 2 - 100, 147, 200, 20, I18n.getString("mco.template.default.name")));
-+ 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.i.add(new GuiButton(field_110357_r, this.width / 2 - 100, 147, 200, 20, I18n.getString("mco.template.name") + ": " + this.field_110356_u.b));
-+ 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);
- }
-
-- protected void actionPerformed(GuiButton var1) {
-- if(var1.enabled) {
-- if(var1.id == field_96261_n) {
-+ /**
-+ * 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(var1.id == field_96253_d) {
-+ } else if (par1GuiButton.id == field_96253_d) {
- this.func_96252_h();
-- } else if(var1.id == field_110357_r) {
-+ } 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.e, this.field_110356_u);
-+ 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() {
-@@ -88,69 +99,79 @@
- return !this.field_96256_r;
- }
-
-- protected void keyTyped(char var1, int var2) {
-- this.field_96257_c.textboxKeyTyped(var1, var2);
-- this.field_96255_b.textboxKeyTyped(var1, var2);
-- if(var2 == 15) {
-+ /**
-+ * 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(var2 == 28 || var2 == 156) {
-- this.actionPerformed((GuiButton)this.i.get(0));
-+ if (par2 == 28 || par2 == 156) {
-+ this.actionPerformed((GuiButton)this.buttonList.get(0));
- }
--
-- }
--
-- protected void mouseClicked(int var1, int var2, int var3) {
-- super.mouseClicked(var1, var2, var3);
-- this.field_96257_c.mouseClicked(var1, var2, var3);
-- this.field_96255_b.mouseClicked(var1, var2, var3);
-- }
--
-- public void drawScreen(int var1, int var2, float var3) {
-+ }
-+
-+ /**
-+ * 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.t, this.width / 2, 167, 16711680);
-+
-+ 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(var1, var2, var3);
-- }
--
-- public void func_110355_a(WorldTemplate var1) {
-- this.field_110356_u = var1;
-- }
--
-- public void func_110354_a(Object var1) {
-- this.func_110355_a((WorldTemplate)var1);
-- }
--
-- static Minecraft func_96248_a(GuiScreenCreateOnlineWorld var0) {
-- return var0.mc;
-- }
--
-- static GuiScreen func_96247_b(GuiScreenCreateOnlineWorld var0) {
-- return var0.field_96260_a;
-- }
--
-- static Minecraft func_96246_c(GuiScreenCreateOnlineWorld var0) {
-- return var0.mc;
-- }
--
-- static Minecraft func_130026_d(GuiScreenCreateOnlineWorld var0) {
-- return var0.mc;
-- }
--
-- static Minecraft func_130027_e(GuiScreenCreateOnlineWorld var0) {
-- return var0.mc;
-- }
--
-- static Minecraft func_130028_f(GuiScreenCreateOnlineWorld var0) {
-- return var0.mc;
-+ 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;
- }
- }
---- net/minecraft/src/GuiScreenEditOnlineWorld.java
-+++ net/minecraft/src/GuiScreenEditOnlineWorld.java
-@@ -15,25 +15,31 @@
- private int field_104052_r;
- private GuiScreenOnlineServersSubscreen field_104051_s;
-
-- public GuiScreenEditOnlineWorld(GuiScreen var1, GuiScreen var2, McoServer var3) {
-- this.field_96204_a = var1;
-- this.field_96202_b = var2;
-- this.field_96205_n = var3;
-+ 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.i.clear();
-- this.i.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.i.add(new GuiButton(1, this.field_104052_r, this.height / 4 + 120 + 22, this.field_104053_q, 20, I18n.getString("gui.cancel")));
-+ 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);
-@@ -42,25 +48,30 @@
- 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.i.addAll(this.field_104051_s.a);
-+ 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);
- }
-
-- protected void actionPerformed(GuiButton var1) {
-- if(var1.enabled) {
-- if(var1.id == 1) {
-+ /**
-+ * 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(var1.id == 0) {
-+ } else if (par1GuiButton.id == 0) {
- this.func_96200_g();
-- } else if(var1.id == 2) {
-+ } else if (par1GuiButton.id == 2) {
- this.mc.displayGuiScreen(new GuiScreenResetWorld(this, this.field_96205_n));
- } else {
-- this.field_104051_s.func_104069_a(var1);
-+ this.field_104051_s.func_104069_a(par1GuiButton);
- }
--
- }
- }
-
-@@ -80,31 +91,40 @@
- } catch (UnsupportedEncodingException var4) {
- this.mc.getLogAgent().logWarning("Realms: " + var4.getLocalizedMessage());
- }
--
- }
-
-- protected void keyTyped(char var1, int var2) {
-- this.field_96201_d.textboxKeyTyped(var1, var2);
-- this.field_96203_c.textboxKeyTyped(var1, var2);
-- if(var2 == 15) {
-+ /**
-+ * 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(var2 == 28 || var2 == 156) {
-+ 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("");
- }
-
-- protected void mouseClicked(int var1, int var2, int var3) {
-- super.mouseClicked(var1, var2, var3);
-- this.field_96203_c.mouseClicked(var1, var2, var3);
-- this.field_96201_d.mouseClicked(var1, var2, var3);
-+ /**
-+ * 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);
- }
-
-- public void drawScreen(int var1, int var2, float var3) {
-+ /**
-+ * 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);
-@@ -112,6 +132,6 @@
- this.field_96201_d.drawTextBox();
- this.field_96203_c.drawTextBox();
- this.field_104051_s.func_104071_a(this, this.fontRenderer);
-- super.drawScreen(var1, var2, var3);
-+ super.drawScreen(par1, par2, par3);
- }
- }
---- net/minecraft/src/WorldGenTrees.java
-+++ net/minecraft/src/WorldGenTrees.java
-@@ -3,46 +3,58 @@
- import java.util.Random;
-
- public class WorldGenTrees extends WorldGenerator {
-+
-+ /** The minimum height of a generated tree. */
- private final int minTreeHeight;
-+
-+ /** True if this tree should grow Vines. */
- private final boolean vinesGrow;
-+
-+ /** The metadata value of the wood to use in tree generation. */
- private final int metaWood;
-+
-+ /** The metadata value of the leaves to use in tree generation. */
- private final int metaLeaves;
-
-- public WorldGenTrees(boolean var1) {
-- this(var1, 4, 0, 0, false);
-- }
--
-- public WorldGenTrees(boolean var1, int var2, int var3, int var4, boolean var5) {
-- super(var1);
-- this.minTreeHeight = var2;
-- this.metaWood = var3;
-- this.metaLeaves = var4;
-- this.vinesGrow = var5;
-- }
--
-- public boolean generate(World var1, Random var2, int var3, int var4, int var5) {
-- int var6 = var2.nextInt(3) + this.minTreeHeight;
-+ public WorldGenTrees(boolean par1) {
-+ this(par1, 4, 0, 0, false);
-+ }
-+
-+ public WorldGenTrees(boolean par1, int par2, int par3, int par4, boolean par5) {
-+ super(par1);
-+ this.minTreeHeight = par2;
-+ this.metaWood = par3;
-+ this.metaLeaves = par4;
-+ this.vinesGrow = par5;
-+ }
-+
-+ public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5) {
-+ int var6 = par2Random.nextInt(3) + this.minTreeHeight;
- boolean var7 = true;
-- if(var4 >= 1 && var4 + var6 + 1 <= 256) {
-+
-+ if (par4 >= 1 && par4 + var6 + 1 <= 256) {
- int var8;
- byte var9;
- int var11;
- int var12;
-- for(var8 = var4; var8 <= var4 + 1 + var6; ++var8) {
-+
-+ for (var8 = par4; var8 <= par4 + 1 + var6; ++var8) {
- var9 = 1;
-- if(var8 == var4) {
-+
-+ if (var8 == par4) {
- var9 = 0;
- }
-
-- if(var8 >= var4 + 1 + var6 - 2) {
-+ if (var8 >= par4 + 1 + var6 - 2) {
- var9 = 2;
- }
-
-- for(int var10 = var3 - var9; var10 <= var3 + var9 && var7; ++var10) {
-- for(var11 = var5 - var9; var11 <= var5 + var9 && var7; ++var11) {
-- if(var8 >= 0 && var8 < 256) {
-- var12 = var1.getBlockId(var10, var8, var11);
-- if(var12 != 0 && var12 != Block.leaves.blockID && var12 != Block.grass.blockID && var12 != Block.dirt.blockID && var12 != Block.wood.blockID) {
-+ for (int var10 = par3 - var9; var10 <= par3 + var9 && var7; ++var10) {
-+ for (var11 = par5 - var9; var11 <= par5 + var9 && var7; ++var11) {
-+ if (var8 >= 0 && var8 < 256) {
-+ var12 = par1World.getBlockId(var10, var8, var11);
-+
-+ if (var12 != 0 && var12 != Block.leaves.blockID && var12 != Block.grass.blockID && var12 != Block.dirt.blockID && var12 != Block.wood.blockID) {
- var7 = false;
- }
- } else {
-@@ -52,95 +64,100 @@
- }
- }
-
-- if(!var7) {
-+ if (!var7) {
- return false;
- } else {
-- var8 = var1.getBlockId(var3, var4 - 1, var5);
-- if((var8 == Block.grass.blockID || var8 == Block.dirt.blockID) && var4 < 256 - var6 - 1) {
-- this.setBlock(var1, var3, var4 - 1, var5, Block.dirt.blockID);
-+ var8 = par1World.getBlockId(par3, par4 - 1, par5);
-+
-+ if ((var8 == Block.grass.blockID || var8 == Block.dirt.blockID) && par4 < 256 - var6 - 1) {
-+ this.setBlock(par1World, par3, par4 - 1, par5, Block.dirt.blockID);
- var9 = 3;
- byte var19 = 0;
--
- int var13;
- int var14;
- int var15;
-- for(var11 = var4 - var9 + var6; var11 <= var4 + var6; ++var11) {
-- var12 = var11 - (var4 + var6);
-+
-+ for (var11 = par4 - var9 + var6; var11 <= par4 + var6; ++var11) {
-+ var12 = var11 - (par4 + var6);
- var13 = var19 + 1 - var12 / 2;
-
-- for(var14 = var3 - var13; var14 <= var3 + var13; ++var14) {
-- var15 = var14 - var3;
--
-- for(int var16 = var5 - var13; var16 <= var5 + var13; ++var16) {
-- int var17 = var16 - var5;
-- if(Math.abs(var15) != var13 || Math.abs(var17) != var13 || var2.nextInt(2) != 0 && var12 != 0) {
-- int var18 = var1.getBlockId(var14, var11, var16);
-- if(var18 == 0 || var18 == Block.leaves.blockID) {
-- this.setBlockAndMetadata(var1, var14, var11, var16, Block.leaves.blockID, this.metaLeaves);
-+ for (var14 = par3 - var13; var14 <= par3 + var13; ++var14) {
-+ var15 = var14 - par3;
-+
-+ for (int var16 = par5 - var13; var16 <= par5 + var13; ++var16) {
-+ int var17 = var16 - par5;
-+
-+ if (Math.abs(var15) != var13 || Math.abs(var17) != var13 || par2Random.nextInt(2) != 0 && var12 != 0) {
-+ int var18 = par1World.getBlockId(var14, var11, var16);
-+
-+ if (var18 == 0 || var18 == Block.leaves.blockID) {
-+ this.setBlockAndMetadata(par1World, var14, var11, var16, Block.leaves.blockID, this.metaLeaves);
- }
- }
- }
- }
- }
-
-- for(var11 = 0; var11 < var6; ++var11) {
-- var12 = var1.getBlockId(var3, var4 + var11, var5);
-- if(var12 == 0 || var12 == Block.leaves.blockID) {
-- this.setBlockAndMetadata(var1, var3, var4 + var11, var5, Block.wood.blockID, this.metaWood);
-- if(this.vinesGrow && var11 > 0) {
-- if(var2.nextInt(3) > 0 && var1.isAirBlock(var3 - 1, var4 + var11, var5)) {
-- this.setBlockAndMetadata(var1, var3 - 1, var4 + var11, var5, Block.vine.blockID, 8);
-- }
--
-- if(var2.nextInt(3) > 0 && var1.isAirBlock(var3 + 1, var4 + var11, var5)) {
-- this.setBlockAndMetadata(var1, var3 + 1, var4 + var11, var5, Block.vine.blockID, 2);
-- }
--
-- if(var2.nextInt(3) > 0 && var1.isAirBlock(var3, var4 + var11, var5 - 1)) {
-- this.setBlockAndMetadata(var1, var3, var4 + var11, var5 - 1, Block.vine.blockID, 1);
-- }
--
-- if(var2.nextInt(3) > 0 && var1.isAirBlock(var3, var4 + var11, var5 + 1)) {
-- this.setBlockAndMetadata(var1, var3, var4 + var11, var5 + 1, Block.vine.blockID, 4);
-+ for (var11 = 0; var11 < var6; ++var11) {
-+ var12 = par1World.getBlockId(par3, par4 + var11, par5);
-+
-+ if (var12 == 0 || var12 == Block.leaves.blockID) {
-+ this.setBlockAndMetadata(par1World, par3, par4 + var11, par5, Block.wood.blockID, this.metaWood);
-+
-+ if (this.vinesGrow && var11 > 0) {
-+ if (par2Random.nextInt(3) > 0 && par1World.isAirBlock(par3 - 1, par4 + var11, par5)) {
-+ this.setBlockAndMetadata(par1World, par3 - 1, par4 + var11, par5, Block.vine.blockID, 8);
-+ }
-+
-+ if (par2Random.nextInt(3) > 0 && par1World.isAirBlock(par3 + 1, par4 + var11, par5)) {
-+ this.setBlockAndMetadata(par1World, par3 + 1, par4 + var11, par5, Block.vine.blockID, 2);
-+ }
-+
-+ if (par2Random.nextInt(3) > 0 && par1World.isAirBlock(par3, par4 + var11, par5 - 1)) {
-+ this.setBlockAndMetadata(par1World, par3, par4 + var11, par5 - 1, Block.vine.blockID, 1);
-+ }
-+
-+ if (par2Random.nextInt(3) > 0 && par1World.isAirBlock(par3, par4 + var11, par5 + 1)) {
-+ this.setBlockAndMetadata(par1World, par3, par4 + var11, par5 + 1, Block.vine.blockID, 4);
- }
- }
- }
- }
-
-- if(this.vinesGrow) {
-- for(var11 = var4 - 3 + var6; var11 <= var4 + var6; ++var11) {
-- var12 = var11 - (var4 + var6);
-+ if (this.vinesGrow) {
-+ for (var11 = par4 - 3 + var6; var11 <= par4 + var6; ++var11) {
-+ var12 = var11 - (par4 + var6);
- var13 = 2 - var12 / 2;
-
-- for(var14 = var3 - var13; var14 <= var3 + var13; ++var14) {
-- for(var15 = var5 - var13; var15 <= var5 + var13; ++var15) {
-- if(var1.getBlockId(var14, var11, var15) == Block.leaves.blockID) {
-- if(var2.nextInt(4) == 0 && var1.getBlockId(var14 - 1, var11, var15) == 0) {
-- this.growVines(var1, var14 - 1, var11, var15, 8);
-- }
--
-- if(var2.nextInt(4) == 0 && var1.getBlockId(var14 + 1, var11, var15) == 0) {
-- this.growVines(var1, var14 + 1, var11, var15, 2);
-- }
--
-- if(var2.nextInt(4) == 0 && var1.getBlockId(var14, var11, var15 - 1) == 0) {
-- this.growVines(var1, var14, var11, var15 - 1, 1);
-- }
--
-- if(var2.nextInt(4) == 0 && var1.getBlockId(var14, var11, var15 + 1) == 0) {
-- this.growVines(var1, var14, var11, var15 + 1, 4);
-+ for (var14 = par3 - var13; var14 <= par3 + var13; ++var14) {
-+ for (var15 = par5 - var13; var15 <= par5 + var13; ++var15) {
-+ if (par1World.getBlockId(var14, var11, var15) == Block.leaves.blockID) {
-+ if (par2Random.nextInt(4) == 0 && par1World.getBlockId(var14 - 1, var11, var15) == 0) {
-+ this.growVines(par1World, var14 - 1, var11, var15, 8);
-+ }
-+
-+ if (par2Random.nextInt(4) == 0 && par1World.getBlockId(var14 + 1, var11, var15) == 0) {
-+ this.growVines(par1World, var14 + 1, var11, var15, 2);
-+ }
-+
-+ if (par2Random.nextInt(4) == 0 && par1World.getBlockId(var14, var11, var15 - 1) == 0) {
-+ this.growVines(par1World, var14, var11, var15 - 1, 1);
-+ }
-+
-+ if (par2Random.nextInt(4) == 0 && par1World.getBlockId(var14, var11, var15 + 1) == 0) {
-+ this.growVines(par1World, var14, var11, var15 + 1, 4);
- }
- }
- }
- }
- }
-
-- if(var2.nextInt(5) == 0 && var6 > 5) {
-- for(var11 = 0; var11 < 2; ++var11) {
-- for(var12 = 0; var12 < 4; ++var12) {
-- if(var2.nextInt(4 - var11) == 0) {
-- var13 = var2.nextInt(3);
-- this.setBlockAndMetadata(var1, var3 + Direction.offsetX[Direction.rotateOpposite[var12]], var4 + var6 - 5 + var11, var5 + Direction.offsetZ[Direction.rotateOpposite[var12]], Block.cocoaPlant.blockID, var13 << 2 | var12);
-+ if (par2Random.nextInt(5) == 0 && var6 > 5) {
-+ for (var11 = 0; var11 < 2; ++var11) {
-+ for (var12 = 0; var12 < 4; ++var12) {
-+ if (par2Random.nextInt(4 - var11) == 0) {
-+ var13 = par2Random.nextInt(3);
-+ this.setBlockAndMetadata(par1World, par3 + Direction.offsetX[Direction.rotateOpposite[var12]], par4 + var6 - 5 + var11, par5 + Direction.offsetZ[Direction.rotateOpposite[var12]], Block.cocoaPlant.blockID, var13 << 2 | var12);
- }
- }
- }
-@@ -157,17 +174,21 @@
- }
- }
-
-- private void growVines(World var1, int var2, int var3, int var4, int var5) {
-- this.setBlockAndMetadata(var1, var2, var3, var4, Block.vine.blockID, var5);
-+ /**
-+ * Grows vines downward from the given block for a given length. Args: World, x, starty, z, vine-length
-+ */
-+ private void growVines(World par1World, int par2, int par3, int par4, int par5) {
-+ this.setBlockAndMetadata(par1World, par2, par3, par4, Block.vine.blockID, par5);
- int var6 = 4;
-
-- while(true) {
-- --var3;
-- if(var1.getBlockId(var2, var3, var4) != 0 || var6 <= 0) {
-+ while (true) {
-+ --par3;
-+
-+ if (par1World.getBlockId(par2, par3, par4) != 0 || var6 <= 0) {
- return;
- }
-
-- this.setBlockAndMetadata(var1, var2, var3, var4, Block.vine.blockID, var5);
-+ this.setBlockAndMetadata(par1World, par2, par3, par4, Block.vine.blockID, par5);
- --var6;
- }
- }
---- net/minecraft/src/ChunkProviderHell.java
-+++ net/minecraft/src/ChunkProviderHell.java
-@@ -4,19 +4,37 @@
- import java.util.Random;
-
- public class ChunkProviderHell implements IChunkProvider {
-- private Random i;
-+ private Random hellRNG;
-+
-+ /** A NoiseGeneratorOctaves used in generating nether terrain */
- private NoiseGeneratorOctaves netherNoiseGen1;
- private NoiseGeneratorOctaves netherNoiseGen2;
- private NoiseGeneratorOctaves netherNoiseGen3;
-+
-+ /** Determines whether slowsand or gravel can be generated at a location */
- private NoiseGeneratorOctaves slowsandGravelNoiseGen;
-+
-+ /**
-+ * Determines whether something other than nettherack can be generated at a location
-+ */
- private NoiseGeneratorOctaves netherrackExculsivityNoiseGen;
- public NoiseGeneratorOctaves netherNoiseGen6;
- public NoiseGeneratorOctaves netherNoiseGen7;
-+
-+ /** Is the world that the nether is getting generated. */
- private World worldObj;
- private double[] noiseField;
- public MapGenNetherBridge genNetherBridge = new MapGenNetherBridge();
-+
-+ /**
-+ * Holds the noise used to determine whether slowsand can be generated at a location
-+ */
- private double[] slowsandNoise = new double[256];
- private double[] gravelNoise = new double[256];
-+
-+ /**
-+ * Holds the noise used to determine whether something other than netherrack can be generated at a location
-+ */
- private double[] netherrackExclusivityNoise = new double[256];
- private MapGenBase netherCaveGenerator = new MapGenCavesHell();
- double[] noiseData1;
-@@ -25,29 +43,32 @@
- double[] noiseData4;
- double[] noiseData5;
-
-- public ChunkProviderHell(World var1, long var2) {
-- this.worldObj = var1;
-- this.i = new Random(var2);
-- this.netherNoiseGen1 = new NoiseGeneratorOctaves(this.i, 16);
-- this.netherNoiseGen2 = new NoiseGeneratorOctaves(this.i, 16);
-- this.netherNoiseGen3 = new NoiseGeneratorOctaves(this.i, 8);
-- this.slowsandGravelNoiseGen = new NoiseGeneratorOctaves(this.i, 4);
-- this.netherrackExculsivityNoiseGen = new NoiseGeneratorOctaves(this.i, 4);
-- this.netherNoiseGen6 = new NoiseGeneratorOctaves(this.i, 10);
-- this.netherNoiseGen7 = new NoiseGeneratorOctaves(this.i, 16);
-+ public ChunkProviderHell(World par1World, long par2) {
-+ this.worldObj = par1World;
-+ this.hellRNG = new Random(par2);
-+ this.netherNoiseGen1 = new NoiseGeneratorOctaves(this.hellRNG, 16);
-+ this.netherNoiseGen2 = new NoiseGeneratorOctaves(this.hellRNG, 16);
-+ this.netherNoiseGen3 = new NoiseGeneratorOctaves(this.hellRNG, 8);
-+ this.slowsandGravelNoiseGen = new NoiseGeneratorOctaves(this.hellRNG, 4);
-+ this.netherrackExculsivityNoiseGen = new NoiseGeneratorOctaves(this.hellRNG, 4);
-+ this.netherNoiseGen6 = new NoiseGeneratorOctaves(this.hellRNG, 10);
-+ this.netherNoiseGen7 = new NoiseGeneratorOctaves(this.hellRNG, 16);
- }
-
-- public void generateNetherTerrain(int var1, int var2, byte[] var3) {
-+ /**
-+ * Generates the shape of the terrain in the nether.
-+ */
-+ public void generateNetherTerrain(int par1, int par2, byte[] par3ArrayOfByte) {
- byte var4 = 4;
- byte var5 = 32;
- int var6 = var4 + 1;
- byte var7 = 17;
- int var8 = var4 + 1;
-- this.noiseField = this.initializeNoiseField(this.noiseField, var1 * var4, 0, var2 * var4, var6, var7, var8);
-+ this.noiseField = this.initializeNoiseField(this.noiseField, par1 * var4, 0, par2 * var4, var6, var7, var8);
-
-- for(int var9 = 0; var9 < var4; ++var9) {
-- for(int var10 = 0; var10 < var4; ++var10) {
-- for(int var11 = 0; var11 < 16; ++var11) {
-+ for (int var9 = 0; var9 < var4; ++var9) {
-+ for (int var10 = 0; var10 < var4; ++var10) {
-+ for (int var11 = 0; var11 < 16; ++var11) {
- double var12 = 0.125D;
- double var14 = this.noiseField[((var9 + 0) * var8 + var10 + 0) * var7 + var11 + 0];
- double var16 = this.noiseField[((var9 + 0) * var8 + var10 + 1) * var7 + var11 + 0];
-@@ -58,31 +79,32 @@
- double var26 = (this.noiseField[((var9 + 1) * var8 + var10 + 0) * var7 + var11 + 1] - var18) * var12;
- double var28 = (this.noiseField[((var9 + 1) * var8 + var10 + 1) * var7 + var11 + 1] - var20) * var12;
-
-- for(int var30 = 0; var30 < 8; ++var30) {
-+ for (int var30 = 0; var30 < 8; ++var30) {
- double var31 = 0.25D;
- double var33 = var14;
- double var35 = var16;
- double var37 = (var18 - var14) * var31;
- double var39 = (var20 - var16) * var31;
-
-- for(int var41 = 0; var41 < 4; ++var41) {
-+ for (int var41 = 0; var41 < 4; ++var41) {
- int var42 = var41 + var9 * 4 << 11 | 0 + var10 * 4 << 7 | var11 * 8 + var30;
- short var43 = 128;
- double var44 = 0.25D;
- double var46 = var33;
- double var48 = (var35 - var33) * var44;
-
-- for(int var50 = 0; var50 < 4; ++var50) {
-+ for (int var50 = 0; var50 < 4; ++var50) {
- int var51 = 0;
-- if(var11 * 8 + var30 < var5) {
-+
-+ if (var11 * 8 + var30 < var5) {
- var51 = Block.lavaStill.blockID;
- }
-
-- if(var46 > 0.0D) {
-+ if (var46 > 0.0D) {
- var51 = Block.netherrack.blockID;
- }
-
-- var3[var42] = (byte)var51;
-+ par3ArrayOfByte[var42] = (byte)var51;
- var42 += var43;
- var46 += var48;
- }
-@@ -99,96 +121,108 @@
- }
- }
- }
--
- }
-
-- public void replaceBlocksForBiome(int var1, int var2, byte[] var3) {
-+ /**
-+ * name based on ChunkProviderGenerate
-+ */
-+ public void replaceBlocksForBiome(int par1, int par2, byte[] par3ArrayOfByte) {
- byte var4 = 64;
-- double var5 = 1.0D / 32.0D;
-- this.slowsandNoise = this.slowsandGravelNoiseGen.generateNoiseOctaves(this.slowsandNoise, var1 * 16, var2 * 16, 0, 16, 16, 1, var5, var5, 1.0D);
-- this.gravelNoise = this.slowsandGravelNoiseGen.generateNoiseOctaves(this.gravelNoise, var1 * 16, 109, var2 * 16, 16, 1, 16, var5, 1.0D, var5);
-- this.netherrackExclusivityNoise = this.netherrackExculsivityNoiseGen.generateNoiseOctaves(this.netherrackExclusivityNoise, var1 * 16, var2 * 16, 0, 16, 16, 1, var5 * 2.0D, var5 * 2.0D, var5 * 2.0D);
-+ double var5 = 0.03125D;
-+ this.slowsandNoise = this.slowsandGravelNoiseGen.generateNoiseOctaves(this.slowsandNoise, par1 * 16, par2 * 16, 0, 16, 16, 1, var5, var5, 1.0D);
-+ this.gravelNoise = this.slowsandGravelNoiseGen.generateNoiseOctaves(this.gravelNoise, par1 * 16, 109, par2 * 16, 16, 1, 16, var5, 1.0D, var5);
-+ this.netherrackExclusivityNoise = this.netherrackExculsivityNoiseGen.generateNoiseOctaves(this.netherrackExclusivityNoise, par1 * 16, par2 * 16, 0, 16, 16, 1, var5 * 2.0D, var5 * 2.0D, var5 * 2.0D);
-
-- for(int var7 = 0; var7 < 16; ++var7) {
-- for(int var8 = 0; var8 < 16; ++var8) {
-- boolean var9 = this.slowsandNoise[var7 + var8 * 16] + this.i.nextDouble() * 0.2D > 0.0D;
-- boolean var10 = this.gravelNoise[var7 + var8 * 16] + this.i.nextDouble() * 0.2D > 0.0D;
-- int var11 = (int)(this.netherrackExclusivityNoise[var7 + var8 * 16] / 3.0D + 3.0D + this.i.nextDouble() * 0.25D);
-+ for (int var7 = 0; var7 < 16; ++var7) {
-+ for (int var8 = 0; var8 < 16; ++var8) {
-+ boolean var9 = this.slowsandNoise[var7 + var8 * 16] + this.hellRNG.nextDouble() * 0.2D > 0.0D;
-+ boolean var10 = this.gravelNoise[var7 + var8 * 16] + this.hellRNG.nextDouble() * 0.2D > 0.0D;
-+ int var11 = (int)(this.netherrackExclusivityNoise[var7 + var8 * 16] / 3.0D + 3.0D + this.hellRNG.nextDouble() * 0.25D);
- int var12 = -1;
- byte var13 = (byte)Block.netherrack.blockID;
- byte var14 = (byte)Block.netherrack.blockID;
-
-- for(int var15 = 127; var15 >= 0; --var15) {
-+ for (int var15 = 127; var15 >= 0; --var15) {
- int var16 = (var8 * 16 + var7) * 128 + var15;
-- if(var15 < 127 - this.i.nextInt(5) && var15 > 0 + this.i.nextInt(5)) {
-- byte var17 = var3[var16];
-- if(var17 == 0) {
-+
-+ if (var15 < 127 - this.hellRNG.nextInt(5) && var15 > 0 + this.hellRNG.nextInt(5)) {
-+ byte var17 = par3ArrayOfByte[var16];
-+
-+ if (var17 == 0) {
- var12 = -1;
-- } else if(var17 == Block.netherrack.blockID) {
-- if(var12 == -1) {
-- if(var11 <= 0) {
-+ } else if (var17 == Block.netherrack.blockID) {
-+ if (var12 == -1) {
-+ if (var11 <= 0) {
- var13 = 0;
- var14 = (byte)Block.netherrack.blockID;
-- } else if(var15 >= var4 - 4 && var15 <= var4 + 1) {
-+ } else if (var15 >= var4 - 4 && var15 <= var4 + 1) {
- var13 = (byte)Block.netherrack.blockID;
- var14 = (byte)Block.netherrack.blockID;
-- if(var10) {
-+
-+ if (var10) {
- var13 = (byte)Block.gravel.blockID;
- }
-
-- if(var10) {
-+ if (var10) {
- var14 = (byte)Block.netherrack.blockID;
- }
-
-- if(var9) {
-+ if (var9) {
- var13 = (byte)Block.slowSand.blockID;
- }
-
-- if(var9) {
-+ if (var9) {
- var14 = (byte)Block.slowSand.blockID;
- }
- }
-
-- if(var15 < var4 && var13 == 0) {
-+ if (var15 < var4 && var13 == 0) {
- var13 = (byte)Block.lavaStill.blockID;
- }
-
- var12 = var11;
-- if(var15 >= var4 - 1) {
-- var3[var16] = var13;
-+
-+ if (var15 >= var4 - 1) {
-+ par3ArrayOfByte[var16] = var13;
- } else {
-- var3[var16] = var14;
-+ par3ArrayOfByte[var16] = var14;
- }
-- } else if(var12 > 0) {
-+ } else if (var12 > 0) {
- --var12;
-- var3[var16] = var14;
-+ par3ArrayOfByte[var16] = var14;
- }
- }
- } else {
-- var3[var16] = (byte)Block.bedrock.blockID;
-+ par3ArrayOfByte[var16] = (byte)Block.bedrock.blockID;
- }
- }
- }
- }
--
-- }
--
-- public Chunk loadChunk(int var1, int var2) {
-- return this.provideChunk(var1, var2);
-- }
--
-- public Chunk provideChunk(int var1, int var2) {
-- this.i.setSeed((long)var1 * 341873128712L + (long)var2 * 132897987541L);
-- byte[] var3 = new byte[-Short.MIN_VALUE];
-- this.generateNetherTerrain(var1, var2, var3);
-- this.replaceBlocksForBiome(var1, var2, var3);
-- this.netherCaveGenerator.generate(this, this.worldObj, var1, var2, var3);
-- this.genNetherBridge.generate(this, this.worldObj, var1, var2, var3);
-- Chunk var4 = new Chunk(this.worldObj, var3, var1, var2);
-- BiomeGenBase[] var5 = this.worldObj.getWorldChunkManager().loadBlockGeneratorData((BiomeGenBase[])null, var1 * 16, var2 * 16, 16, 16);
-+ }
-+
-+ /**
-+ * loads or generates the chunk at the chunk location specified
-+ */
-+ public Chunk loadChunk(int par1, int par2) {
-+ return this.provideChunk(par1, par2);
-+ }
-+
-+ /**
-+ * 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) {
-+ this.hellRNG.setSeed((long)par1 * 341873128712L + (long)par2 * 132897987541L);
-+ byte[] var3 = new byte[32768];
-+ this.generateNetherTerrain(par1, par2, var3);
-+ this.replaceBlocksForBiome(par1, par2, var3);
-+ this.netherCaveGenerator.generate(this, this.worldObj, par1, par2, var3);
-+ this.genNetherBridge.generate(this, this.worldObj, par1, par2, var3);
-+ Chunk var4 = new Chunk(this.worldObj, var3, par1, par2);
-+ BiomeGenBase[] var5 = this.worldObj.getWorldChunkManager().loadBlockGeneratorData((BiomeGenBase[])null, par1 * 16, par2 * 16, 16, 16);
- byte[] var6 = var4.getBiomeArray();
-
-- for(int var7 = 0; var7 < var6.length; ++var7) {
-+ for (int var7 = 0; var7 < var6.length; ++var7) {
- var6[var7] = (byte)var5[var7].biomeID;
- }
-
-@@ -196,53 +230,62 @@
- return var4;
- }
-
-- private double[] initializeNoiseField(double[] var1, int var2, int var3, int var4, int var5, int var6, int var7) {
-- if(var1 == null) {
-- var1 = new double[var5 * var6 * var7];
-+ /**
-+ * generates a subset of the level's terrain data. Takes 7 arguments: the [empty] noise array, the position, and the
-+ * size.
-+ */
-+ private double[] initializeNoiseField(double[] par1ArrayOfDouble, int par2, int par3, int par4, int par5, int par6, int par7) {
-+ if (par1ArrayOfDouble == null) {
-+ par1ArrayOfDouble = new double[par5 * par6 * par7];
- }
-
- double var8 = 684.412D;
- double var10 = 2053.236D;
-- this.noiseData4 = this.netherNoiseGen6.generateNoiseOctaves(this.noiseData4, var2, var3, var4, var5, 1, var7, 1.0D, 0.0D, 1.0D);
-- this.noiseData5 = this.netherNoiseGen7.generateNoiseOctaves(this.noiseData5, var2, var3, var4, var5, 1, var7, 100.0D, 0.0D, 100.0D);
-- this.noiseData1 = this.netherNoiseGen3.generateNoiseOctaves(this.noiseData1, var2, var3, var4, var5, var6, var7, var8 / 80.0D, var10 / 60.0D, var8 / 80.0D);
-- this.noiseData2 = this.netherNoiseGen1.generateNoiseOctaves(this.noiseData2, var2, var3, var4, var5, var6, var7, var8, var10, var8);
-- this.noiseData3 = this.netherNoiseGen2.generateNoiseOctaves(this.noiseData3, var2, var3, var4, var5, var6, var7, var8, var10, var8);
-+ this.noiseData4 = this.netherNoiseGen6.generateNoiseOctaves(this.noiseData4, par2, par3, par4, par5, 1, par7, 1.0D, 0.0D, 1.0D);
-+ this.noiseData5 = this.netherNoiseGen7.generateNoiseOctaves(this.noiseData5, par2, par3, par4, par5, 1, par7, 100.0D, 0.0D, 100.0D);
-+ this.noiseData1 = this.netherNoiseGen3.generateNoiseOctaves(this.noiseData1, par2, par3, par4, par5, par6, par7, var8 / 80.0D, var10 / 60.0D, var8 / 80.0D);
-+ this.noiseData2 = this.netherNoiseGen1.generateNoiseOctaves(this.noiseData2, par2, par3, par4, par5, par6, par7, var8, var10, var8);
-+ this.noiseData3 = this.netherNoiseGen2.generateNoiseOctaves(this.noiseData3, par2, par3, par4, par5, par6, par7, var8, var10, var8);
- int var12 = 0;
- int var13 = 0;
-- double[] var14 = new double[var6];
--
-+ double[] var14 = new double[par6];
- int var15;
-- for(var15 = 0; var15 < var6; ++var15) {
-- var14[var15] = Math.cos((double)var15 * Math.PI * 6.0D / (double)var6) * 2.0D;
-+
-+ for (var15 = 0; var15 < par6; ++var15) {
-+ var14[var15] = Math.cos((double)var15 * Math.PI * 6.0D / (double)par6) * 2.0D;
- double var16 = (double)var15;
-- if(var15 > var6 / 2) {
-- var16 = (double)(var6 - 1 - var15);
-+
-+ if (var15 > par6 / 2) {
-+ var16 = (double)(par6 - 1 - var15);
- }
-
-- if(var16 < 4.0D) {
-+ if (var16 < 4.0D) {
- var16 = 4.0D - var16;
- var14[var15] -= var16 * var16 * var16 * 10.0D;
- }
- }
-
-- for(var15 = 0; var15 < var5; ++var15) {
-- for(int var36 = 0; var36 < var7; ++var36) {
-+ for (var15 = 0; var15 < par5; ++var15) {
-+ for (int var36 = 0; var36 < par7; ++var36) {
- double var17 = (this.noiseData4[var13] + 256.0D) / 512.0D;
-- if(var17 > 1.0D) {
-+
-+ if (var17 > 1.0D) {
- var17 = 1.0D;
- }
-
- double var19 = 0.0D;
- double var21 = this.noiseData5[var13] / 8000.0D;
-- if(var21 < 0.0D) {
-+
-+ if (var21 < 0.0D) {
- var21 = -var21;
- }
-
- var21 = var21 * 3.0D - 3.0D;
-- if(var21 < 0.0D) {
-+
-+ if (var21 < 0.0D) {
- var21 /= 2.0D;
-- if(var21 < -1.0D) {
-+
-+ if (var21 < -1.0D) {
- var21 = -1.0D;
- }
-
-@@ -250,7 +293,7 @@
- var21 /= 2.0D;
- var17 = 0.0D;
- } else {
-- if(var21 > 1.0D) {
-+ if (var21 > 1.0D) {
- var21 = 1.0D;
- }
-
-@@ -258,18 +301,19 @@
- }
-
- var17 += 0.5D;
-- var21 = var21 * (double)var6 / 16.0D;
-+ var21 = var21 * (double)par6 / 16.0D;
- ++var13;
-
-- for(int var23 = 0; var23 < var6; ++var23) {
-+ for (int var23 = 0; var23 < par6; ++var23) {
- double var24 = 0.0D;
- double var26 = var14[var23];
- double var28 = this.noiseData2[var12] / 512.0D;
- double var30 = this.noiseData3[var12] / 512.0D;
- double var32 = (this.noiseData1[var12] / 10.0D + 1.0D) / 2.0D;
-- if(var32 < 0.0D) {
-+
-+ if (var32 < 0.0D) {
- var24 = var28;
-- } else if(var32 > 1.0D) {
-+ } else if (var32 > 1.0D) {
- var24 = var30;
- } else {
- var24 = var28 + (var30 - var28) * var32;
-@@ -277,149 +321,179 @@
-
- var24 -= var26;
- double var34;
-- if(var23 > var6 - 4) {
-- var34 = (double)((float)(var23 - (var6 - 4)) / 3.0F);
-+
-+ if (var23 > par6 - 4) {
-+ var34 = (double)((float)(var23 - (par6 - 4)) / 3.0F);
- var24 = var24 * (1.0D - var34) + -10.0D * var34;
- }
-
-- if((double)var23 < var19) {
-+ if ((double)var23 < var19) {
- var34 = (var19 - (double)var23) / 4.0D;
-- if(var34 < 0.0D) {
-+
-+ if (var34 < 0.0D) {
- var34 = 0.0D;
- }
-
-- if(var34 > 1.0D) {
-+ if (var34 > 1.0D) {
- var34 = 1.0D;
- }
-
- var24 = var24 * (1.0D - var34) + -10.0D * var34;
- }
-
-- var1[var12] = var24;
-+ par1ArrayOfDouble[var12] = var24;
- ++var12;
- }
- }
- }
-
-- return var1;
-+ return par1ArrayOfDouble;
- }
-
-- public boolean chunkExists(int var1, int var2) {
-+ /**
-+ * Checks to see if a chunk exists at x, y
-+ */
-+ public boolean chunkExists(int par1, int par2) {
- return true;
- }
-
-- public void populate(IChunkProvider var1, int var2, int var3) {
-+ /**
-+ * Populates chunk with ores etc etc
-+ */
-+ public void populate(IChunkProvider par1IChunkProvider, int par2, int par3) {
- BlockSand.fallInstantly = true;
-- int var4 = var2 * 16;
-- int var5 = var3 * 16;
-- this.genNetherBridge.generateStructuresInChunk(this.worldObj, this.i, var2, var3);
--
-+ int var4 = par2 * 16;
-+ int var5 = par3 * 16;
-+ this.genNetherBridge.generateStructuresInChunk(this.worldObj, this.hellRNG, par2, par3);
- int var6;
- int var7;
- int var8;
- int var9;
-- for(var6 = 0; var6 < 8; ++var6) {
-- var7 = var4 + this.i.nextInt(16) + 8;
-- var8 = this.i.nextInt(120) + 4;
-- var9 = var5 + this.i.nextInt(16) + 8;
-- (new WorldGenHellLava(Block.lavaMoving.blockID, false)).generate(this.worldObj, this.i, var7, var8, var9);
-+
-+ for (var6 = 0; var6 < 8; ++var6) {
-+ var7 = var4 + this.hellRNG.nextInt(16) + 8;
-+ var8 = this.hellRNG.nextInt(120) + 4;
-+ var9 = var5 + this.hellRNG.nextInt(16) + 8;
-+ (new WorldGenHellLava(Block.lavaMoving.blockID, false)).generate(this.worldObj, this.hellRNG, var7, var8, var9);
- }
-
-- var6 = this.i.nextInt(this.i.nextInt(10) + 1) + 1;
--
-+ var6 = this.hellRNG.nextInt(this.hellRNG.nextInt(10) + 1) + 1;
- int var10;
-- for(var7 = 0; var7 < var6; ++var7) {
-- var8 = var4 + this.i.nextInt(16) + 8;
-- var9 = this.i.nextInt(120) + 4;
-- var10 = var5 + this.i.nextInt(16) + 8;
-- (new WorldGenFire()).generate(this.worldObj, this.i, var8, var9, var10);
-- }
--
-- var6 = this.i.nextInt(this.i.nextInt(10) + 1);
--
-- for(var7 = 0; var7 < var6; ++var7) {
-- var8 = var4 + this.i.nextInt(16) + 8;
-- var9 = this.i.nextInt(120) + 4;
-- var10 = var5 + this.i.nextInt(16) + 8;
-- (new WorldGenGlowStone1()).generate(this.worldObj, this.i, var8, var9, var10);
-- }
--
-- for(var7 = 0; var7 < 10; ++var7) {
-- var8 = var4 + this.i.nextInt(16) + 8;
-- var9 = this.i.nextInt(128);
-- var10 = var5 + this.i.nextInt(16) + 8;
-- (new WorldGenGlowStone2()).generate(this.worldObj, this.i, var8, var9, var10);
-- }
--
-- if(this.i.nextInt(1) == 0) {
-- var7 = var4 + this.i.nextInt(16) + 8;
-- var8 = this.i.nextInt(128);
-- var9 = var5 + this.i.nextInt(16) + 8;
-- (new WorldGenFlowers(Block.mushroomBrown.blockID)).generate(this.worldObj, this.i, var7, var8, var9);
-- }
--
-- if(this.i.nextInt(1) == 0) {
-- var7 = var4 + this.i.nextInt(16) + 8;
-- var8 = this.i.nextInt(128);
-- var9 = var5 + this.i.nextInt(16) + 8;
-- (new WorldGenFlowers(Block.mushroomRed.blockID)).generate(this.worldObj, this.i, var7, var8, var9);
-+
-+ for (var7 = 0; var7 < var6; ++var7) {
-+ var8 = var4 + this.hellRNG.nextInt(16) + 8;
-+ var9 = this.hellRNG.nextInt(120) + 4;
-+ var10 = var5 + this.hellRNG.nextInt(16) + 8;
-+ (new WorldGenFire()).generate(this.worldObj, this.hellRNG, var8, var9, var10);
-+ }
-+
-+ var6 = this.hellRNG.nextInt(this.hellRNG.nextInt(10) + 1);
-+
-+ for (var7 = 0; var7 < var6; ++var7) {
-+ var8 = var4 + this.hellRNG.nextInt(16) + 8;
-+ var9 = this.hellRNG.nextInt(120) + 4;
-+ var10 = var5 + this.hellRNG.nextInt(16) + 8;
-+ (new WorldGenGlowStone1()).generate(this.worldObj, this.hellRNG, var8, var9, var10);
-+ }
-+
-+ for (var7 = 0; var7 < 10; ++var7) {
-+ var8 = var4 + this.hellRNG.nextInt(16) + 8;
-+ var9 = this.hellRNG.nextInt(128);
-+ var10 = var5 + this.hellRNG.nextInt(16) + 8;
-+ (new WorldGenGlowStone2()).generate(this.worldObj, this.hellRNG, var8, var9, var10);
-+ }
-+
-+ if (this.hellRNG.nextInt(1) == 0) {
-+ var7 = var4 + this.hellRNG.nextInt(16) + 8;
-+ var8 = this.hellRNG.nextInt(128);
-+ var9 = var5 + this.hellRNG.nextInt(16) + 8;
-+ (new WorldGenFlowers(Block.mushroomBrown.blockID)).generate(this.worldObj, this.hellRNG, var7, var8, var9);
-+ }
-+
-+ if (this.hellRNG.nextInt(1) == 0) {
-+ var7 = var4 + this.hellRNG.nextInt(16) + 8;
-+ var8 = this.hellRNG.nextInt(128);
-+ var9 = var5 + this.hellRNG.nextInt(16) + 8;
-+ (new WorldGenFlowers(Block.mushroomRed.blockID)).generate(this.worldObj, this.hellRNG, var7, var8, var9);
- }
-
- WorldGenMinable var12 = new WorldGenMinable(Block.oreNetherQuartz.blockID, 13, Block.netherrack.blockID);
--
- int var11;
-- for(var8 = 0; var8 < 16; ++var8) {
-- var9 = var4 + this.i.nextInt(16);
-- var10 = this.i.nextInt(108) + 10;
-- var11 = var5 + this.i.nextInt(16);
-- var12.generate(this.worldObj, this.i, var9, var10, var11);
-+
-+ for (var8 = 0; var8 < 16; ++var8) {
-+ var9 = var4 + this.hellRNG.nextInt(16);
-+ var10 = this.hellRNG.nextInt(108) + 10;
-+ var11 = var5 + this.hellRNG.nextInt(16);
-+ var12.generate(this.worldObj, this.hellRNG, var9, var10, var11);
- }
-
-- for(var8 = 0; var8 < 16; ++var8) {
-- var9 = var4 + this.i.nextInt(16);
-- var10 = this.i.nextInt(108) + 10;
-- var11 = var5 + this.i.nextInt(16);
-- (new WorldGenHellLava(Block.lavaMoving.blockID, true)).generate(this.worldObj, this.i, var9, var10, var11);
-+ for (var8 = 0; var8 < 16; ++var8) {
-+ var9 = var4 + this.hellRNG.nextInt(16);
-+ var10 = this.hellRNG.nextInt(108) + 10;
-+ var11 = var5 + this.hellRNG.nextInt(16);
-+ (new WorldGenHellLava(Block.lavaMoving.blockID, true)).generate(this.worldObj, this.hellRNG, var9, var10, var11);
- }
-
- BlockSand.fallInstantly = false;
- }
-
-- public boolean saveChunks(boolean var1, IProgressUpdate var2) {
-+ /**
-+ * 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;
- }
-
-- public void saveExtraData() {
-- }
-+ /**
-+ * 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 true;
- }
-
-+ /**
-+ * Converts the instance data to a readable string.
-+ */
- public String makeString() {
- return "HellRandomLevelSource";
- }
-
-- public List getPossibleCreatures(EnumCreatureType var1, int var2, int var3, int var4) {
-- if(var1 == EnumCreatureType.monster) {
-- if(this.genNetherBridge.hasStructureAt(var2, var3, var4)) {
-+ /**
-+ * 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) {
-+ if (par1EnumCreatureType == EnumCreatureType.monster) {
-+ if (this.genNetherBridge.hasStructureAt(par2, par3, par4)) {
- return this.genNetherBridge.getSpawnList();
- }
-
-- if(this.genNetherBridge.func_142038_b(var2, var3, var4) && this.worldObj.getBlockId(var2, var3 - 1, var4) == Block.netherBrick.blockID) {
-+ if (this.genNetherBridge.func_142038_b(par2, par3, par4) && this.worldObj.getBlockId(par2, par3 - 1, par4) == Block.netherBrick.blockID) {
- return this.genNetherBridge.getSpawnList();
- }
- }
-
-- BiomeGenBase var5 = this.worldObj.getBiomeGenForCoords(var2, var4);
-- return var5 == null ? null : var5.getSpawnableList(var1);
-+ BiomeGenBase var5 = this.worldObj.getBiomeGenForCoords(par2, par4);
-+ return var5 == null ? null : var5.getSpawnableList(par1EnumCreatureType);
- }
-
-- public ChunkPosition findClosestStructure(World var1, String var2, int var3, int var4, int var5) {
-+ /**
-+ * 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;
- }
-
-@@ -427,7 +501,7 @@
- return 0;
- }
-
-- public void recreateStructures(int var1, int var2) {
-- this.genNetherBridge.generate(this, this.worldObj, var1, var2, (byte[])null);
-+ public void recreateStructures(int par1, int par2) {
-+ this.genNetherBridge.generate(this, this.worldObj, par1, par2, (byte[])null);
- }
- }
---- net/minecraft/src/Packet2ClientProtocol.java
-+++ net/minecraft/src/Packet2ClientProtocol.java
-@@ -6,47 +6,64 @@
-
- public class Packet2ClientProtocol extends Packet {
- private int protocolVersion;
-- private String b;
-- private String c;
-+ private String username;
-+ private String serverHost;
- private int serverPort;
-
-- public Packet2ClientProtocol() {
-- }
--
-- public Packet2ClientProtocol(int var1, String var2, String var3, int var4) {
-- this.protocolVersion = var1;
-- this.b = var2;
-- this.c = var3;
-- this.serverPort = var4;
-- }
--
-- public void readPacketData(DataInput var1) throws IOException {
-- this.protocolVersion = var1.readByte();
-- this.b = readString(var1, 16);
-- this.c = readString(var1, 255);
-- this.serverPort = var1.readInt();
-- }
--
-- public void writePacketData(DataOutput var1) throws IOException {
-- var1.writeByte(this.protocolVersion);
-- writeString(this.b, var1);
-- writeString(this.c, var1);
-- var1.writeInt(this.serverPort);
-- }
--
-- public void processPacket(NetHandler var1) {
-- var1.handleClientProtocol(this);
-- }
--
-+ 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 {
-+ this.protocolVersion = par1DataInput.readByte();
-+ this.username = readString(par1DataInput, 16);
-+ this.serverHost = readString(par1DataInput, 255);
-+ this.serverPort = par1DataInput.readInt();
-+ }
-+
-+ /**
-+ * Abstract. Writes the raw packet data to the data stream.
-+ */
-+ public void writePacketData(DataOutput par1DataOutput) throws IOException {
-+ par1DataOutput.writeByte(this.protocolVersion);
-+ writeString(this.username, par1DataOutput);
-+ writeString(this.serverHost, par1DataOutput);
-+ par1DataOutput.writeInt(this.serverPort);
-+ }
-+
-+ /**
-+ * Passes this Packet on to the NetHandler for processing.
-+ */
-+ public void processPacket(NetHandler par1NetHandler) {
-+ par1NetHandler.handleClientProtocol(this);
-+ }
-+
-+ /**
-+ * Abstract. Return the size of the packet (not counting the header).
-+ */
- public int getPacketSize() {
-- return 3 + 2 * this.b.length();
-+ return 3 + 2 * this.username.length();
- }
-
-+ /**
-+ * Returns the protocol version.
-+ */
- public int getProtocolVersion() {
- return this.protocolVersion;
- }
-
-+ /**
-+ * Returns the username.
-+ */
- public String getUsername() {
-- return this.b;
-+ return this.username;
- }
- }
---- /dev/null
-+++ org/spoutcraft/api/gui/SolidBackground.java
-@@ -1,0 +1,35 @@
-+/*
-+ * This file is part of Spoutcraft.
-+ *
-+ * Copyright (c) 2011 SpoutcraftDev
-+ * Spoutcraft is licensed under the GNU Lesser General Public License.
-+ *
-+ * Spoutcraft is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation, either version 3 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Spoutcraft is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program. If not, see .
-+ */
-+package org.spoutcraft.api.gui;
-+
-+import org.spoutcraft.api.UnsafeClass;
-+
-+@UnsafeClass
-+public interface SolidBackground {
-+ /**
-+ * Not implemented.
-+ *
-+ * @param red
-+ * @param green
-+ * @param blue
-+ * @param alpha
-+ */
-+ public void setColor(float red, float green, float blue, float alpha);
-+}
---- net/minecraft/src/EmptyChunk.java
-+++ net/minecraft/src/EmptyChunk.java
-@@ -4,109 +4,176 @@
- import java.util.Random;
-
- public class EmptyChunk extends Chunk {
-- public EmptyChunk(World var1, int var2, int var3) {
-- super(var1, var2, var3);
-- }
--
-- public boolean isAtLocation(int var1, int var2) {
-- return var1 == this.xPosition && var2 == this.zPosition;
-- }
--
-- public int getHeightValue(int var1, int var2) {
-- return 0;
-- }
--
-- public void generateHeightMap() {
-- }
--
-- public void generateSkylightMap() {
-- }
--
-- public int getBlockID(int var1, int var2, int var3) {
-- return 0;
-- }
--
-- public int getBlockLightOpacity(int var1, int var2, int var3) {
-+ public EmptyChunk(World par1World, int par2, int par3) {
-+ super(par1World, par2, par3);
-+ }
-+
-+ /**
-+ * Checks whether the chunk is at the X/Z location specified
-+ */
-+ public boolean isAtLocation(int par1, int par2) {
-+ return par1 == this.xPosition && par2 == this.zPosition;
-+ }
-+
-+ /**
-+ * Returns the value in the height map at this x, z coordinate in the chunk
-+ */
-+ public int getHeightValue(int par1, int par2) {
-+ 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() {}
-+
-+ /**
-+ * Return the ID of a block in the chunk.
-+ */
-+ public int getBlockID(int par1, int par2, int par3) {
-+ return 0;
-+ }
-+
-+ public int getBlockLightOpacity(int par1, int par2, int par3) {
- return 255;
- }
-
-- public boolean setBlockIDWithMetadata(int var1, int var2, int var3, int var4, int var5) {
-+ /**
-+ * 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;
- }
-
-- public int getBlockMetadata(int var1, int var2, int var3) {
-- return 0;
-- }
--
-- public boolean setBlockMetadata(int var1, int var2, int var3, int var4) {
-- return false;
-- }
--
-- public int getSavedLightValue(EnumSkyBlock var1, int var2, int var3, int var4) {
-- return 0;
-- }
--
-- public void setLightValue(EnumSkyBlock var1, int var2, int var3, int var4, int var5) {
-- }
--
-- public int getBlockLightValue(int var1, int var2, int var3, int var4) {
-- return 0;
-- }
--
-- public void addEntity(Entity var1) {
-- }
--
-- public void removeEntity(Entity var1) {
-- }
--
-- public void removeEntityAtIndex(Entity var1, int var2) {
-- }
--
-- public boolean canBlockSeeTheSky(int var1, int var2, int var3) {
-- return false;
-- }
--
-- public TileEntity getChunkBlockTileEntity(int var1, int var2, int var3) {
-+ /**
-+ * Return the metadata corresponding to the given coordinates inside a chunk.
-+ */
-+ public int getBlockMetadata(int par1, int par2, int par3) {
-+ return 0;
-+ }
-+
-+ /**
-+ * Set the metadata of a block in the chunk
-+ */
-+ public boolean setBlockMetadata(int par1, int par2, int par3, int par4) {
-+ return false;
-+ }
-+
-+ /**
-+ * Gets the amount of light saved in this block (doesn't adjust for daylight)
-+ */
-+ public int getSavedLightValue(EnumSkyBlock par1EnumSkyBlock, int par2, int par3, int par4) {
-+ return 0;
-+ }
-+
-+ /**
-+ * Sets the light value at the coordinate. If enumskyblock is set to sky it sets it in the skylightmap and if its a
-+ * block then into the blocklightmap. Args enumSkyBlock, x, y, z, lightValue
-+ */
-+ public void setLightValue(EnumSkyBlock par1EnumSkyBlock, int par2, int par3, int par4, int par5) {}
-+
-+ /**
-+ * Gets the amount of light on a block taking into account sunlight
-+ */
-+ public int getBlockLightValue(int par1, int par2, int par3, int par4) {
-+ return 0;
-+ }
-+
-+ /**
-+ * Adds an entity to the chunk. Args: entity
-+ */
-+ public void addEntity(Entity par1Entity) {}
-+
-+ /**
-+ * removes entity using its y chunk coordinate as its index
-+ */
-+ public void removeEntity(Entity par1Entity) {}
-+
-+ /**
-+ * Removes entity at the specified index from the entity array.
-+ */
-+ public void removeEntityAtIndex(Entity par1Entity, int par2) {}
-+
-+ /**
-+ * Returns whether is not a block above this one blocking sight to the sky (done via checking against the heightmap)
-+ */
-+ public boolean canBlockSeeTheSky(int par1, int par2, int par3) {
-+ return false;
-+ }
-+
-+ /**
-+ * Gets the TileEntity for a given block in this chunk
-+ */
-+ public TileEntity getChunkBlockTileEntity(int par1, int par2, int par3) {
- return null;
- }
-
-- public void addTileEntity(TileEntity var1) {
-- }
--
-- public void setChunkBlockTileEntity(int var1, int var2, int var3, TileEntity var4) {
-- }
--
-- public void removeChunkBlockTileEntity(int var1, int var2, int var3) {
-- }
--
-- public void onChunkLoad() {
-- }
--
-- public void onChunkUnload() {
-- }
--
-- public void setChunkModified() {
-- }
--
-- public void getEntitiesWithinAABBForEntity(Entity var1, AxisAlignedBB var2, List var3, IEntitySelector var4) {
-- }
--
-- public void getEntitiesOfTypeWithinAAAB(Class var1, AxisAlignedBB var2, List var3, IEntitySelector var4) {
-- }
--
-- public boolean needsSaving(boolean var1) {
-+ /**
-+ * Adds a TileEntity to a chunk
-+ */
-+ public void addTileEntity(TileEntity par1TileEntity) {}
-+
-+ /**
-+ * Sets the TileEntity for a given block in this chunk
-+ */
-+ public void setChunkBlockTileEntity(int par1, int par2, int par3, TileEntity par4TileEntity) {}
-+
-+ /**
-+ * Removes the TileEntity for a given block in this chunk
-+ */
-+ public void removeChunkBlockTileEntity(int par1, int par2, int par3) {}
-+
-+ /**
-+ * Called when this Chunk is loaded by the ChunkProvider
-+ */
-+ public void onChunkLoad() {}
-+
-+ /**
-+ * Called when this Chunk is unloaded by the ChunkProvider
-+ */
-+ public void onChunkUnload() {}
-+
-+ /**
-+ * Sets the isModified flag for this Chunk
-+ */
-+ public void setChunkModified() {}
-+
-+ /**
-+ * Fills the given list of all entities that intersect within the given bounding box that aren't the passed entity
-+ * Args: entity, aabb, listToFill
-+ */
-+ public void getEntitiesWithinAABBForEntity(Entity par1Entity, AxisAlignedBB par2AxisAlignedBB, List par3List, IEntitySelector par4IEntitySelector) {}
-+
-+ /**
-+ * Gets all entities that can be assigned to the specified class. Args: entityClass, aabb, listToFill
-+ */
-+ public void getEntitiesOfTypeWithinAAAB(Class par1Class, AxisAlignedBB par2AxisAlignedBB, List par3List, IEntitySelector par4IEntitySelector) {}
-+
-+ /**
-+ * Returns true if this Chunk needs to be saved
-+ */
-+ public boolean needsSaving(boolean par1) {
- return false;
- }
-
-- public Random getRandomWithSeed(long var1) {
-- return new Random(this.worldObj.getSeed() + (long)(this.xPosition * this.xPosition * 4987142) + (long)(this.xPosition * 5947611) + (long)(this.zPosition * this.zPosition) * 4392871L + (long)(this.zPosition * 389711) ^ var1);
-+ public Random getRandomWithSeed(long par1) {
-+ return new Random(this.worldObj.getSeed() + (long)(this.xPosition * this.xPosition * 4987142) + (long)(this.xPosition * 5947611) + (long)(this.zPosition * this.zPosition) * 4392871L + (long)(this.zPosition * 389711) ^ par1);
- }
-
- public boolean isEmpty() {
- return true;
- }
-
-- public boolean getAreLevelsEmpty(int var1, int var2) {
-+ /**
-+ * Returns whether the ExtendedBlockStorages containing levels (in blocks) from arg 1 to arg 2 are fully empty (true)
-+ * or not (false).
-+ */
-+ public boolean getAreLevelsEmpty(int par1, int par2) {
- return true;
- }
- }
---- net/minecraft/src/ServerBlockEventList.java
-+++ net/minecraft/src/ServerBlockEventList.java
-@@ -3,10 +3,9 @@
- import java.util.ArrayList;
-
- class ServerBlockEventList extends ArrayList {
-- private ServerBlockEventList() {
-- }
-+ private ServerBlockEventList() {}
-
-- ServerBlockEventList(ServerBlockEvent var1) {
-+ ServerBlockEventList(ServerBlockEvent par1ServerBlockEvent) {
- this();
- }
- }
---- net/minecraft/src/StatCollector.java
-+++ net/minecraft/src/StatCollector.java
-@@ -3,15 +3,21 @@
- public class StatCollector {
- private static StringTranslate localizedName = StringTranslate.getInstance();
-
-- public static String translateToLocal(String var0) {
-- return localizedName.translateKey(var0);
-- }
--
-- public static String translateToLocalFormatted(String var0, Object... var1) {
-- return localizedName.translateKeyFormat(var0, var1);
-- }
--
-- public static boolean func_94522_b(String var0) {
-- return localizedName.isKeyTranslated(var0);
-+ /**
-+ * Translates a Stat name
-+ */
-+ public static String translateToLocal(String par0Str) {
-+ return localizedName.translateKey(par0Str);
-+ }
-+
-+ /**
-+ * Translates a Stat name with format args
-+ */
-+ public static String translateToLocalFormatted(String par0Str, Object ... par1ArrayOfObj) {
-+ return localizedName.translateKeyFormat(par0Str, par1ArrayOfObj);
-+ }
-+
-+ public static boolean func_94522_b(String par0Str) {
-+ return localizedName.containsTranslateKey(par0Str);
- }
- }
---- net/minecraft/src/ItemDoor.java
-+++ net/minecraft/src/ItemDoor.java
-@@ -3,32 +3,37 @@
- public class ItemDoor extends Item {
- private Material doorMaterial;
-
-- public ItemDoor(int var1, Material var2) {
-- super(var1);
-- this.doorMaterial = var2;
-+ public ItemDoor(int par1, Material par2Material) {
-+ super(par1);
-+ this.doorMaterial = par2Material;
- this.maxStackSize = 1;
- this.setCreativeTab(CreativeTabs.tabRedstone);
- }
-
-- public boolean onItemUse(ItemStack var1, EntityPlayer var2, World var3, int var4, int var5, int var6, int var7, float var8, float var9, float var10) {
-- if(var7 != 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) {
-+ if (par7 != 1) {
- return false;
- } else {
-- ++var5;
-+ ++par5;
- Block var11;
-- if(this.doorMaterial == Material.wood) {
-+
-+ if (this.doorMaterial == Material.wood) {
- var11 = Block.doorWood;
- } else {
- var11 = Block.doorIron;
- }
-
-- if(var2.canPlayerEdit(var4, var5, var6, var7, var1) && var2.canPlayerEdit(var4, var5 + 1, var6, var7, var1)) {
-- if(!var11.canPlaceBlockAt(var3, var4, var5, var6)) {
-+ if (par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack) && par2EntityPlayer.canPlayerEdit(par4, par5 + 1, par6, par7, par1ItemStack)) {
-+ if (!var11.canPlaceBlockAt(par3World, par4, par5, par6)) {
- return false;
- } else {
-- int var12 = MathHelper.floor_double((double)((var2.rotationYaw + 180.0F) * 4.0F / 360.0F) - 0.5D) & 3;
-- placeDoorBlock(var3, var4, var5, var6, var12, var11);
-- --var1.stackSize;
-+ int var12 = MathHelper.floor_double((double)((par2EntityPlayer.rotationYaw + 180.0F) * 4.0F / 360.0F) - 0.5D) & 3;
-+ placeDoorBlock(par3World, par4, par5, par6, var12, var11);
-+ --par1ItemStack.stackSize;
- return true;
- }
- } else {
-@@ -37,39 +42,41 @@
- }
- }
-
-- public static void placeDoorBlock(World var0, int var1, int var2, int var3, int var4, Block var5) {
-+ public static void placeDoorBlock(World par0World, int par1, int par2, int par3, int par4, Block par5Block) {
- byte var6 = 0;
- byte var7 = 0;
-- if(var4 == 0) {
-+
-+ if (par4 == 0) {
- var7 = 1;
- }
-
-- if(var4 == 1) {
-+ if (par4 == 1) {
- var6 = -1;
- }
-
-- if(var4 == 2) {
-+ if (par4 == 2) {
- var7 = -1;
- }
-
-- if(var4 == 3) {
-+ if (par4 == 3) {
- var6 = 1;
- }
-
-- int var8 = (var0.isBlockNormalCube(var1 - var6, var2, var3 - var7) ? 1 : 0) + (var0.isBlockNormalCube(var1 - var6, var2 + 1, var3 - var7) ? 1 : 0);
-- int var9 = (var0.isBlockNormalCube(var1 + var6, var2, var3 + var7) ? 1 : 0) + (var0.isBlockNormalCube(var1 + var6, var2 + 1, var3 + var7) ? 1 : 0);
-- boolean var10 = var0.getBlockId(var1 - var6, var2, var3 - var7) == var5.blockID || var0.getBlockId(var1 - var6, var2 + 1, var3 - var7) == var5.blockID;
-- boolean var11 = var0.getBlockId(var1 + var6, var2, var3 + var7) == var5.blockID || var0.getBlockId(var1 + var6, var2 + 1, var3 + var7) == var5.blockID;
-+ int var8 = (par0World.isBlockNormalCube(par1 - var6, par2, par3 - var7) ? 1 : 0) + (par0World.isBlockNormalCube(par1 - var6, par2 + 1, par3 - var7) ? 1 : 0);
-+ int var9 = (par0World.isBlockNormalCube(par1 + var6, par2, par3 + var7) ? 1 : 0) + (par0World.isBlockNormalCube(par1 + var6, par2 + 1, par3 + var7) ? 1 : 0);
-+ boolean var10 = par0World.getBlockId(par1 - var6, par2, par3 - var7) == par5Block.blockID || par0World.getBlockId(par1 - var6, par2 + 1, par3 - var7) == par5Block.blockID;
-+ boolean var11 = par0World.getBlockId(par1 + var6, par2, par3 + var7) == par5Block.blockID || par0World.getBlockId(par1 + var6, par2 + 1, par3 + var7) == par5Block.blockID;
- boolean var12 = false;
-- if(var10 && !var11) {
-+
-+ if (var10 && !var11) {
- var12 = true;
-- } else if(var9 > var8) {
-+ } else if (var9 > var8) {
- var12 = true;
- }
-
-- var0.setBlock(var1, var2, var3, var5.blockID, var4, 2);
-- var0.setBlock(var1, var2 + 1, var3, var5.blockID, 8 | (var12 ? 1 : 0), 2);
-- var0.notifyBlocksOfNeighborChange(var1, var2, var3, var5.blockID);
-- var0.notifyBlocksOfNeighborChange(var1, var2 + 1, var3, var5.blockID);
-+ par0World.setBlock(par1, par2, par3, par5Block.blockID, par4, 2);
-+ par0World.setBlock(par1, par2 + 1, par3, par5Block.blockID, 8 | (var12 ? 1 : 0), 2);
-+ par0World.notifyBlocksOfNeighborChange(par1, par2, par3, par5Block.blockID);
-+ par0World.notifyBlocksOfNeighborChange(par1, par2 + 1, par3, par5Block.blockID);
- }
- }
---- net/minecraft/src/NibbleArray.java
-+++ net/minecraft/src/NibbleArray.java
-@@ -1,38 +1,56 @@
- package net.minecraft.src;
-
- public class NibbleArray {
-+
-+ /**
-+ * Byte array of data stored in this holder. Possibly a light map or some chunk data. Data is accessed in 4-bit pieces.
-+ */
- public final byte[] data;
-+
-+ /**
-+ * Log base 2 of the chunk height (128); applied as a shift on Z coordinate
-+ */
- private final int depthBits;
-+
-+ /**
-+ * Log base 2 of the chunk height (128) * width (16); applied as a shift on X coordinate
-+ */
- private final int depthBitsPlusFour;
-
-- public NibbleArray(int var1, int var2) {
-- this.data = new byte[var1 >> 1];
-- this.depthBits = var2;
-- this.depthBitsPlusFour = var2 + 4;
-- }
--
-- public NibbleArray(byte[] var1, int var2) {
-- this.data = var1;
-- this.depthBits = var2;
-- this.depthBitsPlusFour = var2 + 4;
-- }
--
-- public int get(int var1, int var2, int var3) {
-- int var4 = var2 << this.depthBitsPlusFour | var3 << this.depthBits | var1;
-+ public NibbleArray(int par1, int par2) {
-+ this.data = new byte[par1 >> 1];
-+ this.depthBits = par2;
-+ this.depthBitsPlusFour = par2 + 4;
-+ }
-+
-+ public NibbleArray(byte[] par1ArrayOfByte, int par2) {
-+ this.data = par1ArrayOfByte;
-+ this.depthBits = par2;
-+ this.depthBitsPlusFour = par2 + 4;
-+ }
-+
-+ /**
-+ * Returns the nibble of data corresponding to the passed in x, y, z. y is at most 6 bits, z is at most 4.
-+ */
-+ public int get(int par1, int par2, int par3) {
-+ int var4 = par2 << this.depthBitsPlusFour | par3 << this.depthBits | par1;
- int var5 = var4 >> 1;
- int var6 = var4 & 1;
- return var6 == 0 ? this.data[var5] & 15 : this.data[var5] >> 4 & 15;
- }
-
-- public void set(int var1, int var2, int var3, int var4) {
-- int var5 = var2 << this.depthBitsPlusFour | var3 << this.depthBits | var1;
-+ /**
-+ * Arguments are x, y, z, val. Sets the nibble of data at x << 11 | z << 7 | y to val.
-+ */
-+ public void set(int par1, int par2, int par3, int par4) {
-+ int var5 = par2 << this.depthBitsPlusFour | par3 << this.depthBits | par1;
- int var6 = var5 >> 1;
- int var7 = var5 & 1;
-- if(var7 == 0) {
-- this.data[var6] = (byte)(this.data[var6] & 240 | var4 & 15);
-+
-+ if (var7 == 0) {
-+ this.data[var6] = (byte)(this.data[var6] & 240 | par4 & 15);
- } else {
-- this.data[var6] = (byte)(this.data[var6] & 15 | (var4 & 15) << 4);
-+ this.data[var6] = (byte)(this.data[var6] & 15 | (par4 & 15) << 4);
- }
--
- }
- }
---- net/minecraft/src/RenderMinecart.java
-+++ net/minecraft/src/RenderMinecart.java
-@@ -4,6 +4,8 @@
-
- public class RenderMinecart extends Render {
- private static final ResourceLocation minecartTextures = new ResourceLocation("textures/entity/minecart.png");
-+
-+ /** instance of ModelMinecart for rendering */
- protected ModelBase modelMinecart = new ModelMinecart();
- protected final RenderBlocks field_94145_f;
-
-@@ -12,92 +14,112 @@
- this.field_94145_f = new RenderBlocks();
- }
-
-- public void renderTheMinecart(EntityMinecart var1, double var2, double var4, double var6, float var8, float var9) {
-+ /**
-+ * Renders the Minecart.
-+ */
-+ public void renderTheMinecart(EntityMinecart par1EntityMinecart, double par2, double par4, double par6, float par8, float par9) {
- GL11.glPushMatrix();
-- this.bindEntityTexture(var1);
-- long var10 = (long)var1.entityId * 493286711L;
-+ this.bindEntityTexture(par1EntityMinecart);
-+ long var10 = (long)par1EntityMinecart.entityId * 493286711L;
- var10 = var10 * var10 * 4392167121L + var10 * 98761L;
- float var12 = (((float)(var10 >> 16 & 7L) + 0.5F) / 8.0F - 0.5F) * 0.004F;
- float var13 = (((float)(var10 >> 20 & 7L) + 0.5F) / 8.0F - 0.5F) * 0.004F;
- float var14 = (((float)(var10 >> 24 & 7L) + 0.5F) / 8.0F - 0.5F) * 0.004F;
- GL11.glTranslatef(var12, var13, var14);
-- double var15 = var1.lastTickPosX + (var1.posX - var1.lastTickPosX) * (double)var9;
-- double var17 = var1.lastTickPosY + (var1.posY - var1.lastTickPosY) * (double)var9;
-- double var19 = var1.lastTickPosZ + (var1.posZ - var1.lastTickPosZ) * (double)var9;
-- double var21 = (double)0.3F;
-- Vec3 var23 = var1.func_70489_a(var15, var17, var19);
-- float var24 = var1.prevRotationPitch + (var1.rotationPitch - var1.prevRotationPitch) * var9;
-- if(var23 != null) {
-- Vec3 var25 = var1.func_70495_a(var15, var17, var19, var21);
-- Vec3 var26 = var1.func_70495_a(var15, var17, var19, -var21);
-- if(var25 == null) {
-+ double var15 = par1EntityMinecart.lastTickPosX + (par1EntityMinecart.posX - par1EntityMinecart.lastTickPosX) * (double)par9;
-+ double var17 = par1EntityMinecart.lastTickPosY + (par1EntityMinecart.posY - par1EntityMinecart.lastTickPosY) * (double)par9;
-+ double var19 = par1EntityMinecart.lastTickPosZ + (par1EntityMinecart.posZ - par1EntityMinecart.lastTickPosZ) * (double)par9;
-+ double var21 = 0.30000001192092896D;
-+ Vec3 var23 = par1EntityMinecart.func_70489_a(var15, var17, var19);
-+ float var24 = par1EntityMinecart.prevRotationPitch + (par1EntityMinecart.rotationPitch - par1EntityMinecart.prevRotationPitch) * par9;
-+
-+ if (var23 != null) {
-+ Vec3 var25 = par1EntityMinecart.func_70495_a(var15, var17, var19, var21);
-+ Vec3 var26 = par1EntityMinecart.func_70495_a(var15, var17, var19, -var21);
-+
-+ if (var25 == null) {
- var25 = var23;
- }
-
-- if(var26 == null) {
-+ if (var26 == null) {
- var26 = var23;
- }
-
-- var2 += var23.xCoord - var15;
-- var4 += (var25.yCoord + var26.yCoord) / 2.0D - var17;
-- var6 += var23.zCoord - var19;
-+ par2 += var23.xCoord - var15;
-+ par4 += (var25.yCoord + var26.yCoord) / 2.0D - var17;
-+ par6 += var23.zCoord - var19;
- Vec3 var27 = var26.addVector(-var25.xCoord, -var25.yCoord, -var25.zCoord);
-- if(var27.lengthVector() != 0.0D) {
-+
-+ if (var27.lengthVector() != 0.0D) {
- var27 = var27.normalize();
-- var8 = (float)(Math.atan2(var27.zCoord, var27.xCoord) * 180.0D / Math.PI);
-+ par8 = (float)(Math.atan2(var27.zCoord, var27.xCoord) * 180.0D / Math.PI);
- var24 = (float)(Math.atan(var27.yCoord) * 73.0D);
- }
- }
-
-- GL11.glTranslatef((float)var2, (float)var4, (float)var6);
-- GL11.glRotatef(180.0F - var8, 0.0F, 1.0F, 0.0F);
-+ GL11.glTranslatef((float)par2, (float)par4, (float)par6);
-+ GL11.glRotatef(180.0F - par8, 0.0F, 1.0F, 0.0F);
- GL11.glRotatef(-var24, 0.0F, 0.0F, 1.0F);
-- float var31 = (float)var1.getRollingAmplitude() - var9;
-- float var32 = var1.getDamage() - var9;
-- if(var32 < 0.0F) {
-+ float var31 = (float)par1EntityMinecart.getRollingAmplitude() - par9;
-+ float var32 = par1EntityMinecart.getDamage() - par9;
-+
-+ if (var32 < 0.0F) {
- var32 = 0.0F;
- }
-
-- if(var31 > 0.0F) {
-- GL11.glRotatef(MathHelper.sin(var31) * var31 * var32 / 10.0F * (float)var1.getRollingDirection(), 1.0F, 0.0F, 0.0F);
-+ if (var31 > 0.0F) {
-+ GL11.glRotatef(MathHelper.sin(var31) * var31 * var32 / 10.0F * (float)par1EntityMinecart.getRollingDirection(), 1.0F, 0.0F, 0.0F);
- }
-
-- int var33 = var1.getDisplayTileOffset();
-- Block var28 = var1.getDisplayTile();
-- int var29 = var1.getDisplayTileData();
-- if(var28 != null) {
-+ int var33 = par1EntityMinecart.getDisplayTileOffset();
-+ Block var28 = par1EntityMinecart.getDisplayTile();
-+ int var29 = par1EntityMinecart.getDisplayTileData();
-+
-+ if (var28 != null) {
- GL11.glPushMatrix();
- this.bindTexture(TextureMap.locationBlocksTexture);
-- float var30 = 12.0F / 16.0F;
-+ float var30 = 0.75F;
- GL11.glScalef(var30, var30, var30);
- GL11.glTranslatef(0.0F, (float)var33 / 16.0F, 0.0F);
-- this.renderBlockInMinecart(var1, var9, var28, var29);
-+ this.renderBlockInMinecart(par1EntityMinecart, par9, var28, var29);
- GL11.glPopMatrix();
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
-- this.bindEntityTexture(var1);
-+ this.bindEntityTexture(par1EntityMinecart);
- }
-
- GL11.glScalef(-1.0F, -1.0F, 1.0F);
-- this.modelMinecart.render(var1, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 1.0F / 16.0F);
-+ this.modelMinecart.render(par1EntityMinecart, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);
- GL11.glPopMatrix();
- }
-
-- protected ResourceLocation getMinecartTextures(EntityMinecart var1) {
-+ protected ResourceLocation getMinecartTextures(EntityMinecart par1EntityMinecart) {
- return minecartTextures;
- }
-
-- protected void renderBlockInMinecart(EntityMinecart var1, float var2, Block var3, int var4) {
-- float var5 = var1.getBrightness(var2);
-+ /**
-+ * Renders the block that is inside the minecart.
-+ */
-+ protected void renderBlockInMinecart(EntityMinecart par1EntityMinecart, float par2, Block par3Block, int par4) {
-+ float var5 = par1EntityMinecart.getBrightness(par2);
- GL11.glPushMatrix();
-- this.field_94145_f.renderBlockAsItem(var3, var4, var5);
-+ this.field_94145_f.renderBlockAsItem(par3Block, par4, var5);
- GL11.glPopMatrix();
- }
-
-- protected ResourceLocation getEntityTexture(Entity var1) {
-- return this.getMinecartTextures((EntityMinecart)var1);
-+ /**
-+ * 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.getMinecartTextures((EntityMinecart)par1Entity);
- }
-
-- public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) {
-- this.renderTheMinecart((EntityMinecart)var1, var2, var4, var6, var8, var9);
-+ /**
-+ * 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
-+ * Spoutcraft is licensed under the GNU Lesser General Public License.
-+ *
-+ * Spoutcraft is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation, either version 3 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Spoutcraft is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program. If not, see .
-+ */
-+package org.spoutcraft.api.material.block;
-+
-+import org.spoutcraft.api.material.Block;
-+
-+public class Air extends GenericBlock implements Block {
-+ public Air(String name) {
-+ super(name, 0);
-+ }
-+
-+ @Override
-+ public float getFriction() {
-+ return 0;
-+ }
-+
-+ @Override
-+ public Block setFriction(float slip) {
-+ return this;
-+ }
-+
-+ @Override
-+ public float getHardness() {
-+ return 0;
-+ }
-+
-+ @Override
-+ public Block setHardness(float hardness) {
-+ return this;
-+ }
-+
-+ @Override
-+ public boolean isOpaque() {
-+ return false;
-+ }
-+
-+ @Override
-+ public Block setOpaque(boolean opaque) {
-+ return this;
-+ }
-+
-+ @Override
-+ public int getLightLevel() {
-+ return 0;
-+ }
-+
-+ @Override
-+ public Block setLightLevel(int level) {
-+ return this;
-+ }
-+}
---- net/minecraft/src/ModelChest.java
-+++ net/minecraft/src/ModelChest.java
-@@ -1,8 +1,14 @@
- 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() {
-@@ -22,10 +28,13 @@
- 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(1.0F / 16.0F);
-- this.chestKnob.render(1.0F / 16.0F);
-- this.chestBelow.render(1.0F / 16.0F);
-+ this.chestLid.render(0.0625F);
-+ this.chestKnob.render(0.0625F);
-+ this.chestBelow.render(0.0625F);
- }
- }
---- net/minecraft/src/RecipesArmorDyes.java
-+++ net/minecraft/src/RecipesArmorDyes.java
-@@ -2,23 +2,31 @@
-
- import java.util.ArrayList;
-
-+import com.prupe.mcpatcher.cc.ColorizeEntity;
-+
- public class RecipesArmorDyes implements IRecipe {
-- public boolean matches(InventoryCrafting var1, World var2) {
-+
-+ /**
-+ * Used to check if a recipe matches current crafting inventory
-+ */
-+ public boolean matches(InventoryCrafting par1InventoryCrafting, World par2World) {
- ItemStack var3 = null;
- ArrayList var4 = new ArrayList();
-
-- for(int var5 = 0; var5 < var1.getSizeInventory(); ++var5) {
-- ItemStack var6 = var1.getStackInSlot(var5);
-- if(var6 != null) {
-- if(var6.getItem() instanceof ItemArmor) {
-+ for (int var5 = 0; var5 < par1InventoryCrafting.getSizeInventory(); ++var5) {
-+ ItemStack var6 = par1InventoryCrafting.getStackInSlot(var5);
-+
-+ if (var6 != null) {
-+ if (var6.getItem() instanceof ItemArmor) {
- ItemArmor var7 = (ItemArmor)var6.getItem();
-- if(var7.getArmorMaterial() != EnumArmorMaterial.CLOTH || var3 != null) {
-+
-+ if (var7.getArmorMaterial() != EnumArmorMaterial.CLOTH || var3 != null) {
- return false;
- }
-
- var3 = var6;
- } else {
-- if(var6.itemID != Item.dyePowder.itemID) {
-+ if (var6.itemID != Item.dyePowder.itemID) {
- return false;
- }
-
-@@ -30,30 +38,36 @@
- return var3 != null && !var4.isEmpty();
- }
-
-- public ItemStack getCraftingResult(InventoryCrafting var1) {
-+ /**
-+ * Returns an Item that is the result of this recipe
-+ */
-+ public ItemStack getCraftingResult(InventoryCrafting par1InventoryCrafting) {
- ItemStack var2 = null;
- int[] var3 = new int[3];
- int var4 = 0;
- int var5 = 0;
- ItemArmor var6 = null;
--
- int var7;
- int var9;
- float var10;
- float var11;
- int var17;
-- for(var7 = 0; var7 < var1.getSizeInventory(); ++var7) {
-- ItemStack var8 = var1.getStackInSlot(var7);
-- if(var8 != null) {
-- if(var8.getItem() instanceof ItemArmor) {
-+
-+ for (var7 = 0; var7 < par1InventoryCrafting.getSizeInventory(); ++var7) {
-+ ItemStack var8 = par1InventoryCrafting.getStackInSlot(var7);
-+
-+ if (var8 != null) {
-+ if (var8.getItem() instanceof ItemArmor) {
- var6 = (ItemArmor)var8.getItem();
-- if(var6.getArmorMaterial() != EnumArmorMaterial.CLOTH || var2 != null) {
-+
-+ if (var6.getArmorMaterial() != EnumArmorMaterial.CLOTH || var2 != null) {
- return null;
- }
-
- var2 = var8.copy();
- var2.stackSize = 1;
-- if(var6.hasColor(var8)) {
-+
-+ if (var6.hasColor(var8)) {
- var9 = var6.getColor(var2);
- var10 = (float)(var9 >> 16 & 255) / 255.0F;
- var11 = (float)(var9 >> 8 & 255) / 255.0F;
-@@ -65,24 +79,26 @@
- ++var5;
- }
- } else {
-- if(var8.itemID != Item.dyePowder.itemID) {
-+ if (var8.itemID != Item.dyePowder.itemID) {
- return null;
- }
-
-- float[] var14 = EntitySheep.fleeceColorTable[BlockColored.getBlockFromDye(var8.getItemDamage())];
-- int var15 = (int)(var14[0] * 255.0F);
-- int var16 = (int)(var14[1] * 255.0F);
-+ // MCPatcher Start
-+ float[] var14 = ColorizeEntity.armorColors[BlockColored.getBlockFromDye(var8.getItemDamage())];
-+ // MCPatcher End
-+ int var16 = (int)(var14[0] * 255.0F);
-+ int var15 = (int)(var14[1] * 255.0F);
- var17 = (int)(var14[2] * 255.0F);
-- var4 += Math.max(var15, Math.max(var16, var17));
-- var3[0] += var15;
-- var3[1] += var16;
-+ var4 += Math.max(var16, Math.max(var15, var17));
-+ var3[0] += var16;
-+ var3[1] += var15;
- var3[2] += var17;
- ++var5;
- }
- }
- }
-
-- if(var6 == null) {
-+ if (var6 == null) {
- return null;
- } else {
- var7 = var3[0] / var5;
-@@ -100,6 +116,9 @@
- }
- }
-
-+ /**
-+ * Returns the size of the recipe area
-+ */
- public int getRecipeSize() {
- return 10;
- }
---- net/minecraft/src/EntityDragonPart.java
-+++ net/minecraft/src/EntityDragonPart.java
-@@ -1,34 +1,50 @@
- package net.minecraft.src;
-
- public class EntityDragonPart extends Entity {
-+
-+ /** The dragon entity this dragon part belongs to */
- public final IEntityMultiPart entityDragonObj;
-- public final String b;
--
-- public EntityDragonPart(IEntityMultiPart var1, String var2, float var3, float var4) {
-- super(var1.func_82194_d());
-- this.setSize(var3, var4);
-- this.entityDragonObj = var1;
-- this.b = var2;
-- }
--
-- protected void entityInit() {
-- }
--
-- protected void readEntityFromNBT(NBTTagCompound var1) {
-- }
--
-- protected void writeEntityToNBT(NBTTagCompound var1) {
-- }
--
-+
-+ /** The name of the Dragon Part */
-+ public final String name;
-+
-+ public EntityDragonPart(IEntityMultiPart par1IEntityMultiPart, String par2Str, float par3, float par4) {
-+ super(par1IEntityMultiPart.func_82194_d());
-+ this.setSize(par3, par4);
-+ this.entityDragonObj = par1IEntityMultiPart;
-+ this.name = par2Str;
-+ }
-+
-+ protected void entityInit() {}
-+
-+ /**
-+ * (abstract) Protected helper method to read subclass entity data from NBT.
-+ */
-+ protected void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) {}
-+
-+ /**
-+ * (abstract) Protected helper method to write subclass entity data to NBT.
-+ */
-+ protected void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) {}
-+
-+ /**
-+ * Returns true if other Entities should be prevented from moving through this Entity.
-+ */
- public boolean canBeCollidedWith() {
- return true;
- }
-
-- public boolean attackEntityFrom(DamageSource var1, float var2) {
-- return this.isEntityInvulnerable() ? false : this.entityDragonObj.attackEntityFromPart(this, var1, var2);
-+ /**
-+ * Called when the entity is attacked.
-+ */
-+ public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) {
-+ return this.isEntityInvulnerable() ? false : this.entityDragonObj.attackEntityFromPart(this, par1DamageSource, par2);
- }
-
-- public boolean isEntityEqual(Entity var1) {
-- return this == var1 || this.entityDragonObj == var1;
-+ /**
-+ * Returns true if Entity argument is equal to this Entity
-+ */
-+ public boolean isEntityEqual(Entity par1Entity) {
-+ return this == par1Entity || this.entityDragonObj == par1Entity;
- }
- }
---- net/minecraft/src/GuiBeaconButtonConfirm.java
-+++ net/minecraft/src/GuiBeaconButtonConfirm.java
-@@ -1,14 +1,16 @@
- package net.minecraft.src;
-
- class GuiBeaconButtonConfirm extends GuiBeaconButton {
-+
-+ /** Beacon GUI this button belongs to. */
- final GuiBeacon beaconGui;
-
-- public GuiBeaconButtonConfirm(GuiBeacon var1, int var2, int var3, int var4) {
-- super(var2, var3, var4, GuiBeacon.getBeaconGuiTextures(), 90, 220);
-- this.beaconGui = var1;
-+ 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 var1, int var2) {
-- this.beaconGui.drawCreativeTabHoveringText(I18n.getString("gui.done"), var1, var2);
-+ public void func_82251_b(int par1, int par2) {
-+ this.beaconGui.drawCreativeTabHoveringText(I18n.getString("gui.done"), par1, par2);
- }
- }
---- net/minecraft/src/Team.java
-+++ net/minecraft/src/Team.java
-@@ -1,8 +1,12 @@
- package net.minecraft.src;
-
- public abstract class Team {
-- public boolean isSameTeam(Team var1) {
-- return var1 == null ? false : this == var1;
-+
-+ /**
-+ * Same as ==
-+ */
-+ public boolean isSameTeam(Team par1Team) {
-+ return par1Team == null ? false : this == par1Team;
- }
-
- public abstract String func_96661_b();
---- /dev/null
-+++ org/spoutcraft/api/inventory/ShapedRecipe.java
-@@ -1,0 +1,121 @@
-+/*
-+ * This file is part of Spoutcraft.
-+ *
-+ * Copyright (c) 2011 SpoutcraftDev
-+ * Spoutcraft is licensed under the GNU Lesser General Public License.
-+ *
-+ * Spoutcraft is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation, either version 3 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Spoutcraft is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program. If not, see .
-+ */
-+package org.spoutcraft.api.inventory;
-+
-+import java.util.HashMap;
-+
-+import org.spoutcraft.api.material.Material;
-+
-+public class ShapedRecipe implements Recipe {
-+ private ItemStack output;
-+ private String[] rows;
-+ private HashMap ingredients = new HashMap();
-+
-+ /**
-+ * Create a shaped recipe to craft the specified ItemStack. The constructor merely determines the
-+ * result and type; to set the actual recipe, you'll need to call the appropriate methods.
-+ * @param result The item you want the recipe to create.
-+ * @see ShapedRecipe#shape(String...)
-+ * @see ShapedRecipe#setIngredient(char, Material)
-+ * @see ShapedRecipe#setIngredient(char, Material, int)
-+ * @see ShapedRecipe#setIngredient(char, MaterialData)
-+ */
-+ public ShapedRecipe(ItemStack result) {
-+ this.output = result;
-+ }
-+
-+ /**
-+ * Set the shape of this recipe to the specified rows. Each character represents a different
-+ * ingredient; exactly what each character represents is set separately.
-+ * @param shape The rows of the recipe (up to 3 rows).
-+ * @return The changed recipe, so you can chain calls.
-+ */
-+ public ShapedRecipe shape(String... shape) {
-+ if (shape == null || shape.length > 3 || shape.length < 1) {
-+ throw new IllegalArgumentException("Crafting recipes should be 1, 2, or 3 rows.");
-+ }
-+ for (String row : shape) {
-+ if (row == null || row.length() > 3 || row.length() < 1) {
-+ throw new IllegalArgumentException("Crafting rows should be 1, 2, or 3 characters.");
-+ }
-+ }
-+ this.rows = shape;
-+
-+ // Remove character mappings for characters that no longer exist in the shape
-+ HashMap ingredientsTemp = this.ingredients;
-+
-+ this.ingredients = new HashMap();
-+ for (char key : ingredientsTemp.keySet()) {
-+ try {
-+ setIngredient(key, ingredientsTemp.get(key));
-+ } catch (IllegalArgumentException e) {}
-+ }
-+ return this;
-+ }
-+
-+ /**
-+ * Sets the material that a character in the recipe shape refers to.
-+ * @param key The character that represents the ingredient in the shape.
-+ * @param ingredient The ingredient.
-+ * @return The changed recipe, so you can chain calls.
-+ */
-+ public ShapedRecipe setIngredient(char key, Material ingredient) {
-+ if (!hasKey(key)) {
-+ throw new IllegalArgumentException("Symbol " + key + " does not appear in the shape.");
-+ }
-+ ingredients.put(key, ingredient);
-+ return this;
-+ }
-+
-+ private boolean hasKey(char c) {
-+ String key = Character.toString(c);
-+
-+ for (String row : rows) {
-+ if (row.contains(key)) {
-+ return true;
-+ }
-+ }
-+ return false;
-+ }
-+
-+ /**
-+ * Get the ingredients map.
-+ * @return The mapping of character to ingredients.
-+ */
-+ public HashMap getIngredientMap() {
-+ return ingredients;
-+ }
-+
-+ /**
-+ * Get the shape.
-+ * @return The recipe's shape.
-+ */
-+ public String[] getShape() {
-+ return rows;
-+ }
-+
-+ /**
-+ * Get the result.
-+ * @return The result stack.
-+ */
-+ public ItemStack getResult() {
-+ return output;
-+ }
-+}
---- net/minecraft/src/RequestPost.java
-+++ net/minecraft/src/RequestPost.java
-@@ -5,23 +5,23 @@
- public class RequestPost extends Request {
- private byte[] field_96373_c;
-
-- public RequestPost(String var1, byte[] var2, int var3, int var4) {
-- super(var1, var3, var4);
-- this.field_96373_c = var2;
-+ public RequestPost(String par1Str, byte[] par2ArrayOfByte, int par3, int par4) {
-+ super(par1Str, par3, par4);
-+ this.field_96373_c = par2ArrayOfByte;
- }
-
- public RequestPost func_96372_f() {
- try {
-- this.a.setDoInput(true);
-- this.a.setDoOutput(true);
-- this.a.setUseCaches(false);
-- this.a.setRequestMethod("POST");
-- OutputStream var1 = this.a.getOutputStream();
-+ this.field_96367_a.setDoInput(true);
-+ this.field_96367_a.setDoOutput(true);
-+ this.field_96367_a.setUseCaches(false);
-+ this.field_96367_a.setRequestMethod("POST");
-+ OutputStream var1 = this.field_96367_a.getOutputStream();
- var1.write(this.field_96373_c);
- var1.flush();
- return this;
- } catch (Exception var2) {
-- throw new ExceptionMcoHttp("Failed URL: " + this.b, var2);
-+ throw new ExceptionMcoHttp("Failed URL: " + this.field_96365_b, var2);
- }
- }
-
---- net/minecraft/src/GuiDownloadTerrain.java
-+++ net/minecraft/src/GuiDownloadTerrain.java
-@@ -1,35 +1,50 @@
- 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 var1) {
-- this.netHandler = var1;
-- }
--
-- protected void keyTyped(char var1, int var2) {
-- }
--
-+ 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.i.clear();
-+ this.buttonList.clear();
- }
-
-+ /**
-+ * Called from the main game loop to update the screen.
-+ */
- public void updateScreen() {
- ++this.updateCounter;
-- if(this.updateCounter % 20 == 0) {
-+
-+ if (this.updateCounter % 20 == 0) {
- this.netHandler.addToSendQueue(new Packet0KeepAlive());
- }
-
-- if(this.netHandler != null) {
-+ if (this.netHandler != null) {
- this.netHandler.processReadPackets();
- }
--
- }
-
-- public void drawScreen(int var1, int var2, float var3) {
-+ /**
-+ * 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(var1, var2, var3);
-+ super.drawScreen(par1, par2, par3);
- }
- }
---- /dev/null
-+++ org/spoutcraft/client/packet/PacketMusicChange.java
-@@ -1,0 +1,75 @@
-+/*
-+ * This file is part of Spoutcraft.
-+ *
-+ * Copyright (c) 2011 SpoutcraftDev
-+ * Spoutcraft is licensed under the GNU Lesser General Public License.
-+ *
-+ * Spoutcraft is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation, either version 3 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Spoutcraft is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program. If not, see .
-+ */
-+package org.spoutcraft.client.packet;
-+
-+import java.io.IOException;
-+
-+import org.spoutcraft.api.io.SpoutInputStream;
-+import org.spoutcraft.api.io.SpoutOutputStream;
-+import org.spoutcraft.client.SpoutClient;
-+
-+public class PacketMusicChange implements SpoutPacket {
-+ protected int id;
-+ protected int volumePercent;
-+ boolean cancel = false;
-+
-+ public PacketMusicChange() {
-+ }
-+
-+ public PacketMusicChange(int music, int volumePercent) {
-+ this.id = music;
-+ this.volumePercent = volumePercent;
-+ }
-+
-+ public boolean isCancelled() {
-+ return cancel;
-+ }
-+
-+ public void readData(SpoutInputStream input) throws IOException {
-+ id = input.readInt();
-+ volumePercent = input.readInt();
-+ cancel = input.readBoolean();
-+ }
-+
-+ public void writeData(SpoutOutputStream output) throws IOException {
-+ output.writeInt(id);
-+ output.writeInt(volumePercent);
-+ output.writeBoolean(cancel);
-+ }
-+
-+ public void run(int playerId) {
-+ if (cancel) {
-+ SpoutClient.getHandle().sndManager.cancelled = true;
-+ } else {
-+ SpoutClient.getHandle().sndManager.allowed = true;
-+ }
-+ }
-+
-+ public PacketType getPacketType() {
-+ return PacketType.PacketMusicChange;
-+ }
-+
-+ public int getVersion() {
-+ return 0;
-+ }
-+
-+ public void failure(int playerId) {
-+ }
-+}
---- net/minecraft/src/BaseMetadataSectionSerializer.java
-+++ net/minecraft/src/BaseMetadataSectionSerializer.java
-@@ -4,92 +4,99 @@
- import com.google.gson.JsonParseException;
-
- public abstract class BaseMetadataSectionSerializer implements MetadataSectionSerializer {
-- protected float func_110487_a(JsonElement var1, String var2, Float var3, float var4, float var5) {
-- var2 = this.getSectionName() + "->" + var2;
-- if(var1 == null) {
-- if(var3 == null) {
-- throw new JsonParseException("Missing " + var2 + ": expected float");
-- } else {
-- return var3.floatValue();
-- }
-- } else if(!var1.isJsonPrimitive()) {
-- throw new JsonParseException("Invalid " + var2 + ": expected float, was " + var1);
-- } else {
-- try {
-- float var6 = var1.getAsFloat();
-- if(var6 < var4) {
-- throw new JsonParseException("Invalid " + var2 + ": expected float >= " + var4 + ", was " + var6);
-- } else if(var6 > var5) {
-- throw new JsonParseException("Invalid " + var2 + ": expected float <= " + var5 + ", was " + var6);
-- } else {
-- return var6;
-- }
-- } catch (NumberFormatException var7) {
-- throw new JsonParseException("Invalid " + var2 + ": expected float, was " + var1, var7);
-- }
-- }
-- }
--
-- protected int func_110485_a(JsonElement var1, String var2, Integer var3, int var4, int var5) {
-- var2 = this.getSectionName() + "->" + var2;
-- if(var1 == null) {
-- if(var3 == null) {
-- throw new JsonParseException("Missing " + var2 + ": expected int");
-- } else {
-- return var3.intValue();
-- }
-- } else if(!var1.isJsonPrimitive()) {
-- throw new JsonParseException("Invalid " + var2 + ": expected int, was " + var1);
-- } else {
-- try {
-- int var6 = var1.getAsInt();
-- if(var6 < var4) {
-- throw new JsonParseException("Invalid " + var2 + ": expected int >= " + var4 + ", was " + var6);
-- } else if(var6 > var5) {
-- throw new JsonParseException("Invalid " + var2 + ": expected int <= " + var5 + ", was " + var6);
-- } else {
-- return var6;
-- }
-- } catch (NumberFormatException var7) {
-- throw new JsonParseException("Invalid " + var2 + ": expected int, was " + var1, var7);
-- }
-- }
-- }
--
-- protected String func_110486_a(JsonElement var1, String var2, String var3, int var4, int var5) {
-- var2 = this.getSectionName() + "->" + var2;
-- if(var1 == null) {
-- if(var3 == null) {
-- throw new JsonParseException("Missing " + var2 + ": expected string");
-- } else {
-- return var3;
-- }
-- } else if(!var1.isJsonPrimitive()) {
-- throw new JsonParseException("Invalid " + var2 + ": expected string, was " + var1);
-- } else {
-- String var6 = var1.getAsString();
-- if(var6.length() < var4) {
-- throw new JsonParseException("Invalid " + var2 + ": expected string length >= " + var4 + ", was " + var6);
-- } else if(var6.length() > var5) {
-- throw new JsonParseException("Invalid " + var2 + ": expected string length <= " + var5 + ", was " + var6);
-+ 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 var1, String var2, Boolean var3) {
-- var2 = this.getSectionName() + "->" + var2;
-- if(var1 == null) {
-- if(var3 == null) {
-- throw new JsonParseException("Missing " + var2 + ": expected boolean");
-+ 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 var3.booleanValue();
-+ return par3.booleanValue();
- }
-- } else if(!var1.isJsonPrimitive()) {
-- throw new JsonParseException("Invalid " + var2 + ": expected boolean, was " + var1);
-+ } else if (!par1JsonElement.isJsonPrimitive()) {
-+ throw new JsonParseException("Invalid " + par2Str + ": expected boolean, was " + par1JsonElement);
- } else {
-- boolean var4 = var1.getAsBoolean();
-+ boolean var4 = par1JsonElement.getAsBoolean();
- return var4;
- }
- }
---- /dev/null
-+++ com/prupe/mcpatcher/Config.java
-@@ -1,0 +1,264 @@
-+package com.prupe.mcpatcher;
-+
-+import com.google.gson.JsonElement;
-+import com.google.gson.JsonObject;
-+import com.prupe.mcpatcher.Config$ModEntry;
-+import com.prupe.mcpatcher.Config$ProfileEntry;
-+import com.prupe.mcpatcher.Config$VersionEntry;
-+import java.io.File;
-+import java.util.Collection;
-+import java.util.HashMap;
-+import java.util.Iterator;
-+import java.util.LinkedHashMap;
-+import java.util.Map;
-+import java.util.Map.Entry;
-+import java.util.logging.Level;
-+
-+public class Config {
-+ private static Config instance = new Config();
-+ private static File jsonFile;
-+ private static boolean readOnly;
-+ public static final String MCPATCHER_PROPERTIES = "mcpatcher.properties";
-+ public static final String MCPATCHER_JSON = "mcpatcher.json";
-+ public static final String LAUNCHER_JSON = "launcher_profiles.json";
-+ public static final String VERSIONS_JSON = "versions.json";
-+ static final String TAG_MINECRAFT_VERSION = "minecraftVersion";
-+ static final String TAG_PATCHER_VERSION = "patcherVersion";
-+ static final String TAG_PRE_PATCH_STATE = "prePatchState";
-+ static final String TAG_MODIFIED_CLASSES = "modifiedClasses";
-+ static final String TAG_ADDED_CLASSES = "addedClasses";
-+ static final String VAL_BUILTIN = "builtIn";
-+ static final String VAL_EXTERNAL_ZIP = "externalZip";
-+ static final String VAL_EXTERNAL_JAR = "externalJar";
-+ private static final String TAG_SELECTED_PROFILE = "selectedProfile";
-+ public static final String MCPATCHER_PROFILE_NAME = "MCPatcher";
-+ private static final int VAL_FORMAT_CURRENT = 1;
-+ private static final int VAL_FORMAT_MIN = 1;
-+ private static final int VAL_FORMAT_MAX = 1;
-+ transient String selectedProfile = "MCPatcher";
-+ int format = 1;
-+ String patcherVersion;
-+ boolean betaWarningShown;
-+ boolean selectPatchedProfile = true;
-+ boolean fetchRemoteVersionList = true;
-+ boolean extraProfiling;
-+ String lastModDirectory;
-+ LinkedHashMap logging = new LinkedHashMap();
-+ LinkedHashMap profiles = new LinkedHashMap();
-+
-+ static boolean load(File minecraftDir, boolean isGame) {
-+ jsonFile = new File(minecraftDir, "mcpatcher.json");
-+ instance = (Config)JsonUtils.parseJson(jsonFile, Config.class);
-+
-+ if (instance != null && instance.format > 0) {
-+ if (instance.format < 1) {
-+ instance.format = 1;
-+ save();
-+ } else if (instance.format > 1) {
-+ setReadOnly(true);
-+ }
-+ } else {
-+ instance = new Config();
-+
-+ if (isGame) {
-+ // Spout Removed
-+ //System.out.printf("WARNING: configuration file %s not found, using defaults\n", new Object[] {jsonFile});
-+ }
-+
-+ save();
-+ }
-+ // Spout Nullified because we don't use profiles.
-+ //String profile = getSelectedLauncherProfile(minecraftDir);
-+ String profile = null;
-+
-+ if (MCPatcherUtils.isNullOrEmpty(profile)) {
-+ if (isGame) {
-+ // Spout Removed
-+ //System.out.printf("WARNING: could not determine selected profile, defaulting to %s\n", new Object[] {"MCPatcher"});
-+ }
-+
-+ profile = "MCPatcher";
-+ } else if (!instance.profiles.containsKey(profile) && isGame) {
-+ // Spout Removed
-+ //System.out.printf("WARNING: selected profile \'%s\' not found, using defaults\n", new Object[] {profile});
-+ }
-+
-+ instance.selectedProfile = profile;
-+ return true;
-+ }
-+
-+ static boolean save() {
-+ boolean success = false;
-+
-+ if (jsonFile != null && !readOnly) {
-+ JsonUtils.writeJson((Object)instance, jsonFile);
-+ }
-+
-+ return success;
-+ }
-+
-+ private static String getSelectedLauncherProfile(File minecraftDir) {
-+ File path = new File(minecraftDir, "launcher_profiles.json");
-+ JsonObject json = JsonUtils.parseJson(path);
-+
-+ if (json != null) {
-+ JsonElement element = json.get("selectedProfile");
-+
-+ if (element != null && element.isJsonPrimitive()) {
-+ return element.getAsString();
-+ }
-+ }
-+
-+ return null;
-+ }
-+
-+ public static Config getInstance() {
-+ return instance;
-+ }
-+
-+ public static void setReadOnly(boolean readOnly) {
-+ readOnly = readOnly;
-+ }
-+
-+ static Level getLogLevel(String category) {
-+ Level level = Level.INFO;
-+ String value = (String)instance.logging.get(category);
-+
-+ if (value != null) {
-+ try {
-+ level = Level.parse(value.trim().toUpperCase());
-+ } catch (Throwable var4) {
-+ ;
-+ }
-+ }
-+
-+ setLogLevel(category, level);
-+ return level;
-+ }
-+
-+ static void setLogLevel(String category, Level level) {
-+ instance.logging.put(category, level.toString().toUpperCase());
-+ }
-+
-+ public static String getString(String mod, String tag, Object defaultValue) {
-+ LinkedHashMap modConfig = instance.getModConfig(mod);
-+ String value = (String)modConfig.get(tag);
-+
-+ if (value == null) {
-+ modConfig.put(tag, defaultValue.toString());
-+ return defaultValue.toString();
-+ } else {
-+ return value;
-+ }
-+ }
-+
-+ public static int getInt(String mod, String tag, int defaultValue) {
-+ int value;
-+
-+ try {
-+ value = Integer.parseInt(getString(mod, tag, Integer.valueOf(defaultValue)));
-+ } catch (NumberFormatException var5) {
-+ value = defaultValue;
-+ }
-+
-+ return value;
-+ }
-+
-+ public static boolean getBoolean(String mod, String tag, boolean defaultValue) {
-+ String value = getString(mod, tag, Boolean.valueOf(defaultValue)).toLowerCase();
-+ return value.equals("false") ? false : (value.equals("true") ? true : defaultValue);
-+ }
-+
-+ public static void set(String mod, String tag, Object value) {
-+ if (value == null) {
-+ remove(mod, tag);
-+ } else {
-+ instance.getModConfig(mod).put(tag, value.toString());
-+ }
-+ }
-+
-+ public static void remove(String mod, String tag) {
-+ instance.getModConfig(mod).remove(tag);
-+ }
-+
-+ String getSelectedProfileName() {
-+ if (MCPatcherUtils.isNullOrEmpty(this.selectedProfile)) {
-+ this.selectedProfile = "MCPatcher";
-+ }
-+
-+ return this.selectedProfile;
-+ }
-+
-+ Config$ProfileEntry getSelectedProfile() {
-+ Config$ProfileEntry profile = (Config$ProfileEntry)this.profiles.get(this.getSelectedProfileName());
-+
-+ if (profile == null) {
-+ profile = new Config$ProfileEntry();
-+ this.profiles.put(this.selectedProfile, profile);
-+ }
-+
-+ return profile;
-+ }
-+
-+ Config$VersionEntry getSelectedVersion() {
-+ Config$ProfileEntry profile = this.getSelectedProfile();
-+ Config$VersionEntry version = (Config$VersionEntry)profile.versions.get(profile.version);
-+
-+ if (version == null) {
-+ version = new Config$VersionEntry();
-+ profile.versions.put(profile.version, version);
-+ }
-+
-+ return version;
-+ }
-+
-+ Config$ModEntry getModEntry(String mod) {
-+ return (Config$ModEntry)this.getSelectedVersion().mods.get(mod);
-+ }
-+
-+ Collection getModEntries() {
-+ return this.getSelectedVersion().mods.values();
-+ }
-+
-+ private LinkedHashMap getModConfig(String mod) {
-+ return Config$ProfileEntry.access$000(this.getSelectedProfile(), mod);
-+ }
-+
-+ void removeMod(String mod) {
-+ this.getSelectedProfile().config.remove(mod);
-+ this.getSelectedVersion().mods.remove(mod);
-+ }
-+
-+ void removeProfile(String name) {
-+ if (!name.equals(this.selectedProfile)) {
-+ this.profiles.remove(name);
-+ }
-+ }
-+
-+ void removeVersion(String name) {
-+ if (!name.equals(this.getSelectedProfile().version)) {
-+ this.getSelectedProfile().versions.remove(name);
-+ }
-+ }
-+
-+ Map getPatchedVersionMap() {
-+ HashMap map = new HashMap();
-+ Iterator i$ = this.profiles.values().iterator();
-+
-+ while (i$.hasNext()) {
-+ Config$ProfileEntry profile = (Config$ProfileEntry)i$.next();
-+ profile.versions.remove((Object)null);
-+ profile.versions.remove("");
-+ Iterator i$1 = profile.versions.entrySet().iterator();
-+
-+ while (i$1.hasNext()) {
-+ Entry entry = (Entry)i$1.next();
-+ String patchedVersion = (String)entry.getKey();
-+ String unpatchedVersion = ((Config$VersionEntry)entry.getValue()).original;
-+ map.put(patchedVersion, unpatchedVersion);
-+ }
-+ }
-+
-+ return map;
-+ }
-+}
---- /dev/null
-+++ org/spoutcraft/client/packet/PacketEntityInformation.java
-@@ -1,0 +1,155 @@
-+/*
-+ * This file is part of Spoutcraft.
-+ *
-+ * Copyright (c) 2011 SpoutcraftDev
-+ * Spoutcraft is licensed under the GNU Lesser General Public License.
-+ *
-+ * Spoutcraft is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation, either version 3 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Spoutcraft is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program. If not, see .
-+ */
-+package org.spoutcraft.client.packet;
-+
-+import java.io.IOException;
-+import java.nio.ByteBuffer;
-+import java.util.List;
-+import java.util.UUID;
-+import java.util.zip.DataFormatException;
-+import java.util.zip.Deflater;
-+import java.util.zip.Inflater;
-+
-+import org.apache.commons.io.output.ByteArrayOutputStream;
-+
-+import net.minecraft.src.Minecraft;
-+import net.minecraft.src.WorldClient;
-+
-+import org.spoutcraft.api.io.SpoutInputStream;
-+import org.spoutcraft.api.io.SpoutOutputStream;
-+import org.spoutcraft.client.SpoutClient;
-+import org.spoutcraft.client.entity.CraftEntity;
-+
-+public class PacketEntityInformation implements CompressablePacket {
-+ private boolean compressed = false;
-+ private byte[] data = null;
-+
-+ public PacketEntityInformation() {
-+ }
-+
-+ public PacketEntityInformation(List entities) {
-+ ByteBuffer tempbuffer = ByteBuffer.allocate(entities.size() * 4);
-+ for (CraftEntity e : entities) {
-+ tempbuffer.putInt(e.getEntityId());
-+ }
-+ data = tempbuffer.array();
-+ }
-+
-+ public void readData(SpoutInputStream input) throws IOException {
-+ int size = input.readInt();
-+ if (size > 0) {
-+ data = new byte[size];
-+ input.read(data);
-+ }
-+ compressed = input.readBoolean();
-+ }
-+
-+ public void writeData(SpoutOutputStream output) throws IOException {
-+ if (data != null) {
-+ output.writeInt(data.length);
-+ output.write(data);
-+ } else {
-+ output.writeInt(0);
-+ }
-+ output.writeBoolean(compressed);
-+ }
-+
-+ public void run(int playerId) {
-+ if (Minecraft.getMinecraft().theWorld instanceof WorldClient) {
-+ ByteBuffer rawData = ByteBuffer.allocate(data.length);
-+ rawData.put(data);
-+ for (int i = 0; i < data.length / 20; i++) {
-+ int index = i * 20;
-+ long lsb = rawData.getLong(index);
-+ long msb = rawData.getLong(index + 8);
-+ int id = rawData.getInt(index + 16);
-+
-+ net.minecraft.src.Entity e = SpoutClient.getInstance().getEntityFromId(id);
-+ if (e != null) {
-+ e.uniqueId = new UUID(msb, lsb);
-+ }
-+ }
-+ }
-+ }
-+
-+ public void failure(int playerId) {
-+ }
-+
-+ public PacketType getPacketType() {
-+ return PacketType.PacketEntityInformation;
-+ }
-+
-+ public int getVersion() {
-+ return 0;
-+ }
-+
-+ public void compress() {
-+ if (!compressed) {
-+ if (data != null) {
-+ Deflater deflater = new Deflater();
-+ deflater.setInput(data);
-+ deflater.setLevel(Deflater.BEST_COMPRESSION);
-+ deflater.finish();
-+ ByteArrayOutputStream bos = new ByteArrayOutputStream(data.length);
-+ byte[] buffer = new byte[1024];
-+ while (!deflater.finished())
-+ {
-+ int bytesCompressed = deflater.deflate(buffer);
-+ bos.write(buffer, 0, bytesCompressed);
-+ }
-+ try {
-+ bos.close();
-+ } catch (IOException e) {
-+ e.printStackTrace();
-+ }
-+ data = bos.toByteArray();
-+ }
-+ compressed = true;
-+ }
-+ }
-+
-+ public void decompress() {
-+ if (compressed) {
-+ Inflater decompressor = new Inflater();
-+ decompressor.setInput(data);
-+
-+ ByteArrayOutputStream bos = new ByteArrayOutputStream(data.length);
-+
-+ byte[] buf = new byte[1024];
-+ while (!decompressor.finished()) {
-+ try {
-+ int count = decompressor.inflate(buf);
-+ bos.write(buf, 0, count);
-+ } catch (DataFormatException e) {
-+ }
-+ }
-+ try {
-+ bos.close();
-+ } catch (IOException e) {
-+ }
-+
-+ data = bos.toByteArray();
-+ }
-+ }
-+
-+ public boolean isCompressed() {
-+ return compressed;
-+ }
-+}
---- net/minecraft/src/BaseAttribute.java
-+++ net/minecraft/src/BaseAttribute.java
-@@ -1,20 +1,21 @@
- package net.minecraft.src;
-
- public abstract class BaseAttribute implements Attribute {
-- private final String a;
-+ private final String field_111115_a;
- private final double defaultValue;
- private boolean shouldWatch;
-
-- protected BaseAttribute(String var1, double var2) {
-- this.a = var1;
-- this.defaultValue = var2;
-- if(var1 == null) {
-+ protected BaseAttribute(String par1Str, double par2) {
-+ this.field_111115_a = par1Str;
-+ this.defaultValue = par2;
-+
-+ if (par1Str == null) {
- throw new IllegalArgumentException("Name cannot be null!");
- }
- }
-
- public String getAttributeUnlocalizedName() {
-- return this.a;
-+ return this.field_111115_a;
- }
-
- public double getDefaultValue() {
-@@ -25,12 +26,12 @@
- return this.shouldWatch;
- }
-
-- public BaseAttribute setShouldWatch(boolean var1) {
-- this.shouldWatch = var1;
-+ public BaseAttribute setShouldWatch(boolean par1) {
-+ this.shouldWatch = par1;
- return this;
- }
-
- public int hashCode() {
-- return this.a.hashCode();
-+ return this.field_111115_a.hashCode();
- }
- }
---- net/minecraft/src/TileEntitySignRenderer.java
-+++ net/minecraft/src/TileEntitySignRenderer.java
-@@ -1,71 +1,105 @@
- package net.minecraft.src;
-
-+import net.minecraft.src.Minecraft;
-+
- import org.lwjgl.opengl.GL11;
-+import org.spoutcraft.client.config.Configuration;
-
- public class TileEntitySignRenderer extends TileEntitySpecialRenderer {
-- private static final ResourceLocation field_110638_a = new ResourceLocation("textures/entity/sign.png");
-+
-+ /** The ModelSign instance used by the TileEntitySignRenderer */
- private final ModelSign modelSign = new ModelSign();
-
-- public void renderTileEntitySignAt(TileEntitySign var1, double var2, double var4, double var6, float var8) {
-- Block var9 = var1.getBlockType();
-+ public void renderTileEntitySignAt(TileEntitySign par1TileEntitySign, double par2, double par4, double par6, float par8) {
-+ Block var9 = par1TileEntitySign.getBlockType();
- GL11.glPushMatrix();
-- float var10 = 2.0F / 3.0F;
-+ float var10 = 0.6666667F;
- float var12;
-- if(var9 == Block.signPost) {
-- GL11.glTranslatef((float)var2 + 0.5F, (float)var4 + 12.0F / 16.0F * var10, (float)var6 + 0.5F);
-- float var11 = (float)(var1.getBlockMetadata() * 360) / 16.0F;
-+
-+ if (var9 == Block.signPost) {
-+ GL11.glTranslatef((float)par2 + 0.5F, (float)par4 + 0.75F * var10, (float)par6 + 0.5F);
-+ float var11 = (float)(par1TileEntitySign.getBlockMetadata() * 360) / 16.0F;
- GL11.glRotatef(-var11, 0.0F, 1.0F, 0.0F);
- this.modelSign.signStick.showModel = true;
- } else {
-- int var16 = var1.getBlockMetadata();
-+ int var16 = par1TileEntitySign.getBlockMetadata();
- var12 = 0.0F;
-- if(var16 == 2) {
-+
-+ if (var16 == 2) {
- var12 = 180.0F;
- }
-
-- if(var16 == 4) {
-+ if (var16 == 4) {
- var12 = 90.0F;
- }
-
-- if(var16 == 5) {
-+ if (var16 == 5) {
- var12 = -90.0F;
- }
-
-- GL11.glTranslatef((float)var2 + 0.5F, (float)var4 + 12.0F / 16.0F * var10, (float)var6 + 0.5F);
-+ GL11.glTranslatef((float)par2 + 0.5F, (float)par4 + 0.75F * var10, (float)par6 + 0.5F);
- GL11.glRotatef(-var12, 0.0F, 1.0F, 0.0F);
-- GL11.glTranslatef(0.0F, -(5.0F / 16.0F), -(7.0F / 16.0F));
-+ GL11.glTranslatef(0.0F, -0.3125F, -0.4375F);
- this.modelSign.signStick.showModel = false;
- }
-
-- this.bindTexture(field_110638_a);
-+ Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("textures/entity/sign.png"));
- GL11.glPushMatrix();
- GL11.glScalef(var10, -var10, -var10);
- this.modelSign.renderSign();
- GL11.glPopMatrix();
-- FontRenderer var17 = this.getFontRenderer();
-- var12 = (float)(1.0D / 60.0D) * var10;
-- GL11.glTranslatef(0.0F, 0.5F * var10, 0.07F * var10);
-- GL11.glScalef(var12, -var12, var12);
-- GL11.glNormal3f(0.0F, 0.0F, -1.0F * var12);
-- GL11.glDepthMask(false);
-- byte var13 = 0;
--
-- for(int var14 = 0; var14 < var1.a.length; ++var14) {
-- String var15 = var1.a[var14];
-- if(var14 == var1.lineBeingEdited) {
-- var15 = "> " + var15 + " <";
-- var17.drawString(var15, -var17.getStringWidth(var15) / 2, var14 * 10 - var1.a.length * 5, var13);
-- } else {
-- var17.drawString(var15, -var17.getStringWidth(var15) / 2, var14 * 10 - var1.a.length * 5, var13);
-+ // Spout Start
-+ if (par1TileEntitySign.hasText()) {
-+ EntityLivingBase viewer = Minecraft.getMinecraft().renderViewEntity;
-+ if (viewer == null) {
-+ viewer = Minecraft.getMinecraft().thePlayer;
-+ }
-+ if (Configuration.signDistance == Integer.MAX_VALUE || viewer != null && par1TileEntitySign.getDistanceFrom(viewer.posX, viewer.posY, viewer.posZ) < (Configuration.signDistance * Configuration.signDistance)) {
-+ // Spout End
-+ FontRenderer var17 = this.getFontRenderer();
-+ var12 = 0.016666668F * var10;
-+ GL11.glTranslatef(0.0F, 0.5F * var10, 0.07F * var10);
-+ GL11.glScalef(var12, -var12, var12);
-+ GL11.glNormal3f(0.0F, 0.0F, -1.0F * var12);
-+ GL11.glDepthMask(false);
-+ // Spout Start
-+ GL11.glEnable(GL11.GL_BLEND);
-+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
-+ byte var13 = 0;
-+ // Spout End
-+
-+ for (int var14 = 0; var14 < par1TileEntitySign.signText.length; ++var14) {
-+ String var15 = par1TileEntitySign.signText[var14];
-+
-+ if (var14 == par1TileEntitySign.lineBeingEdited) {
-+ // Spout Start
-+ int endColumnStart = Math.min(par1TileEntitySign.columnBeingEdited, var15.length());
-+ String before = "";
-+ if (endColumnStart > 0) {
-+ before = var15.substring(0, endColumnStart);
-+ }
-+ String after = "";
-+ if (var15.length() - par1TileEntitySign.columnBeingEdited > 0) {
-+ after = var15.substring(par1TileEntitySign.columnBeingEdited, var15.length());
-+ }
-+ var15 = before + "_" + after;
-+ // Spout End
-+ var17.drawString(var15, -var17.getStringWidth(var15) / 2, var14 * 10 - par1TileEntitySign.signText.length * 5, var13);
-+ } else {
-+ var17.drawString(var15, -var17.getStringWidth(var15) / 2, var14 * 10 - par1TileEntitySign.signText.length * 5, var13);
-+ }
-+ }
-+
-+ GL11.glDepthMask(true);
-+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
-+ // Spout Start
- }
- }
--
-- GL11.glDepthMask(true);
-- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
-+ // Spout End
- GL11.glPopMatrix();
- }
-
-- public void renderTileEntityAt(TileEntity var1, double var2, double var4, double var6, float var8) {
-- this.renderTileEntitySignAt((TileEntitySign)var1, var2, var4, var6, var8);
-+ public void renderTileEntityAt(TileEntity par1TileEntity, double par2, double par4, double par6, float par8) {
-+ this.renderTileEntitySignAt((TileEntitySign)par1TileEntity, par2, par4, par6, par8);
- }
- }
---- net/minecraft/src/CommandHandler.java
-+++ net/minecraft/src/CommandHandler.java
-@@ -10,122 +10,134 @@
- import java.util.Map.Entry;
-
- public class CommandHandler implements ICommandManager {
-- private final Map a = new HashMap();
-- private final Set b = new HashSet();
--
-- public int executeCommand(ICommandSender var1, String var2) {
-- var2 = var2.trim();
-- if(var2.startsWith("/")) {
-- var2 = var2.substring(1);
-+
-+ /** Map of Strings to the ICommand objects they represent */
-+ private final Map commandMap = new HashMap();
-+
-+ /** The set of ICommand objects currently loaded. */
-+ private final Set commandSet = new HashSet();
-+
-+ public int executeCommand(ICommandSender par1ICommandSender, String par2Str) {
-+ par2Str = par2Str.trim();
-+
-+ if (par2Str.startsWith("/")) {
-+ par2Str = par2Str.substring(1);
- }
-
-- String[] var3 = var2.split(" ");
-+ String[] var3 = par2Str.split(" ");
- String var4 = var3[0];
- var3 = dropFirstString(var3);
-- ICommand var5 = (ICommand)this.a.get(var4);
-+ ICommand var5 = (ICommand)this.commandMap.get(var4);
- int var6 = this.getUsernameIndex(var5, var3);
- int var7 = 0;
-
- try {
-- if(var5 == null) {
-+ if (var5 == null) {
- throw new CommandNotFoundException();
- }
-
-- if(var5.canCommandSenderUseCommand(var1)) {
-- if(var6 > -1) {
-- EntityPlayerMP[] var8 = PlayerSelector.matchPlayers(var1, var3[var6]);
-+ if (var5.canCommandSenderUseCommand(par1ICommandSender)) {
-+ if (var6 > -1) {
-+ EntityPlayerMP[] var8 = PlayerSelector.matchPlayers(par1ICommandSender, var3[var6]);
- String var9 = var3[var6];
- EntityPlayerMP[] var10 = var8;
- int var11 = var8.length;
-
-- for(int var12 = 0; var12 < var11; ++var12) {
-+ for (int var12 = 0; var12 < var11; ++var12) {
- EntityPlayerMP var13 = var10[var12];
- var3[var6] = var13.getEntityName();
-
- try {
-- var5.processCommand(var1, var3);
-+ var5.processCommand(par1ICommandSender, var3);
- ++var7;
- } catch (CommandException var15) {
-- var1.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions(var15.getMessage(), var15.getErrorOjbects()).setColor(EnumChatFormatting.RED));
-+ par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions(var15.getMessage(), var15.getErrorOjbects()).setColor(EnumChatFormatting.RED));
- }
- }
-
- var3[var6] = var9;
- } else {
-- var5.processCommand(var1, var3);
-+ var5.processCommand(par1ICommandSender, var3);
- ++var7;
- }
- } else {
-- var1.sendChatToPlayer(ChatMessageComponent.createFromTranslationKey("commands.generic.permission").setColor(EnumChatFormatting.RED));
-+ par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromTranslationKey("commands.generic.permission").setColor(EnumChatFormatting.RED));
- }
- } catch (WrongUsageException var16) {
-- var1.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions("commands.generic.usage", new Object[]{ChatMessageComponent.createFromTranslationWithSubstitutions(var16.getMessage(), var16.getErrorOjbects())}).setColor(EnumChatFormatting.RED));
-+ par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions("commands.generic.usage", new Object[] {ChatMessageComponent.createFromTranslationWithSubstitutions(var16.getMessage(), var16.getErrorOjbects())}).setColor(EnumChatFormatting.RED));
- } catch (CommandException var17) {
-- var1.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions(var17.getMessage(), var17.getErrorOjbects()).setColor(EnumChatFormatting.RED));
-+ par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions(var17.getMessage(), var17.getErrorOjbects()).setColor(EnumChatFormatting.RED));
- } catch (Throwable var18) {
-- var1.sendChatToPlayer(ChatMessageComponent.createFromTranslationKey("commands.generic.exception").setColor(EnumChatFormatting.RED));
-+ par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromTranslationKey("commands.generic.exception").setColor(EnumChatFormatting.RED));
- var18.printStackTrace();
- }
-
- return var7;
- }
-
-- public ICommand registerCommand(ICommand var1) {
-- List var2 = var1.getCommandAliases();
-- this.a.put(var1.getCommandName(), var1);
-- this.b.add(var1);
-- if(var2 != null) {
-+ /**
-+ * adds the command and any aliases it has to the internal map of available commands
-+ */
-+ public ICommand registerCommand(ICommand par1ICommand) {
-+ List var2 = par1ICommand.getCommandAliases();
-+ this.commandMap.put(par1ICommand.getCommandName(), par1ICommand);
-+ this.commandSet.add(par1ICommand);
-+
-+ if (var2 != null) {
- Iterator var3 = var2.iterator();
-
-- while(true) {
-- String var4;
-- ICommand var5;
-- do {
-- if(!var3.hasNext()) {
-- return var1;
-- }
--
-- var4 = (String)var3.next();
-- var5 = (ICommand)this.a.get(var4);
-- } while(var5 != null && var5.getCommandName().equals(var4));
--
-- this.a.put(var4, var1);
-+ while (var3.hasNext()) {
-+ String var4 = (String)var3.next();
-+ ICommand var5 = (ICommand)this.commandMap.get(var4);
-+
-+ if (var5 == null || !var5.getCommandName().equals(var4)) {
-+ this.commandMap.put(var4, par1ICommand);
-+ }
- }
-- } else {
-- return var1;
- }
-+
-+ return par1ICommand;
- }
-
-- private static String[] dropFirstString(String[] var0) {
-- String[] var1 = new String[var0.length - 1];
-+ /**
-+ * creates a new array and sets elements 0..n-2 to be 0..n-1 of the input (n elements)
-+ */
-+ private static String[] dropFirstString(String[] par0ArrayOfStr) {
-+ String[] var1 = new String[par0ArrayOfStr.length - 1];
-
-- for(int var2 = 1; var2 < var0.length; ++var2) {
-- var1[var2 - 1] = var0[var2];
-+ for (int var2 = 1; var2 < par0ArrayOfStr.length; ++var2) {
-+ var1[var2 - 1] = par0ArrayOfStr[var2];
- }
-
- return var1;
- }
-
-- public List getPossibleCommands(ICommandSender var1, String var2) {
-- String[] var3 = var2.split(" ", -1);
-+ /**
-+ * Performs a "begins with" string match on each token in par2. Only returns commands that par1 can use.
-+ */
-+ public List getPossibleCommands(ICommandSender par1ICommandSender, String par2Str) {
-+ String[] var3 = par2Str.split(" ", -1);
- String var4 = var3[0];
-- if(var3.length == 1) {
-+
-+ if (var3.length == 1) {
- ArrayList var8 = new ArrayList();
-- Iterator var6 = this.a.entrySet().iterator();
-+ Iterator var6 = this.commandMap.entrySet().iterator();
-
-- while(var6.hasNext()) {
-+ while (var6.hasNext()) {
- Entry var7 = (Entry)var6.next();
-- if(CommandBase.doesStringStartWith(var4, (String)var7.getKey()) && ((ICommand)var7.getValue()).canCommandSenderUseCommand(var1)) {
-+
-+ if (CommandBase.doesStringStartWith(var4, (String)var7.getKey()) && ((ICommand)var7.getValue()).canCommandSenderUseCommand(par1ICommandSender)) {
- var8.add(var7.getKey());
- }
- }
-
- return var8;
- } else {
-- if(var3.length > 1) {
-- ICommand var5 = (ICommand)this.a.get(var4);
-- if(var5 != null) {
-- return var5.addTabCompletionOptions(var1, dropFirstString(var3));
-+ if (var3.length > 1) {
-+ ICommand var5 = (ICommand)this.commandMap.get(var4);
-+
-+ if (var5 != null) {
-+ return var5.addTabCompletionOptions(par1ICommandSender, dropFirstString(var3));
- }
- }
-
-@@ -133,13 +145,17 @@
- }
- }
-
-- public List getPossibleCommands(ICommandSender var1) {
-+ /**
-+ * returns all commands that the commandSender can use
-+ */
-+ public List getPossibleCommands(ICommandSender par1ICommandSender) {
- ArrayList var2 = new ArrayList();
-- Iterator var3 = this.b.iterator();
-+ Iterator var3 = this.commandSet.iterator();
-
-- while(var3.hasNext()) {
-+ while (var3.hasNext()) {
- ICommand var4 = (ICommand)var3.next();
-- if(var4.canCommandSenderUseCommand(var1)) {
-+
-+ if (var4.canCommandSenderUseCommand(par1ICommandSender)) {
- var2.add(var4);
- }
- }
-@@ -147,16 +163,22 @@
- return var2;
- }
-
-+ /**
-+ * returns a map of string to commads. All commands are returned, not just ones which someone has permission to use.
-+ */
- public Map getCommands() {
-- return this.a;
-+ return this.commandMap;
- }
-
-- private int getUsernameIndex(ICommand var1, String[] var2) {
-- if(var1 == null) {
-+ /**
-+ * Return a command's first parameter index containing a valid username.
-+ */
-+ private int getUsernameIndex(ICommand par1ICommand, String[] par2ArrayOfStr) {
-+ if (par1ICommand == null) {
- return -1;
- } else {
-- for(int var3 = 0; var3 < var2.length; ++var3) {
-- if(var1.isUsernameIndex(var2, var3) && PlayerSelector.matchesMultiplePlayers(var2[var3])) {
-+ for (int var3 = 0; var3 < par2ArrayOfStr.length; ++var3) {
-+ if (par1ICommand.isUsernameIndex(par2ArrayOfStr, var3) && PlayerSelector.matchesMultiplePlayers(par2ArrayOfStr[var3])) {
- return var3;
- }
- }
---- /dev/null
-+++ org/spoutcraft/api/gui/TextProcessor.java
-@@ -1,0 +1,126 @@
-+/*
-+ * This file is part of Spoutcraft.
-+ *
-+ * Copyright (c) 2011 SpoutcraftDev
-+ * Spoutcraft is licensed under the GNU Lesser General Public License.
-+ *
-+ * Spoutcraft is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation, either version 3 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Spoutcraft is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program. If not, see .
-+ */
-+package org.spoutcraft.api.gui;
-+
-+import java.util.Iterator;
-+
-+import org.spoutcraft.api.UnsafeClass;
-+
-+@UnsafeClass
-+public interface TextProcessor extends Iterable {
-+ /**
-+ * Gets the text handled by this processor
-+ *
-+ * @return text
-+ */
-+ public String getText();
-+
-+ /**
-+ * Sets the text handled by this processor
-+ *
-+ * @param str new text
-+ */
-+ public void setText(String str);
-+
-+ /**
-+ * Returns the text seperated in lines
-+ *
-+ * @return string iterator holding the lines
-+ */
-+ public Iterator iterator();
-+
-+ /**
-+ * Gets the position of the cursor. Position zero is the start of the text.
-+ *
-+ * @return position
-+ */
-+ public int getCursor();
-+
-+ /**
-+ * Sets the position of the cursor
-+ *
-+ * @param position to set to
-+ * @return textfield
-+ */
-+ public void setCursor(int cursor);
-+
-+ /**
-+ * Gets a two dimensional cursor [y, x] where y is the line number and x the position of the cursor in this line
-+ *
-+ * @return 2D cursor
-+ */
-+ public int[] getCursor2D();
-+
-+ /**
-+ * Gets the maximum characters
-+ *
-+ * @return maximum characters
-+ */
-+ public int getMaximumCharacters();
-+
-+ /**
-+ * Sets the maximum characters
-+ *
-+ * @param max maximum characters
-+ */
-+ public void setMaximumCharacters(int max);
-+
-+ /**
-+ * Gets the maximum lines
-+ *
-+ * @return maximum lines
-+ */
-+ public int getMaximumLines();
-+
-+ /**
-+ * Sets the maximum lines
-+ *
-+ * @param max maximum lines
-+ */
-+ public void setMaximumLines(int max);
-+
-+ /**
-+ * Gets the width
-+ *
-+ * @return width
-+ */
-+ public int getWidth();
-+
-+ /**
-+ * Sets the width
-+ *
-+ * @param width
-+ */
-+ public void setWidth(int width);
-+
-+ /**
-+ * Clears the contents
-+ */
-+ public void clear();
-+
-+ /**
-+ * Handles the keyboard input
-+ *
-+ * @param key the key's char representation
-+ * @param keyId the key's Id
-+ * @return dirty (i.e. has the content changed / would a call of getText() return a different String than before?)
-+ */
-+ public boolean handleInput(char key, int keyId);
-+}
---- net/minecraft/src/CommandServerSay.java
-+++ net/minecraft/src/CommandServerSay.java
-@@ -8,24 +8,30 @@
- return "say";
- }
-
-+ /**
-+ * Return the required permission level for this command.
-+ */
- public int getRequiredPermissionLevel() {
- return 1;
- }
-
-- public String getCommandUsage(ICommandSender var1) {
-+ public String getCommandUsage(ICommandSender par1ICommandSender) {
- return "commands.say.usage";
- }
-
-- public void processCommand(ICommandSender var1, String[] var2) {
-- if(var2.length > 0 && var2[0].length() > 0) {
-- String var3 = func_82361_a(var1, var2, 0, true);
-- MinecraftServer.getServer().getConfigurationManager().sendChatMsg(ChatMessageComponent.createFromTranslationWithSubstitutions("chat.type.announcement", new Object[]{var1.getCommandSenderName(), var3}));
-+ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) {
-+ if (par2ArrayOfStr.length > 0 && par2ArrayOfStr[0].length() > 0) {
-+ String var3 = func_82361_a(par1ICommandSender, par2ArrayOfStr, 0, true);
-+ MinecraftServer.getServer().getConfigurationManager().sendChatMsg(ChatMessageComponent.createFromTranslationWithSubstitutions("chat.type.announcement", new Object[] {par1ICommandSender.getCommandSenderName(), var3}));
- } else {
- throw new WrongUsageException("commands.say.usage", new Object[0]);
- }
- }
-
-- public List addTabCompletionOptions(ICommandSender var1, String[] var2) {
-- return var2.length >= 1 ? getListOfStringsMatchingLastWord(var2, MinecraftServer.getServer().getAllUsernames()) : null;
-+ /**
-+ * Adds the strings available in this command to the given list of tab completion options.
-+ */
-+ public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) {
-+ return par2ArrayOfStr.length >= 1 ? getListOfStringsMatchingLastWord(par2ArrayOfStr, MinecraftServer.getServer().getAllUsernames()) : null;
- }
- }
---- net/minecraft/src/EntityIronGolem.java
-+++ net/minecraft/src/EntityIronGolem.java
-@@ -1,13 +1,15 @@
- package net.minecraft.src;
-
- public class EntityIronGolem extends EntityGolem {
-+
-+ /** deincrements, and a distance-to-home check is done at 0 */
- private int homeCheckTimer;
- Village villageObj;
- private int attackTimer;
- private int holdRoseTick;
-
-- public EntityIronGolem(World var1) {
-- super(var1);
-+ public EntityIronGolem(World par1World) {
-+ super(par1World);
- this.setSize(1.4F, 2.9F);
- this.getNavigator().setAvoidsWater(true);
- this.tasks.addTask(1, new EntityAIAttackOnCollide(this, 1.0D, true));
-@@ -28,15 +30,22 @@
- this.dataWatcher.addObject(16, Byte.valueOf((byte)0));
- }
-
-+ /**
-+ * Returns true if the newer Entity AI code should be run
-+ */
- public boolean isAIEnabled() {
- return true;
- }
-
-+ /**
-+ * main AI tick function, replaces updateEntityActionState
-+ */
- protected void updateAITick() {
-- if(--this.homeCheckTimer <= 0) {
-- this.homeCheckTimer = 70 + this.ab.nextInt(50);
-+ if (--this.homeCheckTimer <= 0) {
-+ this.homeCheckTimer = 70 + this.rand.nextInt(50);
- this.villageObj = this.worldObj.villageCollectionObj.findNearestVillage(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ), 32);
-- if(this.villageObj == null) {
-+
-+ if (this.villageObj == null) {
- this.detachHome();
- } else {
- ChunkCoordinates var1 = this.villageObj.getCenter();
-@@ -53,76 +62,93 @@
- this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute(0.25D);
- }
-
-- protected int decreaseAirSupply(int var1) {
-- return var1;
-+ /**
-+ * Decrements the entity's air supply when underwater
-+ */
-+ protected int decreaseAirSupply(int par1) {
-+ return par1;
- }
-
-- protected void collideWithEntity(Entity var1) {
-- if(var1 instanceof IMob && this.getRNG().nextInt(20) == 0) {
-- this.setAttackTarget((EntityLivingBase)var1);
-+ protected void collideWithEntity(Entity par1Entity) {
-+ if (par1Entity instanceof IMob && this.getRNG().nextInt(20) == 0) {
-+ this.setAttackTarget((EntityLivingBase)par1Entity);
- }
-
-- super.collideWithEntity(var1);
-+ super.collideWithEntity(par1Entity);
- }
-
-+ /**
-+ * 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.onLivingUpdate();
-- if(this.attackTimer > 0) {
-+
-+ if (this.attackTimer > 0) {
- --this.attackTimer;
- }
-
-- if(this.holdRoseTick > 0) {
-+ if (this.holdRoseTick > 0) {
- --this.holdRoseTick;
- }
-
-- if(this.motionX * this.motionX + this.motionZ * this.motionZ > (double)2.5000003E-7F && this.ab.nextInt(5) == 0) {
-+ if (this.motionX * this.motionX + this.motionZ * this.motionZ > 2.500000277905201E-7D && this.rand.nextInt(5) == 0) {
- int var1 = MathHelper.floor_double(this.posX);
-- int var2 = MathHelper.floor_double(this.posY - (double)0.2F - (double)this.yOffset);
-+ int var2 = MathHelper.floor_double(this.posY - 0.20000000298023224D - (double)this.yOffset);
- int var3 = MathHelper.floor_double(this.posZ);
- int var4 = this.worldObj.getBlockId(var1, var2, var3);
-- if(var4 > 0) {
-- this.worldObj.spawnParticle("tilecrack_" + var4 + "_" + this.worldObj.getBlockMetadata(var1, var2, var3), this.posX + ((double)this.ab.nextFloat() - 0.5D) * (double)this.width, this.boundingBox.minY + 0.1D, this.posZ + ((double)this.ab.nextFloat() - 0.5D) * (double)this.width, 4.0D * ((double)this.ab.nextFloat() - 0.5D), 0.5D, ((double)this.ab.nextFloat() - 0.5D) * 4.0D);
-+
-+ if (var4 > 0) {
-+ this.worldObj.spawnParticle("tilecrack_" + var4 + "_" + this.worldObj.getBlockMetadata(var1, var2, var3), this.posX + ((double)this.rand.nextFloat() - 0.5D) * (double)this.width, this.boundingBox.minY + 0.1D, this.posZ + ((double)this.rand.nextFloat() - 0.5D) * (double)this.width, 4.0D * ((double)this.rand.nextFloat() - 0.5D), 0.5D, ((double)this.rand.nextFloat() - 0.5D) * 4.0D);
- }
- }
--
-- }
--
-- public boolean canAttackClass(Class var1) {
-- return this.isPlayerCreated() && EntityPlayer.class.isAssignableFrom(var1) ? false : super.canAttackClass(var1);
-- }
--
-- public void writeEntityToNBT(NBTTagCompound var1) {
-- super.writeEntityToNBT(var1);
-- var1.setBoolean("PlayerCreated", this.isPlayerCreated());
-- }
--
-- public void readEntityFromNBT(NBTTagCompound var1) {
-- super.readEntityFromNBT(var1);
-- this.setPlayerCreated(var1.getBoolean("PlayerCreated"));
-- }
--
-- public boolean attackEntityAsMob(Entity var1) {
-+ }
-+
-+ /**
-+ * Returns true if this entity can attack entities of the specified class.
-+ */
-+ public boolean canAttackClass(Class par1Class) {
-+ return this.isPlayerCreated() && EntityPlayer.class.isAssignableFrom(par1Class) ? false : super.canAttackClass(par1Class);
-+ }
-+
-+ /**
-+ * (abstract) Protected helper method to write subclass entity data to NBT.
-+ */
-+ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) {
-+ super.writeEntityToNBT(par1NBTTagCompound);
-+ par1NBTTagCompound.setBoolean("PlayerCreated", this.isPlayerCreated());
-+ }
-+
-+ /**
-+ * (abstract) Protected helper method to read subclass entity data from NBT.
-+ */
-+ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) {
-+ super.readEntityFromNBT(par1NBTTagCompound);
-+ this.setPlayerCreated(par1NBTTagCompound.getBoolean("PlayerCreated"));
-+ }
-+
-+ public boolean attackEntityAsMob(Entity par1Entity) {
- this.attackTimer = 10;
- this.worldObj.setEntityState(this, (byte)4);
-- boolean var2 = var1.attackEntityFrom(DamageSource.causeMobDamage(this), (float)(7 + this.ab.nextInt(15)));
-- if(var2) {
-- var1.motionY += (double)0.4F;
-+ boolean var2 = par1Entity.attackEntityFrom(DamageSource.causeMobDamage(this), (float)(7 + this.rand.nextInt(15)));
-+
-+ if (var2) {
-+ par1Entity.motionY += 0.4000000059604645D;
- }
-
- this.playSound("mob.irongolem.throw", 1.0F, 1.0F);
- return var2;
- }
-
-- public void handleHealthUpdate(byte var1) {
-- if(var1 == 4) {
-+ public void handleHealthUpdate(byte par1) {
-+ if (par1 == 4) {
- this.attackTimer = 10;
- this.playSound("mob.irongolem.throw", 1.0F, 1.0F);
-- } else if(var1 == 11) {
-+ } else if (par1 == 11) {
- this.holdRoseTick = 400;
- } else {
-- super.handleHealthUpdate(var1);
-+ super.handleHealthUpdate(par1);
- }
--
- }
-
- public Village getVillage() {
-@@ -133,41 +159,56 @@
- return this.attackTimer;
- }
-
-- public void setHoldingRose(boolean var1) {
-- this.holdRoseTick = var1 ? 400 : 0;
-+ public void setHoldingRose(boolean par1) {
-+ this.holdRoseTick = par1 ? 400 : 0;
- this.worldObj.setEntityState(this, (byte)11);
- }
-
-+ /**
-+ * Returns the sound this mob makes while it's alive.
-+ */
- protected String getLivingSound() {
- return "none";
- }
-
-+ /**
-+ * Returns the sound this mob makes when it is hurt.
-+ */
- protected String getHurtSound() {
- return "mob.irongolem.hit";
- }
-
-+ /**
-+ * Returns the sound this mob makes on death.
-+ */
- protected String getDeathSound() {
- return "mob.irongolem.death";
- }
-
-- protected void playStepSound(int var1, int var2, int var3, int var4) {
-+ /**
-+ * Plays step sound at given x, y, z for the entity
-+ */
-+ protected void playStepSound(int par1, int par2, int par3, int par4) {
- this.playSound("mob.irongolem.walk", 1.0F, 1.0F);
- }
-
-- protected void dropFewItems(boolean var1, int var2) {
-- int var3 = this.ab.nextInt(3);
--
-+ /**
-+ * 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;
-- for(var4 = 0; var4 < var3; ++var4) {
-+
-+ for (var4 = 0; var4 < var3; ++var4) {
- this.dropItem(Block.plantRed.blockID, 1);
- }
-
-- var4 = 3 + this.ab.nextInt(3);
-+ var4 = 3 + this.rand.nextInt(3);
-
-- for(int var5 = 0; var5 < var4; ++var5) {
-+ for (int var5 = 0; var5 < var4; ++var5) {
- this.dropItem(Item.ingotIron.itemID, 1);
- }
--
- }
-
- public int getHoldRoseTick() {
-@@ -178,21 +219,24 @@
- return (this.dataWatcher.getWatchableObjectByte(16) & 1) != 0;
- }
-
-- public void setPlayerCreated(boolean var1) {
-+ public void setPlayerCreated(boolean par1) {
- byte var2 = this.dataWatcher.getWatchableObjectByte(16);
-- if(var1) {
-+
-+ if (par1) {
- this.dataWatcher.updateObject(16, Byte.valueOf((byte)(var2 | 1)));
- } else {
- this.dataWatcher.updateObject(16, Byte.valueOf((byte)(var2 & -2)));
- }
--
- }
-
-- public void onDeath(DamageSource var1) {
-- if(!this.isPlayerCreated() && this.attackingPlayer != null && this.villageObj != null) {
-+ /**
-+ * Called when the mob's health reaches 0.
-+ */
-+ public void onDeath(DamageSource par1DamageSource) {
-+ if (!this.isPlayerCreated() && this.attackingPlayer != null && this.villageObj != null) {
- this.villageObj.setReputationForPlayer(this.attackingPlayer.getCommandSenderName(), -5);
- }
-
-- super.onDeath(var1);
-+ super.onDeath(par1DamageSource);
- }
- }
---- /dev/null
-+++ org/spoutcraft/client/gui/about/TableSection.java
-@@ -1,0 +1,117 @@
-+/*
-+ * This file is part of Spoutcraft.
-+ *
-+ * Copyright (c) 2011 SpoutcraftDev
-+ * Spoutcraft is licensed under the GNU Lesser General Public License.
-+ *
-+ * Spoutcraft is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation, either version 3 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Spoutcraft is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program. If not, see .
-+ */
-+package org.spoutcraft.client.gui.about;
-+
-+import java.util.LinkedHashMap;
-+import java.util.LinkedList;
-+import java.util.List;
-+import java.util.Map.Entry;
-+
-+import org.spoutcraft.api.Spoutcraft;
-+import org.spoutcraft.api.gui.Color;
-+import org.spoutcraft.api.gui.GenericLabel;
-+import org.spoutcraft.api.gui.Widget;
-+
-+public class TableSection extends Section {
-+ private int maxCaption = 0;
-+ private int height = 0;
-+ protected class Row {
-+ public GenericLabel caption = new GenericLabel("aasdasd");
-+ public GenericLabel text = new GenericLabel("basdasd");
-+ public Row() {
-+ caption.setTextColor(new Color(0xaaaaaa));
-+ caption.setWidth(20);
-+ caption.setWrapLines(true);
-+ text.setTextColor(new Color(0xaaaaaa));
-+ text.setWidth(20);
-+ text.setWrapLines(true);
-+ }
-+ }
-+
-+ private LinkedList rows = new LinkedList();
-+
-+ @Override
-+ public void setX(int x) {
-+ super.setX(x);
-+ update();
-+ }
-+
-+ @Override
-+ public void setY(int y) {
-+ super.setY(y);
-+ update();
-+ }
-+
-+ @Override
-+ public int getHeight() {
-+ return super.getHeight() + height + 5;
-+ }
-+
-+ @Override
-+ public void update() {
-+ super.update();
-+ int y = super.getHeight() + 5 + getY();
-+ int left = getX();
-+ int right = left + maxCaption + 5;
-+ int textRightWidth = getWidth() - right + left;
-+ int textLeftWidth = right - left;
-+ if (right - left > getWidth() || right - left <= 30) {
-+ textRightWidth = textLeftWidth = getWidth() / 2 - 5;
-+ right = left + textLeftWidth + 5;
-+ }
-+ height = 0;
-+ for (Row row:rows) {
-+ row.caption.setX(left);
-+ row.caption.setY(y);
-+ row.caption.setWidth(textLeftWidth);
-+ row.caption.recalculateLines();
-+ row.text.setX(right);
-+ row.text.setY(y);
-+ row.text.setWidth(textRightWidth);
-+ row.text.recalculateLines();
-+ int h = (int) Math.max(row.text.getHeight(), row.caption.getHeight()) + 2;
-+ y += h;
-+ height += h;
-+ }
-+ }
-+
-+ @Override
-+ public List getWidgets() {
-+ List ret = super.getWidgets();
-+ for (Row row:rows) {
-+ ret.add(row.caption);
-+ ret.add(row.text);
-+ }
-+ return ret;
-+ }
-+
-+ @Override
-+ public void init(GuiNewAbout screen, String title, Object yaml) {
-+ setTitle(title);
-+ LinkedHashMap r = (LinkedHashMap) yaml;
-+ for (Entry entry:r.entrySet()) {
-+ Row row = new Row();
-+ row.caption.setText(entry.getKey());
-+ maxCaption = Math.max(maxCaption, Spoutcraft.getRenderDelegate().getMinecraftFont().getTextWidth(row.caption.getText()));
-+ row.text.setText(entry.getValue());
-+ rows.add(row);
-+ }
-+ }
-+}
---- net/minecraft/src/ModelLeashKnot.java
-+++ net/minecraft/src/ModelLeashKnot.java
-@@ -7,22 +7,30 @@
- this(0, 0, 32, 32);
- }
-
-- public ModelLeashKnot(int var1, int var2, int var3, int var4) {
-- this.textureWidth = var3;
-- this.textureHeight = var4;
-- this.field_110723_a = new ModelRenderer(this, var1, var2);
-+ 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);
- }
-
-- public void render(Entity var1, float var2, float var3, float var4, float var5, float var6, float var7) {
-- this.setRotationAngles(var2, var3, var4, var5, var6, var7, var1);
-- this.field_110723_a.render(var7);
-+ /**
-+ * 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);
- }
-
-- public void setRotationAngles(float var1, float var2, float var3, float var4, float var5, float var6, Entity var7) {
-- super.setRotationAngles(var1, var2, var3, var4, var5, var6, var7);
-- this.field_110723_a.rotateAngleY = var4 / (180.0F / (float)Math.PI);
-- this.field_110723_a.rotateAngleX = var5 / (180.0F / (float)Math.PI);
-+ /**
-+ * 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);
- }
- }
---- net/minecraft/src/SlotFurnace.java
-+++ net/minecraft/src/SlotFurnace.java
-@@ -1,54 +1,72 @@
- package net.minecraft.src;
-
- public class SlotFurnace extends Slot {
-+
-+ /** The player that is using the GUI where this slot resides. */
- private EntityPlayer thePlayer;
- private int field_75228_b;
-
-- public SlotFurnace(EntityPlayer var1, IInventory var2, int var3, int var4, int var5) {
-- super(var2, var3, var4, var5);
-- this.thePlayer = var1;
-+ public SlotFurnace(EntityPlayer par1EntityPlayer, IInventory par2IInventory, int par3, int par4, int par5) {
-+ super(par2IInventory, par3, par4, par5);
-+ this.thePlayer = par1EntityPlayer;
- }
-
-- public boolean isItemValid(ItemStack var1) {
-+ /**
-+ * Check if the stack is a valid item for this slot. Always true beside for the armor slots.
-+ */
-+ public boolean isItemValid(ItemStack par1ItemStack) {
- return false;
- }
-
-- public ItemStack decrStackSize(int var1) {
-- if(this.getHasStack()) {
-- this.field_75228_b += Math.min(var1, this.getStack().stackSize);
-+ /**
-+ * Decrease the size of the stack in slot (first int arg) by the amount of the second int arg. Returns the new stack.
-+ */
-+ public ItemStack decrStackSize(int par1) {
-+ if (this.getHasStack()) {
-+ this.field_75228_b += Math.min(par1, this.getStack().stackSize);
- }
-
-- return super.decrStackSize(var1);
-- }
--
-- public void onPickupFromSlot(EntityPlayer var1, ItemStack var2) {
-- this.onCrafting(var2);
-- super.onPickupFromSlot(var1, var2);
-- }
--
-- protected void onCrafting(ItemStack var1, int var2) {
-- this.field_75228_b += var2;
-- this.onCrafting(var1);
-- }
--
-- protected void onCrafting(ItemStack var1) {
-- var1.onCrafting(this.thePlayer.worldObj, this.thePlayer, this.field_75228_b);
-- if(!this.thePlayer.worldObj.isRemote) {
-+ return super.decrStackSize(par1);
-+ }
-+
-+ public void onPickupFromSlot(EntityPlayer par1EntityPlayer, ItemStack par2ItemStack) {
-+ this.onCrafting(par2ItemStack);
-+ super.onPickupFromSlot(par1EntityPlayer, par2ItemStack);
-+ }
-+
-+ /**
-+ * the itemStack passed in is the output - ie, iron ingots, and pickaxes, not ore and wood. Typically increases an
-+ * internal count then calls onCrafting(item).
-+ */
-+ protected void onCrafting(ItemStack par1ItemStack, int par2) {
-+ this.field_75228_b += par2;
-+ this.onCrafting(par1ItemStack);
-+ }
-+
-+ /**
-+ * the itemStack passed in is the output - ie, iron ingots, and pickaxes, not ore and wood.
-+ */
-+ protected void onCrafting(ItemStack par1ItemStack) {
-+ par1ItemStack.onCrafting(this.thePlayer.worldObj, this.thePlayer, this.field_75228_b);
-+
-+ if (!this.thePlayer.worldObj.isRemote) {
- int var2 = this.field_75228_b;
-- float var3 = FurnaceRecipes.smelting().getExperience(var1.itemID);
-+ float var3 = FurnaceRecipes.smelting().getExperience(par1ItemStack.itemID);
- int var4;
-- if(var3 == 0.0F) {
-+
-+ if (var3 == 0.0F) {
- var2 = 0;
-- } else if(var3 < 1.0F) {
-+ } else if (var3 < 1.0F) {
- var4 = MathHelper.floor_float((float)var2 * var3);
-- if(var4 < MathHelper.ceiling_float_int((float)var2 * var3) && (float)Math.random() < (float)var2 * var3 - (float)var4) {
-+
-+ if (var4 < MathHelper.ceiling_float_int((float)var2 * var3) && (float)Math.random() < (float)var2 * var3 - (float)var4) {
- ++var4;
- }
-
- var2 = var4;
- }
-
-- while(var2 > 0) {
-+ while (var2 > 0) {
- var4 = EntityXPOrb.getXPSplit(var2);
- var2 -= var4;
- this.thePlayer.worldObj.spawnEntityInWorld(new EntityXPOrb(this.thePlayer.worldObj, this.thePlayer.posX, this.thePlayer.posY + 0.5D, this.thePlayer.posZ + 0.5D, var4));
-@@ -56,13 +74,13 @@
- }
-
- this.field_75228_b = 0;
-- if(var1.itemID == Item.ingotIron.itemID) {
-+
-+ if (par1ItemStack.itemID == Item.ingotIron.itemID) {
- this.thePlayer.addStat(AchievementList.acquireIron, 1);
- }
-
-- if(var1.itemID == Item.fishCooked.itemID) {
-+ if (par1ItemStack.itemID == Item.fishCooked.itemID) {
- this.thePlayer.addStat(AchievementList.cookFish, 1);
- }
--
- }
- }
---- /dev/null
-+++ org/spoutcraft/api/gui/GenericContainer.java
-@@ -1,0 +1,461 @@
-+/*
-+ * This file is part of Spoutcraft.
-+ *
-+ * Copyright (c) 2011 SpoutcraftDev
-+ * Spoutcraft is licensed under the GNU Lesser General Public License.
-+ *
-+ * Spoutcraft is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation, either version 3 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Spoutcraft is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program. If not, see .
-+ */
-+package org.spoutcraft.api.gui;
-+
-+import java.util.ArrayList;
-+import java.util.Arrays;
-+import java.util.Collections;
-+import java.util.List;
-+
-+import org.spoutcraft.api.UnsafeClass;
-+
-+@UnsafeClass
-+public class GenericContainer extends GenericWidget implements Container {
-+ protected List children = new ArrayList();
-+ protected ContainerType type = ContainerType.VERTICAL;
-+ protected WidgetAnchor align = WidgetAnchor.TOP_LEFT;
-+ protected boolean reverse = false;
-+ protected int minWidthCalc = 0, maxWidthCalc = 427, minHeightCalc = 0, maxHeightCalc = 240;
-+ protected boolean auto = true;
-+ protected boolean recalculating = false;
-+ protected boolean needsLayout = true;
-+
-+ public GenericContainer() {
-+ }
-+
-+ public GenericContainer(Widget... children) {
-+ // Shortcuts because we don't have any of the insertChild values setup yet
-+ this.children.addAll(Arrays.asList(children));
-+ for (Widget child : children) {
-+ child.setContainer(this);
-+ }
-+ updateSize();
-+ }
-+
-+ public Container addChild(Widget child) {
-+ return insertChild(-1, child);
-+ }
-+
-+ public Container insertChild(int index, Widget child) {
-+ if (index < 0 || index > this.children.size()) {
-+ this.children.add(child);
-+ } else {
-+ this.children.add(index, child);
-+ }
-+ child.setContainer(this);
-+ child.savePos();
-+ child.shiftXPos(super.getX());
-+ child.shiftYPos(super.getY());
-+ child.setAnchor(super.getAnchor());
-+ // Relay out if we are already using layout - otherwise this will return immediately
-+ if (getScreen() != null) {
-+ String addon = child.getAddon();
-+ getScreen().attachWidget(addon, child);
-+ }
-+ updateSize();
-+ deferLayout();
-+ return this;
-+ }
-+
-+ public Container addChildren(Widget... children) {
-+ for (Widget child : children) {
-+ this.insertChild(-1, child);
-+ }
-+ return this;
-+ }
-+
-+ public Widget[] getChildren() {
-+ Widget[] list = new Widget[children.size()];
-+ children.toArray(list);
-+ return list;
-+ }
-+
-+ @Override
-+ public Container setVisible(boolean enable) {
-+ super.setVisible(enable);
-+ for (Widget widget : children) {
-+ widget.setVisible(enable);
-+ }
-+ return this;
-+ }
-+
-+ @Override
-+ public Container setPriority(RenderPriority priority) {
-+ super.setPriority(priority);
-+ for (Widget widget : children) {
-+ widget.setPriority(priority);
-+ }
-+ return this;
-+ }
-+
-+ @Override
-+ public Container setAnchor(WidgetAnchor anchor) {
-+ super.setAnchor(anchor);
-+ for (Widget widget : children) {
-+ widget.setAnchor(anchor);
-+ }
-+ return this;
-+ }
-+
-+ public WidgetType getType() {
-+ return WidgetType.Container;
-+ }
-+
-+ @Override
-+ public Widget setX(int pos) {
-+ int delta = pos - super.getX();
-+ super.setX(pos);
-+ for (Widget widget : children) {
-+ widget.shiftXPos(delta);
-+ }
-+ return this;
-+ }
-+
-+ @Override
-+ public Widget setY(int pos) {
-+ int delta = pos - super.getY();
-+ super.setY(pos);
-+ for (Widget widget : children) {
-+ widget.shiftYPos(delta);
-+ }
-+ return this;
-+ }
-+
-+ public Container removeChild(Widget child) {
-+ children.remove(child);
-+ child.setContainer(null);
-+ child.restorePos();
-+ if (this.screen != null) {
-+ this.screen.removeWidget(child);
-+ }
-+ updateSize();
-+ deferLayout();
-+ return this;
-+ }
-+
-+ @Override
-+ public Container setScreen(Screen screen) {
-+ for (Widget child : children) {
-+ if (screen != null) {
-+ screen.attachWidget(getAddon(), child);
-+ } else if (this.screen != null) {
-+ this.screen.removeWidget(child);
-+ }
-+ }
-+ super.setScreen(screen);
-+ return this;
-+ }
-+
-+ @Override
-+ public Container setHeight(int height) {
-+ if (super.getHeight() != height) {
-+ super.setHeight(height);
-+ this.deferLayout();
-+ }
-+ return this;
-+ }
-+
-+ @Override
-+ public Container setWidth(int width) {
-+ if (super.getWidth() != width) {
-+ super.setWidth(width);
-+ this.deferLayout();
-+ }
-+ return this;
-+ }
-+
-+ public Container setLayout(ContainerType type) {
-+ if (this.type != type) {
-+ this.type = type;
-+ deferLayout();
-+ }
-+ return this;
-+ }
-+
-+ public ContainerType getLayout() {
-+ return type;
-+ }
-+
-+ public Container setAlign(WidgetAnchor align) {
-+ if (this.align != align) {
-+ this.align = align;
-+ deferLayout();
-+ }
-+ return this;
-+ }
-+
-+ public WidgetAnchor getAlign() {
-+ return align;
-+ }
-+
-+ public Container setReverse(boolean reverse) {
-+ if (this.reverse != reverse) {
-+ this.reverse = reverse;
-+ deferLayout();
-+ }
-+ return this;
-+ }
-+
-+ public boolean getReverse() {
-+ return reverse;
-+ }
-+
-+ public Container deferLayout() {
-+ needsLayout = true;
-+ return this;
-+ }
-+
-+ public Container updateLayout() {
-+ if (!recalculating && super.getWidth() > 0 && super.getHeight() > 0 && !children.isEmpty()) {
-+ recalculating = true; // Prevent us from getting into a loop
-+ List visibleChildren = new ArrayList();
-+ int totalwidth = 0, totalheight = 0, newwidth, newheight, vcount = 0, hcount = 0;
-+ int availableWidth = (int) (auto ? getWidth() : getMinWidth()), availableHeight = (int) (auto ? getHeight() : getMinHeight());
-+ // We only layout visible children, invisible ones have zero physical presence on screen
-+ for (Widget widget : children) {
-+ if (widget.isVisible()) {
-+ visibleChildren.add(widget);
-+ }
-+ }
-+ // Reverse drawing order if we need to
-+ if (reverse) {
-+ Collections.reverse(visibleChildren);
-+ }
-+ // First - get the total space by fixed widgets and borders
-+ if (type == ContainerType.OVERLAY) {
-+ newwidth = availableWidth;
-+ newheight = availableHeight;
-+ } else {
-+ for (Widget widget : visibleChildren) {
-+ int horiz = widget.getMarginLeft() + widget.getMarginRight();
-+ int vert = widget.getMarginTop() + widget.getMarginBottom();
-+ if (widget.isFixed()) {
-+ horiz += widget.getWidth();
-+ vert += widget.getHeight();
-+ }
-+ if (type == ContainerType.VERTICAL) {
-+ totalheight += vert;
-+ if (!widget.isFixed()) {
-+ vcount++;
-+ }
-+ } else if (type == ContainerType.HORIZONTAL) {
-+ totalwidth += horiz;
-+ if (!widget.isFixed()) {
-+ hcount++;
-+ }
-+ }
-+ }
-+ // Work out the width and height for children
-+ newwidth = (availableWidth - totalwidth) / Math.max(1, hcount);
-+ newheight = (availableHeight - totalheight) / Math.max(1, vcount);
-+ // Deal with minWidth and minHeight - change newwidth/newheight if needed
-+ for (Widget widget : visibleChildren) {
-+ if (!widget.isFixed()) {
-+ if (type == ContainerType.VERTICAL) {
-+ if (widget.getMinHeight() > newheight) {
-+ totalheight += widget.getMinHeight() - newheight;
-+ newheight = (availableHeight - totalheight) / Math.max(1, vcount);
-+ } else if (newheight >= widget.getMaxHeight()) {
-+ totalheight += widget.getMaxHeight();
-+ vcount--;
-+ newheight = (availableHeight - totalheight) / Math.max(1, vcount);
-+ }
-+ } else if (type == ContainerType.HORIZONTAL) {
-+ if (widget.getMinWidth() > newwidth) {
-+ totalwidth += widget.getMinWidth() - newwidth;
-+ newwidth = (availableWidth - totalwidth) / Math.max(1, hcount);
-+ } else if (newwidth >= widget.getMaxWidth()) {
-+ totalwidth += widget.getMaxWidth();
-+ hcount--;
-+ newwidth = (availableWidth - totalwidth) / Math.max(1, hcount);
-+ }
-+ }
-+ }
-+ }
-+ newheight = Math.max(newheight, 0);
-+ newwidth = Math.max(newwidth, 0);
-+ }
-+ totalheight = totalwidth = 0;
-+ // Resize any non-fixed widgets
-+ for (Widget widget : visibleChildren) {
-+ if (!widget.isFixed()) {
-+ int realheight, realwidth;
-+ if (auto) {
-+ realheight = Math.max(widget.getMinHeight(), Math.min(newheight - widget.getMarginTop() - widget.getMarginBottom(), widget.getMaxHeight()));
-+ realwidth = Math.max(widget.getMinWidth(), Math.min(newwidth - widget.getMarginLeft() - widget.getMarginRight(), widget.getMaxWidth()));
-+ } else {
-+ realheight = widget.getMinHeight() == 0 ? newheight - widget.getMarginTop() - widget.getMarginBottom() : widget.getMinHeight();
-+ realwidth = widget.getMinWidth() == 0 ? newwidth - widget.getMarginLeft() - widget.getMarginRight() : widget.getMinWidth();
-+ }
-+ if (widget.getHeight() != realheight || widget.getWidth() != realwidth) {
-+ widget.setHeight(realheight).setWidth(realwidth);
-+ }
-+ }
-+ if (type == ContainerType.VERTICAL) {
-+ totalheight += widget.getHeight() + widget.getMarginTop() + widget.getMarginBottom();
-+ } else {
-+ totalheight = (int) Math.max(totalheight, widget.getHeight() + widget.getMarginTop() + widget.getMarginBottom());
-+ }
-+ if (type == ContainerType.HORIZONTAL) {
-+ totalwidth += widget.getWidth() + widget.getMarginLeft() + widget.getMarginRight();
-+ } else {
-+ totalwidth = (int) Math.max(totalwidth, widget.getWidth() + widget.getMarginLeft() + widget.getMarginRight());
-+ }
-+ }
-+ // Work out the new top-left position taking into account Align
-+ int left = super.getX();
-+ int top = super.getY();
-+ if (align == WidgetAnchor.TOP_CENTER || align == WidgetAnchor.CENTER_CENTER || align == WidgetAnchor.BOTTOM_CENTER) {
-+ left += (super.getWidth() - totalwidth) / 2;
-+ } else if (align == WidgetAnchor.TOP_RIGHT || align == WidgetAnchor.CENTER_RIGHT || align == WidgetAnchor.BOTTOM_RIGHT) {
-+ left += super.getWidth() - totalwidth;
-+ }
-+ if (align == WidgetAnchor.CENTER_LEFT || align == WidgetAnchor.CENTER_CENTER || align == WidgetAnchor.CENTER_RIGHT) {
-+ top += (super.getHeight() - totalheight) / 2;
-+ } else if (align == WidgetAnchor.BOTTOM_LEFT || align == WidgetAnchor.BOTTOM_CENTER || align == WidgetAnchor.BOTTOM_RIGHT) {
-+ top += super.getHeight() - totalheight;
-+ }
-+ // Move all children into the correct position
-+ for (Widget widget : visibleChildren) {
-+ int realtop = top + widget.getMarginTop();
-+ int realleft = left + widget.getMarginLeft();
-+ if (widget.getY() != realtop || widget.getX() != realleft) {
-+ widget.setY(realtop).setX(realleft);
-+ }
-+ if (type == ContainerType.VERTICAL) {
-+ top += widget.getHeight() + widget.getMarginTop() + widget.getMarginBottom();
-+ } else if (type == ContainerType.HORIZONTAL) {
-+ left += widget.getWidth() + widget.getMarginLeft() + widget.getMarginRight();
-+ }
-+ }
-+ recalculating = false;
-+ }
-+ needsLayout = false;
-+ return this;
-+ }
-+
-+ @Override
-+ public void onTick() {
-+ if (needsLayout) {
-+ updateLayout();
-+ }
-+ }
-+
-+ @Override
-+ public int getMinWidth() {
-+ return Math.max(super.getMinWidth(), minWidthCalc);
-+ }
-+
-+ @Override
-+ public int getMaxWidth() {
-+ return Math.min(super.getMaxWidth(), maxWidthCalc);
-+ }
-+
-+ @Override
-+ public int getMinHeight() {
-+ return Math.max(super.getMinHeight(), minHeightCalc);
-+ }
-+
-+ @Override
-+ public int getMaxHeight() {
-+ return Math.min(super.getMaxHeight(), maxHeightCalc);
-+ }
-+
-+ @Override
-+ public Container updateSize() {
-+ if (!recalculating && !isFixed()) {
-+ recalculating = true; // Prevent us from getting into a loop due to both trickle down and push up
-+ int minwidth = 0, maxwidth = 0, minheight = 0, maxheight = 0, minhoriz, maxhoriz, minvert, maxvert;
-+ // Work out the minimum and maximum dimensions for the contents of this container
-+ for (Widget widget : children) {
-+ if (widget.isVisible()) {
-+ if (widget instanceof Container) { // Trickle down to children
-+ ((Container) widget).updateSize();
-+ }
-+ minhoriz = maxhoriz = widget.getMarginLeft() + widget.getMarginRight();
-+ minvert = maxvert = widget.getMarginTop() + widget.getMarginBottom();
-+ if (widget.isFixed()) {
-+ minhoriz += widget.getWidth();
-+ maxhoriz += widget.getWidth();
-+ minvert += widget.getHeight();
-+ maxvert += widget.getHeight();
-+ } else {
-+ minhoriz += widget.getMinWidth();
-+ maxhoriz += widget.getMaxWidth();
-+ minvert += widget.getMinHeight();
-+ maxvert += widget.getMaxHeight();
-+ }
-+ if (type == ContainerType.HORIZONTAL) {
-+ minwidth += minhoriz;
-+ maxwidth += maxhoriz;
-+ } else {
-+ minwidth = Math.max(minwidth, minhoriz);
-+ if (type == ContainerType.OVERLAY) {
-+ maxwidth = Math.max(maxwidth, maxhoriz);
-+ } else {
-+ maxwidth = Math.min(maxwidth, maxhoriz);
-+ }
-+ }
-+ if (type == ContainerType.VERTICAL) {
-+ minheight += minvert;
-+ maxheight += maxvert;
-+ } else {
-+ minheight = Math.max(minheight, minvert);
-+ if (type == ContainerType.OVERLAY) {
-+ maxheight = Math.max(maxheight, maxvert);
-+ } else {
-+ maxheight = Math.min(maxheight, maxvert);
-+ }
-+ }
-+ }
-+ }
-+ minwidth = Math.min(minwidth, 427);
-+ maxwidth = Math.min(maxwidth == 0 ? 427 : maxwidth, 427);
-+ minheight = Math.min(minheight, 240);
-+ maxheight = Math.min(maxheight == 0 ? 240 : maxheight, 240);
-+ // Check if the dimensions have changed
-+ if (minwidth != minWidthCalc || maxwidth != maxWidthCalc || minheight != minHeightCalc || maxheight != maxHeightCalc) {
-+ minWidthCalc = minwidth;
-+ maxWidthCalc = maxwidth;
-+ minHeightCalc = minheight;
-+ maxHeightCalc = maxheight;
-+ deferLayout();
-+ if (hasContainer()) { // Push up to parents
-+ getContainer().updateSize();
-+ getContainer().deferLayout();
-+ }
-+ }
-+ recalculating = false;
-+ }
-+ return this;
-+ }
-+
-+ public Container setAuto(boolean auto) {
-+ this.auto = auto;
-+ return this;
-+ }
-+
-+ public boolean isAuto() {
-+ return auto;
-+ }
-+
-+ public void render() {
-+ }
-+}
---- net/minecraft/src/WorldProvider.java
-+++ net/minecraft/src/WorldProvider.java
-@@ -1,62 +1,102 @@
- package net.minecraft.src;
-
-+// MCPatcher Start
-+import com.prupe.mcpatcher.cc.ColorizeWorld;
-+import com.prupe.mcpatcher.cc.Colorizer;
-+// MCPatcher End
-+
- public abstract class WorldProvider {
-- public static final float[] moonPhaseFactors = new float[]{1.0F, 12.0F / 16.0F, 0.5F, 0.25F, 0.0F, 0.25F, 0.5F, 12.0F / 16.0F};
-+ public static final float[] moonPhaseFactors = new float[] {1.0F, 0.75F, 0.5F, 0.25F, 0.0F, 0.25F, 0.5F, 0.75F};
-+
-+ /** world object being used */
- public World worldObj;
- public WorldType terrainType;
-- public String d;
-+ public String field_82913_c;
-+
-+ /** World chunk manager being used to generate chunks */
- public WorldChunkManager worldChunkMgr;
-+
-+ /**
-+ * States whether the Hell world provider is used(true) or if the normal world provider is used(false)
-+ */
- public boolean isHellWorld;
-+
-+ /**
-+ * A boolean that tells if a world does not have a sky. Used in calculating weather and skylight
-+ */
- public boolean hasNoSky;
-+
-+ /** Light to brightness conversion table */
- public float[] lightBrightnessTable = new float[16];
-+
-+ /** The id for the dimension (ex. -1: Nether, 0: Overworld, 1: The End) */
- public int dimensionId;
-+
-+ /** Array for sunrise/sunset colors (RGBA) */
- private float[] colorsSunriseSunset = new float[4];
-
-- public final void registerWorld(World var1) {
-- this.worldObj = var1;
-- this.terrainType = var1.getWorldInfo().getTerrainType();
-- this.d = var1.getWorldInfo().getGeneratorOptions();
-+ /**
-+ * associate an existing world with a World provider, and setup its lightbrightness table
-+ */
-+ public final void registerWorld(World par1World) {
-+ this.worldObj = par1World;
-+ this.terrainType = par1World.getWorldInfo().getTerrainType();
-+ this.field_82913_c = par1World.getWorldInfo().getGeneratorOptions();
- this.registerWorldChunkManager();
- this.generateLightBrightnessTable();
- }
-
-+ /**
-+ * Creates the light to brightness table
-+ */
- protected void generateLightBrightnessTable() {
- float var1 = 0.0F;
-
-- for(int var2 = 0; var2 <= 15; ++var2) {
-+ for (int var2 = 0; var2 <= 15; ++var2) {
- float var3 = 1.0F - (float)var2 / 15.0F;
- this.lightBrightnessTable[var2] = (1.0F - var3) / (var3 * 3.0F + 1.0F) * (1.0F - var1) + var1;
- }
--
- }
-
-+ /**
-+ * creates a new world chunk manager for WorldProvider
-+ */
- protected void registerWorldChunkManager() {
-- if(this.worldObj.getWorldInfo().getTerrainType() == WorldType.FLAT) {
-+ if (this.worldObj.getWorldInfo().getTerrainType() == WorldType.FLAT) {
- FlatGeneratorInfo var1 = FlatGeneratorInfo.createFlatGeneratorFromString(this.worldObj.getWorldInfo().getGeneratorOptions());
- this.worldChunkMgr = new WorldChunkManagerHell(BiomeGenBase.biomeList[var1.getBiome()], 0.5F, 0.5F);
- } else {
- this.worldChunkMgr = new WorldChunkManager(this.worldObj);
- }
--
- }
-
-+ /**
-+ * Returns a new chunk provider which generates chunks for this world
-+ */
- public IChunkProvider createChunkGenerator() {
-- return (IChunkProvider)(this.terrainType == WorldType.FLAT ? new ChunkProviderFlat(this.worldObj, this.worldObj.getSeed(), this.worldObj.getWorldInfo().isMapFeaturesEnabled(), this.d) : new ChunkProviderGenerate(this.worldObj, this.worldObj.getSeed(), this.worldObj.getWorldInfo().isMapFeaturesEnabled()));
-+ return (IChunkProvider)(this.terrainType == WorldType.FLAT ? new ChunkProviderFlat(this.worldObj, this.worldObj.getSeed(), this.worldObj.getWorldInfo().isMapFeaturesEnabled(), this.field_82913_c) : new ChunkProviderGenerate(this.worldObj, this.worldObj.getSeed(), this.worldObj.getWorldInfo().isMapFeaturesEnabled()));
- }
-
-- public boolean canCoordinateBeSpawn(int var1, int var2) {
-- int var3 = this.worldObj.getFirstUncoveredBlock(var1, var2);
-+ /**
-+ * Will check if the x, z position specified is alright to be set as the map spawn point
-+ */
-+ public boolean canCoordinateBeSpawn(int par1, int par2) {
-+ int var3 = this.worldObj.getFirstUncoveredBlock(par1, par2);
- return var3 == Block.grass.blockID;
- }
-
-- public float calculateCelestialAngle(long var1, float var3) {
-- int var4 = (int)(var1 % 24000L);
-- float var5 = ((float)var4 + var3) / 24000.0F - 0.25F;
-- if(var5 < 0.0F) {
-+ /**
-+ * Calculates the angle of sun and moon in the sky relative to a specified time (usually worldTime)
-+ */
-+ public float calculateCelestialAngle(long par1, float par3) {
-+ int var4 = (int)(par1 % 24000L);
-+ float var5 = ((float)var4 + par3) / 24000.0F - 0.25F;
-+
-+ if (var5 < 0.0F) {
- ++var5;
- }
-
-- if(var5 > 1.0F) {
-+ if (var5 > 1.0F) {
- --var5;
- }
-
-@@ -66,19 +106,26 @@
- return var5;
- }
-
-- public int getMoonPhase(long var1) {
-- return (int)(var1 / 24000L) % 8;
-+ public int getMoonPhase(long par1) {
-+ return (int)(par1 / 24000L) % 8;
- }
-
-+ /**
-+ * Returns 'true' if in the "main surface world", but 'false' if in the Nether or End dimensions.
-+ */
- public boolean isSurfaceWorld() {
- return true;
- }
-
-- public float[] calcSunriseSunsetColors(float var1, float var2) {
-+ /**
-+ * Returns array with sunrise/sunset colors
-+ */
-+ public float[] calcSunriseSunsetColors(float par1, float par2) {
- float var3 = 0.4F;
-- float var4 = MathHelper.cos(var1 * (float)Math.PI * 2.0F) - 0.0F;
-+ float var4 = MathHelper.cos(par1 * (float)Math.PI * 2.0F) - 0.0F;
- float var5 = -0.0F;
-- if(var4 >= var5 - var3 && var4 <= var5 + var3) {
-+
-+ if (var4 >= var5 - var3 && var4 <= var5 + var3) {
- float var6 = (var4 - var5) / var3 * 0.5F + 0.5F;
- float var7 = 1.0F - (1.0F - MathHelper.sin(var6 * (float)Math.PI)) * 0.99F;
- var7 *= var7;
-@@ -92,33 +139,55 @@
- }
- }
-
-- public Vec3 getFogColor(float var1, float var2) {
-- float var3 = MathHelper.cos(var1 * (float)Math.PI * 2.0F) * 2.0F + 0.5F;
-- if(var3 < 0.0F) {
-+ /**
-+ * Return Vec3D with biome specific fog color
-+ */
-+ public Vec3 getFogColor(float par1, float par2) {
-+ float var3 = MathHelper.cos(par1 * (float)Math.PI * 2.0F) * 2.0F + 0.5F;
-+
-+ if (var3 < 0.0F) {
- var3 = 0.0F;
- }
-
-- if(var3 > 1.0F) {
-+ if (var3 > 1.0F) {
- var3 = 1.0F;
- }
-
-- float var4 = 192.0F / 255.0F;
-- float var5 = 216.0F / 255.0F;
-- float var6 = 1.0F;
-+ // MCPatcher Start
-+ float var4;
-+ float var5;
-+ float var6;
-+
-+ if (ColorizeWorld.computeFogColor(Colorizer.COLOR_MAP_FOG0)) {
-+ var4 = Colorizer.setColor[0];
-+ var5 = Colorizer.setColor[1];
-+ var6 = Colorizer.setColor[2];
-+ } else {
-+ var4 = 0.7529412F;
-+ var5 = 0.84705883F;
-+ var6 = 1.0F;
-+ }
-+ // MCPatcher End
- var4 *= var3 * 0.94F + 0.06F;
- var5 *= var3 * 0.94F + 0.06F;
- var6 *= var3 * 0.91F + 0.09F;
- return this.worldObj.getWorldVec3Pool().getVecFromPool((double)var4, (double)var5, (double)var6);
- }
-
-+ /**
-+ * True if the player can respawn in this dimension (true = overworld, false = nether).
-+ */
- public boolean canRespawnHere() {
- return true;
- }
-
-- public static WorldProvider getProviderForDimension(int var0) {
-- return (WorldProvider)(var0 == -1 ? new WorldProviderHell() : (var0 == 0 ? new WorldProviderSurface() : (var0 == 1 ? new WorldProviderEnd() : null)));
-+ public static WorldProvider getProviderForDimension(int par0) {
-+ return (WorldProvider)(par0 == -1 ? new WorldProviderHell() : (par0 == 0 ? new WorldProviderSurface() : (par0 == 1 ? new WorldProviderEnd() : null)));
- }
-
-+ /**
-+ * the y level at which clouds are rendered.
-+ */
- public float getCloudHeight() {
- return 128.0F;
- }
-@@ -127,6 +196,9 @@
- return true;
- }
-
-+ /**
-+ * Gets the hard-coded portal location to use when entering this dimension.
-+ */
- public ChunkCoordinates getEntrancePortalLocation() {
- return null;
- }
-@@ -135,17 +207,32 @@
- return this.terrainType == WorldType.FLAT ? 4 : 64;
- }
-
-+ /**
-+ * returns true if this dimension is supposed to display void particles and pull in the far plane based on the user's Y
-+ * offset.
-+ */
- public boolean getWorldHasVoidParticles() {
- return this.terrainType != WorldType.FLAT && !this.hasNoSky;
- }
-
-+ /**
-+ * Returns a double value representing the Y value relative to the top of the map at which void fog is at its maximum.
-+ * The default factor of 0.03125 relative to 256, for example, means the void fog will be at its maximum at
-+ * (256*0.03125), or 8.
-+ */
- public double getVoidFogYFactor() {
-- return this.terrainType == WorldType.FLAT ? 1.0D : 1.0D / 32.0D;
-+ return this.terrainType == WorldType.FLAT ? 1.0D : 0.03125D;
- }
-
-- public boolean doesXZShowFog(int var1, int var2) {
-+ /**
-+ * Returns true if the given X,Z coordinate should show environmental fog.
-+ */
-+ public boolean doesXZShowFog(int par1, int par2) {
- return false;
- }
-
-+ /**
-+ * Returns the dimension's name, e.g. "The End", "Nether", or "Overworld".
-+ */
- public abstract String getDimensionName();
- }
---- net/minecraft/src/AnimationMetadataSection.java
-+++ net/minecraft/src/AnimationMetadataSection.java
-@@ -7,16 +7,16 @@
- import java.util.Set;
-
- public class AnimationMetadataSection implements MetadataSection {
-- private final List a;
-+ private final List animationFrames;
- private final int frameWidth;
- private final int frameHeight;
- private final int frameTime;
-
-- public AnimationMetadataSection(List var1, int var2, int var3, int var4) {
-- this.a = var1;
-- this.frameWidth = var2;
-- this.frameHeight = var3;
-- this.frameTime = var4;
-+ 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() {
-@@ -28,35 +28,35 @@
- }
-
- public int getFrameCount() {
-- return this.a.size();
-+ return this.animationFrames.size();
- }
-
- public int getFrameTime() {
- return this.frameTime;
- }
-
-- private AnimationFrame getAnimationFrame(int var1) {
-- return (AnimationFrame)this.a.get(var1);
-+ private AnimationFrame getAnimationFrame(int par1) {
-+ return (AnimationFrame)this.animationFrames.get(par1);
- }
-
-- public int getFrameTimeSingle(int var1) {
-- AnimationFrame var2 = this.getAnimationFrame(var1);
-+ public int getFrameTimeSingle(int par1) {
-+ AnimationFrame var2 = this.getAnimationFrame(par1);
- return var2.hasNoTime() ? this.frameTime : var2.getFrameTime();
- }
-
-- public boolean frameHasTime(int var1) {
-- return !((AnimationFrame)this.a.get(var1)).hasNoTime();
-+ public boolean frameHasTime(int par1) {
-+ return !((AnimationFrame)this.animationFrames.get(par1)).hasNoTime();
- }
-
-- public int getFrameIndex(int var1) {
-- return ((AnimationFrame)this.a.get(var1)).getFrameIndex();
-+ public int getFrameIndex(int par1) {
-+ return ((AnimationFrame)this.animationFrames.get(par1)).getFrameIndex();
- }
-
- public Set getFrameIndexSet() {
- HashSet var1 = Sets.newHashSet();
-- Iterator var2 = this.a.iterator();
-+ Iterator var2 = this.animationFrames.iterator();
-
-- while(var2.hasNext()) {
-+ while (var2.hasNext()) {
- AnimationFrame var3 = (AnimationFrame)var2.next();
- var1.add(Integer.valueOf(var3.getFrameIndex()));
- }
---- net/minecraft/src/EntitySorter.java
-+++ net/minecraft/src/EntitySorter.java
-@@ -3,27 +3,36 @@
- 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 var1) {
-- this.entityPosX = -var1.posX;
-- this.entityPosY = -var1.posY;
-- this.entityPosZ = -var1.posZ;
-+ public EntitySorter(Entity par1Entity) {
-+ this.entityPosX = -par1Entity.posX;
-+ this.entityPosY = -par1Entity.posY;
-+ this.entityPosZ = -par1Entity.posZ;
- }
-
-- public int sortByDistanceToEntity(WorldRenderer var1, WorldRenderer var2) {
-- double var3 = (double)var1.posXPlus + this.entityPosX;
-- double var5 = (double)var1.posYPlus + this.entityPosY;
-- double var7 = (double)var1.posZPlus + this.entityPosZ;
-- double var9 = (double)var2.posXPlus + this.entityPosX;
-- double var11 = (double)var2.posYPlus + this.entityPosY;
-- double var13 = (double)var2.posZPlus + this.entityPosZ;
-+ /**
-+ * 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 var1, Object var2) {
-- return this.sortByDistanceToEntity((WorldRenderer)var1, (WorldRenderer)var2);
-+ public int compare(Object par1Obj, Object par2Obj) {
-+ return this.sortByDistanceToEntity((WorldRenderer)par1Obj, (WorldRenderer)par2Obj);
- }
- }
---- net/minecraft/src/PotionEffect.java
-+++ net/minecraft/src/PotionEffect.java
-@@ -1,50 +1,68 @@
- package net.minecraft.src;
-
- public class PotionEffect {
-+
-+ /** ID value of the potion this effect matches. */
- private int potionID;
-+
-+ /** The duration of the potion effect */
- private int duration;
-+
-+ /** The amplifier of the potion effect */
- private int amplifier;
-+
-+ /** Whether the potion is a splash potion */
- 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 var1, int var2) {
-- this(var1, var2, 0);
-- }
--
-- public PotionEffect(int var1, int var2, int var3) {
-- this(var1, var2, var3, false);
-- }
--
-- public PotionEffect(int var1, int var2, int var3, boolean var4) {
-- this.potionID = var1;
-- this.duration = var2;
-- this.amplifier = var3;
-- this.isAmbient = var4;
-- }
--
-- public PotionEffect(PotionEffect var1) {
-- this.potionID = var1.potionID;
-- this.duration = var1.duration;
-- this.amplifier = var1.amplifier;
-- }
--
-- public void combine(PotionEffect var1) {
-- if(this.potionID != var1.potionID) {
-+ public PotionEffect(int par1, int par2) {
-+ this(par1, par2, 0);
-+ }
-+
-+ public PotionEffect(int par1, int par2, int par3) {
-+ this(par1, par2, par3, false);
-+ }
-+
-+ public PotionEffect(int par1, int par2, int par3, boolean par4) {
-+ this.potionID = par1;
-+ this.duration = par2;
-+ this.amplifier = par3;
-+ this.isAmbient = par4;
-+ }
-+
-+ public PotionEffect(PotionEffect par1PotionEffect) {
-+ this.potionID = par1PotionEffect.potionID;
-+ this.duration = par1PotionEffect.duration;
-+ this.amplifier = par1PotionEffect.amplifier;
-+ }
-+
-+ /**
-+ * merges the input PotionEffect into this one if this.amplifier <= tomerge.amplifier. The duration in the supplied
-+ * potion effect is assumed to be greater.
-+ */
-+ public void combine(PotionEffect par1PotionEffect) {
-+ if (this.potionID != par1PotionEffect.potionID) {
- System.err.println("This method should only be called for matching effects!");
- }
-
-- if(var1.amplifier > this.amplifier) {
-- this.amplifier = var1.amplifier;
-- this.duration = var1.duration;
-- } else if(var1.amplifier == this.amplifier && this.duration < var1.duration) {
-- this.duration = var1.duration;
-- } else if(!var1.isAmbient && this.isAmbient) {
-- this.isAmbient = var1.isAmbient;
-+ if (par1PotionEffect.amplifier > this.amplifier) {
-+ this.amplifier = par1PotionEffect.amplifier;
-+ this.duration = par1PotionEffect.duration;
-+ } else if (par1PotionEffect.amplifier == this.amplifier && this.duration < par1PotionEffect.duration) {
-+ this.duration = par1PotionEffect.duration;
-+ } else if (!par1PotionEffect.isAmbient && this.isAmbient) {
-+ this.isAmbient = par1PotionEffect.isAmbient;
- }
--
- }
-
-+ /**
-+ * Retrieve the ID of the potion this effect matches.
-+ */
- public int getPotionID() {
- return this.potionID;
- }
-@@ -57,18 +75,24 @@
- return this.amplifier;
- }
-
-- public void setSplashPotion(boolean var1) {
-- this.isSplashPotion = var1;
-+ /**
-+ * Set whether this potion is a splash potion.
-+ */
-+ public void setSplashPotion(boolean par1) {
-+ this.isSplashPotion = par1;
- }
-
-+ /**
-+ * Gets whether this potion effect originated from a beacon
-+ */
- public boolean getIsAmbient() {
- return this.isAmbient;
- }
-
-- public boolean onUpdate(EntityLivingBase var1) {
-- if(this.duration > 0) {
-- if(Potion.potionTypes[this.potionID].isReady(this.duration, this.amplifier)) {
-- this.performEffect(var1);
-+ public boolean onUpdate(EntityLivingBase par1EntityLivingBase) {
-+ if (this.duration > 0) {
-+ if (Potion.potionTypes[this.potionID].isReady(this.duration, this.amplifier)) {
-+ this.performEffect(par1EntityLivingBase);
- }
-
- this.deincrementDuration();
-@@ -81,11 +105,10 @@
- return --this.duration;
- }
-
-- public void performEffect(EntityLivingBase var1) {
-- if(this.duration > 0) {
-- Potion.potionTypes[this.potionID].performEffect(var1, this.amplifier);
-+ public void performEffect(EntityLivingBase par1EntityLivingBase) {
-+ if (this.duration > 0) {
-+ Potion.potionTypes[this.potionID].performEffect(par1EntityLivingBase, this.amplifier);
- }
--
- }
-
- public String getEffectName() {
-@@ -98,46 +121,56 @@
-
- public String toString() {
- String var1 = "";
-- if(this.getAmplifier() > 0) {
-+
-+ if (this.getAmplifier() > 0) {
- var1 = this.getEffectName() + " x " + (this.getAmplifier() + 1) + ", Duration: " + this.getDuration();
- } else {
- var1 = this.getEffectName() + ", Duration: " + this.getDuration();
- }
-
-- if(this.isSplashPotion) {
-+ if (this.isSplashPotion) {
- var1 = var1 + ", Splash: true";
- }
-
- return Potion.potionTypes[this.potionID].isUsable() ? "(" + var1 + ")" : var1;
- }
-
-- public boolean equals(Object var1) {
-- if(!(var1 instanceof PotionEffect)) {
-+ public boolean equals(Object par1Obj) {
-+ if (!(par1Obj instanceof PotionEffect)) {
- return false;
- } else {
-- PotionEffect var2 = (PotionEffect)var1;
-+ PotionEffect var2 = (PotionEffect)par1Obj;
- return this.potionID == var2.potionID && this.amplifier == var2.amplifier && this.duration == var2.duration && this.isSplashPotion == var2.isSplashPotion && this.isAmbient == var2.isAmbient;
- }
- }
-
-- public NBTTagCompound writeCustomPotionEffectToNBT(NBTTagCompound var1) {
-- var1.setByte("Id", (byte)this.getPotionID());
-- var1.setByte("Amplifier", (byte)this.getAmplifier());
-- var1.setInteger("Duration", this.getDuration());
-- var1.setBoolean("Ambient", this.getIsAmbient());
-- return var1;
-+ /**
-+ * Write a custom potion effect to a potion item's NBT data.
-+ */
-+ public NBTTagCompound writeCustomPotionEffectToNBT(NBTTagCompound par1NBTTagCompound) {
-+ par1NBTTagCompound.setByte("Id", (byte)this.getPotionID());
-+ par1NBTTagCompound.setByte("Amplifier", (byte)this.getAmplifier());
-+ par1NBTTagCompound.setInteger("Duration", this.getDuration());
-+ par1NBTTagCompound.setBoolean("Ambient", this.getIsAmbient());
-+ return par1NBTTagCompound;
- }
-
-- public static PotionEffect readCustomPotionEffectFromNBT(NBTTagCompound var0) {
-- byte var1 = var0.getByte("Id");
-- byte var2 = var0.getByte("Amplifier");
-- int var3 = var0.getInteger("Duration");
-- boolean var4 = var0.getBoolean("Ambient");
-+ /**
-+ * Read a custom potion effect from a potion item's NBT data.
-+ */
-+ public static PotionEffect readCustomPotionEffectFromNBT(NBTTagCompound par0NBTTagCompound) {
-+ 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);
- }
-
-- public void setPotionDurationMax(boolean var1) {
-- this.isPotionDurationMax = var1;
-+ /**
-+ * Toggle the isPotionDurationMax field.
-+ */
-+ public void setPotionDurationMax(boolean par1) {
-+ this.isPotionDurationMax = par1;
- }
-
- public boolean getIsPotionDurationMax() {
---- net/minecraft/src/BlockPumpkin.java
-+++ net/minecraft/src/BlockPumpkin.java
-@@ -1,91 +1,112 @@
- package net.minecraft.src;
-
- 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 var1, boolean var2) {
-- super(var1, Material.pumpkin);
-+ protected BlockPumpkin(int par1, boolean par2) {
-+ super(par1, Material.pumpkin);
- this.setTickRandomly(true);
-- this.blockType = var2;
-+ this.blockType = par2;
- this.setCreativeTab(CreativeTabs.tabBlock);
- }
-
-- public Icon getIcon(int var1, int var2) {
-- return var1 == 1 ? this.field_94474_b : (var1 == 0 ? this.field_94474_b : (var2 == 2 && var1 == 2 ? this.field_94475_c : (var2 == 3 && var1 == 5 ? this.field_94475_c : (var2 == 0 && var1 == 3 ? this.field_94475_c : (var2 == 1 && var1 == 4 ? this.field_94475_c : this.blockIcon)))));
-+ /**
-+ * 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)))));
- }
-
-- public void onBlockAdded(World var1, int var2, int var3, int var4) {
-- super.onBlockAdded(var1, var2, var3, var4);
-- if(var1.getBlockId(var2, var3 - 1, var4) == Block.blockSnow.blockID && var1.getBlockId(var2, var3 - 2, var4) == Block.blockSnow.blockID) {
-- if(!var1.isRemote) {
-- var1.setBlock(var2, var3, var4, 0, 0, 2);
-- var1.setBlock(var2, var3 - 1, var4, 0, 0, 2);
-- var1.setBlock(var2, var3 - 2, var4, 0, 0, 2);
-- EntitySnowman var9 = new EntitySnowman(var1);
-- var9.setLocationAndAngles((double)var2 + 0.5D, (double)var3 - 1.95D, (double)var4 + 0.5D, 0.0F, 0.0F);
-- var1.spawnEntityInWorld(var9);
-- var1.notifyBlockChange(var2, var3, var4, 0);
-- var1.notifyBlockChange(var2, var3 - 1, var4, 0);
-- var1.notifyBlockChange(var2, var3 - 2, var4, 0);
-- }
--
-- for(int var10 = 0; var10 < 120; ++var10) {
-- var1.spawnParticle("snowshovel", (double)var2 + var1.s.nextDouble(), (double)(var3 - 2) + var1.s.nextDouble() * 2.5D, (double)var4 + var1.s.nextDouble(), 0.0D, 0.0D, 0.0D);
-- }
-- } else if(var1.getBlockId(var2, var3 - 1, var4) == Block.blockIron.blockID && var1.getBlockId(var2, var3 - 2, var4) == Block.blockIron.blockID) {
-- boolean var5 = var1.getBlockId(var2 - 1, var3 - 1, var4) == Block.blockIron.blockID && var1.getBlockId(var2 + 1, var3 - 1, var4) == Block.blockIron.blockID;
-- boolean var6 = var1.getBlockId(var2, var3 - 1, var4 - 1) == Block.blockIron.blockID && var1.getBlockId(var2, var3 - 1, var4 + 1) == Block.blockIron.blockID;
-- if(var5 || var6) {
-- var1.setBlock(var2, var3, var4, 0, 0, 2);
-- var1.setBlock(var2, var3 - 1, var4, 0, 0, 2);
-- var1.setBlock(var2, var3 - 2, var4, 0, 0, 2);
-- if(var5) {
-- var1.setBlock(var2 - 1, var3 - 1, var4, 0, 0, 2);
-- var1.setBlock(var2 + 1, var3 - 1, var4, 0, 0, 2);
-+ /**
-+ * 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);
-+
-+ if (par1World.getBlockId(par2, par3 - 1, par4) == Block.blockSnow.blockID && par1World.getBlockId(par2, par3 - 2, par4) == Block.blockSnow.blockID) {
-+ if (!par1World.isRemote) {
-+ par1World.setBlock(par2, par3, par4, 0, 0, 2);
-+ par1World.setBlock(par2, par3 - 1, par4, 0, 0, 2);
-+ par1World.setBlock(par2, par3 - 2, par4, 0, 0, 2);
-+ EntitySnowman var9 = new EntitySnowman(par1World);
-+ var9.setLocationAndAngles((double)par2 + 0.5D, (double)par3 - 1.95D, (double)par4 + 0.5D, 0.0F, 0.0F);
-+ par1World.spawnEntityInWorld(var9);
-+ par1World.notifyBlockChange(par2, par3, par4, 0);
-+ par1World.notifyBlockChange(par2, par3 - 1, par4, 0);
-+ par1World.notifyBlockChange(par2, par3 - 2, par4, 0);
-+ }
-+
-+ for (int var10 = 0; var10 < 120; ++var10) {
-+ par1World.spawnParticle("snowshovel", (double)par2 + par1World.rand.nextDouble(), (double)(par3 - 2) + par1World.rand.nextDouble() * 2.5D, (double)par4 + par1World.rand.nextDouble(), 0.0D, 0.0D, 0.0D);
-+ }
-+ } else if (par1World.getBlockId(par2, par3 - 1, par4) == Block.blockIron.blockID && par1World.getBlockId(par2, par3 - 2, par4) == Block.blockIron.blockID) {
-+ boolean var5 = par1World.getBlockId(par2 - 1, par3 - 1, par4) == Block.blockIron.blockID && par1World.getBlockId(par2 + 1, par3 - 1, par4) == Block.blockIron.blockID;
-+ boolean var6 = par1World.getBlockId(par2, par3 - 1, par4 - 1) == Block.blockIron.blockID && par1World.getBlockId(par2, par3 - 1, par4 + 1) == Block.blockIron.blockID;
-+
-+ if (var5 || var6) {
-+ par1World.setBlock(par2, par3, par4, 0, 0, 2);
-+ par1World.setBlock(par2, par3 - 1, par4, 0, 0, 2);
-+ par1World.setBlock(par2, par3 - 2, par4, 0, 0, 2);
-+
-+ if (var5) {
-+ par1World.setBlock(par2 - 1, par3 - 1, par4, 0, 0, 2);
-+ par1World.setBlock(par2 + 1, par3 - 1, par4, 0, 0, 2);
- } else {
-- var1.setBlock(var2, var3 - 1, var4 - 1, 0, 0, 2);
-- var1.setBlock(var2, var3 - 1, var4 + 1, 0, 0, 2);
-+ par1World.setBlock(par2, par3 - 1, par4 - 1, 0, 0, 2);
-+ par1World.setBlock(par2, par3 - 1, par4 + 1, 0, 0, 2);
- }
-
-- EntityIronGolem var7 = new EntityIronGolem(var1);
-+ EntityIronGolem var7 = new EntityIronGolem(par1World);
- var7.setPlayerCreated(true);
-- var7.setLocationAndAngles((double)var2 + 0.5D, (double)var3 - 1.95D, (double)var4 + 0.5D, 0.0F, 0.0F);
-- var1.spawnEntityInWorld(var7);
-+ var7.setLocationAndAngles((double)par2 + 0.5D, (double)par3 - 1.95D, (double)par4 + 0.5D, 0.0F, 0.0F);
-+ par1World.spawnEntityInWorld(var7);
-
-- for(int var8 = 0; var8 < 120; ++var8) {
-- var1.spawnParticle("snowballpoof", (double)var2 + var1.s.nextDouble(), (double)(var3 - 2) + var1.s.nextDouble() * 3.9D, (double)var4 + var1.s.nextDouble(), 0.0D, 0.0D, 0.0D);
-+ for (int var8 = 0; var8 < 120; ++var8) {
-+ par1World.spawnParticle("snowballpoof", (double)par2 + par1World.rand.nextDouble(), (double)(par3 - 2) + par1World.rand.nextDouble() * 3.9D, (double)par4 + par1World.rand.nextDouble(), 0.0D, 0.0D, 0.0D);
- }
-
-- var1.notifyBlockChange(var2, var3, var4, 0);
-- var1.notifyBlockChange(var2, var3 - 1, var4, 0);
-- var1.notifyBlockChange(var2, var3 - 2, var4, 0);
-- if(var5) {
-- var1.notifyBlockChange(var2 - 1, var3 - 1, var4, 0);
-- var1.notifyBlockChange(var2 + 1, var3 - 1, var4, 0);
-+ par1World.notifyBlockChange(par2, par3, par4, 0);
-+ par1World.notifyBlockChange(par2, par3 - 1, par4, 0);
-+ par1World.notifyBlockChange(par2, par3 - 2, par4, 0);
-+
-+ if (var5) {
-+ par1World.notifyBlockChange(par2 - 1, par3 - 1, par4, 0);
-+ par1World.notifyBlockChange(par2 + 1, par3 - 1, par4, 0);
- } else {
-- var1.notifyBlockChange(var2, var3 - 1, var4 - 1, 0);
-- var1.notifyBlockChange(var2, var3 - 1, var4 + 1, 0);
-+ par1World.notifyBlockChange(par2, par3 - 1, par4 - 1, 0);
-+ par1World.notifyBlockChange(par2, par3 - 1, par4 + 1, 0);
- }
- }
- }
--
-- }
--
-- public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) {
-- int var5 = var1.getBlockId(var2, var3, var4);
-- return (var5 == 0 || Block.blocksList[var5].blockMaterial.isReplaceable()) && var1.doesBlockHaveSolidTopSurface(var2, var3 - 1, var4);
-- }
--
-- public void onBlockPlacedBy(World var1, int var2, int var3, int var4, EntityLivingBase var5, ItemStack var6) {
-- int var7 = MathHelper.floor_double((double)(var5.rotationYaw * 4.0F / 360.0F) + 2.5D) & 3;
-- var1.setBlockMetadata(var2, var3, var4, var7, 2);
-- }
--
-- public void registerIcons(IconRegister var1) {
-- this.field_94475_c = var1.registerIcon(this.getTextureName() + "_face_" + (this.blockType ? "on" : "off"));
-- this.field_94474_b = var1.registerIcon(this.getTextureName() + "_top");
-- this.blockIcon = var1.registerIcon(this.getTextureName() + "_side");
-+ }
-+
-+ /**
-+ * 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) {
-+ int var5 = par1World.getBlockId(par2, par3, par4);
-+ return (var5 == 0 || Block.blocksList[var5].blockMaterial.isReplaceable()) && par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4);
-+ }
-+
-+ /**
-+ * 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");
- }
- }
---- net/minecraft/src/Vec3.java
-+++ net/minecraft/src/Vec3.java
-@@ -1,120 +1,177 @@
- package net.minecraft.src;
-
- public class Vec3 {
-+
-+ /**
-+ * A global Vec3Pool that always creates new vectors instead of reusing them and is thread-safe.
-+ */
- public static final Vec3Pool fakePool = new Vec3Pool(-1, -1);
- public final Vec3Pool myVec3LocalPool;
-+
-+ /** X coordinate of Vec3D */
- public double xCoord;
-+
-+ /** Y coordinate of Vec3D */
- public double yCoord;
-+
-+ /** Z coordinate of Vec3D */
- public double zCoord;
-
-- public static Vec3 createVectorHelper(double var0, double var2, double var4) {
-- return new Vec3(fakePool, var0, var2, var4);
-- }
--
-- protected Vec3(Vec3Pool var1, double var2, double var4, double var6) {
-- if(var2 == -0.0D) {
-- var2 = 0.0D;
-- }
--
-- if(var4 == -0.0D) {
-- var4 = 0.0D;
-- }
--
-- if(var6 == -0.0D) {
-- var6 = 0.0D;
-- }
--
-- this.xCoord = var2;
-- this.yCoord = var4;
-- this.zCoord = var6;
-- this.myVec3LocalPool = var1;
-- }
--
-- protected Vec3 setComponents(double var1, double var3, double var5) {
-- this.xCoord = var1;
-- this.yCoord = var3;
-- this.zCoord = var5;
-+ /**
-+ * Static method for creating a new Vec3D given the three x,y,z values. This is only called from the other static
-+ * method which creates and places it in the list.
-+ */
-+ public static Vec3 createVectorHelper(double par0, double par2, double par4) {
-+ return new Vec3(fakePool, par0, par2, par4);
-+ }
-+
-+ protected Vec3(Vec3Pool par1Vec3Pool, double par2, double par4, double par6) {
-+ if (par2 == -0.0D) {
-+ par2 = 0.0D;
-+ }
-+
-+ if (par4 == -0.0D) {
-+ par4 = 0.0D;
-+ }
-+
-+ if (par6 == -0.0D) {
-+ par6 = 0.0D;
-+ }
-+
-+ this.xCoord = par2;
-+ this.yCoord = par4;
-+ this.zCoord = par6;
-+ this.myVec3LocalPool = par1Vec3Pool;
-+ }
-+
-+ /**
-+ * Sets the x,y,z components of the vector as specified.
-+ */
-+ protected Vec3 setComponents(double par1, double par3, double par5) {
-+ this.xCoord = par1;
-+ this.yCoord = par3;
-+ this.zCoord = par5;
- return this;
- }
-
-- public Vec3 subtract(Vec3 var1) {
-- return this.myVec3LocalPool.getVecFromPool(var1.xCoord - this.xCoord, var1.yCoord - this.yCoord, var1.zCoord - this.zCoord);
-+ /**
-+ * Returns a new vector with the result of the specified vector minus this.
-+ */
-+ public Vec3 subtract(Vec3 par1Vec3) {
-+ return this.myVec3LocalPool.getVecFromPool(par1Vec3.xCoord - this.xCoord, par1Vec3.yCoord - this.yCoord, par1Vec3.zCoord - this.zCoord);
- }
-
-+ /**
-+ * Normalizes the vector to a length of 1 (except if it is the zero vector)
-+ */
- public Vec3 normalize() {
- double var1 = (double)MathHelper.sqrt_double(this.xCoord * this.xCoord + this.yCoord * this.yCoord + this.zCoord * this.zCoord);
- return var1 < 1.0E-4D ? this.myVec3LocalPool.getVecFromPool(0.0D, 0.0D, 0.0D) : this.myVec3LocalPool.getVecFromPool(this.xCoord / var1, this.yCoord / var1, this.zCoord / var1);
- }
-
-- public double dotProduct(Vec3 var1) {
-- return this.xCoord * var1.xCoord + this.yCoord * var1.yCoord + this.zCoord * var1.zCoord;
-- }
--
-- public Vec3 crossProduct(Vec3 var1) {
-- return this.myVec3LocalPool.getVecFromPool(this.yCoord * var1.zCoord - this.zCoord * var1.yCoord, this.zCoord * var1.xCoord - this.xCoord * var1.zCoord, this.xCoord * var1.yCoord - this.yCoord * var1.xCoord);
-- }
--
-- public Vec3 addVector(double var1, double var3, double var5) {
-- return this.myVec3LocalPool.getVecFromPool(this.xCoord + var1, this.yCoord + var3, this.zCoord + var5);
-- }
--
-- public double distanceTo(Vec3 var1) {
-- double var2 = var1.xCoord - this.xCoord;
-- double var4 = var1.yCoord - this.yCoord;
-- double var6 = var1.zCoord - this.zCoord;
-+ public double dotProduct(Vec3 par1Vec3) {
-+ return this.xCoord * par1Vec3.xCoord + this.yCoord * par1Vec3.yCoord + this.zCoord * par1Vec3.zCoord;
-+ }
-+
-+ /**
-+ * Returns a new vector with the result of this vector x the specified vector.
-+ */
-+ public Vec3 crossProduct(Vec3 par1Vec3) {
-+ return this.myVec3LocalPool.getVecFromPool(this.yCoord * par1Vec3.zCoord - this.zCoord * par1Vec3.yCoord, this.zCoord * par1Vec3.xCoord - this.xCoord * par1Vec3.zCoord, this.xCoord * par1Vec3.yCoord - this.yCoord * par1Vec3.xCoord);
-+ }
-+
-+ /**
-+ * Adds the specified x,y,z vector components to this vector and returns the resulting vector. Does not change this
-+ * vector.
-+ */
-+ public Vec3 addVector(double par1, double par3, double par5) {
-+ return this.myVec3LocalPool.getVecFromPool(this.xCoord + par1, this.yCoord + par3, this.zCoord + par5);
-+ }
-+
-+ /**
-+ * Euclidean distance between this and the specified vector, returned as double.
-+ */
-+ public double distanceTo(Vec3 par1Vec3) {
-+ double var2 = par1Vec3.xCoord - this.xCoord;
-+ double var4 = par1Vec3.yCoord - this.yCoord;
-+ double var6 = par1Vec3.zCoord - this.zCoord;
- return (double)MathHelper.sqrt_double(var2 * var2 + var4 * var4 + var6 * var6);
- }
-
-- public double squareDistanceTo(Vec3 var1) {
-- double var2 = var1.xCoord - this.xCoord;
-- double var4 = var1.yCoord - this.yCoord;
-- double var6 = var1.zCoord - this.zCoord;
-+ /**
-+ * The square of the Euclidean distance between this and the specified vector.
-+ */
-+ public double squareDistanceTo(Vec3 par1Vec3) {
-+ double var2 = par1Vec3.xCoord - this.xCoord;
-+ double var4 = par1Vec3.yCoord - this.yCoord;
-+ double var6 = par1Vec3.zCoord - this.zCoord;
- return var2 * var2 + var4 * var4 + var6 * var6;
- }
-
-- public double squareDistanceTo(double var1, double var3, double var5) {
-- double var7 = var1 - this.xCoord;
-- double var9 = var3 - this.yCoord;
-- double var11 = var5 - this.zCoord;
-+ /**
-+ * The square of the Euclidean distance between this and the vector of x,y,z components passed in.
-+ */
-+ public double squareDistanceTo(double par1, double par3, double par5) {
-+ double var7 = par1 - this.xCoord;
-+ double var9 = par3 - this.yCoord;
-+ double var11 = par5 - this.zCoord;
- return var7 * var7 + var9 * var9 + var11 * var11;
- }
-
-+ /**
-+ * Returns the length of the vector.
-+ */
- public double lengthVector() {
- return (double)MathHelper.sqrt_double(this.xCoord * this.xCoord + this.yCoord * this.yCoord + this.zCoord * this.zCoord);
- }
-
-- public Vec3 getIntermediateWithXValue(Vec3 var1, double var2) {
-- double var4 = var1.xCoord - this.xCoord;
-- double var6 = var1.yCoord - this.yCoord;
-- double var8 = var1.zCoord - this.zCoord;
-- if(var4 * var4 < (double)1.0E-7F) {
-- return null;
-- } else {
-- double var10 = (var2 - this.xCoord) / var4;
-- return var10 >= 0.0D && var10 <= 1.0D ? this.myVec3LocalPool.getVecFromPool(this.xCoord + var4 * var10, this.yCoord + var6 * var10, this.zCoord + var8 * var10) : null;
-- }
-- }
--
-- public Vec3 getIntermediateWithYValue(Vec3 var1, double var2) {
-- double var4 = var1.xCoord - this.xCoord;
-- double var6 = var1.yCoord - this.yCoord;
-- double var8 = var1.zCoord - this.zCoord;
-- if(var6 * var6 < (double)1.0E-7F) {
-- return null;
-- } else {
-- double var10 = (var2 - this.yCoord) / var6;
-- return var10 >= 0.0D && var10 <= 1.0D ? this.myVec3LocalPool.getVecFromPool(this.xCoord + var4 * var10, this.yCoord + var6 * var10, this.zCoord + var8 * var10) : null;
-- }
-- }
--
-- public Vec3 getIntermediateWithZValue(Vec3 var1, double var2) {
-- double var4 = var1.xCoord - this.xCoord;
-- double var6 = var1.yCoord - this.yCoord;
-- double var8 = var1.zCoord - this.zCoord;
-- if(var8 * var8 < (double)1.0E-7F) {
-- return null;
-- } else {
-- double var10 = (var2 - this.zCoord) / var8;
-+ /**
-+ * Returns a new vector with x value equal to the second parameter, along the line between this vector and the passed
-+ * in vector, or null if not possible.
-+ */
-+ public Vec3 getIntermediateWithXValue(Vec3 par1Vec3, double par2) {
-+ double var4 = par1Vec3.xCoord - this.xCoord;
-+ double var6 = par1Vec3.yCoord - this.yCoord;
-+ double var8 = par1Vec3.zCoord - this.zCoord;
-+
-+ if (var4 * var4 < 1.0000000116860974E-7D) {
-+ return null;
-+ } else {
-+ double var10 = (par2 - this.xCoord) / var4;
-+ return var10 >= 0.0D && var10 <= 1.0D ? this.myVec3LocalPool.getVecFromPool(this.xCoord + var4 * var10, this.yCoord + var6 * var10, this.zCoord + var8 * var10) : null;
-+ }
-+ }
-+
-+ /**
-+ * Returns a new vector with y value equal to the second parameter, along the line between this vector and the passed
-+ * in vector, or null if not possible.
-+ */
-+ public Vec3 getIntermediateWithYValue(Vec3 par1Vec3, double par2) {
-+ double var4 = par1Vec3.xCoord - this.xCoord;
-+ double var6 = par1Vec3.yCoord - this.yCoord;
-+ double var8 = par1Vec3.zCoord - this.zCoord;
-+
-+ if (var6 * var6 < 1.0000000116860974E-7D) {
-+ return null;
-+ } else {
-+ double var10 = (par2 - this.yCoord) / var6;
-+ return var10 >= 0.0D && var10 <= 1.0D ? this.myVec3LocalPool.getVecFromPool(this.xCoord + var4 * var10, this.yCoord + var6 * var10, this.zCoord + var8 * var10) : null;
-+ }
-+ }
-+
-+ /**
-+ * Returns a new vector with z value equal to the second parameter, along the line between this vector and the passed
-+ * in vector, or null if not possible.
-+ */
-+ public Vec3 getIntermediateWithZValue(Vec3 par1Vec3, double par2) {
-+ double var4 = par1Vec3.xCoord - this.xCoord;
-+ double var6 = par1Vec3.yCoord - this.yCoord;
-+ double var8 = par1Vec3.zCoord - this.zCoord;
-+
-+ if (var8 * var8 < 1.0000000116860974E-7D) {
-+ return null;
-+ } else {
-+ double var10 = (par2 - this.zCoord) / var8;
- return var10 >= 0.0D && var10 <= 1.0D ? this.myVec3LocalPool.getVecFromPool(this.xCoord + var4 * var10, this.yCoord + var6 * var10, this.zCoord + var8 * var10) : null;
- }
- }
-@@ -123,9 +180,12 @@
- return "(" + this.xCoord + ", " + this.yCoord + ", " + this.zCoord + ")";
- }
-
-- public void rotateAroundX(float var1) {
-- float var2 = MathHelper.cos(var1);
-- float var3 = MathHelper.sin(var1);
-+ /**
-+ * Rotates the vector around the x axis by the specified angle.
-+ */
-+ public void rotateAroundX(float par1) {
-+ float var2 = MathHelper.cos(par1);
-+ float var3 = MathHelper.sin(par1);
- double var4 = this.xCoord;
- double var6 = this.yCoord * (double)var2 + this.zCoord * (double)var3;
- double var8 = this.zCoord * (double)var2 - this.yCoord * (double)var3;
-@@ -134,9 +194,12 @@
- this.zCoord = var8;
- }
-
-- public void rotateAroundY(float var1) {
-- float var2 = MathHelper.cos(var1);
-- float var3 = MathHelper.sin(var1);
-+ /**
-+ * Rotates the vector around the y axis by the specified angle.
-+ */
-+ public void rotateAroundY(float par1) {
-+ float var2 = MathHelper.cos(par1);
-+ float var3 = MathHelper.sin(par1);
- double var4 = this.xCoord * (double)var2 + this.zCoord * (double)var3;
- double var6 = this.yCoord;
- double var8 = this.zCoord * (double)var2 - this.xCoord * (double)var3;
-@@ -145,9 +208,12 @@
- this.zCoord = var8;
- }
-
-- public void rotateAroundZ(float var1) {
-- float var2 = MathHelper.cos(var1);
-- float var3 = MathHelper.sin(var1);
-+ /**
-+ * Rotates the vector around the z axis by the specified angle.
-+ */
-+ public void rotateAroundZ(float par1) {
-+ float var2 = MathHelper.cos(par1);
-+ float var3 = MathHelper.sin(par1);
- double var4 = this.xCoord * (double)var2 + this.yCoord * (double)var3;
- double var6 = this.yCoord * (double)var2 - this.xCoord * (double)var3;
- double var8 = this.zCoord;
---- /dev/null
-+++ org/spoutcraft/api/block/design/Vertex.java
-@@ -1,0 +1,117 @@
-+/*
-+ * This file is part of Spoutcraft.
-+ *
-+ * Copyright (c) 2011 SpoutcraftDev
-+ * Spoutcraft is licensed under the GNU Lesser General Public License.
-+ *
-+ * Spoutcraft is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation, either version 3 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Spoutcraft is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program. If not, see .
-+ */
-+package org.spoutcraft.api.block.design;
-+
-+public class Vertex {
-+ private SubTexture texture;
-+ private int index;
-+ private int quad;
-+ private float x;
-+ private float y;
-+ private float z;
-+ private int tx;
-+ private int ty;
-+
-+ private Vertex(int index, int quad, float x, float y, float z) {
-+ if (index < 0 || index > 3) {
-+ throw new IllegalArgumentException("Invalid vertex index: " + index);
-+ }
-+ this.index = index;
-+ this.quad = quad;
-+ this.x = x;
-+ this.y = y;
-+ this.z = z;
-+ }
-+
-+ public Vertex(int index, int quad, float x, float y, float z, SubTexture texture) {
-+ this(index, quad, x, y, z);
-+
-+ this.setSubTexture(texture);
-+ }
-+
-+ public Vertex(int index, int quad, float x, float y, float z, int tx, int ty) {
-+ this(index, quad, x, y, z);
-+ this.tx = tx;
-+ this.ty = ty;
-+ }
-+
-+ public Vertex setSubTexture(SubTexture texture) {
-+ this.texture = texture;
-+
-+ switch (this.index) {
-+ case 0:
-+ this.tx = texture.getXLoc();
-+ this.ty = texture.getYLoc();
-+ break;
-+ case 1:
-+ this.tx = texture.getXLoc();
-+ this.ty = texture.getYTopLoc();
-+ break;
-+ case 2:
-+ this.tx = texture.getXTopLoc();
-+ this.ty = texture.getYTopLoc();
-+ break;
-+ case 3:
-+ this.tx = texture.getXTopLoc();
-+ this.ty = texture.getYLoc();
-+ }
-+
-+ return this;
-+ }
-+
-+ public int getIndex() {
-+ return index;
-+ }
-+ public SubTexture getSubTexture() {
-+ return texture;
-+ }
-+
-+ public float getX() {
-+ return x;
-+ }
-+
-+ public float getY() {
-+ return y;
-+ }
-+
-+ public float getZ() {
-+ return z;
-+ }
-+
-+ public int getTextureX() {
-+ return tx;
-+ }
-+
-+ public int getTextureY() {
-+ return ty;
-+ }
-+
-+ public int getTextureWidth() {
-+ return texture.getParent().getWidth();
-+ }
-+
-+ public int getTextureHeight() {
-+ return texture.getParent().getHeight();
-+ }
-+
-+ public int getQuadNum() {
-+ return quad;
-+ }
-+}
---- /dev/null
-+++ org/spoutcraft/api/material/Block.java
-@@ -1,0 +1,44 @@
-+/*
-+ * This file is part of Spoutcraft.
-+ *
-+ * Copyright (c) 2011 SpoutcraftDev
-+ * Spoutcraft is licensed under the GNU Lesser General Public License.
-+ *
-+ * Spoutcraft is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation, either version 3 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Spoutcraft is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program. If not, see .
-+ */
-+package org.spoutcraft.api.material;
-+
-+import org.spoutcraft.api.block.design.BlockDesign;
-+
-+public interface Block extends Material{
-+ public float getFriction();
-+
-+ public Block setFriction(float slip);
-+
-+ public float getHardness();
-+
-+ public Block setHardness(float hardness);
-+
-+ public boolean isOpaque();
-+
-+ public Block setOpaque(boolean opaque);
-+
-+ public int getLightLevel();
-+
-+ public Block setLightLevel(int level);
-+
-+ public BlockDesign getBlockDesign();
-+
-+ public Block setBlockDesign(BlockDesign design);
-+}
---- net/minecraft/src/EntityEnderPearl.java
-+++ net/minecraft/src/EntityEnderPearl.java
-@@ -1,32 +1,36 @@
- package net.minecraft.src;
-
- public class EntityEnderPearl extends EntityThrowable {
-- public EntityEnderPearl(World var1) {
-- super(var1);
-- }
--
-- public EntityEnderPearl(World var1, EntityLivingBase var2) {
-- super(var1, var2);
-- }
--
-- public EntityEnderPearl(World var1, double var2, double var4, double var6) {
-- super(var1, var2, var4, var6);
-- }
--
-- protected void onImpact(MovingObjectPosition var1) {
-- if(var1.entityHit != null) {
-- var1.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), 0.0F);
-- }
--
-- for(int var2 = 0; var2 < 32; ++var2) {
-- this.worldObj.spawnParticle("portal", this.posX, this.posY + this.ab.nextDouble() * 2.0D, this.posZ, this.ab.nextGaussian(), 0.0D, this.ab.nextGaussian());
-- }
--
-- if(!this.worldObj.isRemote) {
-- if(this.getThrower() != null && this.getThrower() instanceof EntityPlayerMP) {
-+ public EntityEnderPearl(World par1World) {
-+ super(par1World);
-+ }
-+
-+ 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) {
-+ if (par1MovingObjectPosition.entityHit != null) {
-+ par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), 0.0F);
-+ }
-+
-+ for (int var2 = 0; var2 < 32; ++var2) {
-+ this.worldObj.spawnParticle("portal", this.posX, this.posY + this.rand.nextDouble() * 2.0D, this.posZ, this.rand.nextGaussian(), 0.0D, this.rand.nextGaussian());
-+ }
-+
-+ if (!this.worldObj.isRemote) {
-+ if (this.getThrower() != null && this.getThrower() instanceof EntityPlayerMP) {
- EntityPlayerMP var3 = (EntityPlayerMP)this.getThrower();
-- if(!var3.playerNetServerHandler.connectionClosed && var3.worldObj == this.worldObj) {
-- if(this.getThrower().isRiding()) {
-+
-+ if (!var3.playerNetServerHandler.connectionClosed && var3.worldObj == this.worldObj) {
-+ if (this.getThrower().isRiding()) {
- this.getThrower().mountEntity((Entity)null);
- }
-
-@@ -38,6 +42,5 @@
-
- this.setDead();
- }
--
- }
- }
---- net/minecraft/src/RenderLeashKnot.java
-+++ net/minecraft/src/RenderLeashKnot.java
-@@ -7,28 +7,37 @@
- private static final ResourceLocation leashKnotTextures = new ResourceLocation("textures/entity/lead_knot.png");
- private ModelLeashKnot leashKnotModel = new ModelLeashKnot();
-
-- public void func_110799_a(EntityLeashKnot var1, double var2, double var4, double var6, float var8, float var9) {
-+ public void func_110799_a(EntityLeashKnot par1EntityLeashKnot, double par2, double par4, double par6, float par8, float par9) {
- GL11.glPushMatrix();
- GL11.glDisable(GL11.GL_CULL_FACE);
-- GL11.glTranslatef((float)var2, (float)var4, (float)var6);
-- float var10 = 1.0F / 16.0F;
-+ GL11.glTranslatef((float)par2, (float)par4, (float)par6);
-+ float var10 = 0.0625F;
- GL11.glEnable(GL12.GL_RESCALE_NORMAL);
- GL11.glScalef(-1.0F, -1.0F, 1.0F);
- GL11.glEnable(GL11.GL_ALPHA_TEST);
-- this.bindEntityTexture(var1);
-- this.leashKnotModel.render(var1, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, var10);
-+ this.bindEntityTexture(par1EntityLeashKnot);
-+ this.leashKnotModel.render(par1EntityLeashKnot, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, var10);
- GL11.glPopMatrix();
- }
-
-- protected ResourceLocation getLeashKnotTextures(EntityLeashKnot var1) {
-+ protected ResourceLocation getLeashKnotTextures(EntityLeashKnot par1EntityLeashKnot) {
- return leashKnotTextures;
- }
-
-- protected ResourceLocation getEntityTexture(Entity var1) {
-- return this.getLeashKnotTextures((EntityLeashKnot)var1);
-+ /**
-+ * 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.getLeashKnotTextures((EntityLeashKnot)par1Entity);
- }
-
-- public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) {
-- this.func_110799_a((EntityLeashKnot)var1, var2, var4, var6, var8, var9);
-+ /**
-+ * 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) {
-+ if (var2 > 1.0F) {
- var2 = 1.0F;
- }
-
-- int var3 = super.getBrightnessForRender(var1);
-+ int var3 = super.getBrightnessForRender(par1);
- int var4 = var3 & 255;
- int var5 = var3 >> 16 & 255;
- var4 += (int)(var2 * 15.0F * 16.0F);
-- if(var4 > 240) {
-+
-+ if (var4 > 240) {
- var4 = 240;
- }
-
- return var4 | var5 << 16;
- }
-
-- public float getBrightness(float var1) {
-- float var2 = ((float)this.particleAge + var1) / (float)this.particleMaxAge;
-- if(var2 < 0.0F) {
-+ /**
-+ * 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) {
-+ if (var2 > 1.0F) {
- var2 = 1.0F;
- }
-
-- float var3 = super.getBrightness(var1);
-+ 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) {
-+
-+ if (this.particleAge++ >= this.particleMaxAge) {
- this.setDead();
- }
-
- this.moveEntity(this.motionX, this.motionY, this.motionZ);
-- this.motionX *= (double)0.96F;
-- this.motionY *= (double)0.96F;
-- this.motionZ *= (double)0.96F;
-- if(this.onGround) {
-- this.motionX *= (double)0.7F;
-- this.motionZ *= (double)0.7F;
-- }
-+ 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
-+++ org/spoutcraft/client/gui/server/ServerSlot.java
-@@ -1,0 +1,57 @@
-+/*
-+ * This file is part of Spoutcraft.
-+ *
-+ * Copyright (c) 2011 SpoutcraftDev
-+ * Spoutcraft is licensed under the GNU Lesser General Public License.
-+ *
-+ * Spoutcraft is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation, either version 3 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Spoutcraft is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program. If not, see .
-+ */
-+package org.spoutcraft.client.gui.server;
-+
-+public class ServerSlot implements Comparable {
-+ public int ID = 0;
-+ public int uniqueid = 0;
-+ public String ip = "";
-+ public String port = "";
-+ public String name = "";
-+ public int players = 0;
-+ public int maxPlayers = 0;
-+ public String country = "";
-+ public boolean pinging = false;
-+ public long ping = -2L;
-+ public String status = "";
-+ public String msg = "";
-+ public String description = "";
-+ public String site = "";
-+ public String forum = "";
-+ public int loaded = 0;
-+
-+ public ServerSlot(int ID) {
-+ this.ID = ID;
-+ }
-+
-+ public int compareTo(ServerSlot other) {
-+ return other.players - this.players;
-+ }
-+
-+ public String getFullIp() {
-+ return ip + (port.length() > 0 ? ":" : "") + port;
-+ }
-+
-+ // $FF: synthetic method
-+ // $FF: bridge method
-+ public int compareTo(Object other) {
-+ return this.compareTo((ServerSlot)other);
-+ }
-+}
---- net/minecraft/src/GenLayer.java
-+++ net/minecraft/src/GenLayer.java
-@@ -1,12 +1,27 @@
- package net.minecraft.src;
-
- public abstract class GenLayer {
-+
-+ /** seed from World#getWorldSeed that is used in the LCG prng */
- private long worldGenSeed;
-+
-+ /** parent GenLayer that was provided via the constructor */
- protected GenLayer parent;
-+
-+ /**
-+ * final part of the LCG prng that uses the chunk X, Z coords along with the other two seeds to generate pseudorandom
-+ * numbers
-+ */
- private long chunkSeed;
-+
-+ /** base seed to the LCG prng provided via the constructor */
- private long baseSeed;
-
-- public static GenLayer[] initializeAllBiomeGenerators(long var0, WorldType var2) {
-+ /**
-+ * the first array item is a linked list of the bioms, the second is the zoom function, the third is the same as the
-+ * first.
-+ */
-+ public static GenLayer[] initializeAllBiomeGenerators(long par0, WorldType par2WorldType) {
- GenLayerIsland var3 = new GenLayerIsland(1L);
- GenLayerFuzzyZoom var9 = new GenLayerFuzzyZoom(2000L, var3);
- GenLayerAddIsland var10 = new GenLayerAddIsland(1L, var9);
-@@ -19,7 +34,8 @@
- var10 = new GenLayerAddIsland(4L, var11);
- GenLayerAddMushroomIsland var15 = new GenLayerAddMushroomIsland(5L, var10);
- byte var4 = 4;
-- if(var2 == WorldType.LARGE_BIOMES) {
-+
-+ if (par2WorldType == WorldType.LARGE_BIOMES) {
- var4 = 6;
- }
-
-@@ -29,21 +45,22 @@
- GenLayerRiver var14 = new GenLayerRiver(1L, var5);
- GenLayerSmooth var16 = new GenLayerSmooth(1000L, var14);
- GenLayer var6 = GenLayerZoom.magnify(1000L, var15, 0);
-- GenLayerBiome var17 = new GenLayerBiome(200L, var6, var2);
-+ GenLayerBiome var17 = new GenLayerBiome(200L, var6, par2WorldType);
- var6 = GenLayerZoom.magnify(1000L, var17, 2);
- Object var18 = new GenLayerHills(1000L, var6);
-
-- for(int var7 = 0; var7 < var4; ++var7) {
-+ for (int var7 = 0; var7 < var4; ++var7) {
- var18 = new GenLayerZoom((long)(1000 + var7), (GenLayer)var18);
-- if(var7 == 0) {
-+
-+ if (var7 == 0) {
- var18 = new GenLayerAddIsland(3L, (GenLayer)var18);
- }
-
-- if(var7 == 1) {
-+ if (var7 == 1) {
- var18 = new GenLayerShore(1000L, (GenLayer)var18);
- }
-
-- if(var7 == 1) {
-+ if (var7 == 1) {
- var18 = new GenLayerSwampRivers(1000L, (GenLayer)var18);
- }
- }
-@@ -51,25 +68,30 @@
- GenLayerSmooth var19 = new GenLayerSmooth(1000L, (GenLayer)var18);
- GenLayerRiverMix var20 = new GenLayerRiverMix(100L, var19, var16);
- GenLayerVoronoiZoom var8 = new GenLayerVoronoiZoom(10L, var20);
-- var20.initWorldGenSeed(var0);
-- var8.initWorldGenSeed(var0);
-- return new GenLayer[]{var20, var8, var20};
-- }
--
-- public GenLayer(long var1) {
-- this.baseSeed = var1;
-- this.baseSeed *= this.baseSeed * 6364136223846793005L + 1442695040888963407L;
-- this.baseSeed += var1;
-- this.baseSeed *= this.baseSeed * 6364136223846793005L + 1442695040888963407L;
-- this.baseSeed += var1;
-- this.baseSeed *= this.baseSeed * 6364136223846793005L + 1442695040888963407L;
-- this.baseSeed += var1;
-- }
--
-- public void initWorldGenSeed(long var1) {
-- this.worldGenSeed = var1;
-- if(this.parent != null) {
-- this.parent.initWorldGenSeed(var1);
-+ var20.initWorldGenSeed(par0);
-+ var8.initWorldGenSeed(par0);
-+ return new GenLayer[] {var20, var8, var20};
-+ }
-+
-+ public GenLayer(long par1) {
-+ this.baseSeed = par1;
-+ this.baseSeed *= this.baseSeed * 6364136223846793005L + 1442695040888963407L;
-+ this.baseSeed += par1;
-+ this.baseSeed *= this.baseSeed * 6364136223846793005L + 1442695040888963407L;
-+ this.baseSeed += par1;
-+ this.baseSeed *= this.baseSeed * 6364136223846793005L + 1442695040888963407L;
-+ this.baseSeed += par1;
-+ }
-+
-+ /**
-+ * Initialize layer's local worldGenSeed based on its own baseSeed and the world's global seed (passed in as an
-+ * argument).
-+ */
-+ public void initWorldGenSeed(long par1) {
-+ this.worldGenSeed = par1;
-+
-+ if (this.parent != null) {
-+ this.parent.initWorldGenSeed(par1);
- }
-
- this.worldGenSeed *= this.worldGenSeed * 6364136223846793005L + 1442695040888963407L;
-@@ -80,22 +102,29 @@
- this.worldGenSeed += this.baseSeed;
- }
-
-- public void initChunkSeed(long var1, long var3) {
-+ /**
-+ * Initialize layer's current chunkSeed based on the local worldGenSeed and the (x,z) chunk coordinates.
-+ */
-+ public void initChunkSeed(long par1, long par3) {
- this.chunkSeed = this.worldGenSeed;
- this.chunkSeed *= this.chunkSeed * 6364136223846793005L + 1442695040888963407L;
-- this.chunkSeed += var1;
-- this.chunkSeed *= this.chunkSeed * 6364136223846793005L + 1442695040888963407L;
-- this.chunkSeed += var3;
-- this.chunkSeed *= this.chunkSeed * 6364136223846793005L + 1442695040888963407L;
-- this.chunkSeed += var1;
-- this.chunkSeed *= this.chunkSeed * 6364136223846793005L + 1442695040888963407L;
-- this.chunkSeed += var3;
-+ this.chunkSeed += par1;
-+ this.chunkSeed *= this.chunkSeed * 6364136223846793005L + 1442695040888963407L;
-+ this.chunkSeed += par3;
-+ this.chunkSeed *= this.chunkSeed * 6364136223846793005L + 1442695040888963407L;
-+ this.chunkSeed += par1;
-+ this.chunkSeed *= this.chunkSeed * 6364136223846793005L + 1442695040888963407L;
-+ this.chunkSeed += par3;
- }
-
-- protected int nextInt(int var1) {
-- int var2 = (int)((this.chunkSeed >> 24) % (long)var1);
-- if(var2 < 0) {
-- var2 += var1;
-+ /**
-+ * returns a LCG pseudo random number from [0, x). Args: int x
-+ */
-+ protected int nextInt(int par1) {
-+ int var2 = (int)((this.chunkSeed >> 24) % (long)par1);
-+
-+ if (var2 < 0) {
-+ var2 += par1;
- }
-
- this.chunkSeed *= this.chunkSeed * 6364136223846793005L + 1442695040888963407L;
-@@ -103,5 +132,9 @@
- return var2;
- }
-
-+ /**
-+ * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall
-+ * amounts, or biomeList[] indices based on the particular GenLayer subclass.
-+ */
- public abstract int[] getInts(int var1, int var2, int var3, int var4);
- }
---- /dev/null
-+++ org/spoutcraft/api/gui/GenericEntityWidget.java
-@@ -1,0 +1,73 @@
-+/*
-+ * This file is part of Spoutcraft.
-+ *
-+ * Copyright (c) 2011 SpoutcraftDev
-+ * Spoutcraft is licensed under the GNU Lesser General Public License.
-+ *
-+ * Spoutcraft is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation, either version 3 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Spoutcraft is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program. If not, see .
-+ */
-+package org.spoutcraft.api.gui;
-+
-+import java.io.IOException;
-+
-+import org.spoutcraft.api.Spoutcraft;
-+import org.spoutcraft.api.UnsafeClass;
-+import org.spoutcraft.api.io.SpoutInputStream;
-+import org.spoutcraft.api.io.SpoutOutputStream;
-+
-+@UnsafeClass
-+public class GenericEntityWidget extends GenericWidget implements EntityWidget {
-+ private int entityId = 0;
-+
-+ public GenericEntityWidget() {
-+ }
-+
-+ public GenericEntityWidget(int entityId) {
-+ this.entityId = entityId;
-+ }
-+
-+ public WidgetType getType() {
-+ return WidgetType.EntityWidget;
-+ }
-+
-+ public EntityWidget setEntityId(int id) {
-+ entityId = id;
-+ return this;
-+ }
-+
-+ public int getEntityId() {
-+ return entityId;
-+ }
-+
-+ @Override
-+ public void readData(SpoutInputStream input) throws IOException {
-+ super.readData(input);
-+ entityId = input.readInt();
-+ }
-+
-+ @Override
-+ public void writeData(SpoutOutputStream output) throws IOException {
-+ super.writeData(output);
-+ output.writeInt(entityId);
-+ }
-+
-+ @Override
-+ public EntityWidget copy() {
-+ return ((EntityWidget)super.copy()).setEntityId(getEntityId());
-+ }
-+
-+ public void render() {
-+ Spoutcraft.getClient().getRenderDelegate().render(this);
-+ }
-+}
---- net/minecraft/src/NoiseGeneratorPerlin.java
-+++ net/minecraft/src/NoiseGeneratorPerlin.java
-@@ -12,45 +12,49 @@
- this(new Random());
- }
-
-- public NoiseGeneratorPerlin(Random var1) {
-+ public NoiseGeneratorPerlin(Random par1Random) {
- this.permutations = new int[512];
-- this.xCoord = var1.nextDouble() * 256.0D;
-- this.yCoord = var1.nextDouble() * 256.0D;
-- this.zCoord = var1.nextDouble() * 256.0D;
--
-+ this.xCoord = par1Random.nextDouble() * 256.0D;
-+ this.yCoord = par1Random.nextDouble() * 256.0D;
-+ this.zCoord = par1Random.nextDouble() * 256.0D;
- int var2;
-- for(var2 = 0; var2 < 256; this.permutations[var2] = var2++) {
-+
-+ for (var2 = 0; var2 < 256; this.permutations[var2] = var2++) {
-+ ;
- }
-
-- for(var2 = 0; var2 < 256; ++var2) {
-- int var3 = var1.nextInt(256 - var2) + var2;
-+ for (var2 = 0; var2 < 256; ++var2) {
-+ int var3 = par1Random.nextInt(256 - var2) + var2;
- int var4 = this.permutations[var2];
- this.permutations[var2] = this.permutations[var3];
- this.permutations[var3] = var4;
- this.permutations[var2 + 256] = this.permutations[var2];
- }
--
-- }
--
-- public final double lerp(double var1, double var3, double var5) {
-- return var3 + var1 * (var5 - var3);
-- }
--
-- public final double func_76309_a(int var1, double var2, double var4) {
-- int var6 = var1 & 15;
-- double var7 = (double)(1 - ((var6 & 8) >> 3)) * var2;
-- double var9 = var6 < 4 ? 0.0D : (var6 != 12 && var6 != 14 ? var4 : var2);
-+ }
-+
-+ public final double lerp(double par1, double par3, double par5) {
-+ return par3 + par1 * (par5 - par3);
-+ }
-+
-+ public final double func_76309_a(int par1, double par2, double par4) {
-+ int var6 = par1 & 15;
-+ double var7 = (double)(1 - ((var6 & 8) >> 3)) * par2;
-+ double var9 = var6 < 4 ? 0.0D : (var6 != 12 && var6 != 14 ? par4 : par2);
- return ((var6 & 1) == 0 ? var7 : -var7) + ((var6 & 2) == 0 ? var9 : -var9);
- }
-
-- public final double grad(int var1, double var2, double var4, double var6) {
-- int var8 = var1 & 15;
-- double var9 = var8 < 8 ? var2 : var4;
-- double var11 = var8 < 4 ? var4 : (var8 != 12 && var8 != 14 ? var6 : var2);
-+ public final double grad(int par1, double par2, double par4, double par6) {
-+ int var8 = par1 & 15;
-+ double var9 = var8 < 8 ? par2 : par4;
-+ double var11 = var8 < 4 ? par4 : (var8 != 12 && var8 != 14 ? par6 : par2);
- return ((var8 & 1) == 0 ? var9 : -var9) + ((var8 & 2) == 0 ? var11 : -var11);
- }
-
-- public void populateNoiseArray(double[] var1, double var2, double var4, double var6, int var8, int var9, int var10, double var11, double var13, double var15, double var17) {
-+ /**
-+ * pars: noiseArray , xOffset , yOffset , zOffset , xSize , ySize , zSize , xScale, yScale , zScale , noiseScale.
-+ * noiseArray should be xSize*ySize*zSize in size
-+ */
-+ public void populateNoiseArray(double[] par1ArrayOfDouble, double par2, double par4, double par6, int par8, int par9, int par10, double par11, double par13, double par15, double par17) {
- int var10001;
- int var19;
- int var22;
-@@ -62,7 +66,8 @@
- int var41;
- double var42;
- int var75;
-- if(var9 == 1) {
-+
-+ if (par9 == 1) {
- boolean var64 = false;
- boolean var65 = false;
- boolean var21 = false;
-@@ -70,12 +75,13 @@
- double var70 = 0.0D;
- double var73 = 0.0D;
- var75 = 0;
-- double var77 = 1.0D / var17;
-+ double var77 = 1.0D / par17;
-
-- for(int var30 = 0; var30 < var8; ++var30) {
-- var31 = var2 + (double)var30 * var11 + this.xCoord;
-+ for (int var30 = 0; var30 < par8; ++var30) {
-+ var31 = par2 + (double)var30 * par11 + this.xCoord;
- int var78 = (int)var31;
-- if(var31 < (double)var78) {
-+
-+ if (var31 < (double)var78) {
- --var78;
- }
-
-@@ -83,10 +89,11 @@
- var31 -= (double)var78;
- var35 = var31 * var31 * var31 * (var31 * (var31 * 6.0D - 15.0D) + 10.0D);
-
-- for(var37 = 0; var37 < var10; ++var37) {
-- var38 = var6 + (double)var37 * var15 + this.zCoord;
-+ for (var37 = 0; var37 < par10; ++var37) {
-+ var38 = par6 + (double)var37 * par15 + this.zCoord;
- var40 = (int)var38;
-- if(var38 < (double)var40) {
-+
-+ if (var38 < (double)var40) {
- --var40;
- }
-
-@@ -101,13 +108,12 @@
- var73 = this.lerp(var35, this.grad(this.permutations[var66 + 1], var31, 0.0D, var38 - 1.0D), this.grad(this.permutations[var22 + 1], var31 - 1.0D, 0.0D, var38 - 1.0D));
- double var79 = this.lerp(var42, var70, var73);
- var10001 = var75++;
-- var1[var10001] += var79 * var77;
-+ par1ArrayOfDouble[var10001] += var79 * var77;
- }
- }
--
- } else {
- var19 = 0;
-- double var20 = 1.0D / var17;
-+ double var20 = 1.0D / par17;
- var22 = -1;
- boolean var23 = false;
- boolean var24 = false;
-@@ -120,10 +126,11 @@
- double var33 = 0.0D;
- var35 = 0.0D;
-
-- for(var37 = 0; var37 < var8; ++var37) {
-- var38 = var2 + (double)var37 * var11 + this.xCoord;
-+ for (var37 = 0; var37 < par8; ++var37) {
-+ var38 = par2 + (double)var37 * par11 + this.xCoord;
- var40 = (int)var38;
-- if(var38 < (double)var40) {
-+
-+ if (var38 < (double)var40) {
- --var40;
- }
-
-@@ -131,10 +138,11 @@
- var38 -= (double)var40;
- var42 = var38 * var38 * var38 * (var38 * (var38 * 6.0D - 15.0D) + 10.0D);
-
-- for(int var44 = 0; var44 < var10; ++var44) {
-- double var45 = var6 + (double)var44 * var15 + this.zCoord;
-+ for (int var44 = 0; var44 < par10; ++var44) {
-+ double var45 = par6 + (double)var44 * par15 + this.zCoord;
- int var47 = (int)var45;
-- if(var45 < (double)var47) {
-+
-+ if (var45 < (double)var47) {
- --var47;
- }
-
-@@ -142,17 +150,19 @@
- var45 -= (double)var47;
- double var49 = var45 * var45 * var45 * (var45 * (var45 * 6.0D - 15.0D) + 10.0D);
-
-- for(int var51 = 0; var51 < var9; ++var51) {
-- double var52 = var4 + (double)var51 * var13 + this.yCoord;
-+ for (int var51 = 0; var51 < par9; ++var51) {
-+ double var52 = par4 + (double)var51 * par13 + this.yCoord;
- int var54 = (int)var52;
-- if(var52 < (double)var54) {
-+
-+ if (var52 < (double)var54) {
- --var54;
- }
-
- int var55 = var54 & 255;
- var52 -= (double)var54;
- double var56 = var52 * var52 * var52 * (var52 * (var52 * 6.0D - 15.0D) + 10.0D);
-- if(var51 == 0 || var55 != var22) {
-+
-+ if (var51 == 0 || var55 != var22) {
- var22 = var55;
- int var69 = this.permutations[var41] + var55;
- int var71 = this.permutations[var69] + var48;
-@@ -170,11 +180,10 @@
- double var60 = this.lerp(var56, var33, var35);
- double var62 = this.lerp(var49, var58, var60);
- var10001 = var19++;
-- var1[var10001] += var62 * var20;
-+ par1ArrayOfDouble[var10001] += var62 * var20;
- }
- }
- }
--
- }
- }
- }
---- /dev/null
-+++ org/spoutcraft/api/TreeType.java
-@@ -1,0 +1,31 @@
-+/*
-+ * This file is part of Spoutcraft.
-+ *
-+ * Copyright (c) 2011 SpoutcraftDev
-+ * Spoutcraft is licensed under the GNU Lesser General Public License.
-+ *
-+ * Spoutcraft is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation, either version 3 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Spoutcraft is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program. If not, see .
-+ */
-+package org.spoutcraft.api;
-+
-+/**
-+ * Tree type.
-+ */
-+public enum TreeType {
-+ TREE,
-+ BIG_TREE,
-+ REDWOOD,
-+ TALL_REDWOOD,
-+ BIRCH
-+}
---- net/minecraft/src/ComponentNetherBridgePiece.java
-+++ net/minecraft/src/ComponentNetherBridgePiece.java
-@@ -5,29 +5,27 @@
- import java.util.Random;
-
- abstract class ComponentNetherBridgePiece extends StructureComponent {
-- protected static final WeightedRandomChestContent[] field_111019_a = new WeightedRandomChestContent[]{new WeightedRandomChestContent(Item.diamond.itemID, 0, 1, 3, 5), new WeightedRandomChestContent(Item.ingotIron.itemID, 0, 1, 5, 5), new WeightedRandomChestContent(Item.ingotGold.itemID, 0, 1, 3, 15), new WeightedRandomChestContent(Item.swordGold.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.plateGold.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.flintAndSteel.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.netherStalkSeeds.itemID, 0, 3, 7, 5), new WeightedRandomChestContent(Item.saddle.itemID, 0, 1, 1, 10), new WeightedRandomChestContent(Item.horseArmorGold.itemID, 0, 1, 1, 8), new WeightedRandomChestContent(Item.horseArmorIron.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.horseArmorDiamond.itemID, 0, 1, 1, 3)};
--
-- public ComponentNetherBridgePiece() {
-- }
--
-- protected ComponentNetherBridgePiece(int var1) {
-- super(var1);
-- }
--
-- protected void func_143011_b(NBTTagCompound var1) {
-- }
--
-- protected void func_143012_a(NBTTagCompound var1) {
-- }
--
-- private int getTotalWeight(List var1) {
-+ protected static final WeightedRandomChestContent[] field_111019_a = new WeightedRandomChestContent[] {new WeightedRandomChestContent(Item.diamond.itemID, 0, 1, 3, 5), new WeightedRandomChestContent(Item.ingotIron.itemID, 0, 1, 5, 5), new WeightedRandomChestContent(Item.ingotGold.itemID, 0, 1, 3, 15), new WeightedRandomChestContent(Item.swordGold.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.plateGold.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.flintAndSteel.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.netherStalkSeeds.itemID, 0, 3, 7, 5), new WeightedRandomChestContent(Item.saddle.itemID, 0, 1, 1, 10), new WeightedRandomChestContent(Item.horseArmorGold.itemID, 0, 1, 1, 8), new WeightedRandomChestContent(Item.horseArmorIron.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.horseArmorDiamond.itemID, 0, 1, 1, 3)};
-+
-+ public ComponentNetherBridgePiece() {}
-+
-+ protected ComponentNetherBridgePiece(int par1) {
-+ super(par1);
-+ }
-+
-+ protected void func_143011_b(NBTTagCompound par1NBTTagCompound) {}
-+
-+ protected void func_143012_a(NBTTagCompound par1NBTTagCompound) {}
-+
-+ private int getTotalWeight(List par1List) {
- boolean var2 = false;
- int var3 = 0;
--
- StructureNetherBridgePieceWeight var5;
-- for(Iterator var4 = var1.iterator(); var4.hasNext(); var3 += var5.field_78826_b) {
-+
-+ for (Iterator var4 = par1List.iterator(); var4.hasNext(); var3 += var5.field_78826_b) {
- var5 = (StructureNetherBridgePieceWeight)var4.next();
-- if(var5.field_78824_d > 0 && var5.field_78827_c < var5.field_78824_d) {
-+
-+ if (var5.field_78824_d > 0 && var5.field_78827_c < var5.field_78824_d) {
- var2 = true;
- }
- }
-@@ -35,30 +33,33 @@
- return var2 ? var3 : -1;
- }
-
-- private ComponentNetherBridgePiece getNextComponent(ComponentNetherBridgeStartPiece var1, List var2, List var3, Random var4, int var5, int var6, int var7, int var8, int var9) {
-- int var10 = this.getTotalWeight(var2);
-- boolean var11 = var10 > 0 && var9 <= 30;
-+ private ComponentNetherBridgePiece getNextComponent(ComponentNetherBridgeStartPiece par1ComponentNetherBridgeStartPiece, List par2List, List par3List, Random par4Random, int par5, int par6, int par7, int par8, int par9) {
-+ int var10 = this.getTotalWeight(par2List);
-+ boolean var11 = var10 > 0 && par9 <= 30;
- int var12 = 0;
-
-- while(var12 < 5 && var11) {
-+ while (var12 < 5 && var11) {
- ++var12;
-- int var13 = var4.nextInt(var10);
-- Iterator var14 = var2.iterator();
-+ int var13 = par4Random.nextInt(var10);
-+ Iterator var14 = par2List.iterator();
-
-- while(var14.hasNext()) {
-+ while (var14.hasNext()) {
- StructureNetherBridgePieceWeight var15 = (StructureNetherBridgePieceWeight)var14.next();
- var13 -= var15.field_78826_b;
-- if(var13 < 0) {
-- if(!var15.func_78822_a(var9) || var15 == var1.theNetherBridgePieceWeight && !var15.field_78825_e) {
-+
-+ if (var13 < 0) {
-+ if (!var15.func_78822_a(par9) || var15 == par1ComponentNetherBridgeStartPiece.theNetherBridgePieceWeight && !var15.field_78825_e) {
- break;
- }
-
-- ComponentNetherBridgePiece var16 = StructureNetherBridgePieces.createNextComponent(var15, var3, var4, var5, var6, var7, var8, var9);
-- if(var16 != null) {
-+ ComponentNetherBridgePiece var16 = StructureNetherBridgePieces.createNextComponent(var15, par3List, par4Random, par5, par6, par7, par8, par9);
-+
-+ if (var16 != null) {
- ++var15.field_78827_c;
-- var1.theNetherBridgePieceWeight = var15;
-- if(!var15.func_78823_a()) {
-- var2.remove(var15);
-+ par1ComponentNetherBridgeStartPiece.theNetherBridgePieceWeight = var15;
-+
-+ if (!var15.func_78823_a()) {
-+ par2List.remove(var15);
- }
-
- return var16;
-@@ -67,74 +68,103 @@
- }
- }
-
-- return ComponentNetherBridgeEnd.func_74971_a(var3, var4, var5, var6, var7, var8, var9);
-+ return ComponentNetherBridgeEnd.func_74971_a(par3List, par4Random, par5, par6, par7, par8, par9);
- }
-
-- private StructureComponent getNextComponent(ComponentNetherBridgeStartPiece var1, List var2, Random var3, int var4, int var5, int var6, int var7, int var8, boolean var9) {
-- if(Math.abs(var4 - var1.getBoundingBox().minX) <= 112 && Math.abs(var6 - var1.getBoundingBox().minZ) <= 112) {
-- List var10 = var1.c;
-- if(var9) {
-- var10 = var1.d;
-+ /**
-+ * Finds a random component to tack on to the bridge. Or builds the end.
-+ */
-+ private StructureComponent getNextComponent(ComponentNetherBridgeStartPiece par1ComponentNetherBridgeStartPiece, List par2List, Random par3Random, int par4, int par5, int par6, int par7, int par8, boolean par9) {
-+ if (Math.abs(par4 - par1ComponentNetherBridgeStartPiece.getBoundingBox().minX) <= 112 && Math.abs(par6 - par1ComponentNetherBridgeStartPiece.getBoundingBox().minZ) <= 112) {
-+ List var10 = par1ComponentNetherBridgeStartPiece.primaryWeights;
-+
-+ if (par9) {
-+ var10 = par1ComponentNetherBridgeStartPiece.secondaryWeights;
- }
-
-- ComponentNetherBridgePiece var11 = this.getNextComponent(var1, var10, var2, var3, var4, var5, var6, var7, var8 + 1);
-- if(var11 != null) {
-- var2.add(var11);
-- var1.e.add(var11);
-+ ComponentNetherBridgePiece var11 = this.getNextComponent(par1ComponentNetherBridgeStartPiece, var10, par2List, par3Random, par4, par5, par6, par7, par8 + 1);
-+
-+ if (var11 != null) {
-+ par2List.add(var11);
-+ par1ComponentNetherBridgeStartPiece.field_74967_d.add(var11);
- }
-
- return var11;
- } else {
-- return ComponentNetherBridgeEnd.func_74971_a(var2, var3, var4, var5, var6, var7, var8);
-- }
-- }
--
-- protected StructureComponent getNextComponentNormal(ComponentNetherBridgeStartPiece var1, List var2, Random var3, int var4, int var5, boolean var6) {
-- switch(this.coordBaseMode) {
-- case 0:
-- return this.getNextComponent(var1, var2, var3, this.boundingBox.minX + var4, this.boundingBox.minY + var5, this.boundingBox.maxZ + 1, this.coordBaseMode, this.getComponentType(), var6);
-- case 1:
-- return this.getNextComponent(var1, var2, var3, this.boundingBox.minX - 1, this.boundingBox.minY + var5, this.boundingBox.minZ + var4, this.coordBaseMode, this.getComponentType(), var6);
-- case 2:
-- return this.getNextComponent(var1, var2, var3, this.boundingBox.minX + var4, this.boundingBox.minY + var5, this.boundingBox.minZ - 1, this.coordBaseMode, this.getComponentType(), var6);
-- case 3:
-- return this.getNextComponent(var1, var2, var3, this.boundingBox.maxX + 1, this.boundingBox.minY + var5, this.boundingBox.minZ + var4, this.coordBaseMode, this.getComponentType(), var6);
-- default:
-- return null;
-- }
-- }
--
-- protected StructureComponent getNextComponentX(ComponentNetherBridgeStartPiece var1, List var2, Random var3, int var4, int var5, boolean var6) {
-- switch(this.coordBaseMode) {
-- case 0:
-- return this.getNextComponent(var1, var2, var3, this.boundingBox.minX - 1, this.boundingBox.minY + var4, this.boundingBox.minZ + var5, 1, this.getComponentType(), var6);
-- case 1:
-- return this.getNextComponent(var1, var2, var3, this.boundingBox.minX + var5, this.boundingBox.minY + var4, this.boundingBox.minZ - 1, 2, this.getComponentType(), var6);
-- case 2:
-- return this.getNextComponent(var1, var2, var3, this.boundingBox.minX - 1, this.boundingBox.minY + var4, this.boundingBox.minZ + var5, 1, this.getComponentType(), var6);
-- case 3:
-- return this.getNextComponent(var1, var2, var3, this.boundingBox.minX + var5, this.boundingBox.minY + var4, this.boundingBox.minZ - 1, 2, this.getComponentType(), var6);
-- default:
-- return null;
-- }
-- }
--
-- protected StructureComponent getNextComponentZ(ComponentNetherBridgeStartPiece var1, List var2, Random var3, int var4, int var5, boolean var6) {
-- switch(this.coordBaseMode) {
-- case 0:
-- return this.getNextComponent(var1, var2, var3, this.boundingBox.maxX + 1, this.boundingBox.minY + var4, this.boundingBox.minZ + var5, 3, this.getComponentType(), var6);
-- case 1:
-- return this.getNextComponent(var1, var2, var3, this.boundingBox.minX + var5, this.boundingBox.minY + var4, this.boundingBox.maxZ + 1, 0, this.getComponentType(), var6);
-- case 2:
-- return this.getNextComponent(var1, var2, var3, this.boundingBox.maxX + 1, this.boundingBox.minY + var4, this.boundingBox.minZ + var5, 3, this.getComponentType(), var6);
-- case 3:
-- return this.getNextComponent(var1, var2, var3, this.boundingBox.minX + var5, this.boundingBox.minY + var4, this.boundingBox.maxZ + 1, 0, this.getComponentType(), var6);
-- default:
-- return null;
-- }
-- }
--
-- protected static boolean isAboveGround(StructureBoundingBox var0) {
-- return var0 != null && var0.minY > 10;
-+ return ComponentNetherBridgeEnd.func_74971_a(par2List, par3Random, par4, par5, par6, par7, par8);
-+ }
-+ }
-+
-+ /**
-+ * Gets the next component in any cardinal direction
-+ */
-+ protected StructureComponent getNextComponentNormal(ComponentNetherBridgeStartPiece par1ComponentNetherBridgeStartPiece, List par2List, Random par3Random, int par4, int par5, boolean par6) {
-+ switch (this.coordBaseMode) {
-+ case 0:
-+ return this.getNextComponent(par1ComponentNetherBridgeStartPiece, par2List, par3Random, this.boundingBox.minX + par4, this.boundingBox.minY + par5, this.boundingBox.maxZ + 1, this.coordBaseMode, this.getComponentType(), par6);
-+
-+ case 1:
-+ return this.getNextComponent(par1ComponentNetherBridgeStartPiece, par2List, par3Random, this.boundingBox.minX - 1, this.boundingBox.minY + par5, this.boundingBox.minZ + par4, this.coordBaseMode, this.getComponentType(), par6);
-+
-+ case 2:
-+ return this.getNextComponent(par1ComponentNetherBridgeStartPiece, par2List, par3Random, this.boundingBox.minX + par4, this.boundingBox.minY + par5, this.boundingBox.minZ - 1, this.coordBaseMode, this.getComponentType(), par6);
-+
-+ case 3:
-+ return this.getNextComponent(par1ComponentNetherBridgeStartPiece, par2List, par3Random, this.boundingBox.maxX + 1, this.boundingBox.minY + par5, this.boundingBox.minZ + par4, this.coordBaseMode, this.getComponentType(), par6);
-+
-+ default:
-+ return null;
-+ }
-+ }
-+
-+ /**
-+ * Gets the next component in the +/- X direction
-+ */
-+ protected StructureComponent getNextComponentX(ComponentNetherBridgeStartPiece par1ComponentNetherBridgeStartPiece, List par2List, Random par3Random, int par4, int par5, boolean par6) {
-+ switch (this.coordBaseMode) {
-+ case 0:
-+ return this.getNextComponent(par1ComponentNetherBridgeStartPiece, par2List, par3Random, this.boundingBox.minX - 1, this.boundingBox.minY + par4, this.boundingBox.minZ + par5, 1, this.getComponentType(), par6);
-+
-+ case 1:
-+ return this.getNextComponent(par1ComponentNetherBridgeStartPiece, par2List, par3Random, this.boundingBox.minX + par5, this.boundingBox.minY + par4, this.boundingBox.minZ - 1, 2, this.getComponentType(), par6);
-+
-+ case 2:
-+ return this.getNextComponent(par1ComponentNetherBridgeStartPiece, par2List, par3Random, this.boundingBox.minX - 1, this.boundingBox.minY + par4, this.boundingBox.minZ + par5, 1, this.getComponentType(), par6);
-+
-+ case 3:
-+ return this.getNextComponent(par1ComponentNetherBridgeStartPiece, par2List, par3Random, this.boundingBox.minX + par5, this.boundingBox.minY + par4, this.boundingBox.minZ - 1, 2, this.getComponentType(), par6);
-+
-+ default:
-+ return null;
-+ }
-+ }
-+
-+ /**
-+ * Gets the next component in the +/- Z direction
-+ */
-+ protected StructureComponent getNextComponentZ(ComponentNetherBridgeStartPiece par1ComponentNetherBridgeStartPiece, List par2List, Random par3Random, int par4, int par5, boolean par6) {
-+ switch (this.coordBaseMode) {
-+ case 0:
-+ return this.getNextComponent(par1ComponentNetherBridgeStartPiece, par2List, par3Random, this.boundingBox.maxX + 1, this.boundingBox.minY + par4, this.boundingBox.minZ + par5, 3, this.getComponentType(), par6);
-+
-+ case 1:
-+ return this.getNextComponent(par1ComponentNetherBridgeStartPiece, par2List, par3Random, this.boundingBox.minX + par5, this.boundingBox.minY + par4, this.boundingBox.maxZ + 1, 0, this.getComponentType(), par6);
-+
-+ case 2:
-+ return this.getNextComponent(par1ComponentNetherBridgeStartPiece, par2List, par3Random, this.boundingBox.maxX + 1, this.boundingBox.minY + par4, this.boundingBox.minZ + par5, 3, this.getComponentType(), par6);
-+
-+ case 3:
-+ return this.getNextComponent(par1ComponentNetherBridgeStartPiece, par2List, par3Random, this.boundingBox.minX + par5, this.boundingBox.minY + par4, this.boundingBox.maxZ + 1, 0, this.getComponentType(), par6);
-+
-+ default:
-+ return null;
-+ }
-+ }
-+
-+ /**
-+ * Checks if the bounding box's minY is > 10
-+ */
-+ protected static boolean isAboveGround(StructureBoundingBox par0StructureBoundingBox) {
-+ return par0StructureBoundingBox != null && par0StructureBoundingBox.minY > 10;
- }
- }
---- /dev/null
-+++ org/spoutcraft/client/entity/CraftCameraEntity.java
-@@ -1,0 +1,60 @@
-+/*
-+ * This file is part of Spoutcraft.
-+ *
-+ * Copyright (c) 2011 SpoutcraftDev
-+ * Spoutcraft is licensed under the GNU Lesser General Public License.
-+ *
-+ * Spoutcraft is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation, either version 3 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Spoutcraft is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program. If not, see .
-+ */
-+package org.spoutcraft.client.entity;
-+
-+import org.spoutcraft.api.property.Property;
-+import org.spoutcraft.api.util.FixedLocation;
-+import org.spoutcraft.api.util.Location;
-+import org.spoutcraft.api.util.Vector;
-+
-+public class CraftCameraEntity extends CraftEntity {
-+ public CraftCameraEntity(FixedLocation location) {
-+ super(location);
-+ handle = new EntityCamera(this);
-+ teleport(location);
-+ addProperty("location", new Property() {
-+ public void set(Object value) {
-+ teleport((Location)value);
-+ }
-+ public Object get() {
-+ return getLocation();
-+ }
-+ });
-+ addProperty("velocity", new Property() {
-+ public void set(Object value) {
-+ setVelocity((Vector)value);
-+ }
-+ public Object get() {
-+ return getVelocity();
-+ }
-+ });
-+ }
-+
-+ @Override
-+ public boolean teleport(FixedLocation location) {
-+ handle.setPositionAndRotation(location.getX(), location.getY(), location.getZ(), (float)location.getYaw(), (float)location.getPitch());
-+ ((EntityCamera)handle).setRotation((float)location.getYaw(), (float)location.getPitch());
-+ return true;
-+ }
-+
-+ public EntityCamera getHandle() {
-+ return (EntityCamera) handle;
-+ }
-+}
---- net/minecraft/src/NBTBase.java
-+++ net/minecraft/src/NBTBase.java
-@@ -5,52 +5,72 @@
- import java.io.IOException;
-
- public abstract class NBTBase {
-- public static final String[] b = new String[]{"END", "BYTE", "SHORT", "INT", "LONG", "FLOAT", "DOUBLE", "BYTE[]", "STRING", "LIST", "COMPOUND", "INT[]"};
-- private String a;
--
-+ public static final String[] NBTTypes = new String[] {"END", "BYTE", "SHORT", "INT", "LONG", "FLOAT", "DOUBLE", "BYTE[]", "STRING", "LIST", "COMPOUND", "INT[]"};
-+
-+ /** The UTF string key used to lookup values. */
-+ private String name;
-+
-+ /**
-+ * Write the actual data contents of the tag, implemented in NBT extension classes
-+ */
- abstract void write(DataOutput var1) throws IOException;
-
-+ /**
-+ * Read the actual data contents of the tag, implemented in NBT extension classes
-+ */
- abstract void load(DataInput var1, int var2) throws IOException;
-
-+ /**
-+ * Gets the type byte for the tag.
-+ */
- public abstract byte getId();
-
-- protected NBTBase(String var1) {
-- if(var1 == null) {
-- this.a = "";
-+ protected NBTBase(String par1Str) {
-+ if (par1Str == null) {
-+ this.name = "";
- } else {
-- this.a = var1;
-+ this.name = par1Str;
- }
--
- }
-
-- public NBTBase setName(String var1) {
-- if(var1 == null) {
-- this.a = "";
-+ /**
-+ * Sets the name for this tag and returns this for convenience.
-+ */
-+ public NBTBase setName(String par1Str) {
-+ if (par1Str == null) {
-+ this.name = "";
- } else {
-- this.a = var1;
-+ this.name = par1Str;
- }
-
- return this;
- }
-
-+ /**
-+ * Gets the name corresponding to the tag, or an empty string if none set.
-+ */
- public String getName() {
-- return this.a == null ? "" : this.a;
-- }
--
-- public static NBTBase readNamedTag(DataInput var0) throws IOException {
-- return func_130104_b(var0, 0);
-- }
--
-- public static NBTBase func_130104_b(DataInput var0, int var1) throws IOException {
-- byte var2 = var0.readByte();
-- if(var2 == 0) {
-+ return this.name == null ? "" : this.name;
-+ }
-+
-+ /**
-+ * Reads and returns a tag from the given DataInput, or the End tag if no tag could be read.
-+ */
-+ public static NBTBase readNamedTag(DataInput par0DataInput) throws IOException {
-+ return func_130104_b(par0DataInput, 0);
-+ }
-+
-+ public static NBTBase func_130104_b(DataInput par0DataInput, int par1) throws IOException {
-+ byte var2 = par0DataInput.readByte();
-+
-+ if (var2 == 0) {
- return new NBTTagEnd();
- } else {
-- String var3 = var0.readUTF();
-+ String var3 = par0DataInput.readUTF();
- NBTBase var4 = newTag(var2, var3);
-
- try {
-- var4.load(var0, var1);
-+ var4.load(par0DataInput, par1);
- return var4;
- } catch (IOException var8) {
- CrashReport var6 = CrashReport.makeCrashReport(var8, "Loading NBT data");
-@@ -62,88 +82,126 @@
- }
- }
-
-- public static void writeNamedTag(NBTBase var0, DataOutput var1) throws IOException {
-- var1.writeByte(var0.getId());
-- if(var0.getId() != 0) {
-- var1.writeUTF(var0.getName());
-- var0.write(var1);
-- }
-- }
--
-- public static NBTBase newTag(byte var0, String var1) {
-- switch(var0) {
-- case 0:
-- return new NBTTagEnd();
-- case 1:
-- return new NBTTagByte(var1);
-- case 2:
-- return new NBTTagShort(var1);
-- case 3:
-- return new NBTTagInt(var1);
-- case 4:
-- return new NBTTagLong(var1);
-- case 5:
-- return new NBTTagFloat(var1);
-- case 6:
-- return new NBTTagDouble(var1);
-- case 7:
-- return new NBTTagByteArray(var1);
-- case 8:
-- return new NBTTagString(var1);
-- case 9:
-- return new NBTTagList(var1);
-- case 10:
-- return new NBTTagCompound(var1);
-- case 11:
-- return new NBTTagIntArray(var1);
-- default:
-- return null;
-- }
-- }
--
-- public static String getTagName(byte var0) {
-- switch(var0) {
-- case 0:
-- return "TAG_End";
-- case 1:
-- return "TAG_Byte";
-- case 2:
-- return "TAG_Short";
-- case 3:
-- return "TAG_Int";
-- case 4:
-- return "TAG_Long";
-- case 5:
-- return "TAG_Float";
-- case 6:
-- return "TAG_Double";
-- case 7:
-- return "TAG_Byte_Array";
-- case 8:
-- return "TAG_String";
-- case 9:
-- return "TAG_List";
-- case 10:
-- return "TAG_Compound";
-- case 11:
-- return "TAG_Int_Array";
-- default:
-- return "UNKNOWN";
-- }
-- }
--
-+ /**
-+ * Writes the specified tag to the given DataOutput, writing the type byte, the UTF string key and then calling the tag
-+ * to write its data.
-+ */
-+ public static void writeNamedTag(NBTBase par0NBTBase, DataOutput par1DataOutput) throws IOException {
-+ par1DataOutput.writeByte(par0NBTBase.getId());
-+
-+ if (par0NBTBase.getId() != 0) {
-+ par1DataOutput.writeUTF(par0NBTBase.getName());
-+ par0NBTBase.write(par1DataOutput);
-+ }
-+ }
-+
-+ /**
-+ * Creates and returns a new tag of the specified type, or null if invalid.
-+ */
-+ public static NBTBase newTag(byte par0, String par1Str) {
-+ switch (par0) {
-+ case 0:
-+ return new NBTTagEnd();
-+
-+ case 1:
-+ return new NBTTagByte(par1Str);
-+
-+ case 2:
-+ return new NBTTagShort(par1Str);
-+
-+ case 3:
-+ return new NBTTagInt(par1Str);
-+
-+ case 4:
-+ return new NBTTagLong(par1Str);
-+
-+ case 5:
-+ return new NBTTagFloat(par1Str);
-+
-+ case 6:
-+ return new NBTTagDouble(par1Str);
-+
-+ case 7:
-+ return new NBTTagByteArray(par1Str);
-+
-+ case 8:
-+ return new NBTTagString(par1Str);
-+
-+ case 9:
-+ return new NBTTagList(par1Str);
-+
-+ case 10:
-+ return new NBTTagCompound(par1Str);
-+
-+ case 11:
-+ return new NBTTagIntArray(par1Str);
-+
-+ default:
-+ return null;
-+ }
-+ }
-+
-+ /**
-+ * Returns the string name of a tag with the specified type, or 'UNKNOWN' if invalid.
-+ */
-+ public static String getTagName(byte par0) {
-+ switch (par0) {
-+ case 0:
-+ return "TAG_End";
-+
-+ case 1:
-+ return "TAG_Byte";
-+
-+ case 2:
-+ return "TAG_Short";
-+
-+ case 3:
-+ return "TAG_Int";
-+
-+ case 4:
-+ return "TAG_Long";
-+
-+ case 5:
-+ return "TAG_Float";
-+
-+ case 6:
-+ return "TAG_Double";
-+
-+ case 7:
-+ return "TAG_Byte_Array";
-+
-+ case 8:
-+ return "TAG_String";
-+
-+ case 9:
-+ return "TAG_List";
-+
-+ case 10:
-+ return "TAG_Compound";
-+
-+ case 11:
-+ return "TAG_Int_Array";
-+
-+ default:
-+ return "UNKNOWN";
-+ }
-+ }
-+
-+ /**
-+ * Creates a clone of the tag.
-+ */
- public abstract NBTBase copy();
-
-- public boolean equals(Object var1) {
-- if(!(var1 instanceof NBTBase)) {
-+ public boolean equals(Object par1Obj) {
-+ if (!(par1Obj instanceof NBTBase)) {
- return false;
- } else {
-- NBTBase var2 = (NBTBase)var1;
-- return this.getId() != var2.getId() ? false : ((this.a != null || var2.a == null) && (this.a == null || var2.a != null) ? this.a == null || this.a.equals(var2.a) : false);
-+ NBTBase var2 = (NBTBase)par1Obj;
-+ return this.getId() != var2.getId() ? false : ((this.name != null || var2.name == null) && (this.name == null || var2.name != null) ? this.name == null || this.name.equals(var2.name) : false);
- }
- }
-
- public int hashCode() {
-- return this.a.hashCode() ^ this.getId();
-+ return this.name.hashCode() ^ this.getId();
- }
- }
---- net/minecraft/src/BlockEventData.java
-+++ net/minecraft/src/BlockEventData.java
-@@ -5,47 +5,69 @@
- private int coordY;
- private int coordZ;
- private int blockID;
-+
-+ /** Different for each blockID */
- private int eventID;
-+
-+ /** Different for each blockID, eventID */
- private int eventParameter;
-
-- public BlockEventData(int var1, int var2, int var3, int var4, int var5, int var6) {
-- this.coordX = var1;
-- this.coordY = var2;
-- this.coordZ = var3;
-- this.eventID = var5;
-- this.eventParameter = var6;
-- this.blockID = var4;
-+ public BlockEventData(int par1, int par2, int par3, int par4, int par5, int par6) {
-+ this.coordX = par1;
-+ this.coordY = par2;
-+ this.coordZ = par3;
-+ this.eventID = par5;
-+ this.eventParameter = par6;
-+ this.blockID = par4;
- }
-
-+ /**
-+ * Get the X coordinate.
-+ */
- public int getX() {
- return this.coordX;
- }
-
-+ /**
-+ * Get the Y coordinate.
-+ */
- public int getY() {
- return this.coordY;
- }
-
-+ /**
-+ * Get the Z coordinate.
-+ */
- public int getZ() {
- return this.coordZ;
- }
-
-+ /**
-+ * Get the Event ID (different for each BlockID)
-+ */
- public int getEventID() {
- return this.eventID;
- }
-
-+ /**
-+ * Get the Event Parameter (different for each BlockID,EventID)
-+ */
- public int getEventParameter() {
- return this.eventParameter;
- }
-
-+ /**
-+ * Gets the BlockID for this BlockEventData
-+ */
- public int getBlockID() {
- return this.blockID;
- }
-
-- public boolean equals(Object var1) {
-- if(!(var1 instanceof BlockEventData)) {
-+ public boolean equals(Object par1Obj) {
-+ if (!(par1Obj instanceof BlockEventData)) {
- return false;
- } else {
-- BlockEventData var2 = (BlockEventData)var1;
-+ BlockEventData var2 = (BlockEventData)par1Obj;
- return this.coordX == var2.coordX && this.coordY == var2.coordY && this.coordZ == var2.coordZ && this.eventID == var2.eventID && this.eventParameter == var2.eventParameter && this.blockID == var2.blockID;
- }
- }
---- /dev/null
-+++ org/spoutcraft/api/util/Vector.java
-@@ -1,0 +1,136 @@
-+/*
-+ * This file is part of Spoutcraft.
-+ *
-+ * Copyright (c) 2011 SpoutcraftDev
-+ * Spoutcraft is licensed under the GNU Lesser General Public License.
-+ *
-+ * Spoutcraft is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation, either version 3 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Spoutcraft is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program. If not, see .
-+ */
-+package org.spoutcraft.api.util;
-+
-+public interface Vector extends FixedVector {
-+ /**
-+ * Set the X component.
-+ *
-+ * @param x
-+ * @return this vector
-+ */
-+ public Vector setX(double x);
-+
-+ /**
-+ * Set the Y component.
-+ *
-+ * @param y
-+ * @return this vector
-+ */
-+ public Vector setY(double y);
-+
-+ /**
-+ * Set the Z component.
-+ *
-+ * @param z
-+ * @return this vector
-+ */
-+ public Vector setZ(double z);
-+
-+ /**
-+ * Adds the vector by another.
-+ *
-+ * @param vec
-+ * @return the same vector
-+ */
-+ public Vector add(Vector vec);
-+
-+ /**
-+ * Subtracts the vector by another.
-+ *
-+ * @param vec
-+ * @return the same vector
-+ */
-+ public Vector subtract(Vector vec);
-+
-+ /**
-+ * Multiplies the vector by another.
-+ *
-+ * @param vec
-+ * @return the same vector
-+ */
-+ public Vector multiply(Vector vec);
-+
-+ /**
-+ * Divides the vector by another.
-+ *
-+ * @param vec
-+ * @return the same vector
-+ */
-+ public Vector divide(Vector vec);
-+
-+ /**
-+ * Copies another vector
-+ *
-+ * @param vec
-+ * @return the same vector
-+ */
-+ public Vector copy(Vector vec);
-+
-+ /**
-+ * Sets this vector to the midpoint between this vector and another.
-+ *
-+ * @param other
-+ * @return this same vector (now a midpoint)
-+ */
-+ public Vector midpoint(Vector other);
-+
-+ /**
-+ * Gets a new midpoint vector between this vector and another.
-+ *
-+ * @param other
-+ * @return a new midpoint vector
-+ */
-+ public Vector getMidpoint(Vector other);
-+
-+ /**
-+ * Performs scalar multiplication, multiplying all components with a scalar.
-+ *
-+ * @param m
-+ * @return the same vector
-+ */
-+ public Vector multiply(double m);
-+
-+ /**
-+ * Calculates the cross product of this vector with another. The cross product is defined as:
-+ *
-+ * x = y1 * z2 - y2 * z1
-+ * y = z1 * x2 - z2 * x1
-+ * z = x1 * y2 - x2 * y1
-+ *
-+ * @param o
-+ * @return the same vector
-+ */
-+ public Vector crossProduct(Vector o);
-+
-+ /**
-+ * Converts this vector to a unit vector (a vector with length of 1).
-+ *
-+ * @return the same vector
-+ */
-+ public Vector normalize();
-+
-+ /**
-+ * Zero this vector's components.
-+ *
-+ * @return the same vector
-+ */
-+ public Vector zero();
-+}
---- net/minecraft/src/ContainerHorseInventorySlotArmor.java
-+++ net/minecraft/src/ContainerHorseInventorySlotArmor.java
-@@ -2,16 +2,20 @@
-
- class ContainerHorseInventorySlotArmor extends Slot {
- final EntityHorse theHorse;
-+
- final ContainerHorseInventory field_111240_b;
-
-- ContainerHorseInventorySlotArmor(ContainerHorseInventory var1, IInventory var2, int var3, int var4, int var5, EntityHorse var6) {
-- super(var2, var3, var4, var5);
-- this.field_111240_b = var1;
-- this.theHorse = var6;
-+ ContainerHorseInventorySlotArmor(ContainerHorseInventory par1ContainerHorseInventory, IInventory par2IInventory, int par3, int par4, int par5, EntityHorse par6EntityHorse) {
-+ super(par2IInventory, par3, par4, par5);
-+ this.field_111240_b = par1ContainerHorseInventory;
-+ this.theHorse = par6EntityHorse;
- }
-
-- public boolean isItemValid(ItemStack var1) {
-- return super.isItemValid(var1) && this.theHorse.func_110259_cr() && EntityHorse.func_110211_v(var1.itemID);
-+ /**
-+ * Check if the stack is a valid item for this slot. Always true beside for the armor slots.
-+ */
-+ 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() {
---- net/minecraft/src/CreativeCrafting.java
-+++ net/minecraft/src/CreativeCrafting.java
-@@ -5,17 +5,24 @@
- public class CreativeCrafting implements ICrafting {
- private final Minecraft mc;
-
-- public CreativeCrafting(Minecraft var1) {
-- this.mc = var1;
-- }
--
-- public void updateCraftingInventory(Container var1, List var2) {
-- }
--
-- public void sendSlotContents(Container var1, int var2, ItemStack var3) {
-- this.mc.playerController.sendSlotPacket(var3, var2);
-- }
--
-- public void sendProgressBarUpdate(Container var1, int var2, int var3) {
-- }
-+ 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) {}
- }
---- net/minecraft/src/EntityEnderman.java
-+++ net/minecraft/src/EntityEnderman.java
-@@ -3,16 +3,24 @@
- import java.util.UUID;
-
- public class EntityEnderman extends EntityMob {
-- private static final UUID bp = UUID.fromString("020E0DFB-87AE-4653-9556-831010E291A0");
-- private static final AttributeModifier attackingSpeedBoostModifier = (new AttributeModifier(bp, "Attacking speed boost", (double)6.2F, 0)).setSaved(false);
-+ private static final UUID attackingSpeedBoostModifierUUID = UUID.fromString("020E0DFB-87AE-4653-9556-831010E291A0");
-+ private static final AttributeModifier attackingSpeedBoostModifier = (new AttributeModifier(attackingSpeedBoostModifierUUID, "Attacking speed boost", 6.199999809265137D, 0)).setSaved(false);
- private static boolean[] carriableBlocks = new boolean[256];
-+
-+ /**
-+ * Counter to delay the teleportation of an enderman towards the currently attacked target
-+ */
- private int teleportDelay;
-+
-+ /**
-+ * A player must stare at an enderman for 5 ticks before it becomes aggressive. This field counts those ticks.
-+ */
- private int stareTimer;
- private Entity lastEntityToAttack;
- private boolean isAggressive;
-
-- public EntityEnderman(World var1) {
-- super(var1);
-+ public EntityEnderman(World par1World) {
-+ super(par1World);
- this.setSize(0.6F, 2.9F);
- this.stepHeight = 1.0F;
- }
-@@ -20,7 +28,7 @@
- protected void applyEntityAttributes() {
- super.applyEntityAttributes();
- this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setAttribute(40.0D);
-- this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute((double)0.3F);
-+ this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute(0.30000001192092896D);
- this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setAttribute(7.0D);
- }
-
-@@ -31,28 +39,40 @@
- this.dataWatcher.addObject(18, new Byte((byte)0));
- }
-
-- public void writeEntityToNBT(NBTTagCompound var1) {
-- super.writeEntityToNBT(var1);
-- var1.setShort("carried", (short)this.getCarried());
-- var1.setShort("carriedData", (short)this.getCarryingData());
-- }
--
-- public void readEntityFromNBT(NBTTagCompound var1) {
-- super.readEntityFromNBT(var1);
-- this.setCarried(var1.getShort("carried"));
-- this.setCarryingData(var1.getShort("carriedData"));
-- }
--
-+ /**
-+ * (abstract) Protected helper method to write subclass entity data to NBT.
-+ */
-+ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) {
-+ super.writeEntityToNBT(par1NBTTagCompound);
-+ par1NBTTagCompound.setShort("carried", (short)this.getCarried());
-+ par1NBTTagCompound.setShort("carriedData", (short)this.getCarryingData());
-+ }
-+
-+ /**
-+ * (abstract) Protected helper method to read subclass entity data from NBT.
-+ */
-+ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) {
-+ super.readEntityFromNBT(par1NBTTagCompound);
-+ this.setCarried(par1NBTTagCompound.getShort("carried"));
-+ this.setCarryingData(par1NBTTagCompound.getShort("carriedData"));
-+ }
-+
-+ /**
-+ * Finds the closest player within 16 blocks to attack, or null if this Entity isn't interested in attacking (Animals,
-+ * Spiders at day, peaceful PigZombies).
-+ */
- protected Entity findPlayerToAttack() {
- EntityPlayer var1 = this.worldObj.getClosestVulnerablePlayerToEntity(this, 64.0D);
-- if(var1 != null) {
-- if(this.shouldAttackPlayer(var1)) {
-+
-+ if (var1 != null) {
-+ if (this.shouldAttackPlayer(var1)) {
- this.isAggressive = true;
-- if(this.stareTimer == 0) {
-+
-+ if (this.stareTimer == 0) {
- this.worldObj.playSoundAtEntity(var1, "mob.endermen.stare", 1.0F, 1.0F);
- }
-
-- if(this.stareTimer++ == 5) {
-+ if (this.stareTimer++ == 5) {
- this.stareTimer = 0;
- this.setScreaming(true);
- return var1;
-@@ -65,71 +85,85 @@
- return null;
- }
-
-- private boolean shouldAttackPlayer(EntityPlayer var1) {
-- ItemStack var2 = var1.inventory.armorInventory[3];
-- if(var2 != null && var2.itemID == Block.pumpkin.blockID) {
-+ /**
-+ * Checks to see if this enderman should be attacking this player
-+ */
-+ private boolean shouldAttackPlayer(EntityPlayer par1EntityPlayer) {
-+ ItemStack var2 = par1EntityPlayer.inventory.armorInventory[3];
-+
-+ if (var2 != null && var2.itemID == Block.pumpkin.blockID) {
- return false;
- } else {
-- Vec3 var3 = var1.getLook(1.0F).normalize();
-- Vec3 var4 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX - var1.posX, this.boundingBox.minY + (double)(this.height / 2.0F) - (var1.posY + (double)var1.getEyeHeight()), this.posZ - var1.posZ);
-+ Vec3 var3 = par1EntityPlayer.getLook(1.0F).normalize();
-+ Vec3 var4 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX - par1EntityPlayer.posX, this.boundingBox.minY + (double)(this.height / 2.0F) - (par1EntityPlayer.posY + (double)par1EntityPlayer.getEyeHeight()), this.posZ - par1EntityPlayer.posZ);
- double var5 = var4.lengthVector();
- var4 = var4.normalize();
- double var7 = var3.dotProduct(var4);
-- return var7 > 1.0D - 0.025D / var5 ? var1.canEntityBeSeen(this) : false;
-+ return var7 > 1.0D - 0.025D / var5 ? par1EntityPlayer.canEntityBeSeen(this) : false;
- }
- }
-
-+ /**
-+ * 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.isWet()) {
-+ if (this.isWet()) {
- this.attackEntityFrom(DamageSource.drown, 1.0F);
- }
-
-- if(this.lastEntityToAttack != this.entityToAttack) {
-+ if (this.lastEntityToAttack != this.entityToAttack) {
- AttributeInstance var1 = this.getEntityAttribute(SharedMonsterAttributes.movementSpeed);
- var1.removeModifier(attackingSpeedBoostModifier);
-- if(this.entityToAttack != null) {
-+
-+ if (this.entityToAttack != null) {
- var1.applyModifier(attackingSpeedBoostModifier);
- }
- }
-
- this.lastEntityToAttack = this.entityToAttack;
- int var6;
-- if(!this.worldObj.isRemote && this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing")) {
-+
-+ if (!this.worldObj.isRemote && this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing")) {
- int var2;
- int var3;
- int var4;
-- if(this.getCarried() == 0) {
-- if(this.ab.nextInt(20) == 0) {
-- var6 = MathHelper.floor_double(this.posX - 2.0D + this.ab.nextDouble() * 4.0D);
-- var2 = MathHelper.floor_double(this.posY + this.ab.nextDouble() * 3.0D);
-- var3 = MathHelper.floor_double(this.posZ - 2.0D + this.ab.nextDouble() * 4.0D);
-+
-+ if (this.getCarried() == 0) {
-+ if (this.rand.nextInt(20) == 0) {
-+ var6 = MathHelper.floor_double(this.posX - 2.0D + this.rand.nextDouble() * 4.0D);
-+ var2 = MathHelper.floor_double(this.posY + this.rand.nextDouble() * 3.0D);
-+ var3 = MathHelper.floor_double(this.posZ - 2.0D + this.rand.nextDouble() * 4.0D);
- var4 = this.worldObj.getBlockId(var6, var2, var3);
-- if(carriableBlocks[var4]) {
-+
-+ if (carriableBlocks[var4]) {
- this.setCarried(this.worldObj.getBlockId(var6, var2, var3));
- this.setCarryingData(this.worldObj.getBlockMetadata(var6, var2, var3));
- this.worldObj.setBlock(var6, var2, var3, 0);
- }
- }
-- } else if(this.ab.nextInt(2000) == 0) {
-- var6 = MathHelper.floor_double(this.posX - 1.0D + this.ab.nextDouble() * 2.0D);
-- var2 = MathHelper.floor_double(this.posY + this.ab.nextDouble() * 2.0D);
-- var3 = MathHelper.floor_double(this.posZ - 1.0D + this.ab.nextDouble() * 2.0D);
-+ } else if (this.rand.nextInt(2000) == 0) {
-+ var6 = MathHelper.floor_double(this.posX - 1.0D + this.rand.nextDouble() * 2.0D);
-+ var2 = MathHelper.floor_double(this.posY + this.rand.nextDouble() * 2.0D);
-+ var3 = MathHelper.floor_double(this.posZ - 1.0D + this.rand.nextDouble() * 2.0D);
- var4 = this.worldObj.getBlockId(var6, var2, var3);
- int var5 = this.worldObj.getBlockId(var6, var2 - 1, var3);
-- if(var4 == 0 && var5 > 0 && Block.blocksList[var5].renderAsNormalBlock()) {
-+
-+ if (var4 == 0 && var5 > 0 && Block.blocksList[var5].renderAsNormalBlock()) {
- this.worldObj.setBlock(var6, var2, var3, this.getCarried(), this.getCarryingData(), 3);
- this.setCarried(0);
- }
- }
- }
-
-- for(var6 = 0; var6 < 2; ++var6) {
-- this.worldObj.spawnParticle("portal", this.posX + (this.ab.nextDouble() - 0.5D) * (double)this.width, this.posY + this.ab.nextDouble() * (double)this.height - 0.25D, this.posZ + (this.ab.nextDouble() - 0.5D) * (double)this.width, (this.ab.nextDouble() - 0.5D) * 2.0D, -this.ab.nextDouble(), (this.ab.nextDouble() - 0.5D) * 2.0D);
-+ for (var6 = 0; var6 < 2; ++var6) {
-+ this.worldObj.spawnParticle("portal", this.posX + (this.rand.nextDouble() - 0.5D) * (double)this.width, this.posY + this.rand.nextDouble() * (double)this.height - 0.25D, this.posZ + (this.rand.nextDouble() - 0.5D) * (double)this.width, (this.rand.nextDouble() - 0.5D) * 2.0D, -this.rand.nextDouble(), (this.rand.nextDouble() - 0.5D) * 2.0D);
- }
-
-- if(this.worldObj.isDaytime() && !this.worldObj.isRemote) {
-+ if (this.worldObj.isDaytime() && !this.worldObj.isRemote) {
- float var7 = this.getBrightness(1.0F);
-- if(var7 > 0.5F && this.worldObj.canBlockSeeTheSky(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)) && this.ab.nextFloat() * 30.0F < (var7 - 0.4F) * 2.0F) {
-+
-+ if (var7 > 0.5F && this.worldObj.canBlockSeeTheSky(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)) && this.rand.nextFloat() * 30.0F < (var7 - 0.4F) * 2.0F) {
- this.entityToAttack = null;
- this.setScreaming(false);
- this.isAggressive = false;
-@@ -137,31 +171,32 @@
- }
- }
-
-- if(this.isWet() || this.isBurning()) {
-+ if (this.isWet() || this.isBurning()) {
- this.entityToAttack = null;
- this.setScreaming(false);
- this.isAggressive = false;
- this.teleportRandomly();
- }
-
-- if(this.isScreaming() && !this.isAggressive && this.ab.nextInt(100) == 0) {
-+ if (this.isScreaming() && !this.isAggressive && this.rand.nextInt(100) == 0) {
- this.setScreaming(false);
- }
-
- this.isJumping = false;
-- if(this.entityToAttack != null) {
-+
-+ if (this.entityToAttack != null) {
- this.faceEntity(this.entityToAttack, 100.0F, 100.0F);
- }
-
-- if(!this.worldObj.isRemote && this.isEntityAlive()) {
-- if(this.entityToAttack != null) {
-- if(this.entityToAttack instanceof EntityPlayer && this.shouldAttackPlayer((EntityPlayer)this.entityToAttack)) {
-- if(this.entityToAttack.getDistanceSqToEntity(this) < 16.0D) {
-+ if (!this.worldObj.isRemote && this.isEntityAlive()) {
-+ if (this.entityToAttack != null) {
-+ if (this.entityToAttack instanceof EntityPlayer && this.shouldAttackPlayer((EntityPlayer)this.entityToAttack)) {
-+ if (this.entityToAttack.getDistanceSqToEntity(this) < 16.0D) {
- this.teleportRandomly();
- }
-
- this.teleportDelay = 0;
-- } else if(this.entityToAttack.getDistanceSqToEntity(this) > 256.0D && this.teleportDelay++ >= 30 && this.teleportToEntity(this.entityToAttack)) {
-+ } else if (this.entityToAttack.getDistanceSqToEntity(this) > 256.0D && this.teleportDelay++ >= 30 && this.teleportToEntity(this.entityToAttack)) {
- this.teleportDelay = 0;
- }
- } else {
-@@ -173,73 +208,82 @@
- super.onLivingUpdate();
- }
-
-+ /**
-+ * Teleport the enderman to a random nearby position
-+ */
- protected boolean teleportRandomly() {
-- double var1 = this.posX + (this.ab.nextDouble() - 0.5D) * 64.0D;
-- double var3 = this.posY + (double)(this.ab.nextInt(64) - 32);
-- double var5 = this.posZ + (this.ab.nextDouble() - 0.5D) * 64.0D;
-+ double var1 = this.posX + (this.rand.nextDouble() - 0.5D) * 64.0D;
-+ double var3 = this.posY + (double)(this.rand.nextInt(64) - 32);
-+ double var5 = this.posZ + (this.rand.nextDouble() - 0.5D) * 64.0D;
- return this.teleportTo(var1, var3, var5);
- }
-
-- protected boolean teleportToEntity(Entity var1) {
-- Vec3 var2 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX - var1.posX, this.boundingBox.minY + (double)(this.height / 2.0F) - var1.posY + (double)var1.getEyeHeight(), this.posZ - var1.posZ);
-+ /**
-+ * Teleport the enderman to another entity
-+ */
-+ protected boolean teleportToEntity(Entity par1Entity) {
-+ Vec3 var2 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX - par1Entity.posX, this.boundingBox.minY + (double)(this.height / 2.0F) - par1Entity.posY + (double)par1Entity.getEyeHeight(), this.posZ - par1Entity.posZ);
- var2 = var2.normalize();
- double var3 = 16.0D;
-- double var5 = this.posX + (this.ab.nextDouble() - 0.5D) * 8.0D - var2.xCoord * var3;
-- double var7 = this.posY + (double)(this.ab.nextInt(16) - 8) - var2.yCoord * var3;
-- double var9 = this.posZ + (this.ab.nextDouble() - 0.5D) * 8.0D - var2.zCoord * var3;
-+ double var5 = this.posX + (this.rand.nextDouble() - 0.5D) * 8.0D - var2.xCoord * var3;
-+ double var7 = this.posY + (double)(this.rand.nextInt(16) - 8) - var2.yCoord * var3;
-+ double var9 = this.posZ + (this.rand.nextDouble() - 0.5D) * 8.0D - var2.zCoord * var3;
- return this.teleportTo(var5, var7, var9);
- }
-
-- protected boolean teleportTo(double var1, double var3, double var5) {
-+ /**
-+ * Teleport the enderman
-+ */
-+ protected boolean teleportTo(double par1, double par3, double par5) {
- double var7 = this.posX;
- double var9 = this.posY;
- double var11 = this.posZ;
-- this.posX = var1;
-- this.posY = var3;
-- this.posZ = var5;
-+ this.posX = par1;
-+ this.posY = par3;
-+ this.posZ = par5;
- boolean var13 = false;
- int var14 = MathHelper.floor_double(this.posX);
- int var15 = MathHelper.floor_double(this.posY);
- int var16 = MathHelper.floor_double(this.posZ);
- int var18;
-- if(this.worldObj.blockExists(var14, var15, var16)) {
-+
-+ if (this.worldObj.blockExists(var14, var15, var16)) {
- boolean var17 = false;
-
-- while(true) {
-- while(!var17 && var15 > 0) {
-- var18 = this.worldObj.getBlockId(var14, var15 - 1, var16);
-- if(var18 != 0 && Block.blocksList[var18].blockMaterial.blocksMovement()) {
-- var17 = true;
-- } else {
-- --this.posY;
-- --var15;
-- }
-- }
--
-- if(var17) {
-- this.setPosition(this.posX, this.posY, this.posZ);
-- if(this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty() && !this.worldObj.isAnyLiquid(this.boundingBox)) {
-- var13 = true;
-- }
-- }
-- break;
-+ while (!var17 && var15 > 0) {
-+ var18 = this.worldObj.getBlockId(var14, var15 - 1, var16);
-+
-+ if (var18 != 0 && Block.blocksList[var18].blockMaterial.blocksMovement()) {
-+ var17 = true;
-+ } else {
-+ --this.posY;
-+ --var15;
-+ }
-+ }
-+
-+ if (var17) {
-+ this.setPosition(this.posX, this.posY, this.posZ);
-+
-+ if (this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty() && !this.worldObj.isAnyLiquid(this.boundingBox)) {
-+ var13 = true;
-+ }
- }
- }
-
-- if(!var13) {
-+ if (!var13) {
- this.setPosition(var7, var9, var11);
- return false;
- } else {
- short var30 = 128;
-
-- for(var18 = 0; var18 < var30; ++var18) {
-+ for (var18 = 0; var18 < var30; ++var18) {
- double var19 = (double)var18 / ((double)var30 - 1.0D);
-- float var21 = (this.ab.nextFloat() - 0.5F) * 0.2F;
-- float var22 = (this.ab.nextFloat() - 0.5F) * 0.2F;
-- float var23 = (this.ab.nextFloat() - 0.5F) * 0.2F;
-- double var24 = var7 + (this.posX - var7) * var19 + (this.ab.nextDouble() - 0.5D) * (double)this.width * 2.0D;
-- double var26 = var9 + (this.posY - var9) * var19 + this.ab.nextDouble() * (double)this.height;
-- double var28 = var11 + (this.posZ - var11) * var19 + (this.ab.nextDouble() - 0.5D) * (double)this.width * 2.0D;
-+ float var21 = (this.rand.nextFloat() - 0.5F) * 0.2F;
-+ float var22 = (this.rand.nextFloat() - 0.5F) * 0.2F;
-+ float var23 = (this.rand.nextFloat() - 0.5F) * 0.2F;
-+ double var24 = var7 + (this.posX - var7) * var19 + (this.rand.nextDouble() - 0.5D) * (double)this.width * 2.0D;
-+ double var26 = var9 + (this.posY - var9) * var19 + this.rand.nextDouble() * (double)this.height;
-+ double var28 = var11 + (this.posZ - var11) * var19 + (this.rand.nextDouble() - 0.5D) * (double)this.width * 2.0D;
- this.worldObj.spawnParticle("portal", var24, var26, var28, (double)var21, (double)var22, (double)var23);
- }
-
-@@ -249,71 +293,103 @@
- }
- }
-
-+ /**
-+ * Returns the sound this mob makes while it's alive.
-+ */
- protected String getLivingSound() {
- return this.isScreaming() ? "mob.endermen.scream" : "mob.endermen.idle";
- }
-
-+ /**
-+ * Returns the sound this mob makes when it is hurt.
-+ */
- protected String getHurtSound() {
- return "mob.endermen.hit";
- }
-
-+ /**
-+ * Returns the sound this mob makes on death.
-+ */
- protected String getDeathSound() {
- return "mob.endermen.death";
- }
-
-+ /**
-+ * Returns the item ID for the item the mob drops on death.
-+ */
- protected int getDropItemId() {
- return Item.enderPearl.itemID;
- }
-
-- protected void dropFewItems(boolean var1, int var2) {
-+ /**
-+ * 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();
-- if(var3 > 0) {
-- int var4 = this.ab.nextInt(2 + var2);
--
-- for(int var5 = 0; var5 < var4; ++var5) {
-+
-+ if (var3 > 0) {
-+ int var4 = this.rand.nextInt(2 + par2);
-+
-+ for (int var5 = 0; var5 < var4; ++var5) {
- this.dropItem(var3, 1);
- }
- }
--
-- }
--
-- public void setCarried(int var1) {
-- this.dataWatcher.updateObject(16, Byte.valueOf((byte)(var1 & 255)));
-- }
--
-+ }
-+
-+ /**
-+ * Set the id of the block an enderman carries
-+ */
-+ public void setCarried(int par1) {
-+ this.dataWatcher.updateObject(16, Byte.valueOf((byte)(par1 & 255)));
-+ }
-+
-+ /**
-+ * Get the id of the block an enderman carries
-+ */
- public int getCarried() {
- return this.dataWatcher.getWatchableObjectByte(16);
- }
-
-- public void setCarryingData(int var1) {
-- this.dataWatcher.updateObject(17, Byte.valueOf((byte)(var1 & 255)));
-+ /**
-+ * Set the metadata of the block an enderman carries
-+ */
-+ public void setCarryingData(int par1) {
-+ this.dataWatcher.updateObject(17, Byte.valueOf((byte)(par1 & 255)));
- }
-
-+ /**
-+ * Get the metadata of the block an enderman carries
-+ */
- public int getCarryingData() {
- return this.dataWatcher.getWatchableObjectByte(17);
- }
-
-- public boolean attackEntityFrom(DamageSource var1, float var2) {
-- if(this.isEntityInvulnerable()) {
-+ /**
-+ * Called when the entity is attacked.
-+ */
-+ public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) {
-+ if (this.isEntityInvulnerable()) {
- return false;
- } else {
- this.setScreaming(true);
-- if(var1 instanceof EntityDamageSource && var1.getEntity() instanceof EntityPlayer) {
-+
-+ if (par1DamageSource instanceof EntityDamageSource && par1DamageSource.getEntity() instanceof EntityPlayer) {
- this.isAggressive = true;
- }
-
-- if(var1 instanceof EntityDamageSourceIndirect) {
-+ if (par1DamageSource instanceof EntityDamageSourceIndirect) {
- this.isAggressive = false;
-
-- for(int var3 = 0; var3 < 64; ++var3) {
-- if(this.teleportRandomly()) {
-+ for (int var3 = 0; var3 < 64; ++var3) {
-+ if (this.teleportRandomly()) {
- return true;
- }
- }
-
- return false;
- } else {
-- return super.attackEntityFrom(var1, var2);
-+ return super.attackEntityFrom(par1DamageSource, par2);
- }
- }
- }
-@@ -322,8 +398,8 @@
- return this.dataWatcher.getWatchableObjectByte(18) > 0;
- }
-
-- public void setScreaming(boolean var1) {
-- this.dataWatcher.updateObject(18, Byte.valueOf((byte)(var1 ? 1 : 0)));
-+ public void setScreaming(boolean par1) {
-+ this.dataWatcher.updateObject(18, Byte.valueOf((byte)(par1 ? 1 : 0)));
- }
-
- static {
---- /dev/null
-+++ org/spoutcraft/client/special/BaseYAMLResource.java
-@@ -1,0 +1,47 @@
-+/*
-+ * This file is part of Spoutcraft.
-+ *
-+ * Copyright (c) 2011 SpoutcraftDev
-+ * Spoutcraft is licensed under the GNU Lesser General Public License.
-+ *
-+ * Spoutcraft is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation, either version 3 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Spoutcraft is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program. If not, see .
-+ */
-+package org.spoutcraft.client.special;
-+
-+import java.io.File;
-+
-+import org.bukkit.util.config.Configuration;
-+
-+public class BaseYAMLResource implements YAMLResource {
-+ private Configuration cached = null;
-+ private final File localCache;
-+ public BaseYAMLResource(File file) {
-+ this.localCache = file;
-+ }
-+
-+ public synchronized Configuration getYAML() {
-+ updateYAML();
-+ return cached;
-+ }
-+
-+ public synchronized boolean updateYAML() {
-+ if (cached == null) {
-+ // Setup cached processor
-+ cached = new Configuration(localCache);
-+ cached.load();
-+ return true;
-+ }
-+ return false;
-+ }
-+}
---- net/minecraft/src/StructureBoundingBox.java
-+++ net/minecraft/src/StructureBoundingBox.java
-@@ -1,112 +1,156 @@
- package net.minecraft.src;
-
- public class StructureBoundingBox {
-+
-+ /** The first x coordinate of a bounding box. */
- public int minX;
-+
-+ /** The first y coordinate of a bounding box. */
- public int minY;
-+
-+ /** The first z coordinate of a bounding box. */
- public int minZ;
-+
-+ /** The second x coordinate of a bounding box. */
- public int maxX;
-+
-+ /** The second y coordinate of a bounding box. */
- public int maxY;
-+
-+ /** The second z coordinate of a bounding box. */
- public int maxZ;
-
-- public StructureBoundingBox() {
-- }
-+ public StructureBoundingBox() {}
-
-- public StructureBoundingBox(int[] var1) {
-- if(var1.length == 6) {
-- this.minX = var1[0];
-- this.minY = var1[1];
-- this.minZ = var1[2];
-- this.maxX = var1[3];
-- this.maxY = var1[4];
-- this.maxZ = var1[5];
-+ public StructureBoundingBox(int[] par1ArrayOfInteger) {
-+ if (par1ArrayOfInteger.length == 6) {
-+ this.minX = par1ArrayOfInteger[0];
-+ this.minY = par1ArrayOfInteger[1];
-+ this.minZ = par1ArrayOfInteger[2];
-+ this.maxX = par1ArrayOfInteger[3];
-+ this.maxY = par1ArrayOfInteger[4];
-+ this.maxZ = par1ArrayOfInteger[5];
- }
--
- }
-
-+ /**
-+ * returns a new StructureBoundingBox with MAX values
-+ */
- public static StructureBoundingBox getNewBoundingBox() {
- return new StructureBoundingBox(Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MIN_VALUE, Integer.MIN_VALUE, Integer.MIN_VALUE);
- }
-
-- public static StructureBoundingBox getComponentToAddBoundingBox(int var0, int var1, int var2, int var3, int var4, int var5, int var6, int var7, int var8, int var9) {
-- switch(var9) {
-- case 0:
-- return new StructureBoundingBox(var0 + var3, var1 + var4, var2 + var5, var0 + var6 - 1 + var3, var1 + var7 - 1 + var4, var2 + var8 - 1 + var5);
-- case 1:
-- return new StructureBoundingBox(var0 - var8 + 1 + var5, var1 + var4, var2 + var3, var0 + var5, var1 + var7 - 1 + var4, var2 + var6 - 1 + var3);
-- case 2:
-- return new StructureBoundingBox(var0 + var3, var1 + var4, var2 - var8 + 1 + var5, var0 + var6 - 1 + var3, var1 + var7 - 1 + var4, var2 + var5);
-- case 3:
-- return new StructureBoundingBox(var0 + var5, var1 + var4, var2 + var3, var0 + var8 - 1 + var5, var1 + var7 - 1 + var4, var2 + var6 - 1 + var3);
-- default:
-- return new StructureBoundingBox(var0 + var3, var1 + var4, var2 + var5, var0 + var6 - 1 + var3, var1 + var7 - 1 + var4, var2 + var8 - 1 + var5);
-+ /**
-+ * used to project a possible new component Bounding Box - to check if it would cut anything already spawned
-+ */
-+ public static StructureBoundingBox getComponentToAddBoundingBox(int par0, int par1, int par2, int par3, int par4, int par5, int par6, int par7, int par8, int par9) {
-+ switch (par9) {
-+ case 0:
-+ return new StructureBoundingBox(par0 + par3, par1 + par4, par2 + par5, par0 + par6 - 1 + par3, par1 + par7 - 1 + par4, par2 + par8 - 1 + par5);
-+
-+ case 1:
-+ return new StructureBoundingBox(par0 - par8 + 1 + par5, par1 + par4, par2 + par3, par0 + par5, par1 + par7 - 1 + par4, par2 + par6 - 1 + par3);
-+
-+ case 2:
-+ return new StructureBoundingBox(par0 + par3, par1 + par4, par2 - par8 + 1 + par5, par0 + par6 - 1 + par3, par1 + par7 - 1 + par4, par2 + par5);
-+
-+ case 3:
-+ return new StructureBoundingBox(par0 + par5, par1 + par4, par2 + par3, par0 + par8 - 1 + par5, par1 + par7 - 1 + par4, par2 + par6 - 1 + par3);
-+
-+ default:
-+ return new StructureBoundingBox(par0 + par3, par1 + par4, par2 + par5, par0 + par6 - 1 + par3, par1 + par7 - 1 + par4, par2 + par8 - 1 + par5);
- }
- }
-
-- public StructureBoundingBox(StructureBoundingBox var1) {
-- this.minX = var1.minX;
-- this.minY = var1.minY;
-- this.minZ = var1.minZ;
-- this.maxX = var1.maxX;
-- this.maxY = var1.maxY;
-- this.maxZ = var1.maxZ;
-- }
--
-- public StructureBoundingBox(int var1, int var2, int var3, int var4, int var5, int var6) {
-- this.minX = var1;
-- this.minY = var2;
-- this.minZ = var3;
-- this.maxX = var4;
-- this.maxY = var5;
-- this.maxZ = var6;
-- }
--
-- public StructureBoundingBox(int var1, int var2, int var3, int var4) {
-- this.minX = var1;
-- this.minZ = var2;
-- this.maxX = var3;
-- this.maxZ = var4;
-+ public StructureBoundingBox(StructureBoundingBox par1StructureBoundingBox) {
-+ this.minX = par1StructureBoundingBox.minX;
-+ this.minY = par1StructureBoundingBox.minY;
-+ this.minZ = par1StructureBoundingBox.minZ;
-+ this.maxX = par1StructureBoundingBox.maxX;
-+ this.maxY = par1StructureBoundingBox.maxY;
-+ this.maxZ = par1StructureBoundingBox.maxZ;
-+ }
-+
-+ public StructureBoundingBox(int par1, int par2, int par3, int par4, int par5, int par6) {
-+ this.minX = par1;
-+ this.minY = par2;
-+ this.minZ = par3;
-+ this.maxX = par4;
-+ this.maxY = par5;
-+ this.maxZ = par6;
-+ }
-+
-+ public StructureBoundingBox(int par1, int par2, int par3, int par4) {
-+ this.minX = par1;
-+ this.minZ = par2;
-+ this.maxX = par3;
-+ this.maxZ = par4;
- this.minY = 1;
- this.maxY = 512;
- }
-
-- public boolean intersectsWith(StructureBoundingBox var1) {
-- return this.maxX >= var1.minX && this.minX <= var1.maxX && this.maxZ >= var1.minZ && this.minZ <= var1.maxZ && this.maxY >= var1.minY && this.minY <= var1.maxY;
-- }
--
-- public boolean intersectsWith(int var1, int var2, int var3, int var4) {
-- return this.maxX >= var1 && this.minX <= var3 && this.maxZ >= var2 && this.minZ <= var4;
-- }
--
-- public void expandTo(StructureBoundingBox var1) {
-- this.minX = Math.min(this.minX, var1.minX);
-- this.minY = Math.min(this.minY, var1.minY);
-- this.minZ = Math.min(this.minZ, var1.minZ);
-- this.maxX = Math.max(this.maxX, var1.maxX);
-- this.maxY = Math.max(this.maxY, var1.maxY);
-- this.maxZ = Math.max(this.maxZ, var1.maxZ);
-- }
--
-- public void offset(int var1, int var2, int var3) {
-- this.minX += var1;
-- this.minY += var2;
-- this.minZ += var3;
-- this.maxX += var1;
-- this.maxY += var2;
-- this.maxZ += var3;
-- }
--
-- public boolean isVecInside(int var1, int var2, int var3) {
-- return var1 >= this.minX && var1 <= this.maxX && var3 >= this.minZ && var3 <= this.maxZ && var2 >= this.minY && var2 <= this.maxY;
-- }
--
-+ /**
-+ * Returns whether the given bounding box intersects with this one. Args: structureboundingbox
-+ */
-+ public boolean intersectsWith(StructureBoundingBox par1StructureBoundingBox) {
-+ return this.maxX >= par1StructureBoundingBox.minX && this.minX <= par1StructureBoundingBox.maxX && this.maxZ >= par1StructureBoundingBox.minZ && this.minZ <= par1StructureBoundingBox.maxZ && this.maxY >= par1StructureBoundingBox.minY && this.minY <= par1StructureBoundingBox.maxY;
-+ }
-+
-+ /**
-+ * Discover if a coordinate is inside the bounding box area.
-+ */
-+ public boolean intersectsWith(int par1, int par2, int par3, int par4) {
-+ return this.maxX >= par1 && this.minX <= par3 && this.maxZ >= par2 && this.minZ <= par4;
-+ }
-+
-+ /**
-+ * Expands a bounding box's dimensions to include the supplied bounding box.
-+ */
-+ public void expandTo(StructureBoundingBox par1StructureBoundingBox) {
-+ this.minX = Math.min(this.minX, par1StructureBoundingBox.minX);
-+ this.minY = Math.min(this.minY, par1StructureBoundingBox.minY);
-+ this.minZ = Math.min(this.minZ, par1StructureBoundingBox.minZ);
-+ this.maxX = Math.max(this.maxX, par1StructureBoundingBox.maxX);
-+ this.maxY = Math.max(this.maxY, par1StructureBoundingBox.maxY);
-+ this.maxZ = Math.max(this.maxZ, par1StructureBoundingBox.maxZ);
-+ }
-+
-+ /**
-+ * Offsets the current bounding box by the specified coordinates. Args: x, y, z
-+ */
-+ public void offset(int par1, int par2, int par3) {
-+ this.minX += par1;
-+ this.minY += par2;
-+ this.minZ += par3;
-+ this.maxX += par1;
-+ this.maxY += par2;
-+ this.maxZ += par3;
-+ }
-+
-+ /**
-+ * Returns true if block is inside bounding box
-+ */
-+ public boolean isVecInside(int par1, int par2, int par3) {
-+ return par1 >= this.minX && par1 <= this.maxX && par3 >= this.minZ && par3 <= this.maxZ && par2 >= this.minY && par2 <= this.maxY;
-+ }
-+
-+ /**
-+ * Returns width of a bounding box
-+ */
- public int getXSize() {
- return this.maxX - this.minX + 1;
- }
-
-+ /**
-+ * Returns height of a bounding box
-+ */
- public int getYSize() {
- return this.maxY - this.minY + 1;
- }
-
-+ /**
-+ * Returns length of a bounding box
-+ */
- public int getZSize() {
- return this.maxZ - this.minZ + 1;
- }
-@@ -127,7 +171,7 @@
- return "(" + this.minX + ", " + this.minY + ", " + this.minZ + "; " + this.maxX + ", " + this.maxY + ", " + this.maxZ + ")";
- }
-
-- public NBTTagIntArray func_143047_a(String var1) {
-- return new NBTTagIntArray(var1, new int[]{this.minX, this.minY, this.minZ, this.maxX, this.maxY, this.maxZ});
-+ public NBTTagIntArray func_143047_a(String par1Str) {
-+ return new NBTTagIntArray(par1Str, new int[] {this.minX, this.minY, this.minZ, this.maxX, this.maxY, this.maxZ});
- }
- }
---- net/minecraft/src/ICommandManager.java
-+++ net/minecraft/src/ICommandManager.java
-@@ -6,9 +6,18 @@
- public interface ICommandManager {
- int executeCommand(ICommandSender var1, String var2);
-
-+ /**
-+ * Performs a "begins with" string match on each token in par2. Only returns commands that par1 can use.
-+ */
- List getPossibleCommands(ICommandSender var1, String var2);
-
-+ /**
-+ * returns all commands that the commandSender can use
-+ */
- List getPossibleCommands(ICommandSender var1);
-
-+ /**
-+ * returns a map of string to commads. All commands are returned, not just ones which someone has permission to use.
-+ */
- Map getCommands();
- }
---- /dev/null
-+++ org/spoutcraft/client/gui/minimap/ColorToggleCheckBox.java
-@@ -1,0 +1,35 @@
-+/*
-+ * This file is part of Spoutcraft.
-+ *
-+ * Copyright (c) 2011 SpoutcraftDev
-+ * Spoutcraft is licensed under the GNU Lesser General Public License.
-+ *
-+ * Spoutcraft is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation, either version 3 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Spoutcraft is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program. If not, see .
-+ */
-+package org.spoutcraft.client.gui.minimap;
-+
-+import org.spoutcraft.api.gui.GenericCheckBox;
-+
-+public class ColorToggleCheckBox extends GenericCheckBox {
-+ public ColorToggleCheckBox() {
-+ super("Black and White");
-+ setChecked(!MinimapConfig.getInstance().isColor());
-+ setTooltip("Black and White\nRemoves color from the minimap.");
-+ }
-+
-+ @Override
-+ public void onButtonClick() {
-+ MinimapConfig.getInstance().setColor(!isChecked());
-+ }
-+}
---- net/minecraft/src/Icon.java
-+++ net/minecraft/src/Icon.java
-@@ -1,20 +1,45 @@
- 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();
---- net/minecraft/src/CrashReport.java
-+++ net/minecraft/src/CrashReport.java
-@@ -12,20 +12,32 @@
- import java.util.List;
-
- public class CrashReport {
-- private final String a;
-- private final Throwable b;
-+
-+ /** Description of the crash report. */
-+ private final String description;
-+
-+ /** The Throwable that is the "cause" for this crash and Crash Report. */
-+ private final Throwable cause;
- private final CrashReportCategory field_85061_c = new CrashReportCategory(this, "System Details");
-- private final List d = new ArrayList();
-- private File e;
-+
-+ /** Holds the keys and values of all crash report sections. */
-+ private final List crashReportSections = new ArrayList();
-+
-+ /** File of crash report. */
-+ private File crashReportFile;
- private boolean field_85059_f = true;
-- private StackTraceElement[] g = new StackTraceElement[0];
-+ private StackTraceElement[] field_85060_g = new StackTraceElement[0];
-
-- public CrashReport(String var1, Throwable var2) {
-- this.a = var1;
-- this.b = var2;
-+ public CrashReport(String par1Str, Throwable par2Throwable) {
-+ this.description = par1Str;
-+ this.cause = par2Throwable;
- this.populateEnvironment();
- }
-
-+ /**
-+ * Populates this crash report with initial information about the running server and operating system / java
-+ * environment
-+ */
- private void populateEnvironment() {
- this.field_85061_c.addCrashSectionCallable("Minecraft Version", new CallableMinecraftVersion(this));
- this.field_85061_c.addCrashSectionCallable("Operating System", new CallableOSInfo(this));
-@@ -38,68 +50,83 @@
- this.field_85061_c.addCrashSectionCallable("IntCache", new CallableIntCache(this));
- }
-
-+ /**
-+ * Returns the description of the Crash Report.
-+ */
- public String getDescription() {
-- return this.a;
-+ return this.description;
- }
-
-+ /**
-+ * Returns the Throwable object that is the cause for the crash and Crash Report.
-+ */
- public Throwable getCrashCause() {
-- return this.b;
-+ return this.cause;
- }
-
-- public void getSectionsInStringBuilder(StringBuilder var1) {
-- if(this.g != null && this.g.length > 0) {
-- var1.append("-- Head --\n");
-- var1.append("Stacktrace:\n");
-- StackTraceElement[] var2 = this.g;
-+ /**
-+ * Gets the various sections of the crash report into the given StringBuilder
-+ */
-+ public void getSectionsInStringBuilder(StringBuilder par1StringBuilder) {
-+ if (this.field_85060_g != null && this.field_85060_g.length > 0) {
-+ par1StringBuilder.append("-- Head --\n");
-+ par1StringBuilder.append("Stacktrace:\n");
-+ StackTraceElement[] var2 = this.field_85060_g;
- int var3 = var2.length;
-
-- for(int var4 = 0; var4 < var3; ++var4) {
-+ for (int var4 = 0; var4 < var3; ++var4) {
- StackTraceElement var5 = var2[var4];
-- var1.append("\t").append("at ").append(var5.toString());
-- var1.append("\n");
-+ par1StringBuilder.append("\t").append("at ").append(var5.toString());
-+ par1StringBuilder.append("\n");
- }
-
-- var1.append("\n");
-+ par1StringBuilder.append("\n");
- }
-
-- Iterator var6 = this.d.iterator();
-+ Iterator var6 = this.crashReportSections.iterator();
-
-- while(var6.hasNext()) {
-+ while (var6.hasNext()) {
- CrashReportCategory var7 = (CrashReportCategory)var6.next();
-- var7.func_85072_a(var1);
-- var1.append("\n\n");
-+ var7.func_85072_a(par1StringBuilder);
-+ par1StringBuilder.append("\n\n");
- }
-
-- this.field_85061_c.func_85072_a(var1);
-+ this.field_85061_c.func_85072_a(par1StringBuilder);
- }
-
-+ /**
-+ * Gets the stack trace of the Throwable that caused this crash report, or if that fails, the cause .toString().
-+ */
- public String getCauseStackTraceOrString() {
- StringWriter var1 = null;
- PrintWriter var2 = null;
-- String var3 = this.b.toString();
-+ String var3 = this.cause.toString();
-
- try {
- var1 = new StringWriter();
- var2 = new PrintWriter(var1);
-- this.b.printStackTrace(var2);
-+ this.cause.printStackTrace(var2);
- var3 = var1.toString();
- } finally {
- try {
-- if(var1 != null) {
-+ if (var1 != null) {
- var1.close();
- }
-
-- if(var2 != null) {
-+ if (var2 != null) {
- var2.close();
- }
- } catch (IOException var10) {
-+ ;
- }
--
- }
-
- return var3;
- }
-
-+ /**
-+ * Gets the complete report with headers, stack trace, and different sections as a string.
-+ */
- public String getCompleteReport() {
- StringBuilder var1 = new StringBuilder();
- var1.append("---- Minecraft Crash Report ----\n");
-@@ -110,12 +137,12 @@
- var1.append((new SimpleDateFormat()).format(new Date()));
- var1.append("\n");
- var1.append("Description: ");
-- var1.append(this.a);
-+ var1.append(this.description);
- var1.append("\n\n");
- var1.append(this.getCauseStackTraceOrString());
- var1.append("\n\nA detailed walkthrough of the error, its code path and all known details is as follows:\n");
-
-- for(int var2 = 0; var2 < 87; ++var2) {
-+ for (int var2 = 0; var2 < 87; ++var2) {
- var1.append("-");
- }
-
-@@ -124,26 +151,32 @@
- return var1.toString();
- }
-
-+ /**
-+ * Gets the file this crash report is saved into.
-+ */
- public File getFile() {
-- return this.e;
-+ return this.crashReportFile;
- }
-
-- public boolean saveToFile(File var1, ILogAgent var2) {
-- if(this.e != null) {
-+ /**
-+ * Saves the complete crash report to the given File.
-+ */
-+ public boolean saveToFile(File par1File, ILogAgent par2ILogAgent) {
-+ if (this.crashReportFile != null) {
- return false;
- } else {
-- if(var1.getParentFile() != null) {
-- var1.getParentFile().mkdirs();
-+ if (par1File.getParentFile() != null) {
-+ par1File.getParentFile().mkdirs();
- }
-
- try {
-- FileWriter var3 = new FileWriter(var1);
-+ FileWriter var3 = new FileWriter(par1File);
- var3.write(this.getCompleteReport());
- var3.close();
-- this.e = var1;
-+ this.crashReportFile = par1File;
- return true;
- } catch (Throwable var4) {
-- var2.logSevereException("Could not save crash report to " + var1, var4);
-+ par2ILogAgent.logSevereException("Could not save crash report to " + par1File, var4);
- return false;
- }
- }
-@@ -153,42 +186,55 @@
- return this.field_85061_c;
- }
-
-- public CrashReportCategory makeCategory(String var1) {
-- return this.makeCategoryDepth(var1, 1);
-+ /**
-+ * Creates a CrashReportCategory
-+ */
-+ public CrashReportCategory makeCategory(String par1Str) {
-+ return this.makeCategoryDepth(par1Str, 1);
- }
-
-- public CrashReportCategory makeCategoryDepth(String var1, int var2) {
-- CrashReportCategory var3 = new CrashReportCategory(this, var1);
-- if(this.field_85059_f) {
-- int var4 = var3.func_85073_a(var2);
-- StackTraceElement[] var5 = this.b.getStackTrace();
-+ /**
-+ * Creates a CrashReportCategory for the given stack trace depth
-+ */
-+ public CrashReportCategory makeCategoryDepth(String par1Str, int par2) {
-+ CrashReportCategory var3 = new CrashReportCategory(this, par1Str);
-+
-+ if (this.field_85059_f) {
-+ int var4 = var3.func_85073_a(par2);
-+ StackTraceElement[] var5 = this.cause.getStackTrace();
- StackTraceElement var6 = null;
- StackTraceElement var7 = null;
-- if(var5 != null && var5.length - var4 < var5.length) {
-+
-+ if (var5 != null && var5.length - var4 < var5.length) {
- var6 = var5[var5.length - var4];
-- if(var5.length + 1 - var4 < var5.length) {
-+
-+ if (var5.length + 1 - var4 < var5.length) {
- var7 = var5[var5.length + 1 - var4];
- }
- }
-
- this.field_85059_f = var3.func_85069_a(var6, var7);
-- if(var4 > 0 && !this.d.isEmpty()) {
-- CrashReportCategory var8 = (CrashReportCategory)this.d.get(this.d.size() - 1);
-+
-+ if (var4 > 0 && !this.crashReportSections.isEmpty()) {
-+ CrashReportCategory var8 = (CrashReportCategory)this.crashReportSections.get(this.crashReportSections.size() - 1);
- var8.func_85070_b(var4);
-- } else if(var5 != null && var5.length >= var4) {
-- this.g = new StackTraceElement[var5.length - var4];
-- System.arraycopy(var5, 0, this.g, 0, this.g.length);
-+ } else if (var5 != null && var5.length >= var4) {
-+ this.field_85060_g = new StackTraceElement[var5.length - var4];
-+ System.arraycopy(var5, 0, this.field_85060_g, 0, this.field_85060_g.length);
- } else {
- this.field_85059_f = false;
- }
- }
-
-- this.d.add(var3);
-+ this.crashReportSections.add(var3);
- return var3;
- }
-
-+ /**
-+ * Gets a random witty comment for inclusion in this CrashReport
-+ */
- private static String getWittyComment() {
-- String[] var0 = new String[]{"Who set us up the TNT?", "Everything\'s going to plan. No, really, that was supposed to happen.", "Uh... Did I do that?", "Oops.", "Why did you do that?", "I feel sad now :(", "My bad.", "I\'m sorry, Dave.", "I let you down. Sorry :(", "On the bright side, I bought you a teddy bear!", "Daisy, daisy...", "Oh - I know what I did wrong!", "Hey, that tickles! Hehehe!", "I blame Dinnerbone.", "You should try our sister game, Minceraft!", "Don\'t be sad. I\'ll do better next time, I promise!", "Don\'t be sad, have a hug! <3", "I just don\'t know what went wrong :(", "Shall we play a game?", "Quite honestly, I wouldn\'t worry myself about that.", "I bet Cylons wouldn\'t have this problem.", "Sorry :(", "Surprise! Haha. Well, this is awkward.", "Would you like a cupcake?", "Hi. I\'m Minecraft, and I\'m a crashaholic.", "Ooh. Shiny.", "This doesn\'t make any sense!", "Why is it breaking :(", "Don\'t do that.", "Ouch. That hurt :(", "You\'re mean.", "This is a token for 1 free hug. Redeem at your nearest Mojangsta: [~~HUG~~]", "There are four lights!"};
-+ String[] var0 = new String[] {"Who set us up the TNT?", "Everything\'s going to plan. No, really, that was supposed to happen.", "Uh... Did I do that?", "Oops.", "Why did you do that?", "I feel sad now :(", "My bad.", "I\'m sorry, Dave.", "I let you down. Sorry :(", "On the bright side, I bought you a teddy bear!", "Daisy, daisy...", "Oh - I know what I did wrong!", "Hey, that tickles! Hehehe!", "I blame Dinnerbone.", "You should try our sister game, Minceraft!", "Don\'t be sad. I\'ll do better next time, I promise!", "Don\'t be sad, have a hug! <3", "I just don\'t know what went wrong :(", "Shall we play a game?", "Quite honestly, I wouldn\'t worry myself about that.", "I bet Cylons wouldn\'t have this problem.", "Sorry :(", "Surprise! Haha. Well, this is awkward.", "Would you like a cupcake?", "Hi. I\'m Minecraft, and I\'m a crashaholic.", "Ooh. Shiny.", "This doesn\'t make any sense!", "Why is it breaking :(", "Don\'t do that.", "Ouch. That hurt :(", "You\'re mean.", "This is a token for 1 free hug. Redeem at your nearest Mojangsta: [~~HUG~~]", "There are four lights!"};
-
- try {
- return var0[(int)(System.nanoTime() % (long)var0.length)];
-@@ -197,12 +243,16 @@
- }
- }
-
-- public static CrashReport makeCrashReport(Throwable var0, String var1) {
-+ /**
-+ * Creates a crash report for the exception
-+ */
-+ public static CrashReport makeCrashReport(Throwable par0Throwable, String par1Str) {
- CrashReport var2;
-- if(var0 instanceof ReportedException) {
-- var2 = ((ReportedException)var0).getCrashReport();
-+
-+ if (par0Throwable instanceof ReportedException) {
-+ var2 = ((ReportedException)par0Throwable).getCrashReport();
- } else {
-- var2 = new CrashReport(var1, var0);
-+ var2 = new CrashReport(par1Str, par0Throwable);
- }
-
- return var2;
---- net/minecraft/src/TextureMetadataSectionSerializer.java
-+++ net/minecraft/src/TextureMetadataSectionSerializer.java
-@@ -6,18 +6,21 @@
- import java.lang.reflect.Type;
-
- public class TextureMetadataSectionSerializer extends BaseMetadataSectionSerializer {
-- public TextureMetadataSection func_110494_a(JsonElement var1, Type var2, JsonDeserializationContext var3) {
-- JsonObject var4 = var1.getAsJsonObject();
-+ public TextureMetadataSection func_110494_a(JsonElement par1JsonElement, Type par2Type, JsonDeserializationContext par3JsonDeserializationContext) {
-+ JsonObject var4 = par1JsonElement.getAsJsonObject();
- boolean var5 = this.func_110484_a(var4.get("blur"), "blur", Boolean.valueOf(false));
- boolean var6 = this.func_110484_a(var4.get("clamp"), "clamp", Boolean.valueOf(false));
- return new TextureMetadataSection(var5, var6);
- }
-
-+ /**
-+ * The name of this section type as it appears in JSON.
-+ */
- public String getSectionName() {
- return "texture";
- }
-
-- public Object deserialize(JsonElement var1, Type var2, JsonDeserializationContext var3) {
-- return this.func_110494_a(var1, var2, var3);
-+ public Object deserialize(JsonElement par1JsonElement, Type par2Type, JsonDeserializationContext par3JsonDeserializationContext) {
-+ return this.func_110494_a(par1JsonElement, par2Type, par3JsonDeserializationContext);
- }
- }
---- net/minecraft/src/CommandServerBanlist.java
-+++ net/minecraft/src/CommandServerBanlist.java
-@@ -8,30 +8,38 @@
- return "banlist";
- }
-
-+ /**
-+ * Return the required permission level for this command.
-+ */
- public int getRequiredPermissionLevel() {
- return 3;
- }
-
-- public boolean canCommandSenderUseCommand(ICommandSender var1) {
-- return (MinecraftServer.getServer().getConfigurationManager().getBannedIPs().isListActive() || MinecraftServer.getServer().getConfigurationManager().getBannedPlayers().isListActive()) && super.canCommandSenderUseCommand(var1);
-+ /**
-+ * Returns true if the given command sender is allowed to use this command.
-+ */
-+ public boolean canCommandSenderUseCommand(ICommandSender par1ICommandSender) {
-+ return (MinecraftServer.getServer().getConfigurationManager().getBannedIPs().isListActive() || MinecraftServer.getServer().getConfigurationManager().getBannedPlayers().isListActive()) && super.canCommandSenderUseCommand(par1ICommandSender);
- }
-
-- public String getCommandUsage(ICommandSender var1) {
-+ public String getCommandUsage(ICommandSender par1ICommandSender) {
- return "commands.banlist.usage";
- }
-
-- public void processCommand(ICommandSender var1, String[] var2) {
-- if(var2.length >= 1 && var2[0].equalsIgnoreCase("ips")) {
-- var1.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions("commands.banlist.ips", new Object[]{Integer.valueOf(MinecraftServer.getServer().getConfigurationManager().getBannedIPs().getBannedList().size())}));
-- var1.sendChatToPlayer(ChatMessageComponent.createFromText(joinNiceString(MinecraftServer.getServer().getConfigurationManager().getBannedIPs().getBannedList().keySet().toArray())));
-+ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) {
-+ if (par2ArrayOfStr.length >= 1 && par2ArrayOfStr[0].equalsIgnoreCase("ips")) {
-+ par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions("commands.banlist.ips", new Object[] {Integer.valueOf(MinecraftServer.getServer().getConfigurationManager().getBannedIPs().getBannedList().size())}));
-+ par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromText(joinNiceString(MinecraftServer.getServer().getConfigurationManager().getBannedIPs().getBannedList().keySet().toArray())));
- } else {
-- var1.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions("commands.banlist.players", new Object[]{Integer.valueOf(MinecraftServer.getServer().getConfigurationManager().getBannedPlayers().getBannedList().size())}));
-- var1.sendChatToPlayer(ChatMessageComponent.createFromText(joinNiceString(MinecraftServer.getServer().getConfigurationManager().getBannedPlayers().getBannedList().keySet().toArray())));
-+ par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions("commands.banlist.players", new Object[] {Integer.valueOf(MinecraftServer.getServer().getConfigurationManager().getBannedPlayers().getBannedList().size())}));
-+ par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromText(joinNiceString(MinecraftServer.getServer().getConfigurationManager().getBannedPlayers().getBannedList().keySet().toArray())));
- }
--
- }
-
-- public List addTabCompletionOptions(ICommandSender var1, String[] var2) {
-- return var2.length == 1 ? getListOfStringsMatchingLastWord(var2, new String[]{"players", "ips"}) : null;
-+ /**
-+ * Adds the strings available in this command to the given list of tab completion options.
-+ */
-+ public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) {
-+ return par2ArrayOfStr.length == 1 ? getListOfStringsMatchingLastWord(par2ArrayOfStr, new String[] {"players", "ips"}): null;
- }
- }
---- /dev/null
-+++ org/spoutcraft/client/gui/settings/controls/FancyWeatherButton.java
-@@ -1,0 +1,41 @@
-+/*
-+ * This file is part of Spoutcraft.
-+ *
-+ * Copyright (c) 2011 SpoutcraftDev
-+ * Spoutcraft is licensed under the GNU Lesser General Public License.
-+ *
-+ * Spoutcraft is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation, either version 3 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Spoutcraft is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program. If not, see .
-+ */
-+package org.spoutcraft.client.gui.settings.controls;
-+
-+import java.util.UUID;
-+
-+import org.spoutcraft.client.config.Configuration;
-+
-+public class FancyWeatherButton extends AutomatedCheckBox {
-+ UUID fancyGraphics;
-+ public FancyWeatherButton(UUID fancyGraphics) {
-+ super("Fancy Weather");
-+ this.fancyGraphics = fancyGraphics;
-+ setChecked(Configuration.isFancyWeather());
-+ setTooltip("Fancy Weather\nDefault - as set by setting Graphics\nFast - light rain/snow, faster\nFancy - heavy rain/snow, slower\nOFF - no rain/snow, fastest\nWhen rain is OFF the splashes and rain sounds\nare still active.");
-+ }
-+
-+ @Override
-+ public void onButtonClick() {
-+ Configuration.setFancyWeather(!Configuration.isFancyWeather());
-+ Configuration.write();
-+ ((FancyGraphicsButton)getScreen().getWidget(fancyGraphics)).custom = true;
-+ }
-+}
---- net/minecraft/src/CallableSuspiciousClasses.java
-+++ net/minecraft/src/CallableSuspiciousClasses.java
-@@ -11,15 +11,22 @@
- class CallableSuspiciousClasses implements Callable {
- final CrashReport theCrashReport;
-
-- CallableSuspiciousClasses(CrashReport var1) {
-- this.theCrashReport = var1;
-+ CallableSuspiciousClasses(CrashReport par1CrashReport) {
-+ this.theCrashReport = par1CrashReport;
- }
-
-- public String callSuspiciousClasses() throws Exception {
-+ public String callSuspiciousClasses() throws SecurityException, NoSuchFieldException, IllegalAccessException, IllegalArgumentException {
- StringBuilder var1 = new StringBuilder();
-- Field var2 = ClassLoader.class.getDeclaredField("classes");
-- var2.setAccessible(true);
-- ArrayList var3 = new ArrayList((Vector)var2.get(CrashReport.class.getClassLoader()));
-+ ArrayList var3;
-+
-+ try {
-+ Field var2 = ClassLoader.class.getDeclaredField("classes");
-+ var2.setAccessible(true);
-+ var3 = new ArrayList((Vector)var2.get(CrashReport.class.getClassLoader()));
-+ } catch (Exception ex) {
-+ return "";
-+ }
-+
- boolean var4 = true;
- boolean var5 = !CrashReport.class.getCanonicalName().equals("net.minecraft.CrashReport");
- HashMap var6 = new HashMap();
-@@ -27,105 +34,80 @@
- Collections.sort(var3, new ComparatorClassSorter(this));
- Iterator var8 = var3.iterator();
-
-- while(true) {
-- while(true) {
-- Class var9;
-- while(true) {
-- String var10;
-- do {
-- do {
-- do {
-- do {
-- do {
-- do {
-- do {
-- do {
-- do {
-- do {
-- do {
-- do {
-- if(!var8.hasNext()) {
-- if(var4) {
-- var1.append("No suspicious classes found.");
-- } else {
-- var1.append("]");
-- }
--
-- return var1.toString();
-- }
--
-- var9 = (Class)var8.next();
-- } while(var9 == null);
--
-- var10 = var9.getCanonicalName();
-- } while(var10 == null);
-- } while(var10.startsWith("org.lwjgl."));
-- } while(var10.startsWith("paulscode."));
-- } while(var10.startsWith("org.bouncycastle."));
-- } while(var10.startsWith("argo."));
-- } while(var10.startsWith("com.jcraft."));
-- } while(var10.startsWith("com.fasterxml."));
-- } while(var10.startsWith("com.google."));
-- } while(var10.startsWith("joptsimple."));
-- } while(var10.startsWith("org.apache."));
-- } while(var10.equals("util.GLX"));
--
-- if(var5) {
-- if(var10.length() > 3 && !var10.equals("net.minecraft.client.main.Main") && !var10.equals("net.minecraft.client.Minecraft") && !var10.equals("net.minecraft.client.ClientBrandRetriever") && !var10.equals("net.minecraft.server.MinecraftServer")) {
-- break;
-+ while (var8.hasNext()) {
-+ Class var9 = (Class)var8.next();
-+
-+ if (var9 != null) {
-+ String var10 = var9.getCanonicalName();
-+
-+ if (var10 != null && !var10.startsWith("org.lwjgl.") && !var10.startsWith("paulscode.") && !var10.startsWith("org.bouncycastle.") && !var10.startsWith("argo.") && !var10.startsWith("com.jcraft.") && !var10.startsWith("com.fasterxml.") && !var10.startsWith("com.google.") && !var10.startsWith("joptsimple.") && !var10.startsWith("org.apache.") && !var10.equals("util.GLX")) {
-+ if (var5) {
-+ if (var10.length() <= 3 || var10.equals("net.minecraft.client.main.Main") || var10.equals("net.minecraft.client.Minecraft") || var10.equals("net.minecraft.client.ClientBrandRetriever") || var10.equals("net.minecraft.server.MinecraftServer")) {
-+ continue;
-+ }
-+ } else if (var10.startsWith("net.minecraft")) {
-+ continue;
-+ }
-+
-+ Package var11 = var9.getPackage();
-+ String var12 = var11 == null ? "" : var11.getName();
-+
-+ if (var6.containsKey(var12)) {
-+ int var13 = ((Integer)var6.get(var12)).intValue();
-+ var6.put(var12, Integer.valueOf(var13 + 1));
-+
-+ if (var13 == 3) {
-+ if (!var4) {
-+ var1.append(", ");
-+ }
-+
-+ var1.append("...");
-+ var4 = false;
-+ continue;
-+ }
-+
-+ if (var13 > 3) {
-+ continue;
- }
- } else {
-- if(var10.startsWith("net.minecraft")) {
-- continue;
-- }
-- break;
-- }
-- }
--
-- Package var11 = var9.getPackage();
-- String var12 = var11 == null ? "" : var11.getName();
-- if(var6.containsKey(var12)) {
-- int var13 = ((Integer)var6.get(var12)).intValue();
-- var6.put(var12, Integer.valueOf(var13 + 1));
-- if(var13 == 3) {
-- if(!var4) {
-- var1.append(", ");
-- }
--
-- var1.append("...");
-- var4 = false;
-- continue;
-- }
--
-- if(var13 > 3) {
-- continue;
-- }
-- } else {
-- var6.put(var12, Integer.valueOf(1));
-- }
--
-- if(!var7.equals(var12) && var7.length() > 0) {
-- var1.append("], ");
-- }
--
-- if(!var4 && var7.equals(var12)) {
-- var1.append(", ");
-- }
--
-- if(!var7.equals(var12)) {
-- var1.append("[");
-- var1.append(var12);
-- var1.append(".");
-- }
--
-- var1.append(var9.getSimpleName());
-- var7 = var12;
-- var4 = false;
-+ var6.put(var12, Integer.valueOf(1));
-+ }
-+
-+ if (!var7.equals(var12) && var7.length() > 0) {
-+ var1.append("], ");
-+ }
-+
-+ if (!var4 && var7.equals(var12)) {
-+ var1.append(", ");
-+ }
-+
-+ if (!var7.equals(var12)) {
-+ var1.append("[");
-+ var1.append(var12);
-+ var1.append(".");
-+ }
-+
-+ var1.append(var9.getSimpleName());
-+ var7 = var12;
-+ var4 = false;
-+ }
- }
- }
-+
-+ if (var4) {
-+ var1.append("No suspicious classes found.");
-+ } else {
-+ var1.append("]");
-+ }
-+
-+ return var1.toString();
- }
-
-- public Object call() throws Exception {
-- return this.callSuspiciousClasses();
-+ public Object call() {
-+ try {
-+ return this.callSuspiciousClasses();
-+ } catch (Exception ex) {
-+ return null;
-+ }
- }
- }
---- net/minecraft/src/CrashReportCategory.java
-+++ net/minecraft/src/CrashReportCategory.java
-@@ -7,30 +7,32 @@
-
- public class CrashReportCategory {
- private final CrashReport theCrashReport;
-- private final String b;
-- private final List c = new ArrayList();
-- private StackTraceElement[] d = new StackTraceElement[0];
--
-- public CrashReportCategory(CrashReport var1, String var2) {
-- this.theCrashReport = var1;
-- this.b = var2;
-- }
--
-- public static String func_85074_a(double var0, double var2, double var4) {
-- return String.format("%.2f,%.2f,%.2f - %s", new Object[]{Double.valueOf(var0), Double.valueOf(var2), Double.valueOf(var4), getLocationInfo(MathHelper.floor_double(var0), MathHelper.floor_double(var2), MathHelper.floor_double(var4))});
-- }
--
-- public static String getLocationInfo(int var0, int var1, int var2) {
-+ private final String field_85076_b;
-+ private final List field_85077_c = new ArrayList();
-+ private StackTraceElement[] stackTrace = new StackTraceElement[0];
-+
-+ public CrashReportCategory(CrashReport par1CrashReport, String par2Str) {
-+ 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) {
- StringBuilder var3 = new StringBuilder();
-
- try {
-- var3.append(String.format("World: (%d,%d,%d)", new Object[]{Integer.valueOf(var0), Integer.valueOf(var1), Integer.valueOf(var2)}));
-+ var3.append(String.format("World: (%d,%d,%d)", new Object[] {Integer.valueOf(par0), Integer.valueOf(par1), Integer.valueOf(par2)}));
- } catch (Throwable var16) {
- var3.append("(Error finding world loc)");
- }
-
- var3.append(", ");
--
- int var4;
- int var5;
- int var6;
-@@ -40,17 +42,18 @@
- int var10;
- int var11;
- int var12;
-+
- try {
-- var4 = var0 >> 4;
-- var5 = var2 >> 4;
-- var6 = var0 & 15;
-- var7 = var1 >> 4;
-- var8 = var2 & 15;
-+ var4 = par0 >> 4;
-+ var5 = par2 >> 4;
-+ var6 = par0 & 15;
-+ var7 = par1 >> 4;
-+ var8 = par2 & 15;
- var9 = var4 << 4;
- var10 = var5 << 4;
- var11 = (var4 + 1 << 4) - 1;
- var12 = (var5 + 1 << 4) - 1;
-- var3.append(String.format("Chunk: (at %d,%d,%d in %d,%d; contains blocks %d,0,%d to %d,255,%d)", new Object[]{Integer.valueOf(var6), Integer.valueOf(var7), Integer.valueOf(var8), Integer.valueOf(var4), Integer.valueOf(var5), Integer.valueOf(var9), Integer.valueOf(var10), Integer.valueOf(var11), Integer.valueOf(var12)}));
-+ var3.append(String.format("Chunk: (at %d,%d,%d in %d,%d; contains blocks %d,0,%d to %d,255,%d)", new Object[] {Integer.valueOf(var6), Integer.valueOf(var7), Integer.valueOf(var8), Integer.valueOf(var4), Integer.valueOf(var5), Integer.valueOf(var9), Integer.valueOf(var10), Integer.valueOf(var11), Integer.valueOf(var12)}));
- } catch (Throwable var15) {
- var3.append("(Error finding chunk loc)");
- }
-@@ -58,8 +61,8 @@
- var3.append(", ");
-
- try {
-- var4 = var0 >> 9;
-- var5 = var2 >> 9;
-+ var4 = par0 >> 9;
-+ var5 = par2 >> 9;
- var6 = var4 << 5;
- var7 = var5 << 5;
- var8 = (var4 + 1 << 5) - 1;
-@@ -68,7 +71,7 @@
- var11 = var5 << 9;
- var12 = (var4 + 1 << 9) - 1;
- int var13 = (var5 + 1 << 9) - 1;
-- var3.append(String.format("Region: (%d,%d; contains chunks %d,%d to %d,%d, blocks %d,0,%d to %d,255,%d)", new Object[]{Integer.valueOf(var4), Integer.valueOf(var5), Integer.valueOf(var6), Integer.valueOf(var7), Integer.valueOf(var8), Integer.valueOf(var9), Integer.valueOf(var10), Integer.valueOf(var11), Integer.valueOf(var12), Integer.valueOf(var13)}));
-+ var3.append(String.format("Region: (%d,%d; contains chunks %d,%d to %d,%d, blocks %d,0,%d to %d,255,%d)", new Object[] {Integer.valueOf(var4), Integer.valueOf(var5), Integer.valueOf(var6), Integer.valueOf(var7), Integer.valueOf(var8), Integer.valueOf(var9), Integer.valueOf(var10), Integer.valueOf(var11), Integer.valueOf(var12), Integer.valueOf(var13)}));
- } catch (Throwable var14) {
- var3.append("(Error finding world loc)");
- }
-@@ -76,40 +79,49 @@
- return var3.toString();
- }
-
-- public void addCrashSectionCallable(String var1, Callable var2) {
-+ /**
-+ * Adds a Crashreport section with the given name with the value set to the result of the given Callable;
-+ */
-+ public void addCrashSectionCallable(String par1Str, Callable par2Callable) {
- try {
-- this.addCrashSection(var1, var2.call());
-+ this.addCrashSection(par1Str, par2Callable.call());
- } catch (Throwable var4) {
-- this.addCrashSectionThrowable(var1, var4);
-+ this.addCrashSectionThrowable(par1Str, var4);
- }
--
-- }
--
-- public void addCrashSection(String var1, Object var2) {
-- this.c.add(new CrashReportCategoryEntry(var1, var2));
-- }
--
-- public void addCrashSectionThrowable(String var1, Throwable var2) {
-- this.addCrashSection(var1, var2);
-- }
--
-- public int func_85073_a(int var1) {
-+ }
-+
-+ /**
-+ * Adds a Crashreport section with the given name with the given value (convered .toString())
-+ */
-+ public void addCrashSection(String par1Str, Object par2Obj) {
-+ this.field_85077_c.add(new CrashReportCategoryEntry(par1Str, par2Obj));
-+ }
-+
-+ /**
-+ * Adds a Crashreport section with the given name with the given Throwable
-+ */
-+ public void addCrashSectionThrowable(String par1Str, Throwable par2Throwable) {
-+ this.addCrashSection(par1Str, par2Throwable);
-+ }
-+
-+ public int func_85073_a(int par1) {
- StackTraceElement[] var2 = Thread.currentThread().getStackTrace();
-- this.d = new StackTraceElement[var2.length - 3 - var1];
-- System.arraycopy(var2, 3 + var1, this.d, 0, this.d.length);
-- return this.d.length;
-+ this.stackTrace = new StackTraceElement[var2.length - 3 - par1];
-+ System.arraycopy(var2, 3 + par1, this.stackTrace, 0, this.stackTrace.length);
-+ return this.stackTrace.length;
- }
-
-- public boolean func_85069_a(StackTraceElement var1, StackTraceElement var2) {
-- if(this.d.length != 0 && var1 != null) {
-- StackTraceElement var3 = this.d[0];
-- if(var3.isNativeMethod() == var1.isNativeMethod() && var3.getClassName().equals(var1.getClassName()) && var3.getFileName().equals(var1.getFileName()) && var3.getMethodName().equals(var1.getMethodName())) {
-- if(var2 != null != this.d.length > 1) {
-+ public boolean func_85069_a(StackTraceElement par1StackTraceElement, StackTraceElement par2StackTraceElement) {
-+ if (this.stackTrace.length != 0 && par1StackTraceElement != null) {
-+ StackTraceElement var3 = this.stackTrace[0];
-+
-+ if (var3.isNativeMethod() == par1StackTraceElement.isNativeMethod() && var3.getClassName().equals(par1StackTraceElement.getClassName()) && var3.getFileName().equals(par1StackTraceElement.getFileName()) && var3.getMethodName().equals(par1StackTraceElement.getMethodName())) {
-+ if (par2StackTraceElement != null != this.stackTrace.length > 1) {
- return false;
-- } else if(var2 != null && !this.d[1].equals(var2)) {
-+ } else if (par2StackTraceElement != null && !this.stackTrace[1].equals(par2StackTraceElement)) {
- return false;
- } else {
-- this.d[0] = var1;
-+ this.stackTrace[0] = par1StackTraceElement;
- return true;
- }
- } else {
-@@ -120,42 +132,41 @@
- }
- }
-
-- public void func_85070_b(int var1) {
-- StackTraceElement[] var2 = new StackTraceElement[this.d.length - var1];
-- System.arraycopy(this.d, 0, var2, 0, var2.length);
-- this.d = var2;
-+ public void func_85070_b(int par1) {
-+ StackTraceElement[] var2 = new StackTraceElement[this.stackTrace.length - par1];
-+ System.arraycopy(this.stackTrace, 0, var2, 0, var2.length);
-+ this.stackTrace = var2;
- }
-
-- public void func_85072_a(StringBuilder var1) {
-- var1.append("-- ").append(this.b).append(" --\n");
-- var1.append("Details:");
-- Iterator var2 = this.c.iterator();
-+ public void func_85072_a(StringBuilder par1StringBuilder) {
-+ par1StringBuilder.append("-- ").append(this.field_85076_b).append(" --\n");
-+ par1StringBuilder.append("Details:");
-+ Iterator var2 = this.field_85077_c.iterator();
-
-- while(var2.hasNext()) {
-+ while (var2.hasNext()) {
- CrashReportCategoryEntry var3 = (CrashReportCategoryEntry)var2.next();
-- var1.append("\n\t");
-- var1.append(var3.func_85089_a());
-- var1.append(": ");
-- var1.append(var3.func_85090_b());
-+ par1StringBuilder.append("\n\t");
-+ par1StringBuilder.append(var3.func_85089_a());
-+ par1StringBuilder.append(": ");
-+ par1StringBuilder.append(var3.func_85090_b());
- }
-
-- if(this.d != null && this.d.length > 0) {
-- var1.append("\nStacktrace:");
-- StackTraceElement[] var6 = this.d;
-+ if (this.stackTrace != null && this.stackTrace.length > 0) {
-+ par1StringBuilder.append("\nStacktrace:");
-+ StackTraceElement[] var6 = this.stackTrace;
- int var7 = var6.length;
-
-- for(int var4 = 0; var4 < var7; ++var4) {
-+ for (int var4 = 0; var4 < var7; ++var4) {
- StackTraceElement var5 = var6[var4];
-- var1.append("\n\tat ");
-- var1.append(var5.toString());
-+ par1StringBuilder.append("\n\tat ");
-+ par1StringBuilder.append(var5.toString());
- }
- }
--
- }
-
-- public static void addBlockCrashInfo(CrashReportCategory var0, int var1, int var2, int var3, int var4, int var5) {
-- var0.addCrashSectionCallable("Block type", new CallableBlockType(var4));
-- var0.addCrashSectionCallable("Block data value", new CallableBlockDataValue(var5));
-- var0.addCrashSectionCallable("Block location", new CallableBlockLocation(var1, var2, var3));
-+ public static void addBlockCrashInfo(CrashReportCategory par0CrashReportCategory, int par1, int par2, int par3, int par4, int par5) {
-+ par0CrashReportCategory.addCrashSectionCallable("Block type", new CallableBlockType(par4));
-+ par0CrashReportCategory.addCrashSectionCallable("Block data value", new CallableBlockDataValue(par5));
-+ par0CrashReportCategory.addCrashSectionCallable("Block location", new CallableBlockLocation(par1, par2, par3));
- }
- }
---- /dev/null
-+++ org/spoutcraft/api/material/block/DoubleSlabs.java
-@@ -1,0 +1,32 @@
-+/*
-+ * This file is part of Spoutcraft.
-+ *
-+ * Copyright (c) 2011 SpoutcraftDev
-+ * Spoutcraft is licensed under the GNU Lesser General Public License.
-+ *
-+ * Spoutcraft is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation, either version 3 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Spoutcraft is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program. If not, see .
-+ */
-+package org.spoutcraft.api.material.block;
-+
-+import org.spoutcraft.api.material.SolidBlock;
-+
-+public class DoubleSlabs extends GenericBlock implements SolidBlock {
-+ public DoubleSlabs(String name, int id, int data) {
-+ super(name, id, data);
-+ }
-+
-+ public boolean isFallingBlock() {
-+ return false;
-+ }
-+}
---- net/minecraft/src/ModelMagmaCube.java
-+++ net/minecraft/src/ModelMagmaCube.java
-@@ -5,13 +5,14 @@
- ModelRenderer field_78108_b;
-
- public ModelMagmaCube() {
-- for(int var1 = 0; var1 < this.field_78109_a.length; ++var1) {
-+ for (int var1 = 0; var1 < this.field_78109_a.length; ++var1) {
- byte var2 = 0;
- int var3 = var1;
-- if(var1 == 2) {
-+
-+ if (var1 == 2) {
- var2 = 24;
- var3 = 10;
-- } else if(var1 == 3) {
-+ } else if (var1 == 3) {
- var2 = 24;
- var3 = 19;
- }
-@@ -24,26 +25,32 @@
- this.field_78108_b.addBox(-2.0F, 18.0F, -2.0F, 4, 4, 4);
- }
-
-- public void setLivingAnimations(EntityLivingBase var1, float var2, float var3, float var4) {
-- EntityMagmaCube var5 = (EntityMagmaCube)var1;
-- float var6 = var5.prevSquishFactor + (var5.squishFactor - var5.prevSquishFactor) * var4;
-- if(var6 < 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) {
-+ 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) {
-+ for (int var7 = 0; var7 < this.field_78109_a.length; ++var7) {
- this.field_78109_a[var7].rotationPointY = (float)(-(4 - var7)) * var6 * 1.7F;
- }
--
- }
-
-- public void render(Entity var1, float var2, float var3, float var4, float var5, float var6, float var7) {
-- this.setRotationAngles(var2, var3, var4, var5, var6, var7, var1);
-- this.field_78108_b.render(var7);
-+ /**
-+ * 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(var7);
-+ for (int var8 = 0; var8 < this.field_78109_a.length; ++var8) {
-+ this.field_78109_a[var8].render(par7);
- }
--
- }
- }
---- net/minecraft/src/TileEntityEnderChestRenderer.java
-+++ net/minecraft/src/TileEntityEnderChestRenderer.java
-@@ -5,41 +5,48 @@
-
- public class TileEntityEnderChestRenderer extends TileEntitySpecialRenderer {
- private static final ResourceLocation field_110637_a = new ResourceLocation("textures/entity/chest/ender.png");
-+
-+ /** The Ender Chest Chest's model. */
- private ModelChest theEnderChestModel = new ModelChest();
-
-- public void renderEnderChest(TileEntityEnderChest var1, double var2, double var4, double var6, float var8) {
-+ /**
-+ * Helps to render Ender Chest.
-+ */
-+ public void renderEnderChest(TileEntityEnderChest par1TileEntityEnderChest, double par2, double par4, double par6, float par8) {
- int var9 = 0;
-- if(var1.hasWorldObj()) {
-- var9 = var1.getBlockMetadata();
-+
-+ if (par1TileEntityEnderChest.hasWorldObj()) {
-+ var9 = par1TileEntityEnderChest.getBlockMetadata();
- }
-
- this.bindTexture(field_110637_a);
- GL11.glPushMatrix();
- GL11.glEnable(GL12.GL_RESCALE_NORMAL);
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
-- GL11.glTranslatef((float)var2, (float)var4 + 1.0F, (float)var6 + 1.0F);
-+ GL11.glTranslatef((float)par2, (float)par4 + 1.0F, (float)par6 + 1.0F);
- GL11.glScalef(1.0F, -1.0F, -1.0F);
- GL11.glTranslatef(0.5F, 0.5F, 0.5F);
- short var10 = 0;
-- if(var9 == 2) {
-+
-+ if (var9 == 2) {
- var10 = 180;
- }
-
-- if(var9 == 3) {
-+ if (var9 == 3) {
- var10 = 0;
- }
-
-- if(var9 == 4) {
-+ if (var9 == 4) {
- var10 = 90;
- }
-
-- if(var9 == 5) {
-+ if (var9 == 5) {
- var10 = -90;
- }
-
- GL11.glRotatef((float)var10, 0.0F, 1.0F, 0.0F);
- GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
-- float var11 = var1.prevLidAngle + (var1.lidAngle - var1.prevLidAngle) * var8;
-+ float var11 = par1TileEntityEnderChest.prevLidAngle + (par1TileEntityEnderChest.lidAngle - par1TileEntityEnderChest.prevLidAngle) * par8;
- var11 = 1.0F - var11;
- var11 = 1.0F - var11 * var11 * var11;
- this.theEnderChestModel.chestLid.rotateAngleX = -(var11 * (float)Math.PI / 2.0F);
-@@ -49,7 +56,7 @@
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- }
-
-- public void renderTileEntityAt(TileEntity var1, double var2, double var4, double var6, float var8) {
-- this.renderEnderChest((TileEntityEnderChest)var1, var2, var4, var6, var8);
-+ public void renderTileEntityAt(TileEntity par1TileEntity, double par2, double par4, double par6, float par8) {
-+ this.renderEnderChest((TileEntityEnderChest)par1TileEntity, par2, par4, par6, par8);
- }
- }
---- /dev/null
-+++ org/spoutcraft/client/gui/error/GuiUnexpectedError.java
-@@ -1,0 +1,214 @@
-+/*
-+ * This file is part of Spoutcraft.
-+ *
-+ * Copyright (c) 2011 SpoutcraftDev
-+ * Spoutcraft is licensed under the GNU Lesser General Public License.
-+ *
-+ * Spoutcraft is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation, either version 3 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Spoutcraft is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program. If not, see .
-+ */
-+package org.spoutcraft.client.gui.error;
-+
-+import java.awt.Desktop;
-+import java.awt.Toolkit;
-+import java.awt.datatransfer.StringSelection;
-+import java.io.BufferedReader;
-+import java.io.InputStreamReader;
-+import java.io.OutputStreamWriter;
-+import java.io.PrintWriter;
-+import java.io.StringWriter;
-+import java.net.URL;
-+import java.net.URLConnection;
-+
-+import org.lwjgl.Sys;
-+import org.lwjgl.opengl.GL11;
-+
-+import net.minecraft.src.Minecraft;
-+import net.minecraft.src.GuiScreen;
-+
-+import org.bukkit.ChatColor;
-+
-+import org.spoutcraft.api.Spoutcraft;
-+import org.spoutcraft.api.gui.Button;
-+import org.spoutcraft.api.gui.Color;
-+import org.spoutcraft.api.gui.GenericButton;
-+import org.spoutcraft.api.gui.GenericLabel;
-+import org.spoutcraft.api.gui.GenericScrollArea;
-+import org.spoutcraft.api.gui.RenderPriority;
-+import org.spoutcraft.api.gui.WidgetAnchor;
-+import org.spoutcraft.client.SpoutClient;
-+
-+public class GuiUnexpectedError extends GuiScreen {
-+ private Throwable caused;
-+ private GenericLabel hastebinLink;
-+
-+ private String hastebinURL;
-+ private boolean generated = false;
-+
-+ public GuiUnexpectedError(Throwable caused) {
-+ this.caused = caused;
-+ }
-+
-+ public void initGui() {
-+
-+ GenericScrollArea screen = new GenericScrollArea();
-+ screen.setHeight(height - 16 - 24).setWidth(width).setY(16 + 24).setX(0);
-+ getScreen().attachWidget("Spoutcraft", screen);
-+
-+ GenericLabel label = new GenericLabel("Oh noes! An error has occurred!");
-+ int size = Spoutcraft.getMinecraftFont().getTextWidth(label.getText());
-+ label.setX((int) (width / 2 - size / 2)).setY(16);
-+ label.setFixed(true).setPriority(RenderPriority.Lowest);
-+ getScreen().attachWidget("Spoutcraft", label);
-+
-+ int top = 60;
-+ Color grey = new Color(0.80F, 0.80F, 0.80F, 0.65F);
-+
-+ hastebinLink = new GenericLabel("Generating hastie...");
-+ hastebinLink.setX(95).setY(top);
-+ hastebinLink.setTextColor(grey);
-+ screen.attachWidget("Spoutcraft", hastebinLink);
-+ generateHastie();
-+
-+ Button button = new CopyErrorURL(this).setText("Copy Link");
-+ button.setHeight(20).setWidth(80);
-+ button.setX((int) (hastebinLink.getWidth() + hastebinLink.getX() + 10.0));
-+ button.setY(top-5);
-+ button.setAlign(WidgetAnchor.TOP_CENTER);
-+ screen.attachWidget("Spoutcraft", button);
-+
-+ top += 25;
-+
-+ button = new ReportErrorButton().setText("Report");
-+ button.setHeight(20).setWidth(70);
-+ button.setX((int) (width / 2 - button.getWidth() - button.getWidth() / 2));
-+ button.setY(top);
-+ button.setAlign(WidgetAnchor.TOP_CENTER);
-+ screen.attachWidget("Spoutcraft", button);
-+
-+ button = new IgnoreErrorButton().setText("Ignore");
-+ button.setHeight(20).setWidth(70);
-+ button.setX((int) (width / 2 + button.getWidth() / 2));
-+ button.setY(top);
-+ button.setAlign(WidgetAnchor.TOP_CENTER);
-+ screen.attachWidget("Spoutcraft", button);
-+ top += 30;
-+ }
-+
-+ @Override
-+ public void drawScreen(int var1, int var2, float var3) {
-+ drawDefaultBackground();
-+ }
-+
-+ private void generateHastie() {
-+ if (generated) {
-+ hastebinLink.setText("Error Link: " + ChatColor.GREEN + hastebinURL);
-+ return;
-+ }
-+ try {
-+ StringBuilder builder = new StringBuilder("Spoutcraft Error Report:\n");
-+ builder.append(" Build: ").append(SpoutClient.getClientVersion()).append("\n");
-+ builder.append("-----------------------------------").append("\n");
-+ builder.append("Stack Trace:").append("\n");
-+ builder.append(" Exception: ").append(caused.getClass().getSimpleName()).append("\n");
-+ builder.append(" Message: ").append(caused.getMessage()).append("\n");
-+ builder.append(" Trace:").append("\n");
-+
-+ StringWriter sw = new StringWriter();
-+ caused.printStackTrace(new PrintWriter(sw));
-+ String causeString = sw.toString();
-+ builder.append(" ").append(sw).append("\n");
-+
-+ builder.append("-----------------------------------").append("\n");
-+ builder.append("Minecraft Information:\n");
-+ // ToDO:
-+ //builder.append(" Texture Pack: ").append(Minecraft.getMinecraft().texturePackList.getSelectedTexturePack().getTexturePackFileName()).append("\n");
-+ //builder.append(" Texture Pack Res: ").append(TileSize.int_size + "x").append("\n");
-+ builder.append(" LWJGL Version: ").append(Sys.getVersion()).append("\n");
-+
-+ builder.append("System Information:\n");
-+ builder.append(" Operating System: ").append(System.getProperty("os.name")).append("\n");
-+ builder.append(" Operating System Version: ").append(System.getProperty("os.version")).append("\n");
-+ builder.append(" Operating System Architecture: ").append(System.getProperty("os.arch")).append("\n");
-+ builder.append(" Java version: ").append(System.getProperty("java.version")).append(" ").append(System.getProperty("sun.arch.data.model", "32")).append(" bit").append("\n");
-+ builder.append(" Total Memory: ").append(Runtime.getRuntime().totalMemory() / 1024L / 1024L).append(" MB\n");
-+ builder.append(" Max Memory: ").append(Runtime.getRuntime().maxMemory() / 1024L / 1024L).append(" MB\n");
-+ builder.append(" Memory Free: ").append(Runtime.getRuntime().freeMemory() / 1024L / 1024L).append(" MB\n");
-+ builder.append(" CPU Cores: ").append(Runtime.getRuntime().availableProcessors()).append("\n");
-+ builder.append(" OpenGL Version: ").append(GL11.glGetString(GL11.GL_VERSION)).append("\n");
-+ builder.append(" OpenGL Vendor: ").append(GL11.glGetString(GL11.GL_VENDOR)).append("\n");
-+ String message = builder.toString();
-+
-+ PasteBinAPI pastebin = new PasteBinAPI("963f01dd506cb3f607a487bc34b60d16");
-+ String response = pastebin.makePaste(message, "ser_" + System.currentTimeMillis(), "text");
-+ System.out.println("pastebin response: " + response);
-+ if (!response.startsWith("http://pastebin.com")) {
-+ URL url = new URL("http://www.hastebin.com/documents");
-+ URLConnection conn = url.openConnection();
-+ conn.setDoOutput(true);
-+ OutputStreamWriter wr = new OutputStreamWriter(conn.getOutputStream());
-+ wr.write(builder.toString());
-+ wr.flush();
-+
-+ BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
-+ String line = rd.readLine();
-+ hastebinURL = "hastebin.com/" + line.substring(8, line.length() - 2); // Get rid of the JSON stuff
-+ wr.close();
-+ rd.close();
-+ } else {
-+ hastebinURL = response;
-+ }
-+ hastebinLink.setText("Error: " + ChatColor.GREEN + hastebinURL);
-+ generated = true;
-+ } catch (Exception e) {
-+ hastebinLink.setText("Connection error!");
-+ }
-+ }
-+
-+ protected void copyErrorToClipboard() {
-+ Toolkit.getDefaultToolkit().getSystemClipboard().setContents(new StringSelection(hastebinURL), null);
-+ }
-+}
-+
-+class CopyErrorURL extends GenericButton {
-+ private GuiUnexpectedError error;
-+ CopyErrorURL(GuiUnexpectedError error) {
-+ this.error = error;
-+ }
-+
-+ public void onButtonClick() {
-+ error.copyErrorToClipboard();
-+ }
-+}
-+
-+class IgnoreErrorButton extends GenericButton {
-+ public void onButtonClick() {
-+ Minecraft.getMinecraft().displayGuiScreen(new org.spoutcraft.client.gui.mainmenu.MainMenu());
-+ }
-+}
-+
-+class ReportErrorButton extends GenericButton {
-+ public void onButtonClick() {
-+ try {
-+ URL url = new URL("http://spout.in/issues");
-+ Desktop.getDesktop().browse(url.toURI());
-+ } catch (Exception e) { }
-+ Minecraft.getMinecraft().displayGuiScreen(new org.spoutcraft.client.gui.mainmenu.MainMenu());
-+ }
-+}
-+
-+class ExitGameButton extends GenericButton {
-+ public void onButtonClick() {
-+ Minecraft.getMinecraft().shutdownMinecraftApplet();
-+ }
-+}
---- net/minecraft/src/ChunkProviderGenerate.java
-+++ net/minecraft/src/ChunkProviderGenerate.java
-@@ -4,59 +4,107 @@
- import java.util.Random;
-
- public class ChunkProviderGenerate implements IChunkProvider {
-- private Random k;
-+
-+ /** RNG. */
-+ private Random rand;
-+
-+ /** A NoiseGeneratorOctaves used in generating terrain */
- private NoiseGeneratorOctaves noiseGen1;
-+
-+ /** A NoiseGeneratorOctaves used in generating terrain */
- private NoiseGeneratorOctaves noiseGen2;
-+
-+ /** A NoiseGeneratorOctaves used in generating terrain */
- private NoiseGeneratorOctaves noiseGen3;
-+
-+ /** A NoiseGeneratorOctaves used in generating terrain */
- private NoiseGeneratorOctaves noiseGen4;
-+
-+ /** A NoiseGeneratorOctaves used in generating terrain */
- public NoiseGeneratorOctaves noiseGen5;
-+
-+ /** A NoiseGeneratorOctaves used in generating terrain */
- public NoiseGeneratorOctaves noiseGen6;
- public NoiseGeneratorOctaves mobSpawnerNoise;
-+
-+ /** Reference to the World object. */
- private World worldObj;
-+
-+ /** are map structures going to be generated (e.g. strongholds) */
- private final boolean mapFeaturesEnabled;
-+
-+ /** Holds the overall noise array used in chunk generation */
- private double[] noiseArray;
- private double[] stoneNoise = new double[256];
- private MapGenBase caveGenerator = new MapGenCaves();
-+
-+ /** Holds Stronghold Generator */
- private MapGenStronghold strongholdGenerator = new MapGenStronghold();
-+
-+ /** Holds Village Generator */
- private MapGenVillage villageGenerator = new MapGenVillage();
-+
-+ /** Holds Mineshaft Generator */
- private MapGenMineshaft mineshaftGenerator = new MapGenMineshaft();
- private MapGenScatteredFeature scatteredFeatureGenerator = new MapGenScatteredFeature();
-+
-+ /** Holds ravine generator */
- private MapGenBase ravineGenerator = new MapGenRavine();
-+
-+ /** The biomes that are used to generate the chunk */
- private BiomeGenBase[] biomesForGeneration;
-+
-+ /** A double array that hold terrain noise from noiseGen3 */
- double[] noise3;
-+
-+ /** A double array that hold terrain noise */
- double[] noise1;
-+
-+ /** A double array that hold terrain noise from noiseGen2 */
- double[] noise2;
-+
-+ /** A double array that hold terrain noise from noiseGen5 */
- double[] noise5;
-+
-+ /** A double array that holds terrain noise from noiseGen6 */
- double[] noise6;
-+
-+ /**
-+ * Used to store the 5x5 parabolic field that is used during terrain generation.
-+ */
- float[] parabolicField;
- int[][] field_73219_j = new int[32][32];
-
-- public ChunkProviderGenerate(World var1, long var2, boolean var4) {
-- this.worldObj = var1;
-- this.mapFeaturesEnabled = var4;
-- this.k = new Random(var2);
-- this.noiseGen1 = new NoiseGeneratorOctaves(this.k, 16);
-- this.noiseGen2 = new NoiseGeneratorOctaves(this.k, 16);
-- this.noiseGen3 = new NoiseGeneratorOctaves(this.k, 8);
-- this.noiseGen4 = new NoiseGeneratorOctaves(this.k, 4);
-- this.noiseGen5 = new NoiseGeneratorOctaves(this.k, 10);
-- this.noiseGen6 = new NoiseGeneratorOctaves(this.k, 16);
-- this.mobSpawnerNoise = new NoiseGeneratorOctaves(this.k, 8);
-+ public ChunkProviderGenerate(World par1World, long par2, boolean par4) {
-+ this.worldObj = par1World;
-+ this.mapFeaturesEnabled = par4;
-+ this.rand = new Random(par2);
-+ this.noiseGen1 = new NoiseGeneratorOctaves(this.rand, 16);
-+ this.noiseGen2 = new NoiseGeneratorOctaves(this.rand, 16);
-+ this.noiseGen3 = new NoiseGeneratorOctaves(this.rand, 8);
-+ this.noiseGen4 = new NoiseGeneratorOctaves(this.rand, 4);
-+ this.noiseGen5 = new NoiseGeneratorOctaves(this.rand, 10);
-+ this.noiseGen6 = new NoiseGeneratorOctaves(this.rand, 16);
-+ this.mobSpawnerNoise = new NoiseGeneratorOctaves(this.rand, 8);
- }
-
-- public void generateTerrain(int var1, int var2, byte[] var3) {
-+ /**
-+ * Generates the shape of the terrain for the chunk though its all stone though the water is frozen if the temperature
-+ * is low enough
-+ */
-+ public void generateTerrain(int par1, int par2, byte[] par3ArrayOfByte) {
- byte var4 = 4;
- byte var5 = 16;
- byte var6 = 63;
- int var7 = var4 + 1;
- byte var8 = 17;
- int var9 = var4 + 1;
-- this.biomesForGeneration = this.worldObj.getWorldChunkManager().getBiomesForGeneration(this.biomesForGeneration, var1 * 4 - 2, var2 * 4 - 2, var7 + 5, var9 + 5);
-- this.noiseArray = this.initializeNoiseField(this.noiseArray, var1 * var4, 0, var2 * var4, var7, var8, var9);
-+ this.biomesForGeneration = this.worldObj.getWorldChunkManager().getBiomesForGeneration(this.biomesForGeneration, par1 * 4 - 2, par2 * 4 - 2, var7 + 5, var9 + 5);
-+ this.noiseArray = this.initializeNoiseField(this.noiseArray, par1 * var4, 0, par2 * var4, var7, var8, var9);
-
-- for(int var10 = 0; var10 < var4; ++var10) {
-- for(int var11 = 0; var11 < var4; ++var11) {
-- for(int var12 = 0; var12 < var5; ++var12) {
-+ for (int var10 = 0; var10 < var4; ++var10) {
-+ for (int var11 = 0; var11 < var4; ++var11) {
-+ for (int var12 = 0; var12 < var5; ++var12) {
- double var13 = 0.125D;
- double var15 = this.noiseArray[((var10 + 0) * var9 + var11 + 0) * var8 + var12 + 0];
- double var17 = this.noiseArray[((var10 + 0) * var9 + var11 + 1) * var8 + var12 + 0];
-@@ -67,14 +115,14 @@
- double var27 = (this.noiseArray[((var10 + 1) * var9 + var11 + 0) * var8 + var12 + 1] - var19) * var13;
- double var29 = (this.noiseArray[((var10 + 1) * var9 + var11 + 1) * var8 + var12 + 1] - var21) * var13;
-
-- for(int var31 = 0; var31 < 8; ++var31) {
-+ for (int var31 = 0; var31 < 8; ++var31) {
- double var32 = 0.25D;
- double var34 = var15;
- double var36 = var17;
- double var38 = (var19 - var15) * var32;
- double var40 = (var21 - var17) * var32;
-
-- for(int var42 = 0; var42 < 4; ++var42) {
-+ for (int var42 = 0; var42 < 4; ++var42) {
- int var43 = var42 + var10 * 4 << 11 | 0 + var11 * 4 << 7 | var12 * 8 + var31;
- short var44 = 128;
- var43 -= var44;
-@@ -82,17 +130,13 @@
- double var49 = (var36 - var34) * var45;
- double var47 = var34 - var49;
-
-- for(int var51 = 0; var51 < 4; ++var51) {
-- var47 += var49;
-- if(var47 > 0.0D) {
-- var43 += var44;
-- var3[var43] = (byte)Block.stone.blockID;
-- } else if(var12 * 8 + var31 < var6) {
-- var43 += var44;
-- var3[var43] = (byte)Block.waterStill.blockID;
-+ for (int var51 = 0; var51 < 4; ++var51) {
-+ if ((var47 += var49) > 0.0D) {
-+ par3ArrayOfByte[var43 += var44] = (byte)Block.stone.blockID;
-+ } else if (var12 * 8 + var31 < var6) {
-+ par3ArrayOfByte[var43 += var44] = (byte)Block.waterStill.blockID;
- } else {
-- var43 += var44;
-- var3[var43] = 0;
-+ par3ArrayOfByte[var43 += var44] = 0;
- }
- }
-
-@@ -108,43 +152,47 @@
- }
- }
- }
--
- }
-
-- public void replaceBlocksForBiome(int var1, int var2, byte[] var3, BiomeGenBase[] var4) {
-+ /**
-+ * Replaces the stone that was placed in with blocks that match the biome
-+ */
-+ public void replaceBlocksForBiome(int par1, int par2, byte[] par3ArrayOfByte, BiomeGenBase[] par4ArrayOfBiomeGenBase) {
- byte var5 = 63;
-- double var6 = 1.0D / 32.0D;
-- this.stoneNoise = this.noiseGen4.generateNoiseOctaves(this.stoneNoise, var1 * 16, var2 * 16, 0, 16, 16, 1, var6 * 2.0D, var6 * 2.0D, var6 * 2.0D);
-+ double var6 = 0.03125D;
-+ this.stoneNoise = this.noiseGen4.generateNoiseOctaves(this.stoneNoise, par1 * 16, par2 * 16, 0, 16, 16, 1, var6 * 2.0D, var6 * 2.0D, var6 * 2.0D);
-
-- for(int var8 = 0; var8 < 16; ++var8) {
-- for(int var9 = 0; var9 < 16; ++var9) {
-- BiomeGenBase var10 = var4[var9 + var8 * 16];
-+ for (int var8 = 0; var8 < 16; ++var8) {
-+ for (int var9 = 0; var9 < 16; ++var9) {
-+ BiomeGenBase var10 = par4ArrayOfBiomeGenBase[var9 + var8 * 16];
- float var11 = var10.getFloatTemperature();
-- int var12 = (int)(this.stoneNoise[var8 + var9 * 16] / 3.0D + 3.0D + this.k.nextDouble() * 0.25D);
-+ int var12 = (int)(this.stoneNoise[var8 + var9 * 16] / 3.0D + 3.0D + this.rand.nextDouble() * 0.25D);
- int var13 = -1;
- byte var14 = var10.topBlock;
- byte var15 = var10.fillerBlock;
-
-- for(int var16 = 127; var16 >= 0; --var16) {
-+ for (int var16 = 127; var16 >= 0; --var16) {
- int var17 = (var9 * 16 + var8) * 128 + var16;
-- if(var16 <= 0 + this.k.nextInt(5)) {
-- var3[var17] = (byte)Block.bedrock.blockID;
-+
-+ if (var16 <= 0 + this.rand.nextInt(5)) {
-+ par3ArrayOfByte[var17] = (byte)Block.bedrock.blockID;
- } else {
-- byte var18 = var3[var17];
-- if(var18 == 0) {
-+ byte var18 = par3ArrayOfByte[var17];
-+
-+ if (var18 == 0) {
- var13 = -1;
-- } else if(var18 == Block.stone.blockID) {
-- if(var13 == -1) {
-- if(var12 <= 0) {
-+ } else if (var18 == Block.stone.blockID) {
-+ if (var13 == -1) {
-+ if (var12 <= 0) {
- var14 = 0;
- var15 = (byte)Block.stone.blockID;
-- } else if(var16 >= var5 - 4 && var16 <= var5 + 1) {
-+ } else if (var16 >= var5 - 4 && var16 <= var5 + 1) {
- var14 = var10.topBlock;
- var15 = var10.fillerBlock;
- }
-
-- if(var16 < var5 && var14 == 0) {
-- if(var11 < 0.15F) {
-+ if (var16 < var5 && var14 == 0) {
-+ if (var11 < 0.15F) {
- var14 = (byte)Block.ice.blockID;
- } else {
- var14 = (byte)Block.waterStill.blockID;
-@@ -152,16 +200,18 @@
- }
-
- var13 = var12;
-- if(var16 >= var5 - 1) {
-- var3[var17] = var14;
-+
-+ if (var16 >= var5 - 1) {
-+ par3ArrayOfByte[var17] = var14;
- } else {
-- var3[var17] = var15;
-+ par3ArrayOfByte[var17] = var15;
- }
-- } else if(var13 > 0) {
-+ } else if (var13 > 0) {
- --var13;
-- var3[var17] = var15;
-- if(var13 == 0 && var15 == Block.sand.blockID) {
-- var13 = this.k.nextInt(4);
-+ par3ArrayOfByte[var17] = var15;
-+
-+ if (var13 == 0 && var15 == Block.sand.blockID) {
-+ var13 = this.rand.nextInt(4);
- var15 = (byte)Block.sandStone.blockID;
- }
- }
-@@ -170,32 +220,39 @@
- }
- }
- }
--
-- }
--
-- public Chunk loadChunk(int var1, int var2) {
-- return this.provideChunk(var1, var2);
-- }
--
-- public Chunk provideChunk(int var1, int var2) {
-- this.k.setSeed((long)var1 * 341873128712L + (long)var2 * 132897987541L);
-- byte[] var3 = new byte[-Short.MIN_VALUE];
-- this.generateTerrain(var1, var2, var3);
-- this.biomesForGeneration = this.worldObj.getWorldChunkManager().loadBlockGeneratorData(this.biomesForGeneration, var1 * 16, var2 * 16, 16, 16);
-- this.replaceBlocksForBiome(var1, var2, var3, this.biomesForGeneration);
-- this.caveGenerator.generate(this, this.worldObj, var1, var2, var3);
-- this.ravineGenerator.generate(this, this.worldObj, var1, var2, var3);
-- if(this.mapFeaturesEnabled) {
-- this.mineshaftGenerator.generate(this, this.worldObj, var1, var2, var3);
-- this.villageGenerator.generate(this, this.worldObj, var1, var2, var3);
-- this.strongholdGenerator.generate(this, this.worldObj, var1, var2, var3);
-- this.scatteredFeatureGenerator.generate(this, this.worldObj, var1, var2, var3);
-+ }
-+
-+ /**
-+ * loads or generates the chunk at the chunk location specified
-+ */
-+ public Chunk loadChunk(int par1, int par2) {
-+ return this.provideChunk(par1, par2);
-+ }
-+
-+ /**
-+ * 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) {
-+ this.rand.setSeed((long)par1 * 341873128712L + (long)par2 * 132897987541L);
-+ byte[] var3 = new byte[32768];
-+ this.generateTerrain(par1, par2, var3);
-+ this.biomesForGeneration = this.worldObj.getWorldChunkManager().loadBlockGeneratorData(this.biomesForGeneration, par1 * 16, par2 * 16, 16, 16);
-+ this.replaceBlocksForBiome(par1, par2, var3, this.biomesForGeneration);
-+ this.caveGenerator.generate(this, this.worldObj, par1, par2, var3);
-+ this.ravineGenerator.generate(this, this.worldObj, par1, par2, var3);
-+
-+ if (this.mapFeaturesEnabled) {
-+ this.mineshaftGenerator.generate(this, this.worldObj, par1, par2, var3);
-+ this.villageGenerator.generate(this, this.worldObj, par1, par2, var3);
-+ this.strongholdGenerator.generate(this, this.worldObj, par1, par2, var3);
-+ this.scatteredFeatureGenerator.generate(this, this.worldObj, par1, par2, var3);
- }
-
-- Chunk var4 = new Chunk(this.worldObj, var3, var1, var2);
-+ Chunk var4 = new Chunk(this.worldObj, var3, par1, par2);
- byte[] var5 = var4.getBiomeArray();
-
-- for(int var6 = 0; var6 < var5.length; ++var6) {
-+ for (int var6 = 0; var6 < var5.length; ++var6) {
- var5[var6] = (byte)this.biomesForGeneration[var6].biomeID;
- }
-
-@@ -203,46 +260,52 @@
- return var4;
- }
-
-- private double[] initializeNoiseField(double[] var1, int var2, int var3, int var4, int var5, int var6, int var7) {
-- if(var1 == null) {
-- var1 = new double[var5 * var6 * var7];
-+ /**
-+ * generates a subset of the level's terrain data. Takes 7 arguments: the [empty] noise array, the position, and the
-+ * size.
-+ */
-+ private double[] initializeNoiseField(double[] par1ArrayOfDouble, int par2, int par3, int par4, int par5, int par6, int par7) {
-+ if (par1ArrayOfDouble == null) {
-+ par1ArrayOfDouble = new double[par5 * par6 * par7];
- }
-
-- if(this.parabolicField == null) {
-+ if (this.parabolicField == null) {
- this.parabolicField = new float[25];
-
-- for(int var8 = -2; var8 <= 2; ++var8) {
-- for(int var9 = -2; var9 <= 2; ++var9) {
-+ for (int var8 = -2; var8 <= 2; ++var8) {
-+ for (int var9 = -2; var9 <= 2; ++var9) {
- float var10 = 10.0F / MathHelper.sqrt_float((float)(var8 * var8 + var9 * var9) + 0.2F);
- this.parabolicField[var8 + 2 + (var9 + 2) * 5] = var10;
- }
- }
- }
-
-- double var43 = 684.412D;
- double var44 = 684.412D;
-- this.noise5 = this.noiseGen5.generateNoiseOctaves(this.noise5, var2, var4, var5, var7, 1.121D, 1.121D, 0.5D);
-- this.noise6 = this.noiseGen6.generateNoiseOctaves(this.noise6, var2, var4, var5, var7, 200.0D, 200.0D, 0.5D);
-- this.noise3 = this.noiseGen3.generateNoiseOctaves(this.noise3, var2, var3, var4, var5, var6, var7, var43 / 80.0D, var44 / 160.0D, var43 / 80.0D);
-- this.noise1 = this.noiseGen1.generateNoiseOctaves(this.noise1, var2, var3, var4, var5, var6, var7, var43, var44, var43);
-- this.noise2 = this.noiseGen2.generateNoiseOctaves(this.noise2, var2, var3, var4, var5, var6, var7, var43, var44, var43);
-+ double var45 = 684.412D;
-+ this.noise5 = this.noiseGen5.generateNoiseOctaves(this.noise5, par2, par4, par5, par7, 1.121D, 1.121D, 0.5D);
-+ this.noise6 = this.noiseGen6.generateNoiseOctaves(this.noise6, par2, par4, par5, par7, 200.0D, 200.0D, 0.5D);
-+ this.noise3 = this.noiseGen3.generateNoiseOctaves(this.noise3, par2, par3, par4, par5, par6, par7, var44 / 80.0D, var45 / 160.0D, var44 / 80.0D);
-+ this.noise1 = this.noiseGen1.generateNoiseOctaves(this.noise1, par2, par3, par4, par5, par6, par7, var44, var45, var44);
-+ this.noise2 = this.noiseGen2.generateNoiseOctaves(this.noise2, par2, par3, par4, par5, par6, par7, var44, var45, var44);
-+ boolean var43 = false;
- boolean var42 = false;
- int var12 = 0;
- int var13 = 0;
-
-- for(int var14 = 0; var14 < var5; ++var14) {
-- for(int var15 = 0; var15 < var7; ++var15) {
-+ for (int var14 = 0; var14 < par5; ++var14) {
-+ for (int var15 = 0; var15 < par7; ++var15) {
- float var16 = 0.0F;
- float var17 = 0.0F;
- float var18 = 0.0F;
- byte var19 = 2;
-- BiomeGenBase var20 = this.biomesForGeneration[var14 + 2 + (var15 + 2) * (var5 + 5)];
-+ BiomeGenBase var20 = this.biomesForGeneration[var14 + 2 + (var15 + 2) * (par5 + 5)];
-
-- for(int var21 = -var19; var21 <= var19; ++var21) {
-- for(int var22 = -var19; var22 <= var19; ++var22) {
-- BiomeGenBase var23 = this.biomesForGeneration[var14 + var21 + 2 + (var15 + var22 + 2) * (var5 + 5)];
-+ for (int var21 = -var19; var21 <= var19; ++var21) {
-+ for (int var22 = -var19; var22 <= var19; ++var22) {
-+ BiomeGenBase var23 = this.biomesForGeneration[var14 + var21 + 2 + (var15 + var22 + 2) * (par5 + 5)];
- float var24 = this.parabolicField[var21 + 2 + (var22 + 2) * 5] / (var23.minHeight + 2.0F);
-- if(var23.minHeight > var20.minHeight) {
-+
-+ if (var23.minHeight > var20.minHeight) {
- var24 /= 2.0F;
- }
-
-@@ -256,128 +319,144 @@
- var17 /= var18;
- var16 = var16 * 0.9F + 0.1F;
- var17 = (var17 * 4.0F - 1.0F) / 8.0F;
-- double var45 = this.noise6[var13] / 8000.0D;
-- if(var45 < 0.0D) {
-- var45 = -var45 * 0.3D;
-+ double var46 = this.noise6[var13] / 8000.0D;
-+
-+ if (var46 < 0.0D) {
-+ var46 = -var46 * 0.3D;
- }
-
-- var45 = var45 * 3.0D - 2.0D;
-- if(var45 < 0.0D) {
-- var45 /= 2.0D;
-- if(var45 < -1.0D) {
-- var45 = -1.0D;
-+ var46 = var46 * 3.0D - 2.0D;
-+
-+ if (var46 < 0.0D) {
-+ var46 /= 2.0D;
-+
-+ if (var46 < -1.0D) {
-+ var46 = -1.0D;
- }
-
-- var45 /= 1.4D;
-- var45 /= 2.0D;
-+ var46 /= 1.4D;
-+ var46 /= 2.0D;
- } else {
-- if(var45 > 1.0D) {
-- var45 = 1.0D;
-+ if (var46 > 1.0D) {
-+ var46 = 1.0D;
- }
-
-- var45 /= 8.0D;
-+ var46 /= 8.0D;
- }
-
- ++var13;
-
-- for(int var46 = 0; var46 < var6; ++var46) {
-- double var47 = (double)var17;
-+ for (int var47 = 0; var47 < par6; ++var47) {
-+ double var48 = (double)var17;
- double var26 = (double)var16;
-- var47 += var45 * 0.2D;
-- var47 = var47 * (double)var6 / 16.0D;
-- double var28 = (double)var6 / 2.0D + var47 * 4.0D;
-+ var48 += var46 * 0.2D;
-+ var48 = var48 * (double)par6 / 16.0D;
-+ double var28 = (double)par6 / 2.0D + var48 * 4.0D;
- double var30 = 0.0D;
-- double var32 = ((double)var46 - var28) * 12.0D * 128.0D / 128.0D / var26;
-- if(var32 < 0.0D) {
-+ double var32 = ((double)var47 - var28) * 12.0D * 128.0D / 128.0D / var26;
-+
-+ if (var32 < 0.0D) {
- var32 *= 4.0D;
- }
-
- double var34 = this.noise1[var12] / 512.0D;
- double var36 = this.noise2[var12] / 512.0D;
- double var38 = (this.noise3[var12] / 10.0D + 1.0D) / 2.0D;
-- if(var38 < 0.0D) {
-+
-+ if (var38 < 0.0D) {
- var30 = var34;
-- } else if(var38 > 1.0D) {
-+ } else if (var38 > 1.0D) {
- var30 = var36;
- } else {
- var30 = var34 + (var36 - var34) * var38;
- }
-
- var30 -= var32;
-- if(var46 > var6 - 4) {
-- double var40 = (double)((float)(var46 - (var6 - 4)) / 3.0F);
-+
-+ if (var47 > par6 - 4) {
-+ double var40 = (double)((float)(var47 - (par6 - 4)) / 3.0F);
- var30 = var30 * (1.0D - var40) + -10.0D * var40;
- }
-
-- var1[var12] = var30;
-+ par1ArrayOfDouble[var12] = var30;
- ++var12;
- }
- }
- }
-
-- return var1;
-+ return par1ArrayOfDouble;
- }
-
-- public boolean chunkExists(int var1, int var2) {
-+ /**
-+ * Checks to see if a chunk exists at x, y
-+ */
-+ public boolean chunkExists(int par1, int par2) {
- return true;
- }
-
-- public void populate(IChunkProvider var1, int var2, int var3) {
-+ /**
-+ * Populates chunk with ores etc etc
-+ */
-+ public void populate(IChunkProvider par1IChunkProvider, int par2, int par3) {
- BlockSand.fallInstantly = true;
-- int var4 = var2 * 16;
-- int var5 = var3 * 16;
-+ int var4 = par2 * 16;
-+ int var5 = par3 * 16;
- BiomeGenBase var6 = this.worldObj.getBiomeGenForCoords(var4 + 16, var5 + 16);
-- this.k.setSeed(this.worldObj.getSeed());
-- long var7 = this.k.nextLong() / 2L * 2L + 1L;
-- long var9 = this.k.nextLong() / 2L * 2L + 1L;
-- this.k.setSeed((long)var2 * var7 + (long)var3 * var9 ^ this.worldObj.getSeed());
-+ this.rand.setSeed(this.worldObj.getSeed());
-+ long var7 = this.rand.nextLong() / 2L * 2L + 1L;
-+ long var9 = this.rand.nextLong() / 2L * 2L + 1L;
-+ this.rand.setSeed((long)par2 * var7 + (long)par3 * var9 ^ this.worldObj.getSeed());
- boolean var11 = false;
-- if(this.mapFeaturesEnabled) {
-- this.mineshaftGenerator.generateStructuresInChunk(this.worldObj, this.k, var2, var3);
-- var11 = this.villageGenerator.generateStructuresInChunk(this.worldObj, this.k, var2, var3);
-- this.strongholdGenerator.generateStructuresInChunk(this.worldObj, this.k, var2, var3);
-- this.scatteredFeatureGenerator.generateStructuresInChunk(this.worldObj, this.k, var2, var3);
-+
-+ if (this.mapFeaturesEnabled) {
-+ this.mineshaftGenerator.generateStructuresInChunk(this.worldObj, this.rand, par2, par3);
-+ var11 = this.villageGenerator.generateStructuresInChunk(this.worldObj, this.rand, par2, par3);
-+ this.strongholdGenerator.generateStructuresInChunk(this.worldObj, this.rand, par2, par3);
-+ this.scatteredFeatureGenerator.generateStructuresInChunk(this.worldObj, this.rand, par2, par3);
- }
-
- int var12;
- int var13;
- int var14;
-- if(var6 != BiomeGenBase.desert && var6 != BiomeGenBase.desertHills && !var11 && this.k.nextInt(4) == 0) {
-- var12 = var4 + this.k.nextInt(16) + 8;
-- var13 = this.k.nextInt(128);
-- var14 = var5 + this.k.nextInt(16) + 8;
-- (new WorldGenLakes(Block.waterStill.blockID)).generate(this.worldObj, this.k, var12, var13, var14);
-+
-+ if (var6 != BiomeGenBase.desert && var6 != BiomeGenBase.desertHills && !var11 && this.rand.nextInt(4) == 0) {
-+ var12 = var4 + this.rand.nextInt(16) + 8;
-+ var13 = this.rand.nextInt(128);
-+ var14 = var5 + this.rand.nextInt(16) + 8;
-+ (new WorldGenLakes(Block.waterStill.blockID)).generate(this.worldObj, this.rand, var12, var13, var14);
- }
-
-- if(!var11 && this.k.nextInt(8) == 0) {
-- var12 = var4 + this.k.nextInt(16) + 8;
-- var13 = this.k.nextInt(this.k.nextInt(120) + 8);
-- var14 = var5 + this.k.nextInt(16) + 8;
-- if(var13 < 63 || this.k.nextInt(10) == 0) {
-- (new WorldGenLakes(Block.lavaStill.blockID)).generate(this.worldObj, this.k, var12, var13, var14);
-+ if (!var11 && this.rand.nextInt(8) == 0) {
-+ var12 = var4 + this.rand.nextInt(16) + 8;
-+ var13 = this.rand.nextInt(this.rand.nextInt(120) + 8);
-+ var14 = var5 + this.rand.nextInt(16) + 8;
-+
-+ if (var13 < 63 || this.rand.nextInt(10) == 0) {
-+ (new WorldGenLakes(Block.lavaStill.blockID)).generate(this.worldObj, this.rand, var12, var13, var14);
- }
- }
-
-- for(var12 = 0; var12 < 8; ++var12) {
-- var13 = var4 + this.k.nextInt(16) + 8;
-- var14 = this.k.nextInt(128);
-- int var15 = var5 + this.k.nextInt(16) + 8;
-- (new WorldGenDungeons()).generate(this.worldObj, this.k, var13, var14, var15);
-+ for (var12 = 0; var12 < 8; ++var12) {
-+ var13 = var4 + this.rand.nextInt(16) + 8;
-+ var14 = this.rand.nextInt(128);
-+ int var15 = var5 + this.rand.nextInt(16) + 8;
-+ (new WorldGenDungeons()).generate(this.worldObj, this.rand, var13, var14, var15);
- }
-
-- var6.decorate(this.worldObj, this.k, var4, var5);
-- SpawnerAnimals.performWorldGenSpawning(this.worldObj, var6, var4 + 8, var5 + 8, 16, 16, this.k);
-+ var6.decorate(this.worldObj, this.rand, var4, var5);
-+ SpawnerAnimals.performWorldGenSpawning(this.worldObj, var6, var4 + 8, var5 + 8, 16, 16, this.rand);
- var4 += 8;
- var5 += 8;
-
-- for(var12 = 0; var12 < 16; ++var12) {
-- for(var13 = 0; var13 < 16; ++var13) {
-+ for (var12 = 0; var12 < 16; ++var12) {
-+ for (var13 = 0; var13 < 16; ++var13) {
- var14 = this.worldObj.getPrecipitationHeight(var4 + var12, var5 + var13);
-- if(this.worldObj.isBlockFreezable(var12 + var4, var14 - 1, var13 + var5)) {
-+
-+ if (this.worldObj.isBlockFreezable(var12 + var4, var14 - 1, var13 + var5)) {
- this.worldObj.setBlock(var12 + var4, var14 - 1, var13 + var5, Block.ice.blockID, 0, 2);
- }
-
-- if(this.worldObj.canSnowAt(var12 + var4, var14, var13 + var5)) {
-+ if (this.worldObj.canSnowAt(var12 + var4, var14, var13 + var5)) {
- this.worldObj.setBlock(var12 + var4, var14, var13 + var5, Block.snow.blockID, 0, 2);
- }
- }
-@@ -386,45 +465,66 @@
- BlockSand.fallInstantly = false;
- }
-
-- public boolean saveChunks(boolean var1, IProgressUpdate var2) {
-+ /**
-+ * 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;
- }
-
-- public void saveExtraData() {
-- }
-+ /**
-+ * 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 true;
- }
-
-+ /**
-+ * Converts the instance data to a readable string.
-+ */
- public String makeString() {
- return "RandomLevelSource";
- }
-
-- public List getPossibleCreatures(EnumCreatureType var1, int var2, int var3, int var4) {
-- BiomeGenBase var5 = this.worldObj.getBiomeGenForCoords(var2, var4);
-- return var5 == null ? null : (var1 == EnumCreatureType.monster && this.scatteredFeatureGenerator.func_143030_a(var2, var3, var4) ? this.scatteredFeatureGenerator.getScatteredFeatureSpawnList() : var5.getSpawnableList(var1));
-+ /**
-+ * 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) {
-+ BiomeGenBase var5 = this.worldObj.getBiomeGenForCoords(par2, par4);
-+ return var5 == null ? null : (par1EnumCreatureType == EnumCreatureType.monster && this.scatteredFeatureGenerator.func_143030_a(par2, par3, par4) ? this.scatteredFeatureGenerator.getScatteredFeatureSpawnList() : var5.getSpawnableList(par1EnumCreatureType));
- }
-
-- public ChunkPosition findClosestStructure(World var1, String var2, int var3, int var4, int var5) {
-- return "Stronghold".equals(var2) && this.strongholdGenerator != null ? this.strongholdGenerator.getNearestInstance(var1, var3, var4, var5) : 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 "Stronghold".equals(par2Str) && this.strongholdGenerator != null ? this.strongholdGenerator.getNearestInstance(par1World, par3, par4, par5) : null;
- }
-
- public int getLoadedChunkCount() {
- return 0;
- }
-
-- public void recreateStructures(int var1, int var2) {
-- if(this.mapFeaturesEnabled) {
-- this.mineshaftGenerator.generate(this, this.worldObj, var1, var2, (byte[])null);
-- this.villageGenerator.generate(this, this.worldObj, var1, var2, (byte[])null);
-- this.strongholdGenerator.generate(this, this.worldObj, var1, var2, (byte[])null);
-- this.scatteredFeatureGenerator.generate(this, this.worldObj, var1, var2, (byte[])null);
-+ public void recreateStructures(int par1, int par2) {
-+ if (this.mapFeaturesEnabled) {
-+ this.mineshaftGenerator.generate(this, this.worldObj, par1, par2, (byte[])null);
-+ this.villageGenerator.generate(this, this.worldObj, par1, par2, (byte[])null);
-+ this.strongholdGenerator.generate(this, this.worldObj, par1, par2, (byte[])null);
-+ this.scatteredFeatureGenerator.generate(this, this.worldObj, par1, par2, (byte[])null);
- }
--
- }
- }
---- net/minecraft/src/ItemFlintAndSteel.java
-+++ net/minecraft/src/ItemFlintAndSteel.java
-@@ -1,48 +1,53 @@
- package net.minecraft.src;
-
- public class ItemFlintAndSteel extends Item {
-- public ItemFlintAndSteel(int var1) {
-- super(var1);
-+ public ItemFlintAndSteel(int par1) {
-+ super(par1);
- this.maxStackSize = 1;
- this.setMaxDamage(64);
- this.setCreativeTab(CreativeTabs.tabTools);
- }
-
-- public boolean onItemUse(ItemStack var1, EntityPlayer var2, World var3, int var4, int var5, int var6, int var7, float var8, float var9, float var10) {
-- if(var7 == 0) {
-- --var5;
-- }
--
-- if(var7 == 1) {
-- ++var5;
-- }
--
-- if(var7 == 2) {
-- --var6;
-- }
--
-- if(var7 == 3) {
-- ++var6;
-- }
--
-- if(var7 == 4) {
-- --var4;
-- }
--
-- if(var7 == 5) {
-- ++var4;
-- }
--
-- if(!var2.canPlayerEdit(var4, var5, var6, var7, var1)) {
-+ /**
-+ * 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) {
-+ if (par7 == 0) {
-+ --par5;
-+ }
-+
-+ if (par7 == 1) {
-+ ++par5;
-+ }
-+
-+ if (par7 == 2) {
-+ --par6;
-+ }
-+
-+ if (par7 == 3) {
-+ ++par6;
-+ }
-+
-+ if (par7 == 4) {
-+ --par4;
-+ }
-+
-+ if (par7 == 5) {
-+ ++par4;
-+ }
-+
-+ if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack)) {
- return false;
- } else {
-- int var11 = var3.getBlockId(var4, var5, var6);
-- if(var11 == 0) {
-- var3.playSoundEffect((double)var4 + 0.5D, (double)var5 + 0.5D, (double)var6 + 0.5D, "fire.ignite", 1.0F, f.nextFloat() * 0.4F + 0.8F);
-- var3.setBlock(var4, var5, var6, Block.fire.blockID);
-+ int var11 = par3World.getBlockId(par4, par5, par6);
-+
-+ if (var11 == 0) {
-+ par3World.playSoundEffect((double)par4 + 0.5D, (double)par5 + 0.5D, (double)par6 + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F);
-+ par3World.setBlock(par4, par5, par6, Block.fire.blockID);
- }
-
-- var1.damageItem(1, var2);
-+ par1ItemStack.damageItem(1, par2EntityPlayer);
- return true;
- }
- }
---- net/minecraft/src/NBTTagShort.java
-+++ net/minecraft/src/NBTTagShort.java
-@@ -5,25 +5,36 @@
- import java.io.IOException;
-
- public class NBTTagShort extends NBTBase {
-+
-+ /** The short value for the tag. */
- public short data;
-
-- public NBTTagShort(String var1) {
-- super(var1);
-- }
--
-- public NBTTagShort(String var1, short var2) {
-- super(var1);
-- this.data = var2;
-- }
--
-- void write(DataOutput var1) throws IOException {
-- var1.writeShort(this.data);
-- }
--
-- void load(DataInput var1, int var2) throws IOException {
-- this.data = var1.readShort();
-- }
--
-+ public NBTTagShort(String par1Str) {
-+ super(par1Str);
-+ }
-+
-+ public NBTTagShort(String par1Str, short par2) {
-+ super(par1Str);
-+ this.data = par2;
-+ }
-+
-+ /**
-+ * Write the actual data contents of the tag, implemented in NBT extension classes
-+ */
-+ void write(DataOutput par1DataOutput) throws IOException {
-+ par1DataOutput.writeShort(this.data);
-+ }
-+
-+ /**
-+ * Read the actual data contents of the tag, implemented in NBT extension classes
-+ */
-+ void load(DataInput par1DataInput, int par2) throws IOException {
-+ this.data = par1DataInput.readShort();
-+ }
-+
-+ /**
-+ * Gets the type byte for the tag.
-+ */
- public byte getId() {
- return (byte)2;
- }
-@@ -32,13 +43,16 @@
- return "" + this.data;
- }
-
-+ /**
-+ * Creates a clone of the tag.
-+ */
- public NBTBase copy() {
- return new NBTTagShort(this.getName(), this.data);
- }
-
-- public boolean equals(Object var1) {
-- if(super.equals(var1)) {
-- NBTTagShort var2 = (NBTTagShort)var1;
-+ public boolean equals(Object par1Obj) {
-+ if (super.equals(par1Obj)) {
-+ NBTTagShort var2 = (NBTTagShort)par1Obj;
- return this.data == var2.data;
- } else {
- return false;
---- net/minecraft/src/EntitySnowball.java
-+++ net/minecraft/src/EntitySnowball.java
-@@ -1,35 +1,38 @@
- package net.minecraft.src;
-
- public class EntitySnowball extends EntityThrowable {
-- public EntitySnowball(World var1) {
-- super(var1);
-- }
--
-- public EntitySnowball(World var1, EntityLivingBase var2) {
-- super(var1, var2);
-- }
--
-- public EntitySnowball(World var1, double var2, double var4, double var6) {
-- super(var1, var2, var4, var6);
-- }
--
-- protected void onImpact(MovingObjectPosition var1) {
-- if(var1.entityHit != null) {
-+ public EntitySnowball(World par1World) {
-+ super(par1World);
-+ }
-+
-+ public EntitySnowball(World par1World, EntityLivingBase par2EntityLivingBase) {
-+ super(par1World, par2EntityLivingBase);
-+ }
-+
-+ public EntitySnowball(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) {
-+ if (par1MovingObjectPosition.entityHit != null) {
- byte var2 = 0;
-- if(var1.entityHit instanceof EntityBlaze) {
-+
-+ if (par1MovingObjectPosition.entityHit instanceof EntityBlaze) {
- var2 = 3;
- }
-
-- var1.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), (float)var2);
-+ par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), (float)var2);
- }
-
-- for(int var3 = 0; var3 < 8; ++var3) {
-+ for (int var3 = 0; var3 < 8; ++var3) {
- this.worldObj.spawnParticle("snowballpoof", this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D);
- }
-
-- if(!this.worldObj.isRemote) {
-+ if (!this.worldObj.isRemote) {
- this.setDead();
- }
--
- }
- }
---- net/minecraft/src/EntityLavaFX.java
-+++ net/minecraft/src/EntityLavaFX.java
-@@ -3,68 +3,77 @@
- public class EntityLavaFX extends EntityFX {
- private float lavaParticleScale;
-
-- public EntityLavaFX(World var1, double var2, double var4, double var6) {
-- super(var1, var2, var4, var6, 0.0D, 0.0D, 0.0D);
-- this.motionX *= (double)0.8F;
-- this.motionY *= (double)0.8F;
-- this.motionZ *= (double)0.8F;
-- this.motionY = (double)(this.ab.nextFloat() * 0.4F + 0.05F);
-+ 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.ab.nextFloat() * 2.0F + 0.2F;
-+ 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 var1) {
-- float var2 = ((float)this.particleAge + var1) / (float)this.particleMaxAge;
-- if(var2 < 0.0F) {
-+ 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) {
-+ if (var2 > 1.0F) {
- var2 = 1.0F;
- }
-
-- int var3 = super.getBrightnessForRender(var1);
-+ int var3 = super.getBrightnessForRender(par1);
- short var4 = 240;
- int var5 = var3 >> 16 & 255;
- return var4 | var5 << 16;
- }
-
-- public float getBrightness(float var1) {
-+ /**
-+ * Gets how bright this entity is.
-+ */
-+ public float getBrightness(float par1) {
- return 1.0F;
- }
-
-- public void renderParticle(Tessellator var1, float var2, float var3, float var4, float var5, float var6, float var7) {
-- float var8 = ((float)this.particleAge + var2) / (float)this.particleMaxAge;
-+ 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(var1, var2, var3, var4, var5, var6, var7);
-+ 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) {
-+
-+ if (this.particleAge++ >= this.particleMaxAge) {
- this.setDead();
- }
-
- float var1 = (float)this.particleAge / (float)this.particleMaxAge;
-- if(this.ab.nextFloat() > var1) {
-+
-+ 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 *= (double)0.999F;
-- this.motionY *= (double)0.999F;
-- this.motionZ *= (double)0.999F;
-- if(this.onGround) {
-- this.motionX *= (double)0.7F;
-- this.motionZ *= (double)0.7F;
-- }
-+ this.motionX *= 0.9990000128746033D;
-+ this.motionY *= 0.9990000128746033D;
-+ this.motionZ *= 0.9990000128746033D;
-
-+ if (this.onGround) {
-+ this.motionX *= 0.699999988079071D;
-+ this.motionZ *= 0.699999988079071D;
-+ }
- }
- }
---- /dev/null
-+++ org/spoutcraft/client/gui/controls/GuiControls.java
-@@ -1,0 +1,253 @@
-+/*
-+ * This file is part of Spoutcraft.
-+ *
-+ * Copyright (c) 2011 SpoutcraftDev
-+ * Spoutcraft is licensed under the GNU Lesser General Public License.
-+ *
-+ * Spoutcraft is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation, either version 3 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Spoutcraft is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program. If not, see .
-+ */
-+package org.spoutcraft.client.gui.controls;
-+
-+import net.minecraft.src.GuiScreen;
-+
-+import org.spoutcraft.api.ChatColor;
-+import org.spoutcraft.api.gui.Button;
-+import org.spoutcraft.api.gui.CheckBox;
-+import org.spoutcraft.api.gui.GenericButton;
-+import org.spoutcraft.api.gui.GenericLabel;
-+import org.spoutcraft.api.gui.GenericListView;
-+import org.spoutcraft.api.gui.GenericScrollArea;
-+import org.spoutcraft.api.gui.Keyboard;
-+import org.spoutcraft.api.gui.Orientation;
-+import org.spoutcraft.api.gui.ScrollArea;
-+import org.spoutcraft.api.gui.Widget;
-+import org.spoutcraft.client.SpoutClient;
-+import org.spoutcraft.client.controls.Shortcut;
-+import org.spoutcraft.client.controls.SimpleKeyBindingManager;
-+import org.spoutcraft.client.gui.ButtonUpdater;
-+import org.spoutcraft.client.gui.GuiSpoutScreen;
-+
-+public class GuiControls extends GuiSpoutScreen implements ButtonUpdater {
-+ private GenericLabel labelTitle, labelDescription;
-+ private Button buttonDone, buttonAdd, buttonEdit, buttonRemove;
-+ public CheckBox checkVanilla, checkSpoutcraft, checkCustom, checkShortcuts;
-+ public ControlsSearch search;
-+ private ScrollArea filter;
-+ private GenericListView view;
-+ private GuiScreen parentScreen;
-+ private static ControlsModel model = null;
-+
-+ public static final ChatColor VANILLA_COLOR = ChatColor.YELLOW;
-+ public static final ChatColor SPOUTCRAFT_COLOR = ChatColor.RED;
-+ public static final ChatColor CUSTOM_COLOR = ChatColor.BLUE;
-+ public static final ChatColor SHORTCUTS_COLOR = ChatColor.GREEN;
-+
-+ public GuiControls(GuiScreen parent) {
-+ if (model == null) {
-+ model = new ControlsModel(this);
-+ }
-+ this.parentScreen = parent;
-+ }
-+
-+ protected void createInstances() {
-+ labelTitle = new GenericLabel("Controls");
-+ buttonDone = new GenericButton("Done");
-+ buttonAdd = new GenericButton("Add Shortcut");
-+ buttonEdit = new GenericButton("Edit");
-+ buttonEdit.setTooltip("Edit Shortcut");
-+ buttonRemove = new DeleteControlButton(this);
-+ buttonRemove.setTooltip("Remove Shortcut");
-+ labelDescription = new GenericLabel();
-+ labelDescription.setText("Double-click an item, then press the key (combination).");
-+ labelDescription.setWrapLines(true);
-+ filter = new GenericScrollArea();
-+ view = new GenericListView(model);
-+ model.setCurrentGui(this);
-+
-+ checkVanilla = new ControlsCheckBox(this, VANILLA_COLOR + "Minecraft Bindings");
-+ checkSpoutcraft = new ControlsCheckBox(this, SPOUTCRAFT_COLOR + "Spoutcraft Bindings");
-+ checkCustom = new ControlsCheckBox(this, CUSTOM_COLOR + "Custom Bindings");
-+ checkShortcuts = new ControlsCheckBox(this, SHORTCUTS_COLOR + "Shortcuts");
-+ search = new ControlsSearch(this);
-+
-+ filter.attachWidget("Spoutcraft", checkVanilla);
-+ filter.attachWidget("Spoutcraft", checkSpoutcraft);
-+ filter.attachWidget("Spoutcraft", checkCustom);
-+ filter.attachWidget("Spoutcraft", checkShortcuts);
-+
-+ getScreen().attachWidget("Spoutcraft", search);
-+ getScreen().attachWidget("Spoutcraft", labelTitle);
-+ getScreen().attachWidget("Spoutcraft", filter);
-+ getScreen().attachWidget("Spoutcraft", view);
-+ getScreen().attachWidget("Spoutcraft", buttonAdd);
-+ getScreen().attachWidget("Spoutcraft", buttonEdit);
-+ getScreen().attachWidget("Spoutcraft", buttonRemove);
-+ getScreen().attachWidget("Spoutcraft", buttonDone);
-+ getScreen().attachWidget("Spoutcraft", labelDescription);
-+ updateButtons();
-+ model.refresh();
-+ }
-+
-+ protected void layoutWidgets() {
-+ int top = 5;
-+
-+ int swidth = mc.fontRenderer.getStringWidth(labelTitle.getText());
-+ labelTitle.setY(top + 7).setX(width / 2 - swidth / 2).setHeight(11).setWidth(swidth);
-+
-+ search.setX(5).setY(top).setWidth(150).setHeight(20);
-+
-+ top+=25;
-+
-+ int sheight = height - top - 55;
-+
-+ filter.setX(5).setY(top).setWidth(130).setHeight(sheight);
-+
-+ view.setX((int) (5 + filter.getX() + filter.getWidth())).setY(top).setWidth((int) (width - 15 - filter.getWidth())).setHeight(sheight);
-+
-+ int ftop = 5;
-+ checkVanilla.setX(5).setY(ftop).setWidth(100).setHeight(20);
-+ ftop += 25;
-+ checkSpoutcraft.setX(5).setY(ftop).setWidth(100).setHeight(20);
-+ ftop += 25;
-+ checkCustom.setX(5).setY(ftop).setWidth(100).setHeight(20);
-+ ftop += 25;
-+ checkShortcuts.setX(5).setY(ftop).setWidth(100).setHeight(20);
-+
-+ for (Widget w:filter.getAttachedWidgets()) {
-+ w.setWidth(filter.getViewportSize(Orientation.HORIZONTAL) - 10);
-+ }
-+ search.setWidth((int) filter.getWidth());
-+
-+ top += 5 + view.getHeight();
-+
-+ int totalWidth = Math.min(width - 10, 200 * 3 + 10);
-+ int cellWidth = (totalWidth - 10) / 3;
-+ int left = width / 2 - totalWidth / 2;
-+ int center = left + 5 + cellWidth;
-+ int right = center + 5 + cellWidth;
-+
-+ buttonAdd.setHeight(20).setWidth(cellWidth).setX(left).setY(top);
-+
-+ buttonEdit.setHeight(20).setWidth(cellWidth).setX(center).setY(top);
-+
-+ buttonRemove.setHeight(20).setWidth(cellWidth).setX(right).setY(top);
-+
-+ top+=25;
-+
-+ labelDescription.setHeight(20).setWidth(cellWidth * 2 + 5).setX(left).setY(top);
-+ labelDescription.recalculateLines();
-+
-+ buttonDone.setHeight(20).setWidth(cellWidth).setX(right).setY(top);
-+ }
-+
-+ @Override
-+ protected void buttonClicked(Button btn) {
-+ if (btn.equals(buttonDone)) {
-+ mc.displayGuiScreen(parentScreen);
-+ return;
-+ }
-+
-+ if (btn.equals(buttonAdd)) {
-+ Shortcut sh = new Shortcut();
-+ sh.setTitle("");
-+ sh.setKey(Keyboard.KEY_UNKNOWN.getKeyCode());
-+ editItem(sh);
-+ return;
-+ }
-+ ControlsBasicItem item = model.getItem(view.getSelectedRow());
-+ ShortcutBindingItem sh = null;
-+ if (item != null && item instanceof ShortcutBindingItem) {
-+ sh = (ShortcutBindingItem) item;
-+ }
-+ if (sh != null && btn.equals(buttonEdit)) {
-+ editItem(sh.getShortcut());
-+ } else if (btn.equals(buttonEdit) && item != null) {
-+ model.setEditing(item);
-+ }
-+ }
-+
-+ public void editItem(Shortcut item) {
-+ GuiEditShortcut gui = new GuiEditShortcut(this, item);
-+ mc.displayGuiScreen(gui);
-+ }
-+
-+ public void updateButtons() {
-+ ControlsBasicItem item = model.getItem(view.getSelectedRow());
-+ buttonEdit.setEnabled(item != null);
-+ ((DeleteControlButton)buttonRemove).setReallyShown(false);
-+ //buttonRemove.setEnabled(item instanceof ShortcutBindingItem || item instanceof KeyBindingItem);
-+ }
-+
-+ protected void keyTyped(char c, int i, boolean pressed) {
-+ ControlsBasicItem item = model.getEditingItem();
-+ if (item != null) {
-+ if (item.useModifiers() && (!SimpleKeyBindingManager.isModifierKey(i) && pressed) || (SimpleKeyBindingManager.isModifierKey(i) && !pressed)) {
-+ item.setModifiers(SimpleKeyBindingManager.getPressedModifiers());
-+ item.setKey(i);
-+ model.finishEdit();
-+ } else if (!item.useModifiers()) {
-+ item.setKey(i);
-+ model.finishEdit();
-+ }
-+ }
-+ }
-+
-+ @Override
-+ public void handleKeyboardInput() {
-+ ControlsBasicItem item = model.getEditingItem();
-+ if (item != null) {
-+ this.keyTyped(org.lwjgl.input.Keyboard.getEventCharacter(), org.lwjgl.input.Keyboard.getEventKey(), org.lwjgl.input.Keyboard.getEventKeyState());
-+ } else {
-+ super.handleKeyboardInput();
-+ }
-+ }
-+
-+ @Override
-+ protected void mouseClicked(int x, int y, int button) {
-+ ControlsBasicItem item = model.getEditingItem();
-+ if (item != null && item.useMouseButtons()) {
-+ item.setModifiers(SimpleKeyBindingManager.getPressedModifiers());
-+ item.setKey(SimpleKeyBindingManager.MOUSE_OFFSET + button);
-+ model.finishEdit();
-+ }
-+ }
-+
-+ public ControlsModel getModel() {
-+ return model;
-+ }
-+
-+ public void deleteCurrentControl() {
-+ SimpleKeyBindingManager man = (SimpleKeyBindingManager) SpoutClient.getInstance().getKeyBindingManager();
-+ ControlsBasicItem item = model.getItem(view.getSelectedRow());
-+ ShortcutBindingItem sh = null;
-+ if (item != null && item instanceof ShortcutBindingItem) {
-+ sh = (ShortcutBindingItem) item;
-+ }
-+ KeyBindingItem binding = null;
-+ if (item != null && item instanceof KeyBindingItem) {
-+ binding = (KeyBindingItem) item;
-+ }
-+ if (sh != null) {
-+ man.unregisterShortcut(sh.getShortcut());
-+ man.save();
-+ } else if (binding != null) {
-+ man.unregisterControl(binding.getBinding());
-+ man.save();
-+ model.refresh();
-+ } else {
-+ item.setKey(-128);
-+ }
-+ model.refresh();
-+ }
-+}
---- net/minecraft/src/ComponentVillageField.java
-+++ net/minecraft/src/ComponentVillageField.java
-@@ -4,95 +4,112 @@
- import java.util.Random;
-
- public class ComponentVillageField extends ComponentVillage {
-+
-+ /** First crop type for this field. */
- private int cropTypeA;
-+
-+ /** Second crop type for this field. */
- private int cropTypeB;
-+
-+ /** Third crop type for this field. */
- private int cropTypeC;
-+
-+ /** Fourth crop type for this field. */
- private int cropTypeD;
-
-- public ComponentVillageField() {
-- }
--
-- public ComponentVillageField(ComponentVillageStartPiece var1, int var2, Random var3, StructureBoundingBox var4, int var5) {
-- super(var1, var2);
-- this.coordBaseMode = var5;
-- this.boundingBox = var4;
-- this.cropTypeA = this.getRandomCrop(var3);
-- this.cropTypeB = this.getRandomCrop(var3);
-- this.cropTypeC = this.getRandomCrop(var3);
-- this.cropTypeD = this.getRandomCrop(var3);
-- }
--
-- protected void func_143012_a(NBTTagCompound var1) {
-- super.func_143012_a(var1);
-- var1.setInteger("CA", this.cropTypeA);
-- var1.setInteger("CB", this.cropTypeB);
-- var1.setInteger("CC", this.cropTypeC);
-- var1.setInteger("CD", this.cropTypeD);
-- }
--
-- protected void func_143011_b(NBTTagCompound var1) {
-- super.func_143011_b(var1);
-- this.cropTypeA = var1.getInteger("CA");
-- this.cropTypeB = var1.getInteger("CB");
-- this.cropTypeC = var1.getInteger("CC");
-- this.cropTypeD = var1.getInteger("CD");
-- }
--
-- private int getRandomCrop(Random var1) {
-- switch(var1.nextInt(5)) {
-- case 0:
-- return Block.carrot.blockID;
-- case 1:
-- return Block.potato.blockID;
-- default:
-- return Block.crops.blockID;
-+ public ComponentVillageField() {}
-+
-+ public ComponentVillageField(ComponentVillageStartPiece par1ComponentVillageStartPiece, int par2, Random par3Random, StructureBoundingBox par4StructureBoundingBox, int par5) {
-+ super(par1ComponentVillageStartPiece, par2);
-+ this.coordBaseMode = par5;
-+ this.boundingBox = par4StructureBoundingBox;
-+ this.cropTypeA = this.getRandomCrop(par3Random);
-+ this.cropTypeB = this.getRandomCrop(par3Random);
-+ this.cropTypeC = this.getRandomCrop(par3Random);
-+ this.cropTypeD = this.getRandomCrop(par3Random);
-+ }
-+
-+ protected void func_143012_a(NBTTagCompound par1NBTTagCompound) {
-+ super.func_143012_a(par1NBTTagCompound);
-+ par1NBTTagCompound.setInteger("CA", this.cropTypeA);
-+ par1NBTTagCompound.setInteger("CB", this.cropTypeB);
-+ par1NBTTagCompound.setInteger("CC", this.cropTypeC);
-+ par1NBTTagCompound.setInteger("CD", this.cropTypeD);
-+ }
-+
-+ protected void func_143011_b(NBTTagCompound par1NBTTagCompound) {
-+ super.func_143011_b(par1NBTTagCompound);
-+ this.cropTypeA = par1NBTTagCompound.getInteger("CA");
-+ this.cropTypeB = par1NBTTagCompound.getInteger("CB");
-+ this.cropTypeC = par1NBTTagCompound.getInteger("CC");
-+ this.cropTypeD = par1NBTTagCompound.getInteger("CD");
-+ }
-+
-+ /**
-+ * Returns a crop type to be planted on this field.
-+ */
-+ private int getRandomCrop(Random par1Random) {
-+ switch (par1Random.nextInt(5)) {
-+ case 0:
-+ return Block.carrot.blockID;
-+
-+ case 1:
-+ return Block.potato.blockID;
-+
-+ default:
-+ return Block.crops.blockID;
- }
- }
-
-- public static ComponentVillageField func_74900_a(ComponentVillageStartPiece var0, List var1, Random var2, int var3, int var4, int var5, int var6, int var7) {
-- StructureBoundingBox var8 = StructureBoundingBox.getComponentToAddBoundingBox(var3, var4, var5, 0, 0, 0, 13, 4, 9, var6);
-- return canVillageGoDeeper(var8) && StructureComponent.findIntersecting(var1, var8) == null ? new ComponentVillageField(var0, var7, var2, var8, var6) : null;
-+ public static ComponentVillageField func_74900_a(ComponentVillageStartPiece par0ComponentVillageStartPiece, List par1List, Random par2Random, int par3, int par4, int par5, int par6, int par7) {
-+ StructureBoundingBox var8 = StructureBoundingBox.getComponentToAddBoundingBox(par3, par4, par5, 0, 0, 0, 13, 4, 9, par6);
-+ return canVillageGoDeeper(var8) && StructureComponent.findIntersecting(par1List, var8) == null ? new ComponentVillageField(par0ComponentVillageStartPiece, par7, par2Random, var8, par6) : null;
- }
-
-- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) {
-- if(this.field_143015_k < 0) {
-- this.field_143015_k = this.getAverageGroundLevel(var1, var3);
-- if(this.field_143015_k < 0) {
-+ /**
-+ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the
-+ * end, it adds Fences...
-+ */
-+ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) {
-+ if (this.field_143015_k < 0) {
-+ this.field_143015_k = this.getAverageGroundLevel(par1World, par3StructureBoundingBox);
-+
-+ if (this.field_143015_k < 0) {
- return true;
- }
-
- this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 4 - 1, 0);
- }
-
-- this.fillWithBlocks(var1, var3, 0, 1, 0, 12, 4, 8, 0, 0, false);
-- this.fillWithBlocks(var1, var3, 1, 0, 1, 2, 0, 7, Block.tilledField.blockID, Block.tilledField.blockID, false);
-- this.fillWithBlocks(var1, var3, 4, 0, 1, 5, 0, 7, Block.tilledField.blockID, Block.tilledField.blockID, false);
-- this.fillWithBlocks(var1, var3, 7, 0, 1, 8, 0, 7, Block.tilledField.blockID, Block.tilledField.blockID, false);
-- this.fillWithBlocks(var1, var3, 10, 0, 1, 11, 0, 7, Block.tilledField.blockID, Block.tilledField.blockID, false);
-- this.fillWithBlocks(var1, var3, 0, 0, 0, 0, 0, 8, Block.wood.blockID, Block.wood.blockID, false);
-- this.fillWithBlocks(var1, var3, 6, 0, 0, 6, 0, 8, Block.wood.blockID, Block.wood.blockID, false);
-- this.fillWithBlocks(var1, var3, 12, 0, 0, 12, 0, 8, Block.wood.blockID, Block.wood.blockID, false);
-- this.fillWithBlocks(var1, var3, 1, 0, 0, 11, 0, 0, Block.wood.blockID, Block.wood.blockID, false);
-- this.fillWithBlocks(var1, var3, 1, 0, 8, 11, 0, 8, Block.wood.blockID, Block.wood.blockID, false);
-- this.fillWithBlocks(var1, var3, 3, 0, 1, 3, 0, 7, Block.waterMoving.blockID, Block.waterMoving.blockID, false);
-- this.fillWithBlocks(var1, var3, 9, 0, 1, 9, 0, 7, Block.waterMoving.blockID, Block.waterMoving.blockID, false);
--
-+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 1, 0, 12, 4, 8, 0, 0, false);
-+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 0, 1, 2, 0, 7, Block.tilledField.blockID, Block.tilledField.blockID, false);
-+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 0, 1, 5, 0, 7, Block.tilledField.blockID, Block.tilledField.blockID, false);
-+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 7, 0, 1, 8, 0, 7, Block.tilledField.blockID, Block.tilledField.blockID, false);
-+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 10, 0, 1, 11, 0, 7, Block.tilledField.blockID, Block.tilledField.blockID, false);
-+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 0, 0, 8, Block.wood.blockID, Block.wood.blockID, false);
-+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 6, 0, 0, 6, 0, 8, Block.wood.blockID, Block.wood.blockID, false);
-+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 12, 0, 0, 12, 0, 8, Block.wood.blockID, Block.wood.blockID, false);
-+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 0, 0, 11, 0, 0, Block.wood.blockID, Block.wood.blockID, false);
-+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 0, 8, 11, 0, 8, Block.wood.blockID, Block.wood.blockID, false);
-+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 3, 0, 1, 3, 0, 7, Block.waterMoving.blockID, Block.waterMoving.blockID, false);
-+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 9, 0, 1, 9, 0, 7, Block.waterMoving.blockID, Block.waterMoving.blockID, false);
- int var4;
-- for(var4 = 1; var4 <= 7; ++var4) {
-- this.placeBlockAtCurrentPosition(var1, this.cropTypeA, MathHelper.getRandomIntegerInRange(var2, 2, 7), 1, 1, var4, var3);
-- this.placeBlockAtCurrentPosition(var1, this.cropTypeA, MathHelper.getRandomIntegerInRange(var2, 2, 7), 2, 1, var4, var3);
-- this.placeBlockAtCurrentPosition(var1, this.cropTypeB, MathHelper.getRandomIntegerInRange(var2, 2, 7), 4, 1, var4, var3);
-- this.placeBlockAtCurrentPosition(var1, this.cropTypeB, MathHelper.getRandomIntegerInRange(var2, 2, 7), 5, 1, var4, var3);
-- this.placeBlockAtCurrentPosition(var1, this.cropTypeC, MathHelper.getRandomIntegerInRange(var2, 2, 7), 7, 1, var4, var3);
-- this.placeBlockAtCurrentPosition(var1, this.cropTypeC, MathHelper.getRandomIntegerInRange(var2, 2, 7), 8, 1, var4, var3);
-- this.placeBlockAtCurrentPosition(var1, this.cropTypeD, MathHelper.getRandomIntegerInRange(var2, 2, 7), 10, 1, var4, var3);
-- this.placeBlockAtCurrentPosition(var1, this.cropTypeD, MathHelper.getRandomIntegerInRange(var2, 2, 7), 11, 1, var4, var3);
-+
-+ for (var4 = 1; var4 <= 7; ++var4) {
-+ this.placeBlockAtCurrentPosition(par1World, this.cropTypeA, MathHelper.getRandomIntegerInRange(par2Random, 2, 7), 1, 1, var4, par3StructureBoundingBox);
-+ this.placeBlockAtCurrentPosition(par1World, this.cropTypeA, MathHelper.getRandomIntegerInRange(par2Random, 2, 7), 2, 1, var4, par3StructureBoundingBox);
-+ this.placeBlockAtCurrentPosition(par1World, this.cropTypeB, MathHelper.getRandomIntegerInRange(par2Random, 2, 7), 4, 1, var4, par3StructureBoundingBox);
-+ this.placeBlockAtCurrentPosition(par1World, this.cropTypeB, MathHelper.getRandomIntegerInRange(par2Random, 2, 7), 5, 1, var4, par3StructureBoundingBox);
-+ this.placeBlockAtCurrentPosition(par1World, this.cropTypeC, MathHelper.getRandomIntegerInRange(par2Random, 2, 7), 7, 1, var4, par3StructureBoundingBox);
-+ this.placeBlockAtCurrentPosition(par1World, this.cropTypeC, MathHelper.getRandomIntegerInRange(par2Random, 2, 7), 8, 1, var4, par3StructureBoundingBox);
-+ this.placeBlockAtCurrentPosition(par1World, this.cropTypeD, MathHelper.getRandomIntegerInRange(par2Random, 2, 7), 10, 1, var4, par3StructureBoundingBox);
-+ this.placeBlockAtCurrentPosition(par1World, this.cropTypeD, MathHelper.getRandomIntegerInRange(par2Random, 2, 7), 11, 1, var4, par3StructureBoundingBox);
- }
-
-- for(var4 = 0; var4 < 9; ++var4) {
-- for(int var5 = 0; var5 < 13; ++var5) {
-- this.clearCurrentPositionBlocksUpwards(var1, var5, 4, var4, var3);
-- this.fillCurrentPositionBlocksDownwards(var1, Block.dirt.blockID, 0, var5, -1, var4, var3);
-+ for (var4 = 0; var4 < 9; ++var4) {
-+ for (int var5 = 0; var5 < 13; ++var5) {
-+ this.clearCurrentPositionBlocksUpwards(par1World, var5, 4, var4, par3StructureBoundingBox);
-+ this.fillCurrentPositionBlocksDownwards(par1World, Block.dirt.blockID, 0, var5, -1, var4, par3StructureBoundingBox);
- }
- }
-
---- net/minecraft/src/BlockWeb.java
-+++ net/minecraft/src/BlockWeb.java
-@@ -3,35 +3,58 @@
- import java.util.Random;
-
- public class BlockWeb extends Block {
-- public BlockWeb(int var1) {
-- super(var1, Material.web);
-+ public BlockWeb(int par1) {
-+ super(par1, Material.web);
- this.setCreativeTab(CreativeTabs.tabDecorations);
- }
-
-- public void onEntityCollidedWithBlock(World var1, int var2, int var3, int var4, Entity var5) {
-- var5.setInWeb();
-+ /**
-+ * 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.setInWeb();
- }
-
-+ /**
-+ * 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;
- }
-
-- public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) {
-+ /**
-+ * 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;
- }
-
-+ /**
-+ * The type of render function that is called for this block
-+ */
- public int getRenderType() {
- return 1;
- }
-
-+ /**
-+ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc)
-+ */
- public boolean renderAsNormalBlock() {
- return false;
- }
-
-- public int idDropped(int var1, Random var2, int var3) {
-+ /**
-+ * Returns the ID of the items to drop on destruction.
-+ */
-+ public int idDropped(int par1, Random par2Random, int par3) {
- return Item.silk.itemID;
- }
-
-+ /**
-+ * Return true if a player with Silk Touch can harvest this block directly, and not its normal drops.
-+ */
- protected boolean canSilkHarvest() {
- return true;
- }
---- net/minecraft/src/CallableConnectionName.java
-+++ net/minecraft/src/CallableConnectionName.java
-@@ -4,11 +4,12 @@
-
- class CallableConnectionName implements Callable {
- final NetServerHandler field_111201_a;
-+
- final NetworkListenThread field_111200_b;
-
-- CallableConnectionName(NetworkListenThread var1, NetServerHandler var2) {
-- this.field_111200_b = var1;
-- this.field_111201_a = var2;
-+ CallableConnectionName(NetworkListenThread par1NetworkListenThread, NetServerHandler par2NetServerHandler) {
-+ this.field_111200_b = par1NetworkListenThread;
-+ this.field_111201_a = par2NetServerHandler;
- }
-
- public String func_111199_a() {
---- net/minecraft/src/BlockTripWireSource.java
-+++ net/minecraft/src/BlockTripWireSource.java
-@@ -3,138 +3,176 @@
- import java.util.Random;
-
- public class BlockTripWireSource extends Block {
-- public BlockTripWireSource(int var1) {
-- super(var1, Material.circuits);
-+ public BlockTripWireSource(int par1) {
-+ super(par1, Material.circuits);
- this.setCreativeTab(CreativeTabs.tabRedstone);
- this.setTickRandomly(true);
- }
-
-- public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) {
-+ /**
-+ * 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;
- }
-
-+ /**
-+ * 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;
- }
-
-+ /**
-+ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc)
-+ */
- public boolean renderAsNormalBlock() {
- return false;
- }
-
-+ /**
-+ * The type of render function that is called for this block
-+ */
- public int getRenderType() {
- return 29;
- }
-
-- public int tickRate(World var1) {
-+ /**
-+ * How many world ticks before ticking
-+ */
-+ public int tickRate(World par1World) {
- return 10;
- }
-
-- public boolean canPlaceBlockOnSide(World var1, int var2, int var3, int var4, int var5) {
-- return var5 == 2 && var1.isBlockNormalCube(var2, var3, var4 + 1) ? true : (var5 == 3 && var1.isBlockNormalCube(var2, var3, var4 - 1) ? true : (var5 == 4 && var1.isBlockNormalCube(var2 + 1, var3, var4) ? true : var5 == 5 && var1.isBlockNormalCube(var2 - 1, var3, var4)));
-- }
--
-- public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) {
-- return var1.isBlockNormalCube(var2 - 1, var3, var4) ? true : (var1.isBlockNormalCube(var2 + 1, var3, var4) ? true : (var1.isBlockNormalCube(var2, var3, var4 - 1) ? true : var1.isBlockNormalCube(var2, var3, var4 + 1)));
-- }
--
-- public int onBlockPlaced(World var1, int var2, int var3, int var4, int var5, float var6, float var7, float var8, int var9) {
-+ /**
-+ * checks to see if you can place this block can be placed on that side of a block: BlockLever overrides
-+ */
-+ public boolean canPlaceBlockOnSide(World par1World, int par2, int par3, int par4, int par5) {
-+ return par5 == 2 && par1World.isBlockNormalCube(par2, par3, par4 + 1) ? true : (par5 == 3 && par1World.isBlockNormalCube(par2, par3, par4 - 1) ? true : (par5 == 4 && par1World.isBlockNormalCube(par2 + 1, par3, par4) ? true : par5 == 5 && par1World.isBlockNormalCube(par2 - 1, par3, par4)));
-+ }
-+
-+ /**
-+ * 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.isBlockNormalCube(par2 - 1, par3, par4) ? true : (par1World.isBlockNormalCube(par2 + 1, par3, par4) ? true : (par1World.isBlockNormalCube(par2, par3, par4 - 1) ? true : par1World.isBlockNormalCube(par2, par3, par4 + 1)));
-+ }
-+
-+ /**
-+ * 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) {
- byte var10 = 0;
-- if(var5 == 2 && var1.isBlockNormalCubeDefault(var2, var3, var4 + 1, true)) {
-+
-+ if (par5 == 2 && par1World.isBlockNormalCubeDefault(par2, par3, par4 + 1, true)) {
- var10 = 2;
- }
-
-- if(var5 == 3 && var1.isBlockNormalCubeDefault(var2, var3, var4 - 1, true)) {
-+ if (par5 == 3 && par1World.isBlockNormalCubeDefault(par2, par3, par4 - 1, true)) {
- var10 = 0;
- }
-
-- if(var5 == 4 && var1.isBlockNormalCubeDefault(var2 + 1, var3, var4, true)) {
-+ if (par5 == 4 && par1World.isBlockNormalCubeDefault(par2 + 1, par3, par4, true)) {
- var10 = 1;
- }
-
-- if(var5 == 5 && var1.isBlockNormalCubeDefault(var2 - 1, var3, var4, true)) {
-+ if (par5 == 5 && par1World.isBlockNormalCubeDefault(par2 - 1, par3, par4, true)) {
- var10 = 3;
- }
-
- return var10;
- }
-
-- public void onPostBlockPlaced(World var1, int var2, int var3, int var4, int var5) {
-- this.func_72143_a(var1, var2, var3, var4, this.blockID, var5, false, -1, 0);
-+ /**
-+ * Called after a block is placed
-+ */
-+ public void onPostBlockPlaced(World par1World, int par2, int par3, int par4, int par5) {
-+ this.func_72143_a(par1World, par2, par3, par4, this.blockID, par5, false, -1, 0);
- }
-
-- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) {
-- if(var5 != this.blockID) {
-- if(this.func_72144_l(var1, var2, var3, var4)) {
-- int var6 = var1.getBlockMetadata(var2, var3, var4);
-+ /**
-+ * 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) {
-+ if (par5 != this.blockID) {
-+ if (this.func_72144_l(par1World, par2, par3, par4)) {
-+ int var6 = par1World.getBlockMetadata(par2, par3, par4);
- int var7 = var6 & 3;
- boolean var8 = false;
-- if(!var1.isBlockNormalCube(var2 - 1, var3, var4) && var7 == 3) {
-- var8 = true;
-- }
--
-- if(!var1.isBlockNormalCube(var2 + 1, var3, var4) && var7 == 1) {
-- var8 = true;
-- }
--
-- if(!var1.isBlockNormalCube(var2, var3, var4 - 1) && var7 == 0) {
-- var8 = true;
-- }
--
-- if(!var1.isBlockNormalCube(var2, var3, var4 + 1) && var7 == 2) {
-- var8 = true;
-- }
--
-- if(var8) {
-- this.dropBlockAsItem(var1, var2, var3, var4, var6, 0);
-- var1.setBlockToAir(var2, var3, var4);
-+
-+ if (!par1World.isBlockNormalCube(par2 - 1, par3, par4) && var7 == 3) {
-+ var8 = true;
-+ }
-+
-+ if (!par1World.isBlockNormalCube(par2 + 1, par3, par4) && var7 == 1) {
-+ var8 = true;
-+ }
-+
-+ if (!par1World.isBlockNormalCube(par2, par3, par4 - 1) && var7 == 0) {
-+ var8 = true;
-+ }
-+
-+ if (!par1World.isBlockNormalCube(par2, par3, par4 + 1) && var7 == 2) {
-+ var8 = true;
-+ }
-+
-+ if (var8) {
-+ this.dropBlockAsItem(par1World, par2, par3, par4, var6, 0);
-+ par1World.setBlockToAir(par2, par3, par4);
- }
- }
--
- }
- }
-
-- public void func_72143_a(World var1, int var2, int var3, int var4, int var5, int var6, boolean var7, int var8, int var9) {
-- int var10 = var6 & 3;
-- boolean var11 = (var6 & 4) == 4;
-- boolean var12 = (var6 & 8) == 8;
-- boolean var13 = var5 == Block.tripWireSource.blockID;
-+ public void func_72143_a(World par1World, int par2, int par3, int par4, int par5, int par6, boolean par7, int par8, int par9) {
-+ int var10 = par6 & 3;
-+ boolean var11 = (par6 & 4) == 4;
-+ boolean var12 = (par6 & 8) == 8;
-+ boolean var13 = par5 == Block.tripWireSource.blockID;
- boolean var14 = false;
-- boolean var15 = !var1.doesBlockHaveSolidTopSurface(var2, var3 - 1, var4);
-+ boolean var15 = !par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4);
- int var16 = Direction.offsetX[var10];
- int var17 = Direction.offsetZ[var10];
- int var18 = 0;
- int[] var19 = new int[42];
--
- int var20;
- int var21;
- int var22;
- int var23;
- int var24;
-- for(var20 = 1; var20 < 42; ++var20) {
-- var21 = var2 + var16 * var20;
-- var22 = var4 + var17 * var20;
-- var23 = var1.getBlockId(var21, var3, var22);
-- if(var23 == Block.tripWireSource.blockID) {
-- var24 = var1.getBlockMetadata(var21, var3, var22);
-- if((var24 & 3) == Direction.rotateOpposite[var10]) {
-+
-+ for (var20 = 1; var20 < 42; ++var20) {
-+ var21 = par2 + var16 * var20;
-+ var22 = par4 + var17 * var20;
-+ var23 = par1World.getBlockId(var21, par3, var22);
-+
-+ if (var23 == Block.tripWireSource.blockID) {
-+ var24 = par1World.getBlockMetadata(var21, par3, var22);
-+
-+ if ((var24 & 3) == Direction.rotateOpposite[var10]) {
- var18 = var20;
- }
-+
- break;
- }
-
-- if(var23 != Block.tripWire.blockID && var20 != var8) {
-+ if (var23 != Block.tripWire.blockID && var20 != par8) {
- var19[var20] = -1;
- var13 = false;
- } else {
-- var24 = var20 == var8 ? var9 : var1.getBlockMetadata(var21, var3, var22);
-+ var24 = var20 == par8 ? par9 : par1World.getBlockMetadata(var21, par3, var22);
- boolean var25 = (var24 & 8) != 8;
- boolean var26 = (var24 & 1) == 1;
- boolean var27 = (var24 & 2) == 2;
- var13 &= var27 == var15;
- var14 |= var25 && var26;
- var19[var20] = var24;
-- if(var20 == var8) {
-- var1.scheduleBlockUpdate(var2, var3, var4, var5, this.tickRate(var1));
-+
-+ if (var20 == par8) {
-+ par1World.scheduleBlockUpdate(par2, par3, par4, par5, this.tickRate(par1World));
- var13 &= var25;
- }
- }
-@@ -143,137 +181,167 @@
- var13 &= var18 > 1;
- var14 &= var13;
- var20 = (var13 ? 4 : 0) | (var14 ? 8 : 0);
-- var6 = var10 | var20;
-- if(var18 > 0) {
-- var21 = var2 + var16 * var18;
-- var22 = var4 + var17 * var18;
-+ par6 = var10 | var20;
-+
-+ if (var18 > 0) {
-+ var21 = par2 + var16 * var18;
-+ var22 = par4 + var17 * var18;
- var23 = Direction.rotateOpposite[var10];
-- var1.setBlockMetadata(var21, var3, var22, var23 | var20, 3);
-- this.notifyNeighborOfChange(var1, var21, var3, var22, var23);
-- this.playSoundEffect(var1, var21, var3, var22, var13, var14, var11, var12);
-+ 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(var1, var2, var3, var4, var13, var14, var11, var12);
-- if(var5 > 0) {
-- var1.setBlockMetadata(var2, var3, var4, var6, 3);
-- if(var7) {
-- this.notifyNeighborOfChange(var1, var2, var3, var4, var10);
-+ 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);
- }
- }
-
-- if(var11 != var13) {
-- for(var21 = 1; var21 < var18; ++var21) {
-- var22 = var2 + var16 * var21;
-- var23 = var4 + var17 * var21;
-+ if (var11 != var13) {
-+ for (var21 = 1; var21 < var18; ++var21) {
-+ var22 = par2 + var16 * var21;
-+ var23 = par4 + var17 * var21;
- var24 = var19[var21];
-- if(var24 >= 0) {
-- if(var13) {
-+
-+ if (var24 >= 0) {
-+ if (var13) {
- var24 |= 4;
- } else {
- var24 &= -5;
- }
-
-- var1.setBlockMetadata(var22, var3, var23, var24, 3);
-+ par1World.setBlockMetadataWithNotify(var22, par3, var23, var24, 3);
- }
- }
- }
--
-- }
--
-- public void updateTick(World var1, int var2, int var3, int var4, Random var5) {
-- this.func_72143_a(var1, var2, var3, var4, this.blockID, var1.getBlockMetadata(var2, var3, var4), true, -1, 0);
-- }
--
-- private void playSoundEffect(World var1, int var2, int var3, int var4, boolean var5, boolean var6, boolean var7, boolean var8) {
-- if(var6 && !var8) {
-- var1.playSoundEffect((double)var2 + 0.5D, (double)var3 + 0.1D, (double)var4 + 0.5D, "random.click", 0.4F, 0.6F);
-- } else if(!var6 && var8) {
-- var1.playSoundEffect((double)var2 + 0.5D, (double)var3 + 0.1D, (double)var4 + 0.5D, "random.click", 0.4F, 0.5F);
-- } else if(var5 && !var7) {
-- var1.playSoundEffect((double)var2 + 0.5D, (double)var3 + 0.1D, (double)var4 + 0.5D, "random.click", 0.4F, 0.7F);
-- } else if(!var5 && var7) {
-- var1.playSoundEffect((double)var2 + 0.5D, (double)var3 + 0.1D, (double)var4 + 0.5D, "random.bowhit", 0.4F, 1.2F / (var1.s.nextFloat() * 0.2F + 0.9F));
-- }
--
-- }
--
-- private void notifyNeighborOfChange(World var1, int var2, int var3, int var4, int var5) {
-- var1.notifyBlocksOfNeighborChange(var2, var3, var4, this.blockID);
-- if(var5 == 3) {
-- var1.notifyBlocksOfNeighborChange(var2 - 1, var3, var4, this.blockID);
-- } else if(var5 == 1) {
-- var1.notifyBlocksOfNeighborChange(var2 + 1, var3, var4, this.blockID);
-- } else if(var5 == 0) {
-- var1.notifyBlocksOfNeighborChange(var2, var3, var4 - 1, this.blockID);
-- } else if(var5 == 2) {
-- var1.notifyBlocksOfNeighborChange(var2, var3, var4 + 1, this.blockID);
-- }
--
-- }
--
-- private boolean func_72144_l(World var1, int var2, int var3, int var4) {
-- if(!this.canPlaceBlockAt(var1, var2, var3, var4)) {
-- this.dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4), 0);
-- var1.setBlockToAir(var2, var3, var4);
-+ }
-+
-+ /**
-+ * Ticks the block if it's been scheduled
-+ */
-+ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) {
-+ this.func_72143_a(par1World, par2, par3, par4, this.blockID, par1World.getBlockMetadata(par2, par3, par4), true, -1, 0);
-+ }
-+
-+ /**
-+ * only of the conditions are right
-+ */
-+ private void playSoundEffect(World par1World, int par2, int par3, int par4, boolean par5, boolean par6, boolean par7, boolean par8) {
-+ if (par6 && !par8) {
-+ par1World.playSoundEffect((double)par2 + 0.5D, (double)par3 + 0.1D, (double)par4 + 0.5D, "random.click", 0.4F, 0.6F);
-+ } else if (!par6 && par8) {
-+ par1World.playSoundEffect((double)par2 + 0.5D, (double)par3 + 0.1D, (double)par4 + 0.5D, "random.click", 0.4F, 0.5F);
-+ } else if (par5 && !par7) {
-+ par1World.playSoundEffect((double)par2 + 0.5D, (double)par3 + 0.1D, (double)par4 + 0.5D, "random.click", 0.4F, 0.7F);
-+ } else if (!par5 && par7) {
-+ par1World.playSoundEffect((double)par2 + 0.5D, (double)par3 + 0.1D, (double)par4 + 0.5D, "random.bowhit", 0.4F, 1.2F / (par1World.rand.nextFloat() * 0.2F + 0.9F));
-+ }
-+ }
-+
-+ private void notifyNeighborOfChange(World par1World, int par2, int par3, int par4, int par5) {
-+ par1World.notifyBlocksOfNeighborChange(par2, par3, par4, this.blockID);
-+
-+ if (par5 == 3) {
-+ par1World.notifyBlocksOfNeighborChange(par2 - 1, par3, par4, this.blockID);
-+ } else if (par5 == 1) {
-+ par1World.notifyBlocksOfNeighborChange(par2 + 1, par3, par4, this.blockID);
-+ } else if (par5 == 0) {
-+ par1World.notifyBlocksOfNeighborChange(par2, par3, par4 - 1, this.blockID);
-+ } else if (par5 == 2) {
-+ par1World.notifyBlocksOfNeighborChange(par2, par3, par4 + 1, this.blockID);
-+ }
-+ }
-+
-+ private boolean func_72144_l(World par1World, int par2, int par3, int par4) {
-+ if (!this.canPlaceBlockAt(par1World, par2, par3, par4)) {
-+ this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0);
-+ par1World.setBlockToAir(par2, par3, par4);
- return false;
- } else {
- return true;
- }
- }
-
-- public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) {
-- int var5 = var1.getBlockMetadata(var2, var3, var4) & 3;
-- float var6 = 3.0F / 16.0F;
-- if(var5 == 3) {
-+ /**
-+ * 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) & 3;
-+ float var6 = 0.1875F;
-+
-+ if (var5 == 3) {
- this.setBlockBounds(0.0F, 0.2F, 0.5F - var6, var6 * 2.0F, 0.8F, 0.5F + var6);
-- } else if(var5 == 1) {
-+ } else if (var5 == 1) {
- this.setBlockBounds(1.0F - var6 * 2.0F, 0.2F, 0.5F - var6, 1.0F, 0.8F, 0.5F + var6);
-- } else if(var5 == 0) {
-+ } else if (var5 == 0) {
- this.setBlockBounds(0.5F - var6, 0.2F, 0.0F, 0.5F + var6, 0.8F, var6 * 2.0F);
-- } else if(var5 == 2) {
-+ } else if (var5 == 2) {
- this.setBlockBounds(0.5F - var6, 0.2F, 1.0F - var6 * 2.0F, 0.5F + var6, 0.8F, 1.0F);
- }
--
- }
-
-- public void breakBlock(World var1, int var2, int var3, int var4, int var5, int var6) {
-- boolean var7 = (var6 & 4) == 4;
-- boolean var8 = (var6 & 8) == 8;
-- if(var7 || var8) {
-- this.func_72143_a(var1, var2, var3, var4, 0, var6, false, -1, 0);
-+ /**
-+ * 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) {
-+ boolean var7 = (par6 & 4) == 4;
-+ boolean var8 = (par6 & 8) == 8;
-+
-+ if (var7 || var8) {
-+ this.func_72143_a(par1World, par2, par3, par4, 0, par6, false, -1, 0);
- }
-
-- if(var8) {
-- var1.notifyBlocksOfNeighborChange(var2, var3, var4, this.blockID);
-- int var9 = var6 & 3;
-- if(var9 == 3) {
-- var1.notifyBlocksOfNeighborChange(var2 - 1, var3, var4, this.blockID);
-- } else if(var9 == 1) {
-- var1.notifyBlocksOfNeighborChange(var2 + 1, var3, var4, this.blockID);
-- } else if(var9 == 0) {
-- var1.notifyBlocksOfNeighborChange(var2, var3, var4 - 1, this.blockID);
-- } else if(var9 == 2) {
-- var1.notifyBlocksOfNeighborChange(var2, var3, var4 + 1, this.blockID);
-+ if (var8) {
-+ par1World.notifyBlocksOfNeighborChange(par2, par3, par4, this.blockID);
-+ int var9 = par6 & 3;
-+
-+ if (var9 == 3) {
-+ par1World.notifyBlocksOfNeighborChange(par2 - 1, par3, par4, this.blockID);
-+ } else if (var9 == 1) {
-+ par1World.notifyBlocksOfNeighborChange(par2 + 1, par3, par4, this.blockID);
-+ } else if (var9 == 0) {
-+ par1World.notifyBlocksOfNeighborChange(par2, par3, par4 - 1, this.blockID);
-+ } else if (var9 == 2) {
-+ par1World.notifyBlocksOfNeighborChange(par2, par3, par4 + 1, this.blockID);
- }
- }
-
-- super.breakBlock(var1, var2, var3, var4, var5, var6);
-- }
--
-- public int isProvidingWeakPower(IBlockAccess var1, int var2, int var3, int var4, int var5) {
-- return (var1.getBlockMetadata(var2, var3, var4) & 8) == 8 ? 15 : 0;
-- }
--
-- public int isProvidingStrongPower(IBlockAccess var1, int var2, int var3, int var4, int var5) {
-- int var6 = var1.getBlockMetadata(var2, var3, var4);
-- if((var6 & 8) != 8) {
-+ super.breakBlock(par1World, par2, par3, par4, par5, par6);
-+ }
-+
-+ /**
-+ * 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.
-+ */
-+ public int isProvidingWeakPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) {
-+ return (par1IBlockAccess.getBlockMetadata(par2, par3, par4) & 8) == 8 ? 15 : 0;
-+ }
-+
-+ /**
-+ * Returns true if the block is emitting direct/strong redstone power on the specified side. Args: World, X, Y, Z,
-+ * side. Note that the side is reversed - eg it is 1 (up) when checking the bottom of the block.
-+ */
-+ public int isProvidingStrongPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) {
-+ int var6 = par1IBlockAccess.getBlockMetadata(par2, par3, par4);
-+
-+ if ((var6 & 8) != 8) {
- return 0;
- } else {
- int var7 = var6 & 3;
-- return var7 == 2 && var5 == 2 ? 15 : (var7 == 0 && var5 == 3 ? 15 : (var7 == 1 && var5 == 4 ? 15 : (var7 == 3 && var5 == 5 ? 15 : 0)));
-+ return var7 == 2 && par5 == 2 ? 15 : (var7 == 0 && par5 == 3 ? 15 : (var7 == 1 && par5 == 4 ? 15 : (var7 == 3 && par5 == 5 ? 15 : 0)));
- }
- }
-
-+ /**
-+ * Can this block provide power. Only wire currently seems to have this change based on its state.
-+ */
- public boolean canProvidePower() {
- return true;
- }
---- /dev/null
-+++ com/prupe/mcpatcher/TexturePackChangeHandler.java
-@@ -1,0 +1,218 @@
-+package com.prupe.mcpatcher;
-+
-+import com.prupe.mcpatcher.TexturePackChangeHandler$1;
-+import java.util.ArrayList;
-+import java.util.Collections;
-+import java.util.HashSet;
-+import java.util.Iterator;
-+import java.util.List;
-+import java.util.Set;
-+import java.util.Map.Entry;
-+import net.minecraft.src.Minecraft;
-+import net.minecraft.src.ResourceLocation;
-+import net.minecraft.src.ResourcePack;
-+import net.minecraft.src.SimpleTexture;
-+import net.minecraft.src.TextureManager;
-+import net.minecraft.src.TextureObject;
-+
-+public abstract class TexturePackChangeHandler {
-+ private static final MCLogger logger = MCLogger.getLogger("Texture Pack");
-+ private static final ArrayList handlers = new ArrayList();
-+ private static boolean initializing;
-+ private static boolean changing;
-+ private static long startTime;
-+ private static long startMem;
-+ private boolean updateNeeded;
-+ protected final String name;
-+ protected final int order;
-+
-+ public TexturePackChangeHandler(String name, int order) {
-+ this.name = name;
-+ this.order = order;
-+ }
-+
-+ public void initialize() {
-+ this.beforeChange();
-+ this.afterChange();
-+ }
-+
-+ public void refresh() {
-+ this.beforeChange();
-+ this.afterChange();
-+ }
-+
-+ public abstract void beforeChange();
-+
-+ public abstract void afterChange();
-+
-+ public void afterChange2() {}
-+
-+ protected void setUpdateNeeded(boolean updateNeeded) {
-+ this.updateNeeded = updateNeeded;
-+ }
-+
-+ public static void scheduleTexturePackRefresh() {
-+ // ToDO:
-+ //Minecraft.getMinecraft().scheduleTexturePackRefresh();
-+ }
-+
-+ public static void register(TexturePackChangeHandler handler) {
-+ if (handler != null) {
-+ if (Minecraft.getMinecraft().getResourceManager() != null) {
-+ try {
-+ logger.info("initializing %s...", new Object[] {handler.name});
-+ handler.initialize();
-+ } catch (Throwable var2) {
-+ var2.printStackTrace();
-+ logger.severe("%s initialization failed", new Object[] {handler.name});
-+ }
-+ }
-+
-+ handlers.add(handler);
-+ logger.fine("registered texture pack handler %s, priority %d", new Object[] {handler.name, Integer.valueOf(handler.order)});
-+ Collections.sort(handlers, new TexturePackChangeHandler$1());
-+ }
-+ }
-+
-+ public static void earlyInitialize(String className, String methodName) {
-+ try {
-+ logger.fine("calling %s.%s", new Object[] {className, methodName});
-+ Class.forName(className).getDeclaredMethod(methodName, new Class[0]).invoke((Object)null, new Object[0]);
-+ } catch (Throwable var3) {
-+ ;
-+ }
-+ }
-+
-+ public static void checkForTexturePackChange() {
-+ Iterator i$ = handlers.iterator();
-+
-+ while (i$.hasNext()) {
-+ TexturePackChangeHandler handler = (TexturePackChangeHandler)i$.next();
-+
-+ if (handler.updateNeeded) {
-+ handler.updateNeeded = false;
-+
-+ try {
-+ logger.info("refreshing %s...", new Object[] {handler.name});
-+ handler.refresh();
-+ } catch (Throwable var3) {
-+ var3.printStackTrace();
-+ logger.severe("%s refresh failed", new Object[] {handler.name});
-+ }
-+ }
-+ }
-+ }
-+
-+ public static void beforeChange1(boolean initializing1) {
-+ logger.finer("beforeChange1(%s) initializing=%s changing=%s", new Object[] {Boolean.valueOf(initializing1), Boolean.valueOf(initializing), Boolean.valueOf(changing)});
-+
-+ if (initializing1) {
-+ logger.finer("skipping beforeChange1 because we are still initializing", new Object[0]);
-+ initializing = true;
-+ } else if (changing && !initializing) {
-+ (new RuntimeException("unexpected recursive call to TexturePackChangeHandler")).printStackTrace();
-+ } else {
-+ changing = true;
-+ startTime = System.currentTimeMillis();
-+ Runtime runtime = Runtime.getRuntime();
-+ startMem = runtime.totalMemory() - runtime.freeMemory();
-+ List resourcePacks = TexturePackAPI.getResourcePacks((String)null);
-+ logger.fine("%s resource packs (%d selected):", new Object[] {initializing ? "initializing" : "changing", Integer.valueOf(resourcePacks.size())});
-+ Iterator namespaces = resourcePacks.iterator();
-+
-+ while (namespaces.hasNext()) {
-+ ResourcePack textureManager = (ResourcePack)namespaces.next();
-+ logger.fine("resource pack: %s", new Object[] {textureManager.getPackName()});
-+ }
-+
-+ Set namespaces1 = TexturePackAPI.getNamespaces();
-+ logger.fine("%d resource namespaces:", new Object[] {Integer.valueOf(namespaces1.size())});
-+ Iterator textureManager1 = namespaces1.iterator();
-+
-+ while (textureManager1.hasNext()) {
-+ String texturesToUnload = (String)textureManager1.next();
-+ logger.fine("namespace: %s", new Object[] {texturesToUnload});
-+ }
-+
-+ textureManager1 = handlers.iterator();
-+
-+ while (textureManager1.hasNext()) {
-+ TexturePackChangeHandler texturesToUnload1 = (TexturePackChangeHandler)textureManager1.next();
-+
-+ try {
-+ logger.info("refreshing %s (pre)...", new Object[] {texturesToUnload1.name});
-+ texturesToUnload1.beforeChange();
-+ } catch (Throwable var10) {
-+ var10.printStackTrace();
-+ logger.severe("%s.beforeChange failed", new Object[] {texturesToUnload1.name});
-+ }
-+ }
-+
-+ TextureManager textureManager2 = Minecraft.getMinecraft().getTextureManager();
-+
-+ if (textureManager2 != null) {
-+ HashSet texturesToUnload2 = new HashSet();
-+ Iterator i$ = textureManager2.mapTextureObjects.entrySet().iterator();
-+
-+ while (i$.hasNext()) {
-+ Entry resource = (Entry)i$.next();
-+ ResourceLocation resource1 = (ResourceLocation)resource.getKey();
-+ TextureObject texture = (TextureObject)resource.getValue();
-+
-+ if (texture instanceof SimpleTexture && !TexturePackAPI.hasResource(resource1)) {
-+ texturesToUnload2.add(resource1);
-+ }
-+ }
-+
-+ i$ = texturesToUnload2.iterator();
-+
-+ while (i$.hasNext()) {
-+ ResourceLocation resource2 = (ResourceLocation)i$.next();
-+ TexturePackAPI.unloadTexture(resource2);
-+ }
-+ }
-+ }
-+ }
-+
-+ public static void afterChange1(boolean initializing1) {
-+ logger.finer("afterChange1(%s) initializing=%s changing=%s", new Object[] {Boolean.valueOf(initializing1), Boolean.valueOf(initializing), Boolean.valueOf(changing)});
-+
-+ if (initializing && !initializing1) {
-+ logger.finer("deferring afterChange1 because we are still initializing", new Object[0]);
-+ } else {
-+ Iterator timeDiff = handlers.iterator();
-+ TexturePackChangeHandler handler;
-+
-+ while (timeDiff.hasNext()) {
-+ handler = (TexturePackChangeHandler)timeDiff.next();
-+
-+ try {
-+ logger.info("refreshing %s (post)...", new Object[] {handler.name});
-+ handler.afterChange();
-+ } catch (Throwable var7) {
-+ var7.printStackTrace();
-+ logger.severe("%s.afterChange failed", new Object[] {handler.name});
-+ }
-+ }
-+
-+ for (int var8 = handlers.size() - 1; var8 >= 0; --var8) {
-+ handler = (TexturePackChangeHandler)handlers.get(var8);
-+
-+ try {
-+ handler.afterChange2();
-+ } catch (Throwable var6) {
-+ var6.printStackTrace();
-+ logger.severe("%s.afterChange2 failed", new Object[] {handler.name});
-+ }
-+ }
-+
-+ System.gc();
-+ long var9 = System.currentTimeMillis() - startTime;
-+ Runtime runtime = Runtime.getRuntime();
-+ long memDiff = runtime.totalMemory() - runtime.freeMemory() - startMem;
-+ logger.info("done (%.3fs elapsed, mem usage %+.1fMB)\n", new Object[] {Double.valueOf((double)var9 / 1000.0D), Double.valueOf((double)memDiff / 1048576.0D)});
-+ changing = false;
-+ initializing = false;
-+ }
-+ }
-+}
---- net/minecraft/src/ICamera.java
-+++ net/minecraft/src/ICamera.java
-@@ -1,6 +1,10 @@
- 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);
---- net/minecraft/src/Packet18Animation.java
-+++ net/minecraft/src/Packet18Animation.java
-@@ -4,32 +4,66 @@
- import java.io.DataOutput;
- import java.io.IOException;
-
-+import org.spoutcraft.client.SpoutClient;
-+import org.spoutcraft.client.packet.PacketFullVersion;
-+import org.spoutcraft.client.packet.PacketRenderDistance;
-+
- public class Packet18Animation extends Packet {
-+
-+ /** The entity ID, in this case it's the player ID. */
- public int entityId;
- public int animate;
--
-- public Packet18Animation() {
-- }
--
-- public Packet18Animation(Entity var1, int var2) {
-- this.entityId = var1.entityId;
-- this.animate = var2;
-- }
--
-- public void readPacketData(DataInput var1) throws IOException {
-- this.entityId = var1.readInt();
-- this.animate = var1.readByte();
-- }
--
-- public void writePacketData(DataOutput var1) throws IOException {
-- var1.writeInt(this.entityId);
-- var1.writeByte(this.animate);
-- }
--
-- public void processPacket(NetHandler var1) {
-- var1.handleAnimation(this);
-- }
--
-+ // Spout Start
-+ Minecraft mc = SpoutClient.getHandle();
-+ // Spout End
-+
-+ public Packet18Animation() {}
-+
-+ public Packet18Animation(Entity par1Entity, int par2) {
-+ this.entityId = par1Entity.entityId;
-+ this.animate = par2;
-+ }
-+
-+ /**
-+ * Abstract. Reads the raw packet data from the data stream.
-+ */
-+ public void readPacketData(DataInput par1DataInput) throws IOException {
-+ this.entityId = par1DataInput.readInt();
-+ this.animate = par1DataInput.readByte();
-+ }
-+
-+ /**
-+ * Abstract. Writes the raw packet data to the data stream.
-+ */
-+ public void writePacketData(DataOutput par1DataOutput) throws IOException {
-+ par1DataOutput.writeInt(this.entityId);
-+ par1DataOutput.writeByte(this.animate);
-+ }
-+
-+ /**
-+ * Passes this Packet on to the NetHandler for processing.
-+ */
-+ public void processPacket(NetHandler par1NetHandler) {
-+ // Spout Start
-+ if (entityId == -42) {
-+ SpoutClient.getInstance().setSpoutVersion(1);
-+ ((NetClientHandler) par1NetHandler).addToSendQueue(this);
-+ SpoutClient.getInstance().getPacketManager().sendSpoutPacket(new PacketRenderDistance((byte)Minecraft.getMinecraft().gameSettings.renderDistance));
-+ SpoutClient.getInstance().getPacketManager().sendSpoutPacket(new PacketFullVersion(SpoutClient.getClientVersion()));
-+ System.out.println("Detected SpoutPlugin enabled server.");
-+ if (this.mc.currentScreen instanceof GuiDownloadTerrain) {
-+ this.mc.displayGuiScreen(null, true);
-+ this.mc.displayGuiScreen(new org.spoutcraft.client.gui.precache.GuiPrecache());
-+ }
-+ } else {
-+ par1NetHandler.handleAnimation(this);
-+ }
-+ // Spout End
-+ }
-+
-+ /**
-+ * Abstract. Return the size of the packet (not counting the header).
-+ */
- public int getPacketSize() {
- return 5;
- }
---- /dev/null
-+++ org/spoutcraft/api/gui/MinecraftTessellator.java
-@@ -1,0 +1,54 @@
-+/*
-+ * This file is part of Spoutcraft.
-+ *
-+ * Copyright (c) 2011 SpoutcraftDev
-+ * Spoutcraft is licensed under the GNU Lesser General Public License.
-+ *
-+ * Spoutcraft is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation, either version 3 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Spoutcraft is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program. If not, see .
-+ */
-+package org.spoutcraft.api.gui;
-+
-+public interface MinecraftTessellator {
-+ public void draw();
-+
-+ public void startDrawingQuads();
-+
-+ public void startDrawing(int drawMode);
-+
-+ public void setBrightness(int brightness);
-+
-+ public void setTextureUV(double s, double t);
-+
-+ public void setColorOpaqueFloat(float red, float green, float blue);
-+
-+ public void setColorRGBAFloat(float red, float green, float blue, float alpha);
-+
-+ public void setColorOpaque(int red, int green, int blue);
-+
-+ public void setColorRGBA(int red, int green, int blue, int alpha);
-+
-+ public void addVertexWithUV(double x, double y, double z, double s, double t);
-+
-+ public void addVertex(double x, double y, double z);
-+
-+ public void setColorOpaqueInt(int color);
-+
-+ public void setColorRGBAInt(int color, int alpha);
-+
-+ public void disableColor();
-+
-+ public void setNormal(float x, float y, float z);
-+
-+ public void setTranslation(double x, double y, double z);
-+}
---- net/minecraft/src/CallableType2.java
-+++ net/minecraft/src/CallableType2.java
-@@ -5,8 +5,8 @@
- class CallableType2 implements Callable {
- final Minecraft mc;
-
-- CallableType2(Minecraft var1) {
-- this.mc = var1;
-+ CallableType2(Minecraft par1Minecraft) {
-+ this.mc = par1Minecraft;
- }
-
- public String func_82886_a() {
---- net/minecraft/src/GuiPlayerInfo.java
-+++ net/minecraft/src/GuiPlayerInfo.java
-@@ -1,12 +1,18 @@
- package net.minecraft.src;
-
- public class GuiPlayerInfo {
-- public final String a;
-- private final String c;
-+
-+ /** 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 var1) {
-- this.a = var1;
-- this.c = var1.toLowerCase();
-+ public GuiPlayerInfo(String par1Str) {
-+ this.name = par1Str;
-+ this.nameinLowerCase = par1Str.toLowerCase();
- }
- }
---- /dev/null
-+++ org/spoutcraft/client/gui/settings/controls/SmoothLightingSlider.java
-@@ -1,0 +1,47 @@
-+/*
-+ * This file is part of Spoutcraft.
-+ *
-+ * Copyright (c) 2011 SpoutcraftDev
-+ * Spoutcraft is licensed under the GNU Lesser General Public License.
-+ *
-+ * Spoutcraft is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation, either version 3 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Spoutcraft is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program. If not, see .
-+ */
-+package org.spoutcraft.client.gui.settings.controls;
-+
-+import net.minecraft.src.Minecraft;
-+
-+import org.spoutcraft.api.gui.GenericSlider;
-+import org.spoutcraft.client.config.Configuration;
-+
-+public class SmoothLightingSlider extends GenericSlider {
-+ public SmoothLightingSlider() {
-+ super("Smooth Lighting");
-+ setSliderPosition(Configuration.getSmoothLighting());
-+ setTooltip("Smooth lighting\nOFF - no smooth lighting (faster)\n1% - light smooth lighting (slower)\n100% - dark smooth lighting (slower)");
-+ }
-+
-+ @Override
-+ public void onSliderDrag(float old, float newPos) {
-+ Configuration.setSmoothLighting(newPos);
-+ Minecraft.getMinecraft().gameSettings.ambientOcclusion = Configuration.getSmoothLighting() > 0F ? 0 : 2;
-+ if (Minecraft.getMinecraft().theWorld != null) {
-+ Minecraft.getMinecraft().renderGlobal.loadRenderers();
-+ }
-+ Configuration.write();
-+ }
-+
-+ public String getText() {
-+ return "Smooth Lighting: " + (int)(this.getSliderPosition() * 100) + "%";
-+ }
-+}
---- net/minecraft/src/EnchantmentThorns.java
-+++ net/minecraft/src/EnchantmentThorns.java
-@@ -3,47 +3,57 @@
- import java.util.Random;
-
- public class EnchantmentThorns extends Enchantment {
-- public EnchantmentThorns(int var1, int var2) {
-- super(var1, var2, EnumEnchantmentType.armor_torso);
-+ public EnchantmentThorns(int par1, int par2) {
-+ super(par1, par2, EnumEnchantmentType.armor_torso);
- this.setName("thorns");
- }
-
-- public int getMinEnchantability(int var1) {
-- return 10 + 20 * (var1 - 1);
-- }
--
-- public int getMaxEnchantability(int var1) {
-- return super.getMinEnchantability(var1) + 50;
-- }
--
-+ /**
-+ * Returns the minimal value of enchantability needed on the enchantment level passed.
-+ */
-+ public int getMinEnchantability(int par1) {
-+ return 10 + 20 * (par1 - 1);
-+ }
-+
-+ /**
-+ * Returns the maximum value of enchantability nedded on the enchantment level passed.
-+ */
-+ public int getMaxEnchantability(int par1) {
-+ return super.getMinEnchantability(par1) + 50;
-+ }
-+
-+ /**
-+ * Returns the maximum level that the enchantment can have.
-+ */
- public int getMaxLevel() {
- return 3;
- }
-
-- public boolean canApply(ItemStack var1) {
-- return var1.getItem() instanceof ItemArmor ? true : super.canApply(var1);
-- }
--
-- public static boolean func_92094_a(int var0, Random var1) {
-- return var0 <= 0 ? false : var1.nextFloat() < 0.15F * (float)var0;
-- }
--
-- public static int func_92095_b(int var0, Random var1) {
-- return var0 > 10 ? var0 - 10 : 1 + var1.nextInt(4);
-- }
--
-- public static void func_92096_a(Entity var0, EntityLivingBase var1, Random var2) {
-- int var3 = EnchantmentHelper.func_92098_i(var1);
-- ItemStack var4 = EnchantmentHelper.func_92099_a(Enchantment.thorns, var1);
-- if(func_92094_a(var3, var2)) {
-- var0.attackEntityFrom(DamageSource.causeThornsDamage(var1), (float)func_92095_b(var3, var2));
-- var0.playSound("damage.thorns", 0.5F, 1.0F);
-- if(var4 != null) {
-- var4.damageItem(3, var1);
-+ public boolean canApply(ItemStack par1ItemStack) {
-+ return par1ItemStack.getItem() instanceof ItemArmor ? true : super.canApply(par1ItemStack);
-+ }
-+
-+ public static boolean func_92094_a(int par0, Random par1Random) {
-+ return par0 <= 0 ? false : par1Random.nextFloat() < 0.15F * (float)par0;
-+ }
-+
-+ public static int func_92095_b(int par0, Random par1Random) {
-+ return par0 > 10 ? par0 - 10 : 1 + par1Random.nextInt(4);
-+ }
-+
-+ public static void func_92096_a(Entity par0Entity, EntityLivingBase par1EntityLivingBase, Random par2Random) {
-+ int var3 = EnchantmentHelper.func_92098_i(par1EntityLivingBase);
-+ ItemStack var4 = EnchantmentHelper.func_92099_a(Enchantment.thorns, par1EntityLivingBase);
-+
-+ if (func_92094_a(var3, par2Random)) {
-+ par0Entity.attackEntityFrom(DamageSource.causeThornsDamage(par1EntityLivingBase), (float)func_92095_b(var3, par2Random));
-+ par0Entity.playSound("damage.thorns", 0.5F, 1.0F);
-+
-+ if (var4 != null) {
-+ var4.damageItem(3, par1EntityLivingBase);
- }
-- } else if(var4 != null) {
-- var4.damageItem(1, var1);
-+ } else if (var4 != null) {
-+ var4.damageItem(1, par1EntityLivingBase);
- }
--
- }
- }
---- net/minecraft/src/GuiContainer.java
-+++ net/minecraft/src/GuiContainer.java
-@@ -1,34 +1,75 @@
- package net.minecraft.src;
-
-+import java.util.ArrayList;
- import java.util.Arrays;
-+import java.util.Collections;
- import java.util.HashSet;
- import java.util.Iterator;
- import java.util.List;
- import java.util.Set;
-+
-+import net.minecraft.src.Minecraft;
-+import net.minecraft.src.RenderHelper;
-+
- import org.lwjgl.input.Keyboard;
- import org.lwjgl.opengl.GL11;
- import org.lwjgl.opengl.GL12;
-+import org.spoutcraft.api.Spoutcraft;
-+import org.spoutcraft.api.gui.Button;
-+import org.spoutcraft.api.gui.GenericButton;
-+import org.spoutcraft.api.gui.ScreenType;
-+import org.spoutcraft.api.gui.Widget;
-+import org.spoutcraft.client.MCItemStackComparator;
-+import org.spoutcraft.client.gui.ScreenUtil;
-+import org.spoutcraft.client.inventory.CraftItemStack;
-+import org.spoutcraft.client.inventory.InventoryUtil;
-
- public abstract class GuiContainer extends GuiScreen {
- protected static final ResourceLocation field_110408_a = new ResourceLocation("textures/gui/container/inventory.png");
-- protected static RenderItem itemRenderer = new RenderItem();
-+
-+ /** Stacks renderer. Icons, stack size, health, etc... */
-+ // Spout Start
-+ protected static RenderItem itemRenderer;
-+ // Spout End
-+
-+ /** 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 r = new HashSet();
-+ protected final Set field_94077_p = new HashSet();
- protected boolean field_94076_q;
- private int field_94071_C;
- private int field_94067_D;
-@@ -40,31 +81,255 @@
- private boolean field_94074_J;
- private ItemStack field_94075_K;
-
-- public GuiContainer(Container var1) {
-- this.inventorySlots = var1;
-+ // Spout Start
-+ private Button orderByAlphabet, orderById;
-+ static {
-+ itemRenderer = GuiScreen.ourItemRenderer;
-+ }
-+ // Spout Start
-+
-+ 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;
-- }
--
-- public void drawScreen(int var1, int var2, float var3) {
-+
-+ // Spout Start
-+ if (Spoutcraft.hasPermission("spout.plugin.sortinventory")) {
-+ orderByAlphabet = new GenericButton("A-Z");
-+ orderById = new GenericButton("Id");
-+ orderByAlphabet.setTooltip("Will sort the inventory contents by their name");
-+ orderById.setTooltip("Will sort the inventory contents by their id");
-+ ScreenType type = ScreenUtil.getType(this);
-+
-+ if (type == ScreenType.PLAYER_INVENTORY) {
-+ if (!this.mc.thePlayer.getActivePotionEffects().isEmpty()) {
-+ orderByAlphabet.setGeometry((guiLeft+146), (guiTop+65), 27, 13);
-+ orderById.setGeometry((guiLeft+176), (guiTop+65), 22, 13);
-+ } else {
-+ orderByAlphabet.setGeometry((guiLeft+86), (guiTop+65), 27, 13);
-+ orderById.setGeometry((guiLeft+116), (guiTop+65), 22, 13);
-+ }
-+ } else if (type == ScreenType.CHEST_INVENTORY) {
-+ orderByAlphabet.setGeometry((guiLeft+115), (guiTop+3), 27, 12);
-+ orderById.setGeometry((guiLeft+145), (guiTop+3), 22, 12);
-+ }
-+
-+ IInventory inv = inventorySlots.getIInventory();
-+ if (inv != null && inventorySlots.isSortableInventory()) {
-+ getScreen().attachWidgets("Spoutcraft", orderByAlphabet, orderById);
-+ }
-+ }
-+ // Spout End
-+ }
-+
-+ @Override
-+ public void drawWidgets(int x, int y, float z) {
-+ GL11.glDisable(GL12.GL_RESCALE_NORMAL);
-+ RenderHelper.disableStandardItemLighting();
-+ GL11.glDisable(GL11.GL_LIGHTING);
-+ GL11.glDisable(GL11.GL_DEPTH_TEST);
-+ super.drawWidgets(x, y, z);
-+ GL11.glEnable(GL11.GL_LIGHTING);
-+ GL11.glEnable(GL11.GL_DEPTH_TEST);
-+ }
-+
-+ public void buttonClicked(Button btn) {
-+ if (btn == orderByAlphabet || btn == orderById) {
-+ try {
-+ IInventory inv = inventorySlots.getIInventory();
-+ if (inv != null) {
-+ if (inv instanceof InventoryPlayer) {
-+ compactInventory(inv, true);
-+ sortPlayerInventory(btn == orderByAlphabet);
-+ } else {
-+ compactInventory(inv, false);
-+ sortInventory(inv, (btn == orderByAlphabet));
-+ }
-+ }
-+ } catch (Exception e) {
-+ e.printStackTrace();
-+ }
-+ }
-+ }
-+
-+ public int getNumItems(IInventory inventory) {
-+ int used = 0;
-+ for (int i = 0; i < inventory.getSizeInventory(); i++) {
-+ if (inventory.getStackInSlot(i) != null) {
-+ used++;
-+ }
-+ }
-+ return used;
-+ }
-+
-+ public void compactInventory(IInventory inventory, boolean player) {
-+ // To keep mp compatibility, fake window clicks
-+ for (int i = 0; i < inventory.getSizeInventory(); i++) {
-+ ItemStack item = inventory.getStackInSlot(i);
-+ if (item != null && item.stackSize < item.getMaxStackSize()) {
-+
-+ // Find a place to put this
-+ int orig = i;
-+ // Avoid the hotbar
-+ if (orig < 9 && player) {
-+ continue;
-+ }
-+ handleMouseClick(null, orig, 0, 0); // Pick up the item
-+
-+ for (int j = 0; j < inventory.getSizeInventory(); j++) {
-+ if (j != i) {
-+ ItemStack other = inventory.getStackInSlot(j);
-+ if (other != null && other.itemID == item.itemID && other.getItemDamage() == item.getItemDamage()) {
-+ int slot = j;
-+ // Avoid the hotbar
-+ if (slot < 9 && player) {
-+ continue;
-+ }
-+ handleMouseClick(null, slot, 0, 0); // Merge with the existing stack we found
-+
-+ // Move onto the next item to merge if this one is completely used up
-+ ItemStack cursor = Minecraft.getMinecraft().thePlayer.inventory.getItemStack();
-+ if (cursor == null) {
-+ break;
-+ }
-+ }
-+ }
-+ }
-+
-+ // If we didn't merge all of the item, put it back
-+ ItemStack cursor = Minecraft.getMinecraft().thePlayer.inventory.getItemStack();
-+ if (cursor != null) {
-+ handleMouseClick(null, orig, 0, 0);
-+ }
-+ }
-+ }
-+ }
-+
-+ @SuppressWarnings("unchecked")
-+ public void sortPlayerInventory(boolean byName) {
-+ // To keep mp compatibility, fake window clicks
-+ InventoryPlayer inventory = Minecraft.getMinecraft().thePlayer.inventory;
-+ for (int itemPass = 0; itemPass < getNumItems(inventory); itemPass++) {
-+ for (int pass = 0; pass < inventory.mainInventory.length; pass++) {
-+ ArrayList items = new ArrayList();
-+ for (int i = 0; i < inventory.mainInventory.length; i++) {
-+ ItemStack item = inventory.mainInventory[i];
-+ if (item == null || i < 9) {
-+ items.add(null);
-+ } else {
-+ items.add(new PositionedItemStack(item, i));
-+ }
-+ }
-+ Collections.sort(items, new MCItemStackComparator(byName));
-+
-+ while (true) {
-+ if (items.get(pass) instanceof PositionedItemStack) {
-+ PositionedItemStack item = (PositionedItemStack) items.get(pass);
-+ // Left click pick up item
-+ int origSlot = item.position;
-+ if (origSlot < 9) {
-+ break;
-+ }
-+ int newSlot = pass;
-+ if (origSlot != newSlot) {
-+ // Left click pick up item
-+ handleMouseClick(null, origSlot, 0, 0);
-+
-+ // Left click place item down
-+ handleMouseClick(null, newSlot, 0, 0);
-+
-+ ItemStack cursor = Minecraft.getMinecraft().thePlayer.inventory.getItemStack();
-+ if (cursor != null) {
-+ handleMouseClick(null, origSlot, 0, 0);
-+ }
-+ }
-+ break;
-+ }
-+ pass++;
-+ if (pass >= inventory.mainInventory.length) {
-+ break;
-+ }
-+ }
-+ }
-+ }
-+ }
-+
-+ @SuppressWarnings("unchecked")
-+ public void sortInventory(IInventory inventory, boolean byName) {
-+ // To keep mp compatibility, fake window clicks
-+ for (int itemPass = 0; itemPass < getNumItems(inventory); itemPass++) {
-+ for (int pass = 0; pass < inventory.getSizeInventory(); pass++) {
-+ ArrayList items = new ArrayList();
-+ for (int i = 0; i < inventory.getSizeInventory(); i++) {
-+ ItemStack item = inventory.getStackInSlot(i);
-+ if (item == null) {
-+ items.add(null);
-+ } else {
-+ items.add(new PositionedItemStack(item, i));
-+ }
-+ }
-+ Collections.sort(items, new MCItemStackComparator(byName));
-+
-+ while (true) {
-+ if (items.get(pass) instanceof PositionedItemStack) {
-+ PositionedItemStack item = (PositionedItemStack) items.get(pass);
-+ //Left click pick up item
-+ Slot origSlot = getSlotFromPosition(item.position);
-+ Slot newSlot = getSlotFromPosition(pass);
-+ if (newSlot != origSlot) {
-+ handleMouseClick(origSlot, 0, 0, 0);
-+
-+ // Left click place item down
-+ handleMouseClick(newSlot, 0, 0, 0);
-+
-+ ItemStack cursor = Minecraft.getMinecraft().thePlayer.inventory.getItemStack();
-+ if (cursor != null) {
-+ handleMouseClick(origSlot, 0, 0, 0);
-+ }
-+ }
-+ break;
-+ }
-+ pass++;
-+ if (pass >= inventory.getSizeInventory()) {
-+ break;
-+ }
-+ }
-+ }
-+ }
-+ }
-+
-+ public Slot getSlotFromPosition(int pos) {
-+ return InventoryUtil.getSlotFromPosition(pos, inventorySlots);
-+ }
-+ // Spout End
-+
-+ /**
-+ * Draws the screen and all the components in it.
-+ */
-+ // ToDo: this method should be stripped and updated.
-+ public void drawScreen(int par1, int par2, float par3) {
- this.drawDefaultBackground();
- int var4 = this.guiLeft;
- int var5 = this.guiTop;
-- this.drawGuiContainerBackgroundLayer(var3, var1, var2);
-+ 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(var1, var2, var3);
-- RenderHelper.enableGUIStandardItemLighting();
-+ super.drawScreen(par1, par2, par3);
- GL11.glPushMatrix();
- GL11.glTranslatef((float)var4, (float)var5, 0.0F);
-+ this.drawGuiContainerForegroundLayer(par1, par2);
-+ RenderHelper.enableGUIStandardItemLighting();
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- GL11.glEnable(GL12.GL_RESCALE_NORMAL);
- this.theSlot = null;
-@@ -72,126 +337,227 @@
- 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.c.size(); ++var13) {
-- Slot var15 = (Slot)this.inventorySlots.c.get(var13);
-- this.drawSlotInventory(var15);
-- if(this.isMouseOverSlot(var15, var1, var2) && var15.func_111238_b()) {
-- this.theSlot = var15;
-+
-+ for (int var13 = 0; var13 < this.inventorySlots.inventorySlots.size(); ++var13) {
-+ Slot var14 = (Slot)this.inventorySlots.inventorySlots.get(var13);
-+ this.drawSlotInventory(var14);
-+
-+ if (this.isMouseOverSlot(var14, par1, par2) && var14.func_111238_b()) {
-+ this.theSlot = var14;
- GL11.glDisable(GL11.GL_LIGHTING);
- GL11.glDisable(GL11.GL_DEPTH_TEST);
-- int var8 = var15.xDisplayPosition;
-- var9 = var15.yDisplayPosition;
-+ int var8 = var14.xDisplayPosition;
-+ var9 = var14.yDisplayPosition;
- this.drawGradientRect(var8, var9, var8 + 16, var9 + 16, -2130706433, -2130706433);
- GL11.glEnable(GL11.GL_LIGHTING);
- GL11.glEnable(GL11.GL_DEPTH_TEST);
- }
- }
-
-- this.drawGuiContainerForegroundLayer(var1, var2);
-- InventoryPlayer var14 = this.mc.thePlayer.inventory;
-- ItemStack var16 = this.draggedStack == null ? var14.getItemStack() : this.draggedStack;
-- if(var16 != null) {
-- byte var17 = 8;
-+ InventoryPlayer var15 = this.mc.thePlayer.inventory;
-+ ItemStack var16 = this.draggedStack == null ? var15.getItemStack() : this.draggedStack;
-+
-+ if (var16 != null) {
-+ byte var18 = 8;
- var9 = this.draggedStack == null ? 8 : 16;
- String var10 = null;
-- if(this.draggedStack != null && this.isRightMouseClick) {
-+
-+ 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.r.size() > 1) {
-+ } 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) {
-+
-+ if (var16.stackSize == 0) {
- var10 = "" + EnumChatFormatting.YELLOW + "0";
- }
- }
-
-- this.drawItemStack(var16, var1 - var4 - var17, var2 - var5 - var9, var10);
-+ this.drawItemStack(var16, par1 - var4 - var18, par2 - var5 - var9, var10);
- }
-
-- if(this.returningStack != null) {
-- float var18 = (float)(Minecraft.getSystemTime() - this.returningStackTime) / 100.0F;
-- if(var18 >= 1.0F) {
-- var18 = 1.0F;
-+ if (this.returningStack != null) {
-+ float var17 = (float)(Minecraft.getSystemTime() - this.returningStackTime) / 100.0F;
-+
-+ if (var17 >= 1.0F) {
-+ var17 = 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);
-+ int var11 = this.field_85049_r + (int)((float)var9 * var17);
-+ int var12 = this.field_85048_s + (int)((float)var20 * var17);
- this.drawItemStack(this.returningStack, var11, var12, (String)null);
- }
-
-- GL11.glPopMatrix();
-- if(var14.getItemStack() == null && this.theSlot != null && this.theSlot.getHasStack()) {
-+ if (var15.getItemStack() == null && this.theSlot != null && this.theSlot.getHasStack()) {
- ItemStack var19 = this.theSlot.getStack();
-- this.drawItemStackTooltip(var19, var1, var2);
-+ this.drawItemStackTooltip(var19, par1 - var4 + 8, par2 - var5 + 8);
- }
-
-+ GL11.glPopMatrix();
- GL11.glEnable(GL11.GL_LIGHTING);
- GL11.glEnable(GL11.GL_DEPTH_TEST);
-- RenderHelper.enableStandardItemLighting();
-+ RenderHelper.disableStandardItemLighting();
-+ GL11.glDisable(GL12.GL_RESCALE_NORMAL);
- }
-
-- private void drawItemStack(ItemStack var1, int var2, int var3, String var4) {
-+ 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(), var1, var2, var3);
-- itemRenderer.renderItemOverlayIntoGUI(this.fontRenderer, this.mc.getTextureManager(), var1, var2, var3 - (this.draggedStack == null ? 0 : 8), var4);
-+ 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 var1, int var2, int var3) {
-- List var4 = var1.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(var1.getRarity().rarityColor) + (String)var4.get(var5));
-- } else {
-- var4.set(var5, EnumChatFormatting.GRAY + (String)var4.get(var5));
-- }
-+ protected void drawItemStackTooltip(ItemStack par1ItemStack, int par2, int par3) {
-+ GL11.glDisable(GL12.GL_RESCALE_NORMAL);
-+ RenderHelper.disableStandardItemLighting();
-+ GL11.glDisable(GL11.GL_LIGHTING);
-+ GL11.glDisable(GL11.GL_DEPTH_TEST);
-+ // Spout Start
-+ List var4 = Arrays.asList(Spoutcraft.getMaterialManager().getToolTip(new CraftItemStack(par1ItemStack)).split("\n"));
-+ // Spout End
-+
-+ if (!var4.isEmpty()) {
-+ int var5 = 0;
-+ int var7;
-+ int var6;
-+
-+ for (var6 = 0; var6 < var4.size(); ++var6) {
-+ var7 = this.fontRenderer.getStringWidth((String)var4.get(var6));
-+
-+ if (var7 > var5) {
-+ var5 = var7;
-+ }
-+ }
-+
-+ var6 = par2 + 12;
-+ var7 = par3 - 12;
-+ int var9 = 8;
-+
-+ if (var4.size() > 1) {
-+ var9 += 2 + (var4.size() - 1) * 10;
-+ }
-+
-+ if (this.guiTop + var7 + var9 + 6 > this.height) {
-+ var7 = this.height - var9 - this.guiTop - 6;
-+ }
-+
-+ this.zLevel = 300.0F;
-+ itemRenderer.zLevel = 300.0F;
-+ int var10 = -267386864;
-+ this.drawGradientRect(var6 - 3, var7 - 4, var6 + var5 + 3, var7 - 3, var10, var10);
-+ this.drawGradientRect(var6 - 3, var7 + var9 + 3, var6 + var5 + 3, var7 + var9 + 4, var10, var10);
-+ this.drawGradientRect(var6 - 3, var7 - 3, var6 + var5 + 3, var7 + var9 + 3, var10, var10);
-+ this.drawGradientRect(var6 - 4, var7 - 3, var6 - 3, var7 + var9 + 3, var10, var10);
-+ this.drawGradientRect(var6 + var5 + 3, var7 - 3, var6 + var5 + 4, var7 + var9 + 3, var10, var10);
-+ int var11 = 1347420415;
-+ int var12 = (var11 & 16711422) >> 1 | var11 & -16777216;
-+ this.drawGradientRect(var6 - 3, var7 - 3 + 1, var6 - 3 + 1, var7 + var9 + 3 - 1, var11, var12);
-+ this.drawGradientRect(var6 + var5 + 2, var7 - 3 + 1, var6 + var5 + 3, var7 + var9 + 3 - 1, var11, var12);
-+ this.drawGradientRect(var6 - 3, var7 - 3, var6 + var5 + 3, var7 - 3 + 1, var11, var11);
-+ this.drawGradientRect(var6 - 3, var7 + var9 + 2, var6 + var5 + 3, var7 + var9 + 3, var12, var12);
-+
-+ for (int var13 = 0; var13 < var4.size(); ++var13) {
-+ String var14 = (String)var4.get(var13);
-+
-+ if (var13 == 0) {
-+ var14 = "\u00a7" + Integer.toHexString(par1ItemStack.getRarity().rarityColor) + var14;
-+ } else {
-+ var14 = EnumChatFormatting.GRAY + var14;
-+ }
-+
-+ this.fontRenderer.drawStringWithShadow(var14, var6, var7, -1);
-+
-+ if (var13 == 0) {
-+ var7 += 2;
-+ }
-+
-+ var7 += 10;
-+ }
-+
-+ this.zLevel = 0.0F;
-+ itemRenderer.zLevel = 0.0F;
- }
--
-- this.func_102021_a(var4, var2, var3);
-- }
--
-- protected void drawCreativeTabHoveringText(String var1, int var2, int var3) {
-- this.func_102021_a(Arrays.asList(new String[]{var1}), var2, var3);
-- }
--
-- protected void func_102021_a(List var1, int var2, int var3) {
-- if(!var1.isEmpty()) {
-+ //ToDo: might need this
-+ //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) {
-+ //Todo: may need this instead:
-+ //this.func_102021_a(Arrays.asList(new String[] {par1Str}), par2, par3);
-+ GL11.glDisable(GL12.GL_RESCALE_NORMAL);
-+ RenderHelper.disableStandardItemLighting();
-+ GL11.glDisable(GL11.GL_LIGHTING);
-+ GL11.glDisable(GL11.GL_DEPTH_TEST);
-+ int var4 = this.fontRenderer.getStringWidth(par1Str);
-+ int var5 = par2 + 12;
-+ int var6 = par3 - 12;
-+ byte var8 = 8;
-+ this.zLevel = 300.0F;
-+ itemRenderer.zLevel = 300.0F;
-+ int var9 = -267386864;
-+ this.drawGradientRect(var5 - 3, var6 - 4, var5 + var4 + 3, var6 - 3, var9, var9);
-+ this.drawGradientRect(var5 - 3, var6 + var8 + 3, var5 + var4 + 3, var6 + var8 + 4, var9, var9);
-+ this.drawGradientRect(var5 - 3, var6 - 3, var5 + var4 + 3, var6 + var8 + 3, var9, var9);
-+ this.drawGradientRect(var5 - 4, var6 - 3, var5 - 3, var6 + var8 + 3, var9, var9);
-+ this.drawGradientRect(var5 + var4 + 3, var6 - 3, var5 + var4 + 4, var6 + var8 + 3, var9, var9);
-+ int var10 = 1347420415;
-+ int var11 = (var10 & 16711422) >> 1 | var10 & -16777216;
-+ this.drawGradientRect(var5 - 3, var6 - 3 + 1, var5 - 3 + 1, var6 + var8 + 3 - 1, var10, var11);
-+ this.drawGradientRect(var5 + var4 + 2, var6 - 3 + 1, var5 + var4 + 3, var6 + var8 + 3 - 1, var10, var11);
-+ this.drawGradientRect(var5 - 3, var6 - 3, var5 + var4 + 3, var6 - 3 + 1, var10, var10);
-+ this.drawGradientRect(var5 - 3, var6 + var8 + 2, var5 + var4 + 3, var6 + var8 + 3, var11, var11);
-+ this.fontRenderer.drawStringWithShadow(par1Str, var5, var6, -1);
-+ 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);
-+ }
-+
-+ 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 = var1.iterator();
-+ Iterator var5 = par1List.iterator();
-
-- while(var5.hasNext()) {
-+ while (var5.hasNext()) {
- String var6 = (String)var5.next();
- int var7 = this.fontRenderer.getStringWidth(var6);
-- if(var7 > var4) {
-+
-+ if (var7 > var4) {
- var4 = var7;
- }
- }
-
-- int var14 = var2 + 12;
-- int var15 = var3 - 12;
-+ int var14 = par2 + 12;
-+ int var15 = par3 - 12;
- int var8 = 8;
-- if(var1.size() > 1) {
-- var8 += 2 + (var1.size() - 1) * 10;
-+
-+ if (par1List.size() > 1) {
-+ var8 += 2 + (par1List.size() - 1) * 10;
- }
-
-- if(var14 + var4 > this.width) {
-+ if (var14 + var4 > this.width) {
- var14 -= 28 + var4;
- }
-
-- if(var15 + var8 + 6 > this.height) {
-+ if (var15 + var8 + 6 > this.height) {
- var15 = this.height - var8 - 6;
- }
-
-@@ -210,10 +576,11 @@
- 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 < var1.size(); ++var12) {
-- String var13 = (String)var1.get(var12);
-+ for (int var12 = 0; var12 < par1List.size(); ++var12) {
-+ String var13 = (String)par1List.get(var12);
- this.fontRenderer.drawStringWithShadow(var13, var14, var15, -1);
-- if(var12 == 0) {
-+
-+ if (var12 == 0) {
- var15 += 2;
- }
-
-@@ -228,52 +595,63 @@
- GL11.glEnable(GL12.GL_RESCALE_NORMAL);
- }
- }
--
-- protected void drawGuiContainerForegroundLayer(int var1, int var2) {
-- }
--
-+ /**
-+ * 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);
-
-- private void drawSlotInventory(Slot var1) {
-- int var2 = var1.xDisplayPosition;
-- int var3 = var1.yDisplayPosition;
-- ItemStack var4 = var1.getStack();
-+ /**
-+ * 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 = var1 == this.clickedSlot && this.draggedStack != null && !this.isRightMouseClick;
-+ boolean var6 = par1Slot == this.clickedSlot && this.draggedStack != null && !this.isRightMouseClick;
- ItemStack var7 = this.mc.thePlayer.inventory.getItemStack();
- String var8 = null;
-- if(var1 == this.clickedSlot && this.draggedStack != null && this.isRightMouseClick && var4 != 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.r.contains(var1) && var7 != null) {
-- if(this.r.size() == 1) {
-+ } 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(var1, var7, true) && this.inventorySlots.canDragIntoSlot(var1)) {
-+ if (Container.func_94527_a(par1Slot, var7, true) && this.inventorySlots.canDragIntoSlot(par1Slot)) {
- var4 = var7.copy();
- var5 = true;
-- Container.func_94525_a(this.r, this.field_94071_C, var4, var1.getStack() == null ? 0 : var1.getStack().stackSize);
-- if(var4.stackSize > var4.getMaxStackSize()) {
-+ 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 > var1.getSlotStackLimit()) {
-- var8 = EnumChatFormatting.YELLOW + "" + var1.getSlotStackLimit();
-- var4.stackSize = var1.getSlotStackLimit();
-+ if (var4.stackSize > par1Slot.getSlotStackLimit()) {
-+ var8 = EnumChatFormatting.YELLOW + "" + par1Slot.getSlotStackLimit();
-+ var4.stackSize = par1Slot.getSlotStackLimit();
- }
- } else {
-- this.r.remove(var1);
-+ this.field_94077_p.remove(par1Slot);
- this.func_94066_g();
- }
- }
-
- this.zLevel = 100.0F;
- itemRenderer.zLevel = 100.0F;
-- if(var4 == null) {
-- Icon var9 = var1.getBackgroundIconIndex();
-- if(var9 != null) {
-+
-+ 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);
-@@ -282,8 +660,8 @@
- }
- }
-
-- if(!var6) {
-- if(var5) {
-+ if (!var6) {
-+ if (var5) {
- drawRect(var2, var3, var2 + 16, var3 + 16, -2130706433);
- }
-
-@@ -298,32 +676,36 @@
-
- private void func_94066_g() {
- ItemStack var1 = this.mc.thePlayer.inventory.getItemStack();
-- if(var1 != null && this.field_94076_q) {
-+ if (var1 != null && this.field_94076_q) {
- this.field_94069_F = var1.stackSize;
--
- ItemStack var4;
- int var5;
-- for(Iterator var2 = this.r.iterator(); var2.hasNext(); this.field_94069_F -= var4.stackSize - 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.r, this.field_94071_C, var4, var5);
-- if(var4.stackSize > var4.getMaxStackSize()) {
-+ 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()) {
-+ if (var4.stackSize > var3.getSlotStackLimit()) {
- var4.stackSize = var3.getSlotStackLimit();
- }
- }
--
- }
- }
-
-- private Slot getSlotAtPosition(int var1, int var2) {
-- for(int var3 = 0; var3 < this.inventorySlots.c.size(); ++var3) {
-- Slot var4 = (Slot)this.inventorySlots.c.get(var3);
-- if(this.isMouseOverSlot(var4, var1, var2)) {
-+ /**
-+ * 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;
- }
- }
-@@ -331,90 +713,85 @@
- return null;
- }
-
-- protected void mouseClicked(int var1, int var2, int var3) {
-- super.mouseClicked(var1, var2, var3);
-- boolean var4 = var3 == this.mc.gameSettings.keyBindPickBlock.keyCode + 100;
-- Slot var5 = this.getSlotAtPosition(var1, var2);
-- long var6 = Minecraft.getSystemTime();
-- this.field_94074_J = this.field_94072_H == var5 && var6 - this.field_94070_G < 250L && this.field_94073_I == var3;
-- this.field_94068_E = false;
-- if(var3 == 0 || var3 == 1 || var4) {
-- int var8 = this.guiLeft;
-- int var9 = this.guiTop;
-- boolean var10 = var1 < var8 || var2 < var9 || var1 >= var8 + this.xSize || var2 >= 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) {
-+ /**
-+ * 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;
-+
-+ if (par3 == 0 || par3 == 1 || var4) {
-+ Slot var5 = this.getSlotAtPosition(par1, par2);
-+ int var6 = this.guiLeft;
-+ int var7 = this.guiTop;
-+ boolean var8 = par1 < var6 || par2 < var7 || par1 >= var6 + this.xSize || par2 >= var7 + this.ySize;
-+ int var9 = -1;
-+
-+ if (var5 != null) {
-+ var9 = var5.slotNumber;
-+ }
-+
-+ if (var8) {
-+ // Spout Start
-+ boolean isSpoutSlot = false;
-+ for (Widget w : getScreen().getAttachedWidgets(true)) {
-+ if (isInBoundingRect(w, par1, par2)) {
-+ if (w instanceof org.spoutcraft.api.gui.Slot) {
-+ isSpoutSlot = true;
-+ break;
-+ }
-+ }
-+ }
-+ if (!isSpoutSlot) {
-+ var9 = -999;
-+ }
-+ // Spout End
-+ }
-+
-+ if (this.mc.gameSettings.touchscreen && var8 && 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()) {
-+ if (var9 != -1) {
-+ if (this.mc.gameSettings.touchscreen) {
-+ if (var5 != null && var5.getHasStack()) {
- this.clickedSlot = var5;
- this.draggedStack = null;
-- this.isRightMouseClick = var3 == 1;
-+ this.isRightMouseClick = par3 == 1;
- } else {
- this.clickedSlot = null;
- }
-- } else if(!this.field_94076_q) {
-- if(this.mc.thePlayer.inventory.getItemStack() == null) {
-- if(var3 == this.mc.gameSettings.keyBindPickBlock.keyCode + 100) {
-- this.handleMouseClick(var5, var11, var3, 3);
-- } else {
-- boolean var12 = var11 != -999 && (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT));
-- 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, var3, var13);
-- }
--
-- this.field_94068_E = true;
-- } else {
-- this.field_94076_q = true;
-- this.field_94067_D = var3;
-- this.r.clear();
-- if(var3 == 0) {
-- this.field_94071_C = 0;
-- } else if(var3 == 1) {
-- this.field_94071_C = 1;
-- }
-- }
-+ } else if (var4) {
-+ this.handleMouseClick(var5, var9, par3, 3);
-+ } else {
-+ boolean var10 = var9 != -999 && (Keyboard.isKeyDown(42) || Keyboard.isKeyDown(54));
-+ this.handleMouseClick(var5, var9, par3, var10 ? 1 : 0);
- }
- }
- }
--
-- this.field_94072_H = var5;
-- this.field_94070_G = var6;
-- this.field_94073_I = var3;
- }
-
-- protected void mouseClickMove(int var1, int var2, int var3, long var4) {
-- Slot var6 = this.getSlotAtPosition(var1, var2);
-+ /**
-+ * Called when a mouse button is pressed and the mouse is moved around. Parameters are : mouseX, mouseY,
-+ * lastButtonClicked & timeSinceMouseClick.
-+ */
-+ // ToDo: this may break a lot of stuff....
-+ 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(var3 == 0 || var3 == 1) {
-- if(this.draggedStack == null) {
-- if(var6 != this.clickedSlot) {
-+
-+ 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)) {
-+ } 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) {
-+
-+ 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);
-@@ -427,84 +804,93 @@
- }
- }
- }
-- } else if(this.field_94076_q && var6 != null && var7 != null && var7.stackSize > this.r.size() && Container.func_94527_a(var6, var7, true) && var6.isItemValid(var7) && this.inventorySlots.canDragIntoSlot(var6)) {
-- this.r.add(var6);
-+ } 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();
- }
--
- }
-
-- protected void mouseMovedOrUp(int var1, int var2, int var3) {
-- Slot var4 = this.getSlotAtPosition(var1, var2);
-+ /**
-+ * 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 = var1 < var5 || var2 < var6 || var1 >= var5 + this.xSize || var2 >= var6 + this.ySize;
-+ boolean var7 = par1 < var5 || par2 < var6 || par1 >= var5 + this.xSize || par2 >= var6 + this.ySize;
- int var8 = -1;
-- if(var4 != null) {
-+
-+ if (var4 != null) {
- var8 = var4.slotNumber;
- }
-
-- if(var7) {
-+ if (var7) {
- var8 = -999;
- }
-
- Slot var10;
- Iterator var11;
-- if(this.field_94074_J && var4 != null && var3 == 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.c.iterator();
--
-- while(var11.hasNext()) {
-+
-+ 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, var3, 1);
-+
-+ 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, var3, 6);
-+ 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 != var3) {
-+ if (this.field_94076_q && this.field_94067_D != par3) {
- this.field_94076_q = false;
-- this.r.clear();
-+ this.field_94077_p.clear();
- this.field_94068_E = true;
- return;
- }
-
-- if(this.field_94068_E) {
-+ if (this.field_94068_E) {
- this.field_94068_E = false;
- return;
- }
-
- boolean var9;
-- if(this.clickedSlot != null && this.mc.gameSettings.touchscreen) {
-- if(var3 == 0 || var3 == 1) {
-- if(this.draggedStack == null && var4 != this.clickedSlot) {
-+
-+ 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, var3, 0);
-+
-+ 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, var3, 0);
-- this.field_85049_r = var1 - var5;
-- this.field_85048_s = var2 - var6;
-+
-+ 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 = var1 - var5;
-- this.field_85048_s = var2 - var6;
-+ } 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();
-@@ -513,77 +899,86 @@
- this.draggedStack = null;
- this.clickedSlot = null;
- }
-- } else if(this.field_94076_q && !this.r.isEmpty()) {
-+ } 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.r.iterator();
-+ var11 = this.field_94077_p.iterator();
-
-- while(var11.hasNext()) {
-+ 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(var3 == this.mc.gameSettings.keyBindPickBlock.keyCode + 100) {
-- this.handleMouseClick(var4, var8, var3, 3);
-+ } 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(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT));
-- if(var9) {
-+ 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, var3, var9 ? 1 : 0);
-+ // ToDo: Fixes dragging itemStack bug, but may be important later.
-+ //this.handleMouseClick(var4, var8, par3, var9 ? 1 : 0);
- }
- }
- }
-
-- if(this.mc.thePlayer.inventory.getItemStack() == null) {
-+ if (this.mc.thePlayer.inventory.getItemStack() == null) {
- this.field_94070_G = 0L;
- }
-
- this.field_94076_q = false;
- }
-
-- private boolean isMouseOverSlot(Slot var1, int var2, int var3) {
-- return this.isPointInRegion(var1.xDisplayPosition, var1.yDisplayPosition, 16, 16, var2, var3);
-+ /**
-+ * 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);
- }
-
-- protected boolean isPointInRegion(int var1, int var2, int var3, int var4, int var5, int var6) {
-+ /**
-+ * 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;
-- var5 -= var7;
-- var6 -= var8;
-- return var5 >= var1 - 1 && var5 < var1 + var3 + 1 && var6 >= var2 - 1 && var6 < var2 + var4 + 1;
-+ par5 -= var7;
-+ par6 -= var8;
-+ return par5 >= par1 - 1 && par5 < par1 + par3 + 1 && par6 >= par2 - 1 && par6 < par2 + par4 + 1;
- }
-
-- protected void handleMouseClick(Slot var1, int var2, int var3, int var4) {
-- if(var1 != null) {
-- var2 = var1.slotNumber;
-+ protected void handleMouseClick(Slot par1Slot, int par2, int par3, int par4) {
-+ if (par1Slot != null) {
-+ par2 = par1Slot.slotNumber;
- }
-
-- this.mc.playerController.windowClick(this.inventorySlots.windowId, var2, var3, var4, this.mc.thePlayer);
-+ this.mc.playerController.windowClick(this.inventorySlots.windowId, par2, par3, par4, this.mc.thePlayer);
- }
-
-- protected void keyTyped(char var1, int var2) {
-- if(var2 == 1 || var2 == this.mc.gameSettings.keyBindInventory.keyCode) {
-+ /**
-+ * 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(var2);
-- if(this.theSlot != null && this.theSlot.getHasStack()) {
-- if(var2 == this.mc.gameSettings.keyBindPickBlock.keyCode) {
-- this.handleMouseClick(this.theSlot, this.theSlot.slotNumber, 0, 3);
-- } else if(var2 == this.mc.gameSettings.keyBindDrop.keyCode) {
-- this.handleMouseClick(this.theSlot, this.theSlot.slotNumber, isCtrlKeyDown() ? 1 : 0, 4);
-- }
-+ this.checkHotbarKeys(par2);
-+
-+ if (par2 == this.mc.gameSettings.keyBindPickBlock.keyCode && this.theSlot != null && this.theSlot.getHasStack()) {
-+ this.handleMouseClick(this.theSlot, this.theSlot.slotNumber, this.ySize, 3);
- }
--
- }
-
-- protected boolean checkHotbarKeys(int var1) {
-- if(this.mc.thePlayer.inventory.getItemStack() == null && this.theSlot != null) {
-- for(int var2 = 0; var2 < 9; ++var2) {
-- if(var1 == 2 + var2) {
-+ /**
-+ * 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;
- }
-@@ -593,21 +988,41 @@
- return false;
- }
-
-+ /**
-+ * Called when the screen is unloaded. Used to disable keyboard repeat events
-+ */
- public void onGuiClosed() {
-- if(this.mc.thePlayer != null) {
-+ 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) {
-+
-+ if (!this.mc.thePlayer.isEntityAlive() || this.mc.thePlayer.isDead) {
- this.mc.thePlayer.closeScreen();
- }
--
-- }
--}
-+ }
-+}
-+
-+// Spout Start
-+class PositionedItemStack extends ItemStack {
-+ final int position;
-+ public PositionedItemStack(ItemStack item, int position) {
-+ super(item.itemID, item.stackSize, item.getItemDamage());
-+ this.position = position;
-+ }
-+
-+}
-+// Spout End
---- net/minecraft/src/RenderWolf.java
-+++ net/minecraft/src/RenderWolf.java
-@@ -2,52 +2,70 @@
-
- import org.lwjgl.opengl.GL11;
-
-+import com.prupe.mcpatcher.cc.ColorizeEntity;
-+import com.prupe.mcpatcher.mob.MobRandomizer;
-+
- public class RenderWolf extends RenderLiving {
- private static final ResourceLocation wolfTextures = new ResourceLocation("textures/entity/wolf/wolf.png");
- private static final ResourceLocation tamedWolfTextures = new ResourceLocation("textures/entity/wolf/wolf_tame.png");
- private static final ResourceLocation anrgyWolfTextures = new ResourceLocation("textures/entity/wolf/wolf_angry.png");
- private static final ResourceLocation wolfCollarTextures = new ResourceLocation("textures/entity/wolf/wolf_collar.png");
-
-- public RenderWolf(ModelBase var1, ModelBase var2, float var3) {
-- super(var1, var3);
-- this.setRenderPassModel(var2);
-- }
--
-- protected float getTailRotation(EntityWolf var1, float var2) {
-- return var1.getTailRotation();
-- }
--
-- protected int func_82447_a(EntityWolf var1, int var2, float var3) {
-+ public RenderWolf(ModelBase par1ModelBase, ModelBase par2ModelBase, float par3) {
-+ super(par1ModelBase, par3);
-+ this.setRenderPassModel(par2ModelBase);
-+ }
-+
-+ protected float getTailRotation(EntityWolf par1EntityWolf, float par2) {
-+ return par1EntityWolf.getTailRotation();
-+ }
-+
-+ protected int func_82447_a(EntityWolf par1EntityWolf, int par2, float par3) {
- float var4;
-- if(var2 == 0 && var1.getWolfShaking()) {
-- var4 = var1.getBrightness(var3) * var1.getShadingWhileShaking(var3);
-+
-+ if (par2 == 0 && par1EntityWolf.getWolfShaking()) {
-+ var4 = par1EntityWolf.getBrightness(par3) * par1EntityWolf.getShadingWhileShaking(par3);
- this.bindTexture(wolfTextures);
- GL11.glColor3f(var4, var4, var4);
- return 1;
-- } else if(var2 == 1 && var1.isTamed()) {
-- this.bindTexture(wolfCollarTextures);
-+ } else if (par2 == 1 && par1EntityWolf.isTamed()) {
-+ // MCPatcher Start
-+ //ToDo: need spoutcraft update
-+ this.bindTexture(MobRandomizer.randomTexture((EntityLivingBase)par1EntityWolf, wolfCollarTextures));
-+ // MCPatcher End
- var4 = 1.0F;
-- int var5 = var1.getCollarColor();
-- GL11.glColor3f(var4 * EntitySheep.fleeceColorTable[var5][0], var4 * EntitySheep.fleeceColorTable[var5][1], var4 * EntitySheep.fleeceColorTable[var5][2]);
-+ int var5 = par1EntityWolf.getCollarColor();
-+ // MCPatcher Start
-+ GL11.glColor3f(var4 * ColorizeEntity.collarColors[var5][0], var4 * ColorizeEntity.collarColors[var5][1], var4 * ColorizeEntity.collarColors[var5][2]);
-+ // MCPatcher End
- return 1;
- } else {
- return -1;
- }
- }
-
-- protected ResourceLocation func_110914_a(EntityWolf var1) {
-- return var1.isTamed() ? tamedWolfTextures : (var1.isAngry() ? anrgyWolfTextures : wolfTextures);
-- }
--
-- protected int shouldRenderPass(EntityLivingBase var1, int var2, float var3) {
-- return this.func_82447_a((EntityWolf)var1, var2, var3);
-- }
--
-- protected float handleRotationFloat(EntityLivingBase var1, float var2) {
-- return this.getTailRotation((EntityWolf)var1, var2);
-- }
--
-- protected ResourceLocation getEntityTexture(Entity var1) {
-- return this.func_110914_a((EntityWolf)var1);
-+ protected ResourceLocation func_110914_a(EntityWolf par1EntityWolf) {
-+ return par1EntityWolf.isTamed() ? tamedWolfTextures : (par1EntityWolf.isAngry() ? anrgyWolfTextures : wolfTextures);
-+ }
-+
-+ /**
-+ * Queries whether should render the specified pass or not.
-+ */
-+ protected int shouldRenderPass(EntityLivingBase par1EntityLivingBase, int par2, float par3) {
-+ return this.func_82447_a((EntityWolf)par1EntityLivingBase, par2, par3);
-+ }
-+
-+ /**
-+ * Defines what float the third param in setRotationAngles of ModelBase is
-+ */
-+ protected float handleRotationFloat(EntityLivingBase par1EntityLivingBase, float par2) {
-+ return this.getTailRotation((EntityWolf)par1EntityLivingBase, par2);
-+ }
-+
-+ /**
-+ * 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_110914_a((EntityWolf)par1Entity);
- }
- }
---- net/minecraft/src/EntitySelectorInventory.java
-+++ net/minecraft/src/EntitySelectorInventory.java
-@@ -1,7 +1,11 @@
- package net.minecraft.src;
-
- final class EntitySelectorInventory implements IEntitySelector {
-- public boolean isEntityApplicable(Entity var1) {
-- return var1 instanceof IInventory && var1.isEntityAlive();
-+
-+ /**
-+ * Return whether the specified entity is applicable to this filter.
-+ */
-+ public boolean isEntityApplicable(Entity par1Entity) {
-+ return par1Entity instanceof IInventory && par1Entity.isEntityAlive();
- }
- }
---- net/minecraft/src/GenLayerAddMushroomIsland.java
-+++ net/minecraft/src/GenLayerAddMushroomIsland.java
-@@ -1,31 +1,36 @@
- package net.minecraft.src;
-
- public class GenLayerAddMushroomIsland extends GenLayer {
-- public GenLayerAddMushroomIsland(long var1, GenLayer var3) {
-- super(var1);
-- this.parent = var3;
-+ public GenLayerAddMushroomIsland(long par1, GenLayer par3GenLayer) {
-+ super(par1);
-+ this.parent = par3GenLayer;
- }
-
-- public int[] getInts(int var1, int var2, int var3, int var4) {
-- int var5 = var1 - 1;
-- int var6 = var2 - 1;
-- int var7 = var3 + 2;
-- int var8 = var4 + 2;
-+ /**
-+ * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall
-+ * amounts, or biomeList[] indices based on the particular GenLayer subclass.
-+ */
-+ public int[] getInts(int par1, int par2, int par3, int par4) {
-+ int var5 = par1 - 1;
-+ int var6 = par2 - 1;
-+ int var7 = par3 + 2;
-+ int var8 = par4 + 2;
- int[] var9 = this.parent.getInts(var5, var6, var7, var8);
-- int[] var10 = IntCache.getIntCache(var3 * var4);
-+ int[] var10 = IntCache.getIntCache(par3 * par4);
-
-- for(int var11 = 0; var11 < var4; ++var11) {
-- for(int var12 = 0; var12 < var3; ++var12) {
-+ for (int var11 = 0; var11 < par4; ++var11) {
-+ for (int var12 = 0; var12 < par3; ++var12) {
- int var13 = var9[var12 + 0 + (var11 + 0) * var7];
- int var14 = var9[var12 + 2 + (var11 + 0) * var7];
- int var15 = var9[var12 + 0 + (var11 + 2) * var7];
- int var16 = var9[var12 + 2 + (var11 + 2) * var7];
- int var17 = var9[var12 + 1 + (var11 + 1) * var7];
-- this.initChunkSeed((long)(var12 + var1), (long)(var11 + var2));
-- if(var17 == 0 && var13 == 0 && var14 == 0 && var15 == 0 && var16 == 0 && this.nextInt(100) == 0) {
-- var10[var12 + var11 * var3] = BiomeGenBase.mushroomIsland.biomeID;
-+ this.initChunkSeed((long)(var12 + par1), (long)(var11 + par2));
-+
-+ if (var17 == 0 && var13 == 0 && var14 == 0 && var15 == 0 && var16 == 0 && this.nextInt(100) == 0) {
-+ var10[var12 + var11 * par3] = BiomeGenBase.mushroomIsland.biomeID;
- } else {
-- var10[var12 + var11 * var3] = var17;
-+ var10[var12 + var11 * par3] = var17;
- }
- }
- }
---- /dev/null
-+++ org/spoutcraft/client/gui/settings/controls/SkyToggleButton.java
-@@ -1,0 +1,39 @@
-+/*
-+ * This file is part of Spoutcraft.
-+ *
-+ * Copyright (c) 2011 SpoutcraftDev
-+ * Spoutcraft is licensed under the GNU Lesser General Public License.
-+ *
-+ * Spoutcraft is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation, either version 3 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Spoutcraft is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program. If not, see .
-+ */
-+package org.spoutcraft.client.gui.settings.controls;
-+
-+import org.spoutcraft.api.gui.GenericCheckBox;
-+import org.spoutcraft.client.SpoutClient;
-+import org.spoutcraft.client.config.Configuration;
-+
-+public class SkyToggleButton extends GenericCheckBox {
-+ public SkyToggleButton() {
-+ super("Sky");
-+ setChecked(Configuration.isSky());
-+ setEnabled(SpoutClient.getInstance().isSkyCheat());
-+ setTooltip("Sky\nON - sky is visible, slower\nOFF - sky is not visible, faster\nWhen sky is OFF the moon and sun are still visible.");
-+ }
-+
-+ @Override
-+ public void onButtonClick() {
-+ Configuration.setSky(!Configuration.isSky());
-+ Configuration.write();
-+ }
-+}
---- net/minecraft/src/RenderBat.java
-+++ net/minecraft/src/RenderBat.java
-@@ -4,69 +4,92 @@
-
- public class RenderBat extends RenderLiving {
- private static final ResourceLocation batTextures = new ResourceLocation("textures/entity/bat.png");
-- private int renderedBatSize = ((ModelBat)this.mainModel).getBatSize();
-+
-+ /**
-+ * 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
-+ */
-+ private int renderedBatSize;
-
- public RenderBat() {
- super(new ModelBat(), 0.25F);
-+ this.renderedBatSize = ((ModelBat)this.mainModel).getBatSize();
- }
-
-- public void func_82443_a(EntityBat var1, double var2, double var4, double var6, float var8, float var9) {
-+ public void func_82443_a(EntityBat par1EntityBat, double par2, double par4, double par6, float par8, float par9) {
- int var10 = ((ModelBat)this.mainModel).getBatSize();
-- if(var10 != this.renderedBatSize) {
-+
-+ if (var10 != this.renderedBatSize) {
- this.renderedBatSize = var10;
- this.mainModel = new ModelBat();
- }
-
-- super.doRenderLiving(var1, var2, var4, var6, var8, var9);
-+ super.doRenderLiving(par1EntityBat, par2, par4, par6, par8, par9);
- }
-
-- protected ResourceLocation getBatTextures(EntityBat var1) {
-+ protected ResourceLocation getBatTextures(EntityBat par1EntityBat) {
- return batTextures;
- }
-
-- protected void func_82442_a(EntityBat var1, float var2) {
-+ protected void func_82442_a(EntityBat par1EntityBat, float par2) {
- GL11.glScalef(0.35F, 0.35F, 0.35F);
- }
-
-- protected void func_82445_a(EntityBat var1, double var2, double var4, double var6) {
-- super.renderLivingAt(var1, var2, var4, var6);
-+ protected void func_82445_a(EntityBat par1EntityBat, double par2, double par4, double par6) {
-+ super.renderLivingAt(par1EntityBat, par2, par4, par6);
- }
-
-- protected void func_82444_a(EntityBat var1, float var2, float var3, float var4) {
-- if(!var1.getIsBatHanging()) {
-- GL11.glTranslatef(0.0F, MathHelper.cos(var2 * 0.3F) * 0.1F, 0.0F);
-+ protected void func_82444_a(EntityBat par1EntityBat, float par2, float par3, float par4) {
-+ if (!par1EntityBat.getIsBatHanging()) {
-+ GL11.glTranslatef(0.0F, MathHelper.cos(par2 * 0.3F) * 0.1F, 0.0F);
- } else {
- GL11.glTranslatef(0.0F, -0.1F, 0.0F);
- }
-
-- super.rotateCorpse(var1, var2, var3, var4);
-- }
--
-- public void doRenderLiving(EntityLiving var1, double var2, double var4, double var6, float var8, float var9) {
-- this.func_82443_a((EntityBat)var1, var2, var4, var6, var8, var9);
-- }
--
-- protected void preRenderCallback(EntityLivingBase var1, float var2) {
-- this.func_82442_a((EntityBat)var1, var2);
-- }
--
-- protected void rotateCorpse(EntityLivingBase var1, float var2, float var3, float var4) {
-- this.func_82444_a((EntityBat)var1, var2, var3, var4);
-- }
--
-- protected void renderLivingAt(EntityLivingBase var1, double var2, double var4, double var6) {
-- this.func_82445_a((EntityBat)var1, var2, var4, var6);
-- }
--
-- public void doRenderLiving(EntityLivingBase var1, double var2, double var4, double var6, float var8, float var9) {
-- this.func_82443_a((EntityBat)var1, var2, var4, var6, var8, var9);
-- }
--
-- protected ResourceLocation getEntityTexture(Entity var1) {
-- return this.getBatTextures((EntityBat)var1);
-- }
--
-- public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) {
-- this.func_82443_a((EntityBat)var1, var2, var4, var6, var8, var9);
-+ super.rotateCorpse(par1EntityBat, par2, par3, par4);
-+ }
-+
-+ public void doRenderLiving(EntityLiving par1EntityLiving, double par2, double par4, double par6, float par8, float par9) {
-+ this.func_82443_a((EntityBat)par1EntityLiving, par2, par4, par6, par8, par9);
-+ }
-+
-+ /**
-+ * 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.func_82442_a((EntityBat)par1EntityLivingBase, par2);
-+ }
-+
-+ protected void rotateCorpse(EntityLivingBase par1EntityLivingBase, float par2, float par3, float par4) {
-+ this.func_82444_a((EntityBat)par1EntityLivingBase, par2, par3, par4);
-+ }
-+
-+ /**
-+ * Sets a simple glTranslate on a LivingEntity.
-+ */
-+ protected void renderLivingAt(EntityLivingBase par1EntityLivingBase, double par2, double par4, double par6) {
-+ this.func_82445_a((EntityBat)par1EntityLivingBase, par2, par4, par6);
-+ }
-+
-+ public void doRenderLiving(EntityLivingBase par1EntityLivingBase, double par2, double par4, double par6, float par8, float par9) {
-+ this.func_82443_a((EntityBat)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.getBatTextures((EntityBat)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
-+ * Spoutcraft is licensed under the GNU Lesser General Public License.
-+ *
-+ * Spoutcraft is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation, either version 3 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Spoutcraft is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program. If not, see .
-+ */
-+package org.spoutcraft.client.entity;
-+
-+import net.minecraft.src.EntityLivingBase;
-+import net.minecraft.src.EntityPlayerSP;
-+
-+import org.spoutcraft.client.player.ClientPlayer;
-+
-+public class CraftEntityFactory {
-+ public static CraftEntity getCraftEntity(net.minecraft.src.Entity aThis) {
-+ if (aThis instanceof EntityPlayerSP) {
-+ return ClientPlayer.getInstance();
-+ }
-+ if (aThis instanceof EntityLivingBase) {
-+ return new CraftLivingEntity((EntityLivingBase)aThis);
-+ }
-+ return null; // Should not break, got most of the important stuff
-+ }
-+}
---- net/minecraft/src/Packet71Weather.java
-+++ net/minecraft/src/Packet71Weather.java
-@@ -11,40 +11,51 @@
- public int posZ;
- public int isLightningBolt;
-
-- public Packet71Weather() {
-- }
--
-- public Packet71Weather(Entity var1) {
-- this.entityID = var1.entityId;
-- this.posX = MathHelper.floor_double(var1.posX * 32.0D);
-- this.posY = MathHelper.floor_double(var1.posY * 32.0D);
-- this.posZ = MathHelper.floor_double(var1.posZ * 32.0D);
-- if(var1 instanceof EntityLightningBolt) {
-+ public Packet71Weather() {}
-+
-+ public Packet71Weather(Entity par1Entity) {
-+ this.entityID = par1Entity.entityId;
-+ this.posX = MathHelper.floor_double(par1Entity.posX * 32.0D);
-+ this.posY = MathHelper.floor_double(par1Entity.posY * 32.0D);
-+ this.posZ = MathHelper.floor_double(par1Entity.posZ * 32.0D);
-+
-+ if (par1Entity instanceof EntityLightningBolt) {
- this.isLightningBolt = 1;
- }
--
-- }
--
-- public void readPacketData(DataInput var1) throws IOException {
-- this.entityID = var1.readInt();
-- this.isLightningBolt = var1.readByte();
-- this.posX = var1.readInt();
-- this.posY = var1.readInt();
-- this.posZ = var1.readInt();
-- }
--
-- public void writePacketData(DataOutput var1) throws IOException {
-- var1.writeInt(this.entityID);
-- var1.writeByte(this.isLightningBolt);
-- var1.writeInt(this.posX);
-- var1.writeInt(this.posY);
-- var1.writeInt(this.posZ);
-- }
--
-- public void processPacket(NetHandler var1) {
-- var1.handleWeather(this);
-- }
--
-+ }
-+
-+ /**
-+ * Abstract. Reads the raw packet data from the data stream.
-+ */
-+ public void readPacketData(DataInput par1DataInput) throws IOException {
-+ this.entityID = par1DataInput.readInt();
-+ this.isLightningBolt = par1DataInput.readByte();
-+ this.posX = par1DataInput.readInt();
-+ this.posY = par1DataInput.readInt();
-+ this.posZ = par1DataInput.readInt();
-+ }
-+
-+ /**
-+ * Abstract. Writes the raw packet data to the data stream.
-+ */
-+ public void writePacketData(DataOutput par1DataOutput) throws IOException {
-+ par1DataOutput.writeInt(this.entityID);
-+ par1DataOutput.writeByte(this.isLightningBolt);
-+ par1DataOutput.writeInt(this.posX);
-+ par1DataOutput.writeInt(this.posY);
-+ par1DataOutput.writeInt(this.posZ);
-+ }
-+
-+ /**
-+ * Passes this Packet on to the NetHandler for processing.
-+ */
-+ public void processPacket(NetHandler par1NetHandler) {
-+ par1NetHandler.handleWeather(this);
-+ }
-+
-+ /**
-+ * Abstract. Return the size of the packet (not counting the header).
-+ */
- public int getPacketSize() {
- return 17;
- }
---- /dev/null
-+++ org/spoutcraft/api/material/item/GenericArmor.java
-@@ -1,0 +1,28 @@
-+/*
-+ * This file is part of Spoutcraft.
-+ *
-+ * Copyright (c) 2011 SpoutcraftDev
-+ * Spoutcraft is licensed under the GNU Lesser General Public License.
-+ *
-+ * Spoutcraft is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation, either version 3 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Spoutcraft is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program. If not, see .
-+ */
-+package org.spoutcraft.api.material.item;
-+
-+import org.spoutcraft.api.material.Armor;
-+
-+public class GenericArmor extends GenericItem implements Armor {
-+ public GenericArmor(String name, int id) {
-+ super(name, id);
-+ }
-+}
---- /dev/null
-+++ org/spoutcraft/api/inventory/MaterialManager.java
-@@ -1,0 +1,48 @@
-+/*
-+ * This file is part of Spoutcraft.
-+ *
-+ * Copyright (c) 2011 SpoutcraftDev
-+ * Spoutcraft is licensed under the GNU Lesser General Public License.
-+ *
-+ * Spoutcraft is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation, either version 3 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Spoutcraft is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program. If not, see .
-+ */
-+package org.spoutcraft.api.inventory;
-+
-+public interface MaterialManager {
-+ public float getFriction(org.spoutcraft.api.material.Block block);
-+
-+ public void setFriction(org.spoutcraft.api.material.Block block, float friction);
-+
-+ public void resetFriction(org.spoutcraft.api.material.Block block);
-+
-+ public float getHardness(org.spoutcraft.api.material.Block block);
-+
-+ public void setHardness(org.spoutcraft.api.material.Block block, float hardness);
-+
-+ public void resetHardness(org.spoutcraft.api.material.Block block);
-+
-+ public boolean isOpaque(org.spoutcraft.api.material.Block block);
-+
-+ public void setOpaque(org.spoutcraft.api.material.Block block, boolean opacity);
-+
-+ public void resetOpacity(org.spoutcraft.api.material.Block block);
-+
-+ public int getLightLevel(org.spoutcraft.api.material.Block block);
-+
-+ public void setLightLevel(org.spoutcraft.api.material.Block block, int level);
-+
-+ public void resetLightLevel(org.spoutcraft.api.material.Block block);
-+
-+ public String getToolTip(org.spoutcraft.api.inventory.ItemStack is);
-+}
---- net/minecraft/src/GameRuleValue.java
-+++ net/minecraft/src/GameRuleValue.java
-@@ -1,35 +1,45 @@
- package net.minecraft.src;
-
- class GameRuleValue {
-- private String a;
-+ private String valueString;
- private boolean valueBoolean;
- private int valueInteger;
- private double valueDouble;
-
-- public GameRuleValue(String var1) {
-- this.setValue(var1);
-+ public GameRuleValue(String par1Str) {
-+ this.setValue(par1Str);
- }
-
-- public void setValue(String var1) {
-- this.a = var1;
-- this.valueBoolean = Boolean.parseBoolean(var1);
-+ /**
-+ * Set this game rule value.
-+ */
-+ public void setValue(String par1Str) {
-+ this.valueString = par1Str;
-+ this.valueBoolean = Boolean.parseBoolean(par1Str);
-
- try {
-- this.valueInteger = Integer.parseInt(var1);
-+ this.valueInteger = Integer.parseInt(par1Str);
- } catch (NumberFormatException var4) {
-+ ;
- }
-
- try {
-- this.valueDouble = Double.parseDouble(var1);
-+ this.valueDouble = Double.parseDouble(par1Str);
- } catch (NumberFormatException var3) {
-+ ;
- }
--
- }
-
-+ /**
-+ * Gets the GameRule's value as String.
-+ */
- public String getGameRuleStringValue() {
-- return this.a;
-+ return this.valueString;
- }
-
-+ /**
-+ * Gets the GameRule's value as boolean.
-+ */
- public boolean getGameRuleBooleanValue() {
- return this.valueBoolean;
- }
---- /dev/null
-+++ org/spoutcraft/api/gui/GenericSlider.java
-@@ -1,0 +1,162 @@
-+/*
-+ * This file is part of Spoutcraft.
-+ *
-+ * Copyright (c) 2011 SpoutcraftDev
-+ * Spoutcraft is licensed under the GNU Lesser General Public License.
-+ *
-+ * Spoutcraft is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation, either version 3 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Spoutcraft is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program. If not, see .
-+ */
-+package org.spoutcraft.api.gui;
-+
-+import java.io.IOException;
-+
-+import org.spoutcraft.api.Spoutcraft;
-+import org.spoutcraft.api.UnsafeClass;
-+import org.spoutcraft.api.io.SpoutInputStream;
-+import org.spoutcraft.api.io.SpoutOutputStream;
-+
-+@UnsafeClass
-+public class GenericSlider extends GenericControl implements Slider {
-+ protected Label label = new GenericLabel();
-+ protected float slider = 0.5f;
-+ protected boolean dragged = false;
-+
-+ public GenericSlider() {
-+ }
-+
-+ public GenericSlider(String text) {
-+ label.setText(text);
-+ }
-+
-+ public int getVersion() {
-+ return super.getVersion() + 2;
-+ }
-+
-+ @Override
-+ public void readData(SpoutInputStream input) throws IOException {
-+ super.readData(input);
-+ setSliderPosition(input.readFloat());
-+ label.readData(input);
-+ }
-+
-+ @Override
-+ public void writeData(SpoutOutputStream output) throws IOException {
-+ super.writeData(output);
-+ output.writeFloat(getSliderPosition());
-+ label.writeData(output);
-+ }
-+
-+ public float getSliderPosition() {
-+ return slider;
-+ }
-+
-+ public Slider setSliderPosition(float value) {
-+ if (value > 1f) {
-+ value = 1f;
-+ } else if (value < 0f) {
-+ value = 0f;
-+ }
-+ slider = value;
-+ return this;
-+ }
-+
-+ @Override
-+ public double getScreenX() {
-+ return super.getScreenX();
-+ }
-+
-+ @Override
-+ public double getScreenY() {
-+ return super.getScreenY();
-+ }
-+
-+ public WidgetType getType() {
-+ return WidgetType.Slider;
-+ }
-+
-+ public void render() {
-+ Spoutcraft.getClient().getRenderDelegate().render(this);
-+ }
-+
-+ public boolean isDragging() {
-+ return dragged;
-+ }
-+
-+ public Slider setDragging(boolean dragged) {
-+ this.dragged = dragged;
-+ return this;
-+ }
-+
-+ public void onSliderDrag(float oldPos, float newPos) {
-+ }
-+
-+ @Override
-+ public Slider copy() {
-+ return ((Slider)super.copy()).setSliderPosition(getSliderPosition());
-+ }
-+
-+ public String getText() {
-+ return label.getText();
-+ }
-+
-+ public Color getTextColor() {
-+ return label.getTextColor();
-+ }
-+
-+ public boolean isAuto() {
-+ return label.isAuto();
-+ }
-+
-+ public WidgetAnchor getAlign() {
-+ return label.getAlign();
-+ }
-+
-+ public Label setScale(float scale) {
-+ label.setScale(scale);
-+ return this;
-+ }
-+
-+ public float getScale() {
-+ return label.getScale();
-+ }
-+
-+ public Slider setText(String text) {
-+ label.setText(text);
-+ return this;
-+ }
-+
-+ public Slider setTextColor(Color color) {
-+ label.setTextColor(color);
-+ return this;
-+ }
-+
-+ public Slider setAuto(boolean auto) {
-+ label.setAuto(auto);
-+ return this;
-+ }
-+
-+ public Slider setAlign(WidgetAnchor align) {
-+ label.setAlign(align);
-+ return this;
-+ }
-+
-+ public Label setShadow(boolean shadow) {
-+ label.setShadow(shadow);
-+ return this;
-+ }
-+
-+ public boolean hasShadow() {
-+ return label.hasShadow();
-+ }
-+}
---- net/minecraft/src/Packet131MapData.java
-+++ net/minecraft/src/Packet131MapData.java
-@@ -6,38 +6,58 @@
-
- public class Packet131MapData extends Packet {
- public short itemID;
-+
-+ /**
-+ * Contains a unique ID for the item that this packet will be populating.
-+ */
- public short uniqueID;
-+
-+ /**
-+ * Contains a buffer of arbitrary data with which to populate an individual item in the world.
-+ */
- public byte[] itemData;
-
- public Packet131MapData() {
- this.isChunkDataPacket = true;
- }
-
-- public Packet131MapData(short var1, short var2, byte[] var3) {
-+ public Packet131MapData(short par1, short par2, byte[] par3ArrayOfByte) {
- this.isChunkDataPacket = true;
-- this.itemID = var1;
-- this.uniqueID = var2;
-- this.itemData = var3;
-- }
--
-- public void readPacketData(DataInput var1) throws IOException {
-- this.itemID = var1.readShort();
-- this.uniqueID = var1.readShort();
-- this.itemData = new byte[var1.readUnsignedShort()];
-- var1.readFully(this.itemData);
-- }
--
-- public void writePacketData(DataOutput var1) throws IOException {
-- var1.writeShort(this.itemID);
-- var1.writeShort(this.uniqueID);
-- var1.writeShort(this.itemData.length);
-- var1.write(this.itemData);
-- }
--
-- public void processPacket(NetHandler var1) {
-- var1.handleMapData(this);
-- }
--
-+ this.itemID = par1;
-+ this.uniqueID = par2;
-+ this.itemData = par3ArrayOfByte;
-+ }
-+
-+ /**
-+ * Abstract. Reads the raw packet data from the data stream.
-+ */
-+ public void readPacketData(DataInput par1DataInput) throws IOException {
-+ this.itemID = par1DataInput.readShort();
-+ this.uniqueID = par1DataInput.readShort();
-+ this.itemData = new byte[par1DataInput.readUnsignedShort()];
-+ par1DataInput.readFully(this.itemData);
-+ }
-+
-+ /**
-+ * Abstract. Writes the raw packet data to the data stream.
-+ */
-+ public void writePacketData(DataOutput par1DataOutput) throws IOException {
-+ par1DataOutput.writeShort(this.itemID);
-+ par1DataOutput.writeShort(this.uniqueID);
-+ par1DataOutput.writeShort(this.itemData.length);
-+ par1DataOutput.write(this.itemData);
-+ }
-+
-+ /**
-+ * Passes this Packet on to the NetHandler for processing.
-+ */
-+ public void processPacket(NetHandler par1NetHandler) {
-+ par1NetHandler.handleMapData(this);
-+ }
-+
-+ /**
-+ * Abstract. Return the size of the packet (not counting the header).
-+ */
- public int getPacketSize() {
- return 4 + this.itemData.length;
- }
---- net/minecraft/src/CallableLevelDimension.java
-+++ net/minecraft/src/CallableLevelDimension.java
-@@ -5,8 +5,8 @@
- class CallableLevelDimension implements Callable {
- final WorldInfo worldInfoInstance;
-
-- CallableLevelDimension(WorldInfo var1) {
-- this.worldInfoInstance = var1;
-+ CallableLevelDimension(WorldInfo par1WorldInfo) {
-+ this.worldInfoInstance = par1WorldInfo;
- }
-
- public String callLevelDimension() {
---- net/minecraft/src/LanguageMetadataSection.java
-+++ net/minecraft/src/LanguageMetadataSection.java
-@@ -3,13 +3,13 @@
- import java.util.Collection;
-
- public class LanguageMetadataSection implements MetadataSection {
-- private final Collection a;
-+ private final Collection languages;
-
-- public LanguageMetadataSection(Collection var1) {
-- this.a = var1;
-+ public LanguageMetadataSection(Collection par1Collection) {
-+ this.languages = par1Collection;
- }
-
- public Collection getLanguages() {
-- return this.a;
-+ return this.languages;
- }
- }
---- net/minecraft/src/EnumFacing.java
-+++ net/minecraft/src/EnumFacing.java
-@@ -8,21 +8,29 @@
- EAST(4, 5, -1, 0, 0),
- WEST(5, 4, 1, 0, 0);
-
-+ /** Face order for D-U-N-S-E-W. */
- private final int order_a;
-+
-+ /** Face order for U-D-S-N-W-E. */
- private final int order_b;
- private final int frontOffsetX;
- private final int frontOffsetY;
- private final int frontOffsetZ;
-+
-+ /** List of all values in EnumFacing. Order is D-U-N-S-E-W. */
- private static final EnumFacing[] faceList = new EnumFacing[6];
-
-- private EnumFacing(int var3, int var4, int var5, int var6, int var7) {
-- this.order_a = var3;
-- this.order_b = var4;
-- this.frontOffsetX = var5;
-- this.frontOffsetY = var6;
-- this.frontOffsetZ = var7;
-+ private EnumFacing(int par3, int par4, int par5, int par6, int par7) {
-+ this.order_a = par3;
-+ this.order_b = par4;
-+ this.frontOffsetX = par5;
-+ this.frontOffsetY = par6;
-+ this.frontOffsetZ = par7;
- }
-
-+ /**
-+ * Returns a offset that addresses the block in front of this facing.
-+ */
- public int getFrontOffsetX() {
- return this.frontOffsetX;
- }
-@@ -31,22 +39,27 @@
- return this.frontOffsetY;
- }
-
-+ /**
-+ * Returns a offset that addresses the block in front of this facing.
-+ */
- public int getFrontOffsetZ() {
- return this.frontOffsetZ;
- }
-
-- public static EnumFacing getFront(int var0) {
-- return faceList[var0 % faceList.length];
-+ /**
-+ * Returns the facing that represents the block in front of it.
-+ */
-+ public static EnumFacing getFront(int par0) {
-+ return faceList[par0 % faceList.length];
- }
-
- static {
- EnumFacing[] var0 = values();
- int var1 = var0.length;
-
-- for(int var2 = 0; var2 < var1; ++var2) {
-+ for (int var2 = 0; var2 < var1; ++var2) {
- EnumFacing var3 = var0[var2];
- faceList[var3.order_a] = var3;
- }
--
- }
- }
---- /dev/null
-+++ com/prupe/mcpatcher/cc/Lightmap.java
-@@ -1,0 +1,153 @@
-+package com.prupe.mcpatcher.cc;
-+
-+import com.prupe.mcpatcher.Config;
-+import com.prupe.mcpatcher.MCLogger;
-+import com.prupe.mcpatcher.TexturePackAPI;
-+import java.awt.image.BufferedImage;
-+import java.util.HashMap;
-+import net.minecraft.src.EntityRenderer;
-+import net.minecraft.src.Minecraft;
-+import net.minecraft.src.ResourceLocation;
-+import net.minecraft.src.World;
-+
-+public final class Lightmap {
-+ private static final MCLogger logger = MCLogger.getLogger("Custom Colors");
-+ private static final String LIGHTMAP_FORMAT = "lightmap/world%d.png";
-+ private static final int LIGHTMAP_SIZE = 16;
-+ private static final int HEIGHT_WITHOUT_NIGHTVISION = 32;
-+ private static final int HEIGHT_WITH_NIGHTVISION = 64;
-+ private static final boolean useLightmaps = Config.getBoolean("Custom Colors", "lightmaps", true);
-+ private static final HashMap lightmaps = new HashMap();
-+ private final int width;
-+ private final boolean customNightvision;
-+ private final int[] origMap;
-+ private final boolean valid;
-+ private final float[] sunrgb = new float[48];
-+ private final float[] torchrgb = new float[48];
-+ private final float[] sunrgbnv = new float[48];
-+ private final float[] torchrgbnv = new float[48];
-+ private final float[] rgb = new float[3];
-+
-+ static void reset() {
-+ lightmaps.clear();
-+ }
-+
-+ public static boolean computeLightmap(EntityRenderer renderer, World world, int[] mapRGB, float partialTick) {
-+ if (world != null && useLightmaps) {
-+ Lightmap lightmap = null;
-+ int worldType = world.provider.dimensionId;
-+
-+ if (lightmaps.containsKey(Integer.valueOf(worldType))) {
-+ lightmap = (Lightmap)lightmaps.get(Integer.valueOf(worldType));
-+ } else {
-+ ResourceLocation resource = TexturePackAPI.newMCPatcherResourceLocation(String.format("lightmap/world%d.png", new Object[] {Integer.valueOf(worldType)}));
-+ BufferedImage image = TexturePackAPI.getImage(resource);
-+
-+ if (image != null) {
-+ lightmap = new Lightmap(resource, image);
-+
-+ if (!lightmap.valid) {
-+ lightmap = null;
-+ }
-+ }
-+
-+ lightmaps.put(Integer.valueOf(worldType), lightmap);
-+ }
-+
-+ return lightmap != null && lightmap.compute(renderer, world, mapRGB, partialTick);
-+ } else {
-+ return false;
-+ }
-+ }
-+
-+ private Lightmap(ResourceLocation resource, BufferedImage image) {
-+ this.width = image.getWidth();
-+ int height = image.getHeight();
-+ this.customNightvision = height == 64;
-+ this.origMap = new int[this.width * height];
-+ image.getRGB(0, 0, this.width, height, this.origMap, 0, this.width);
-+ this.valid = height == 32 || height == 64;
-+
-+ if (!this.valid) {
-+ logger.error("%s must be exactly %d or %d pixels high", new Object[] {resource, Integer.valueOf(32), Integer.valueOf(64)});
-+ }
-+ }
-+
-+ private boolean compute(EntityRenderer renderer, World world, int[] mapRGB, float partialTick) {
-+ float sun = Colorizer.clamp(world.lastLightningBolt > 0 ? 1.0F : 1.1666666F * (world.getSunBrightness(1.0F) - 0.2F)) * (float)(this.width - 1);
-+ float torch = Colorizer.clamp(renderer.torchFlickerX + 0.5F) * (float)(this.width - 1);
-+ float nightVisionStrength = renderer.getNightVisionStrength(partialTick);
-+ float gamma = Colorizer.clamp(Minecraft.getMinecraft().gameSettings.gammaSetting);
-+ int s;
-+
-+ for (s = 0; s < 16; ++s) {
-+ interpolate(this.origMap, s * this.width, sun, this.sunrgb, 3 * s);
-+ interpolate(this.origMap, (s + 16) * this.width, torch, this.torchrgb, 3 * s);
-+
-+ if (this.customNightvision && nightVisionStrength > 0.0F) {
-+ interpolate(this.origMap, (s + 32) * this.width, sun, this.sunrgbnv, 3 * s);
-+ interpolate(this.origMap, (s + 48) * this.width, torch, this.torchrgbnv, 3 * s);
-+ }
-+ }
-+
-+ for (s = 0; s < 16; ++s) {
-+ for (int t = 0; t < 16; ++t) {
-+ int k;
-+
-+ for (k = 0; k < 3; ++k) {
-+ this.rgb[k] = Colorizer.clamp(this.sunrgb[3 * s + k] + this.torchrgb[3 * t + k]);
-+ }
-+
-+ if (nightVisionStrength > 0.0F) {
-+ if (this.customNightvision) {
-+ for (k = 0; k < 3; ++k) {
-+ this.rgb[k] = Colorizer.clamp((1.0F - nightVisionStrength) * this.rgb[k] + nightVisionStrength * (this.sunrgbnv[3 * s + k] + this.torchrgbnv[3 * t + k]));
-+ }
-+ } else {
-+ float var13 = Math.max(Math.max(this.rgb[0], this.rgb[1]), this.rgb[2]);
-+
-+ if (var13 > 0.0F) {
-+ var13 = 1.0F - nightVisionStrength + nightVisionStrength / var13;
-+
-+ for (int tmp = 0; tmp < 3; ++tmp) {
-+ this.rgb[tmp] = Colorizer.clamp(this.rgb[tmp] * var13);
-+ }
-+ }
-+ }
-+ }
-+
-+ if (gamma != 0.0F) {
-+ for (k = 0; k < 3; ++k) {
-+ float var14 = 1.0F - this.rgb[k];
-+ var14 = 1.0F - var14 * var14 * var14 * var14;
-+ this.rgb[k] = gamma * var14 + (1.0F - gamma) * this.rgb[k];
-+ }
-+ }
-+
-+ mapRGB[s * 16 + t] = -16777216 | Colorizer.float3ToInt(this.rgb);
-+ }
-+ }
-+
-+ return true;
-+ }
-+
-+ private static void interpolate(int[] map, int offset1, float x, float[] rgb, int offset2) {
-+ int x0 = (int)Math.floor((double)x);
-+ int x1 = (int)Math.ceil((double)x);
-+
-+ if (x0 == x1) {
-+ Colorizer.intToFloat3(map[offset1 + x0], rgb, offset2);
-+ } else {
-+ float xf = x - (float)x0;
-+ float xg = 1.0F - xf;
-+ float[] rgb0 = new float[3];
-+ float[] rgb1 = new float[3];
-+ Colorizer.intToFloat3(map[offset1 + x0], rgb0);
-+ Colorizer.intToFloat3(map[offset1 + x1], rgb1);
-+
-+ for (int i = 0; i < 3; ++i) {
-+ rgb[offset2 + i] = xg * rgb0[i] + xf * rgb1[i];
-+ }
-+ }
-+ }
-+}
---- /dev/null
-+++ net/minecraft/src/GuiParticle.java
-@@ -1,0 +1,42 @@
-+package net.minecraft.src;
-+
-+import java.util.ArrayList;
-+import java.util.List;
-+import net.minecraft.src.Minecraft;
-+import org.lwjgl.opengl.GL11;
-+
-+public class GuiParticle extends Gui {
-+ private List particles = new ArrayList();
-+ private Minecraft mc;
-+
-+ public GuiParticle(Minecraft par1Minecraft) {
-+ this.mc = par1Minecraft;
-+ }
-+
-+ public void update() {
-+ for (int var1 = 0; var1 < this.particles.size(); ++var1) {
-+ Particle var2 = (Particle)this.particles.get(var1);
-+ var2.preUpdate();
-+ var2.update(this);
-+
-+ if (var2.isDead) {
-+ this.particles.remove(var1--);
-+ }
-+ }
-+ }
-+
-+ public void draw(float par1) {
-+ mc.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("textures/particle/particles.png"));
-+ for (int var2 = 0; var2 < this.particles.size(); ++var2) {
-+ Particle var3 = (Particle)this.particles.get(var2);
-+ int var4 = (int)(var3.prevPosX + (var3.posX - var3.prevPosX) * (double)par1 - 4.0D);
-+ int var5 = (int)(var3.prevPosY + (var3.posY - var3.prevPosY) * (double)par1 - 4.0D);
-+ float var6 = (float)(var3.prevTintAlpha + (var3.tintAlpha - var3.prevTintAlpha) * (double)par1);
-+ float var7 = (float)(var3.prevTintRed + (var3.tintRed - var3.prevTintRed) * (double)par1);
-+ float var8 = (float)(var3.prevTintGreen + (var3.tintGreen - var3.prevTintGreen) * (double)par1);
-+ float var9 = (float)(var3.prevTintBlue + (var3.tintBlue - var3.prevTintBlue) * (double)par1);
-+ GL11.glColor4f(var7, var8, var9, var6);
-+ this.drawTexturedModalRect(var4, var5, 40, 0, 8, 8);
-+ }
-+ }
-+}
---- net/minecraft/src/WorldServer.java
-+++ net/minecraft/src/WorldServer.java
-@@ -1,54 +1,77 @@
- package net.minecraft.src;
-
- import java.util.ArrayList;
--import java.util.Collection;
- import java.util.HashSet;
- import java.util.Iterator;
- import java.util.List;
- import java.util.Random;
- import java.util.Set;
- import java.util.TreeSet;
-+
- import net.minecraft.server.MinecraftServer;
-
- public class WorldServer extends World {
-- private final MinecraftServer a;
-+ private final MinecraftServer mcServer;
- private final EntityTracker theEntityTracker;
- private final PlayerManager thePlayerManager;
-- private Set L;
-- private TreeSet M;
-+ private Set pendingTickListEntriesHashSet;
-+
-+ /** All work to do in future ticks. */
-+ private TreeSet pendingTickListEntriesTreeSet;
- public ChunkProviderServer theChunkProviderServer;
-- public boolean levelSaving;
-+
-+ /** set by CommandServerSave{all,Off,On} */
-+ public boolean canNotSave;
-+
-+ /** is false if there are no players */
- private boolean allPlayersSleeping;
- private int updateEntityTick;
-+
-+ /**
-+ * the teleporter to use when the entity is being transferred into the dimension
-+ */
- private final Teleporter worldTeleporter;
- private final SpawnerAnimals animalSpawner = new SpawnerAnimals();
-- private ServerBlockEventList[] blockEventCache = new ServerBlockEventList[]{new ServerBlockEventList((ServerBlockEvent)null), new ServerBlockEventList((ServerBlockEvent)null)};
-+
-+ /**
-+ * Double buffer of ServerBlockEventList[] for holding pending BlockEventData's
-+ */
-+ private ServerBlockEventList[] blockEventCache = new ServerBlockEventList[] {new ServerBlockEventList((ServerBlockEvent)null), new ServerBlockEventList((ServerBlockEvent)null)};
-+
-+ /**
-+ * The index into the blockEventCache; either 0, or 1, toggled in sendBlockEventPackets where all BlockEvent are
-+ * applied locally and send to clients.
-+ */
- private int blockEventCacheIndex;
-- private static final WeightedRandomChestContent[] bonusChestContent = new WeightedRandomChestContent[]{new WeightedRandomChestContent(Item.stick.itemID, 0, 1, 3, 10), new WeightedRandomChestContent(Block.planks.blockID, 0, 1, 3, 10), new WeightedRandomChestContent(Block.wood.blockID, 0, 1, 3, 10), new WeightedRandomChestContent(Item.axeStone.itemID, 0, 1, 1, 3), new WeightedRandomChestContent(Item.axeWood.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.pickaxeStone.itemID, 0, 1, 1, 3), new WeightedRandomChestContent(Item.pickaxeWood.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.appleRed.itemID, 0, 2, 3, 5), new WeightedRandomChestContent(Item.bread.itemID, 0, 2, 3, 3)};
-- private List U = new ArrayList();
-+ private static final WeightedRandomChestContent[] bonusChestContent = new WeightedRandomChestContent[] {new WeightedRandomChestContent(Item.stick.itemID, 0, 1, 3, 10), new WeightedRandomChestContent(Block.planks.blockID, 0, 1, 3, 10), new WeightedRandomChestContent(Block.wood.blockID, 0, 1, 3, 10), new WeightedRandomChestContent(Item.axeStone.itemID, 0, 1, 1, 3), new WeightedRandomChestContent(Item.axeWood.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.pickaxeStone.itemID, 0, 1, 1, 3), new WeightedRandomChestContent(Item.pickaxeWood.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.appleRed.itemID, 0, 2, 3, 5), new WeightedRandomChestContent(Item.bread.itemID, 0, 2, 3, 3)};
-+ private List pendingTickListEntriesThisTick = new ArrayList();
-+
-+ /** An IntHashMap of entity IDs (integers) to their Entity objects. */
- private IntHashMap entityIdMap;
-
-- public WorldServer(MinecraftServer var1, ISaveHandler var2, String var3, int var4, WorldSettings var5, Profiler var6, ILogAgent var7) {
-- super(var2, var3, var5, WorldProvider.getProviderForDimension(var4), var6, var7);
-- this.a = var1;
-+ public WorldServer(MinecraftServer par1MinecraftServer, ISaveHandler par2ISaveHandler, String par3Str, int par4, WorldSettings par5WorldSettings, Profiler par6Profiler, ILogAgent par7ILogAgent) {
-+ super(par2ISaveHandler, par3Str, par5WorldSettings, WorldProvider.getProviderForDimension(par4), par6Profiler, par7ILogAgent);
-+ this.mcServer = par1MinecraftServer;
- this.theEntityTracker = new EntityTracker(this);
-- this.thePlayerManager = new PlayerManager(this, var1.getConfigurationManager().getViewDistance());
-- if(this.entityIdMap == null) {
-+ this.thePlayerManager = new PlayerManager(this, par1MinecraftServer.getConfigurationManager().getViewDistance());
-+
-+ if (this.entityIdMap == null) {
- this.entityIdMap = new IntHashMap();
- }
-
-- if(this.L == null) {
-- this.L = new HashSet();
-+ if (this.pendingTickListEntriesHashSet == null) {
-+ this.pendingTickListEntriesHashSet = new HashSet();
- }
-
-- if(this.M == null) {
-- this.M = new TreeSet();
-+ if (this.pendingTickListEntriesTreeSet == null) {
-+ this.pendingTickListEntriesTreeSet = new TreeSet();
- }
-
- this.worldTeleporter = new Teleporter(this);
-- this.worldScoreboard = new ServerScoreboard(var1);
-+ this.worldScoreboard = new ServerScoreboard(par1MinecraftServer);
- ScoreboardSaveData var8 = (ScoreboardSaveData)this.mapStorage.loadData(ScoreboardSaveData.class, "scoreboard");
-- if(var8 == null) {
-+
-+ if (var8 == null) {
- var8 = new ScoreboardSaveData();
- this.mapStorage.setData("scoreboard", var8);
- }
-@@ -57,15 +80,20 @@
- ((ServerScoreboard)this.worldScoreboard).func_96547_a(var8);
- }
-
-+ /**
-+ * Runs a single tick for the world
-+ */
- public void tick() {
- super.tick();
-- if(this.getWorldInfo().isHardcoreModeEnabled() && this.difficultySetting < 3) {
-+
-+ if (this.getWorldInfo().isHardcoreModeEnabled() && this.difficultySetting < 3) {
- this.difficultySetting = 3;
- }
-
- this.provider.worldChunkMgr.cleanupCache();
-- if(this.areAllPlayersAsleep()) {
-- if(this.getGameRules().getGameRuleBooleanValue("doDaylightCycle")) {
-+
-+ if (this.areAllPlayersAsleep()) {
-+ if (this.getGameRules().getGameRuleBooleanValue("doDaylightCycle")) {
- long var1 = this.worldInfo.getWorldTime() + 24000L;
- this.worldInfo.setWorldTime(var1 - var1 % 24000L);
- }
-@@ -74,19 +102,22 @@
- }
-
- this.theProfiler.startSection("mobSpawner");
-- if(this.getGameRules().getGameRuleBooleanValue("doMobSpawning")) {
-+
-+ if (this.getGameRules().getGameRuleBooleanValue("doMobSpawning")) {
- this.animalSpawner.findChunksForSpawning(this, this.spawnHostileMobs, this.spawnPeacefulMobs, this.worldInfo.getWorldTotalTime() % 400L == 0L);
- }
-
- this.theProfiler.endStartSection("chunkSource");
- this.chunkProvider.unloadQueuedChunks();
- int var3 = this.calculateSkylightSubtracted(1.0F);
-- if(var3 != this.skylightSubtracted) {
-+
-+ if (var3 != this.skylightSubtracted) {
- this.skylightSubtracted = var3;
- }
-
- this.worldInfo.incrementTotalWorldTime(this.worldInfo.getWorldTotalTime() + 1L);
-- if(this.getGameRules().getGameRuleBooleanValue("doDaylightCycle")) {
-+
-+ if (this.getGameRules().getGameRuleBooleanValue("doDaylightCycle")) {
- this.worldInfo.setWorldTime(this.worldInfo.getWorldTime() + 1L);
- }
-
-@@ -105,32 +136,39 @@
- this.sendAndApplyBlockEvents();
- }
-
-- public SpawnListEntry spawnRandomCreature(EnumCreatureType var1, int var2, int var3, int var4) {
-- List var5 = this.getChunkProvider().getPossibleCreatures(var1, var2, var3, var4);
-- return var5 != null && !var5.isEmpty() ? (SpawnListEntry)WeightedRandom.getRandomItem(this.s, (Collection)var5) : null;
-+ /**
-+ * only spawns creatures allowed by the chunkProvider
-+ */
-+ public SpawnListEntry spawnRandomCreature(EnumCreatureType par1EnumCreatureType, int par2, int par3, int par4) {
-+ List var5 = this.getChunkProvider().getPossibleCreatures(par1EnumCreatureType, par2, par3, par4);
-+ return var5 != null && !var5.isEmpty() ? (SpawnListEntry)WeightedRandom.getRandomItem(this.rand, var5) : null;
- }
-
-+ /**
-+ * Updates the flag that indicates whether or not all players in the world are sleeping.
-+ */
- public void updateAllPlayersSleepingFlag() {
-- this.allPlayersSleeping = !this.h.isEmpty();
-- Iterator var1 = this.h.iterator();
-+ this.allPlayersSleeping = !this.playerEntities.isEmpty();
-+ Iterator var1 = this.playerEntities.iterator();
-
-- while(var1.hasNext()) {
-+ while (var1.hasNext()) {
- EntityPlayer var2 = (EntityPlayer)var1.next();
-- if(!var2.isPlayerSleeping()) {
-+
-+ if (!var2.isPlayerSleeping()) {
- this.allPlayersSleeping = false;
- break;
- }
- }
--
- }
-
- protected void wakeAllPlayers() {
- this.allPlayersSleeping = false;
-- Iterator var1 = this.h.iterator();
-+ Iterator var1 = this.playerEntities.iterator();
-
-- while(var1.hasNext()) {
-+ while (var1.hasNext()) {
- EntityPlayer var2 = (EntityPlayer)var1.next();
-- if(var2.isPlayerSleeping()) {
-+
-+ if (var2.isPlayerSleeping()) {
- var2.wakeUpPlayer(false, false, true);
- }
- }
-@@ -146,17 +184,17 @@
- }
-
- public boolean areAllPlayersAsleep() {
-- if(this.allPlayersSleeping && !this.isRemote) {
-- Iterator var1 = this.h.iterator();
--
-+ if (this.allPlayersSleeping && !this.isRemote) {
-+ Iterator var1 = this.playerEntities.iterator();
- EntityPlayer var2;
-+
- do {
-- if(!var1.hasNext()) {
-+ if (!var1.hasNext()) {
- return true;
- }
-
- var2 = (EntityPlayer)var1.next();
-- } while(var2.isPlayerFullyAsleep());
-+ } while (var2.isPlayerFullyAsleep());
-
- return false;
- } else {
-@@ -164,8 +202,11 @@
- }
- }
-
-+ /**
-+ * Sets a new spawn location by finding an uncovered block at a random (x,z) location in the chunk.
-+ */
- public void setSpawnLocation() {
-- if(this.worldInfo.getSpawnY() <= 0) {
-+ if (this.worldInfo.getSpawnY() <= 0) {
- this.worldInfo.setSpawnY(64);
- }
-
-@@ -173,11 +214,12 @@
- int var2 = this.worldInfo.getSpawnZ();
- int var3 = 0;
-
-- while(this.getFirstUncoveredBlock(var1, var2) == 0) {
-- var1 += this.s.nextInt(8) - this.s.nextInt(8);
-- var2 += this.s.nextInt(8) - this.s.nextInt(8);
-+ while (this.getFirstUncoveredBlock(var1, var2) == 0) {
-+ var1 += this.rand.nextInt(8) - this.rand.nextInt(8);
-+ var2 += this.rand.nextInt(8) - this.rand.nextInt(8);
- ++var3;
-- if(var3 == 10000) {
-+
-+ if (var3 == 10000) {
- break;
- }
- }
-@@ -186,13 +228,16 @@
- this.worldInfo.setSpawnZ(var2);
- }
-
-+ /**
-+ * plays random cave ambient sounds and runs updateTick on random blocks within each chunk in the vacinity of a player
-+ */
- protected void tickBlocksAndAmbiance() {
- super.tickBlocksAndAmbiance();
- int var1 = 0;
- int var2 = 0;
-- Iterator var3 = this.G.iterator();
-+ Iterator var3 = this.activeChunkSet.iterator();
-
-- while(var3.hasNext()) {
-+ while (var3.hasNext()) {
- ChunkCoordIntPair var4 = (ChunkCoordIntPair)var3.next();
- int var5 = var4.chunkXPos * 16;
- int var6 = var4.chunkZPos * 16;
-@@ -206,38 +251,44 @@
- int var9;
- int var10;
- int var11;
-- if(this.s.nextInt(100000) == 0 && this.isRaining() && this.isThundering()) {
-+
-+ if (this.rand.nextInt(100000) == 0 && this.isRaining() && this.isThundering()) {
- this.updateLCG = this.updateLCG * 3 + 1013904223;
- var8 = this.updateLCG >> 2;
- var9 = var5 + (var8 & 15);
- var10 = var6 + (var8 >> 8 & 15);
- var11 = this.getPrecipitationHeight(var9, var10);
-- if(this.canLightningStrikeAt(var9, var11, var10)) {
-+
-+ if (this.canLightningStrikeAt(var9, var11, var10)) {
- this.addWeatherEffect(new EntityLightningBolt(this, (double)var9, (double)var11, (double)var10));
- }
- }
-
- this.theProfiler.endStartSection("iceandsnow");
- int var13;
-- if(this.s.nextInt(16) == 0) {
-+
-+ if (this.rand.nextInt(16) == 0) {
- this.updateLCG = this.updateLCG * 3 + 1013904223;
- var8 = this.updateLCG >> 2;
- var9 = var8 & 15;
- var10 = var8 >> 8 & 15;
- var11 = this.getPrecipitationHeight(var9 + var5, var10 + var6);
-- if(this.isBlockFreezableNaturally(var9 + var5, var11 - 1, var10 + var6)) {
-+
-+ if (this.isBlockFreezableNaturally(var9 + var5, var11 - 1, var10 + var6)) {
- this.setBlock(var9 + var5, var11 - 1, var10 + var6, Block.ice.blockID);
- }
-
-- if(this.isRaining() && this.canSnowAt(var9 + var5, var11, var10 + var6)) {
-+ if (this.isRaining() && this.canSnowAt(var9 + var5, var11, var10 + var6)) {
- this.setBlock(var9 + var5, var11, var10 + var6, Block.snow.blockID);
- }
-
-- if(this.isRaining()) {
-+ if (this.isRaining()) {
- BiomeGenBase var12 = this.getBiomeGenForCoords(var9 + var5, var10 + var6);
-- if(var12.canSpawnLightningBolt()) {
-+
-+ if (var12.canSpawnLightningBolt()) {
- var13 = this.getBlockId(var9 + var5, var11 - 1, var10 + var6);
-- if(var13 != 0) {
-+
-+ if (var13 != 0) {
- Block.blocksList[var13].fillWithRain(this, var9 + var5, var11 - 1, var10 + var6);
- }
- }
-@@ -248,21 +299,23 @@
- ExtendedBlockStorage[] var19 = var7.getBlockStorageArray();
- var9 = var19.length;
-
-- for(var10 = 0; var10 < var9; ++var10) {
-- ExtendedBlockStorage var20 = var19[var10];
-- if(var20 != null && var20.getNeedsRandomTick()) {
-- for(int var21 = 0; var21 < 3; ++var21) {
-+ for (var10 = 0; var10 < var9; ++var10) {
-+ ExtendedBlockStorage var21 = var19[var10];
-+
-+ if (var21 != null && var21.getNeedsRandomTick()) {
-+ for (int var20 = 0; var20 < 3; ++var20) {
- this.updateLCG = this.updateLCG * 3 + 1013904223;
- var13 = this.updateLCG >> 2;
- int var14 = var13 & 15;
- int var15 = var13 >> 8 & 15;
- int var16 = var13 >> 16 & 15;
-- int var17 = var20.getExtBlockID(var14, var16, var15);
-+ int var17 = var21.getExtBlockID(var14, var16, var15);
- ++var2;
- Block var18 = Block.blocksList[var17];
-- if(var18 != null && var18.getTickRandomly()) {
-+
-+ if (var18 != null && var18.getTickRandomly()) {
- ++var1;
-- var18.updateTick(this, var14 + var5, var16 + var20.getYLocation(), var15 + var6, this.s);
-+ var18.updateTick(this, var14 + var5, var16 + var21.getYLocation(), var15 + var6, this.rand);
- }
- }
- }
-@@ -270,68 +323,81 @@
-
- this.theProfiler.endSection();
- }
--
-- }
--
-- public boolean isBlockTickScheduledThisTick(int var1, int var2, int var3, int var4) {
-- NextTickListEntry var5 = new NextTickListEntry(var1, var2, var3, var4);
-- return this.U.contains(var5);
-- }
--
-- public void scheduleBlockUpdate(int var1, int var2, int var3, int var4, int var5) {
-- this.scheduleBlockUpdateWithPriority(var1, var2, var3, var4, var5, 0);
-- }
--
-- public void scheduleBlockUpdateWithPriority(int var1, int var2, int var3, int var4, int var5, int var6) {
-- NextTickListEntry var7 = new NextTickListEntry(var1, var2, var3, var4);
-+ }
-+
-+ /**
-+ * Returns true if the given block will receive a scheduled tick in this tick. Args: X, Y, Z, blockID
-+ */
-+ public boolean isBlockTickScheduledThisTick(int par1, int par2, int par3, int par4) {
-+ NextTickListEntry var5 = new NextTickListEntry(par1, par2, par3, par4);
-+ return this.pendingTickListEntriesThisTick.contains(var5);
-+ }
-+
-+ /**
-+ * Schedules a tick to a block with a delay (Most commonly the tick rate)
-+ */
-+ public void scheduleBlockUpdate(int par1, int par2, int par3, int par4, int par5) {
-+ this.scheduleBlockUpdateWithPriority(par1, par2, par3, par4, par5, 0);
-+ }
-+
-+ public void scheduleBlockUpdateWithPriority(int par1, int par2, int par3, int par4, int par5, int par6) {
-+ NextTickListEntry var7 = new NextTickListEntry(par1, par2, par3, par4);
- byte var8 = 0;
-- if(this.scheduledUpdatesAreImmediate && var4 > 0) {
-- if(Block.blocksList[var4].func_82506_l()) {
-+
-+ if (this.scheduledUpdatesAreImmediate && par4 > 0) {
-+ if (Block.blocksList[par4].func_82506_l()) {
- var8 = 8;
-- if(this.checkChunksExist(var7.xCoord - var8, var7.yCoord - var8, var7.zCoord - var8, var7.xCoord + var8, var7.yCoord + var8, var7.zCoord + var8)) {
-+
-+ if (this.checkChunksExist(var7.xCoord - var8, var7.yCoord - var8, var7.zCoord - var8, var7.xCoord + var8, var7.yCoord + var8, var7.zCoord + var8)) {
- int var9 = this.getBlockId(var7.xCoord, var7.yCoord, var7.zCoord);
-- if(var9 == var7.blockID && var9 > 0) {
-- Block.blocksList[var9].updateTick(this, var7.xCoord, var7.yCoord, var7.zCoord, this.s);
-+
-+ if (var9 == var7.blockID && var9 > 0) {
-+ Block.blocksList[var9].updateTick(this, var7.xCoord, var7.yCoord, var7.zCoord, this.rand);
- }
- }
-
- return;
- }
-
-- var5 = 1;
-- }
--
-- if(this.checkChunksExist(var1 - var8, var2 - var8, var3 - var8, var1 + var8, var2 + var8, var3 + var8)) {
-- if(var4 > 0) {
-- var7.setScheduledTime((long)var5 + this.worldInfo.getWorldTotalTime());
-- var7.setPriority(var6);
-- }
--
-- if(!this.L.contains(var7)) {
-- this.L.add(var7);
-- this.M.add(var7);
-- }
-- }
--
-- }
--
-- public void scheduleBlockUpdateFromLoad(int var1, int var2, int var3, int var4, int var5, int var6) {
-- NextTickListEntry var7 = new NextTickListEntry(var1, var2, var3, var4);
-- var7.setPriority(var6);
-- if(var4 > 0) {
-- var7.setScheduledTime((long)var5 + this.worldInfo.getWorldTotalTime());
-- }
--
-- if(!this.L.contains(var7)) {
-- this.L.add(var7);
-- this.M.add(var7);
-- }
--
-- }
--
-+ par5 = 1;
-+ }
-+
-+ if (this.checkChunksExist(par1 - var8, par2 - var8, par3 - var8, par1 + var8, par2 + var8, par3 + var8)) {
-+ if (par4 > 0) {
-+ var7.setScheduledTime((long)par5 + this.worldInfo.getWorldTotalTime());
-+ var7.setPriority(par6);
-+ }
-+
-+ if (!this.pendingTickListEntriesHashSet.contains(var7)) {
-+ this.pendingTickListEntriesHashSet.add(var7);
-+ this.pendingTickListEntriesTreeSet.add(var7);
-+ }
-+ }
-+ }
-+
-+ /**
-+ * Schedules a block update from the saved information in a chunk. Called when the chunk is loaded.
-+ */
-+ public void scheduleBlockUpdateFromLoad(int par1, int par2, int par3, int par4, int par5, int par6) {
-+ NextTickListEntry var7 = new NextTickListEntry(par1, par2, par3, par4);
-+ var7.setPriority(par6);
-+
-+ if (par4 > 0) {
-+ var7.setScheduledTime((long)par5 + this.worldInfo.getWorldTotalTime());
-+ }
-+
-+ if (!this.pendingTickListEntriesHashSet.contains(var7)) {
-+ this.pendingTickListEntriesHashSet.add(var7);
-+ this.pendingTickListEntriesTreeSet.add(var7);
-+ }
-+ }
-+
-+ /**
-+ * Updates (and cleans up) entities and tile entities
-+ */
- public void updateEntities() {
-- if(this.h.isEmpty()) {
-- if(this.updateEntityTick++ >= 1200) {
-+ if (this.playerEntities.isEmpty()) {
-+ if (this.updateEntityTick++ >= 1200) {
- return;
- }
- } else {
-@@ -341,51 +407,61 @@
- super.updateEntities();
- }
-
-+ /**
-+ * Resets the updateEntityTick field to 0
-+ */
- public void resetUpdateEntityTick() {
- this.updateEntityTick = 0;
- }
-
-- public boolean tickUpdates(boolean var1) {
-- int var2 = this.M.size();
-- if(var2 != this.L.size()) {
-+ /**
-+ * Runs through the list of updates to run and ticks them
-+ */
-+ public boolean tickUpdates(boolean par1) {
-+ int var2 = this.pendingTickListEntriesTreeSet.size();
-+
-+ if (var2 != this.pendingTickListEntriesHashSet.size()) {
- throw new IllegalStateException("TickNextTick list out of synch");
- } else {
-- if(var2 > 1000) {
-+ if (var2 > 1000) {
- var2 = 1000;
- }
-
- this.theProfiler.startSection("cleaning");
--
- NextTickListEntry var4;
-- for(int var3 = 0; var3 < var2; ++var3) {
-- var4 = (NextTickListEntry)this.M.first();
-- if(!var1 && var4.scheduledTime > this.worldInfo.getWorldTotalTime()) {
-+
-+ for (int var3 = 0; var3 < var2; ++var3) {
-+ var4 = (NextTickListEntry)this.pendingTickListEntriesTreeSet.first();
-+
-+ if (!par1 && var4.scheduledTime > this.worldInfo.getWorldTotalTime()) {
- break;
- }
-
-- this.M.remove(var4);
-- this.L.remove(var4);
-- this.U.add(var4);
-+ this.pendingTickListEntriesTreeSet.remove(var4);
-+ this.pendingTickListEntriesHashSet.remove(var4);
-+ this.pendingTickListEntriesThisTick.add(var4);
- }
-
- this.theProfiler.endSection();
- this.theProfiler.startSection("ticking");
-- Iterator var14 = this.U.iterator();
-+ Iterator var14 = this.pendingTickListEntriesThisTick.iterator();
-
-- while(var14.hasNext()) {
-+ while (var14.hasNext()) {
- var4 = (NextTickListEntry)var14.next();
- var14.remove();
- byte var5 = 0;
-- if(this.checkChunksExist(var4.xCoord - var5, var4.yCoord - var5, var4.zCoord - var5, var4.xCoord + var5, var4.yCoord + var5, var4.zCoord + var5)) {
-+
-+ if (this.checkChunksExist(var4.xCoord - var5, var4.yCoord - var5, var4.zCoord - var5, var4.xCoord + var5, var4.yCoord + var5, var4.zCoord + var5)) {
- int var6 = this.getBlockId(var4.xCoord, var4.yCoord, var4.zCoord);
-- if(var6 > 0 && Block.isAssociatedBlockID(var6, var4.blockID)) {
-+
-+ if (var6 > 0 && Block.isAssociatedBlockID(var6, var4.blockID)) {
- try {
-- Block.blocksList[var6].updateTick(this, var4.xCoord, var4.yCoord, var4.zCoord, this.s);
-+ Block.blocksList[var6].updateTick(this, var4.xCoord, var4.yCoord, var4.zCoord, this.rand);
- } catch (Throwable var13) {
- CrashReport var8 = CrashReport.makeCrashReport(var13, "Exception while ticking a block");
- CrashReportCategory var9 = var8.makeCategory("Block being ticked");
--
- int var10;
-+
- try {
- var10 = this.getBlockMetadata(var4.xCoord, var4.yCoord, var4.zCoord);
- } catch (Throwable var12) {
-@@ -402,39 +478,42 @@
- }
-
- this.theProfiler.endSection();
-- this.U.clear();
-- return !this.M.isEmpty();
-+ this.pendingTickListEntriesThisTick.clear();
-+ return !this.pendingTickListEntriesTreeSet.isEmpty();
- }
- }
-
-- public List getPendingBlockUpdates(Chunk var1, boolean var2) {
-+ public List getPendingBlockUpdates(Chunk par1Chunk, boolean par2) {
- ArrayList var3 = null;
-- ChunkCoordIntPair var4 = var1.getChunkCoordIntPair();
-+ ChunkCoordIntPair var4 = par1Chunk.getChunkCoordIntPair();
- int var5 = (var4.chunkXPos << 4) - 2;
- int var6 = var5 + 16 + 2;
- int var7 = (var4.chunkZPos << 4) - 2;
- int var8 = var7 + 16 + 2;
-
-- for(int var9 = 0; var9 < 2; ++var9) {
-+ for (int var9 = 0; var9 < 2; ++var9) {
- Iterator var10;
-- if(var9 == 0) {
-- var10 = this.M.iterator();
-+
-+ if (var9 == 0) {
-+ var10 = this.pendingTickListEntriesTreeSet.iterator();
- } else {
-- var10 = this.U.iterator();
-- if(!this.U.isEmpty()) {
-- System.out.println(this.U.size());
-+ var10 = this.pendingTickListEntriesThisTick.iterator();
-+
-+ if (!this.pendingTickListEntriesThisTick.isEmpty()) {
-+ System.out.println(this.pendingTickListEntriesThisTick.size());
- }
- }
-
-- while(var10.hasNext()) {
-+ while (var10.hasNext()) {
- NextTickListEntry var11 = (NextTickListEntry)var10.next();
-- if(var11.xCoord >= var5 && var11.xCoord < var6 && var11.zCoord >= var7 && var11.zCoord < var8) {
-- if(var2) {
-- this.L.remove(var11);
-+
-+ if (var11.xCoord >= var5 && var11.xCoord < var6 && var11.zCoord >= var7 && var11.zCoord < var8) {
-+ if (par2) {
-+ this.pendingTickListEntriesHashSet.remove(var11);
- var10.remove();
- }
-
-- if(var3 == null) {
-+ if (var3 == null) {
- var3 = new ArrayList();
- }
-
-@@ -446,30 +525,41 @@
- return var3;
- }
-
-- public void updateEntityWithOptionalForce(Entity var1, boolean var2) {
-- if(!this.a.getCanSpawnAnimals() && (var1 instanceof EntityAnimal || var1 instanceof EntityWaterMob)) {
-- var1.setDead();
-- }
--
-- if(!this.a.getCanSpawnNPCs() && var1 instanceof INpc) {
-- var1.setDead();
-- }
--
-- super.updateEntityWithOptionalForce(var1, var2);
-+ /**
-+ * Will update the entity in the world if the chunk the entity is in is currently loaded or its forced to update. Args:
-+ * entity, forceUpdate
-+ */
-+ public void updateEntityWithOptionalForce(Entity par1Entity, boolean par2) {
-+ if (!this.mcServer.getCanSpawnAnimals() && (par1Entity instanceof EntityAnimal || par1Entity instanceof EntityWaterMob)) {
-+ par1Entity.setDead();
-+ }
-+
-+ if (!this.mcServer.getCanSpawnNPCs() && par1Entity instanceof INpc) {
-+ par1Entity.setDead();
-+ }
-+
-+ super.updateEntityWithOptionalForce(par1Entity, par2);
- }
-
-+ /**
-+ * Creates the chunk provider for this world. Called in the constructor. Retrieves provider from worldProvider?
-+ */
- protected IChunkProvider createChunkProvider() {
- IChunkLoader var1 = this.saveHandler.getChunkLoader(this.provider);
- this.theChunkProviderServer = new ChunkProviderServer(this, var1, this.provider.createChunkGenerator());
- return this.theChunkProviderServer;
- }
-
-- public List getTileEntityList(int var1, int var2, int var3, int var4, int var5, int var6) {
-+ /**
-+ * pars: min x,y,z , max x,y,z
-+ */
-+ public List getAllTileEntityInBox(int par1, int par2, int par3, int par4, int par5, int par6) {
- ArrayList var7 = new ArrayList();
-
-- for(int var8 = 0; var8 < this.g.size(); ++var8) {
-- TileEntity var9 = (TileEntity)this.g.get(var8);
-- if(var9.xCoord >= var1 && var9.yCoord >= var2 && var9.zCoord >= var3 && var9.xCoord < var4 && var9.yCoord < var5 && var9.zCoord < var6) {
-+ for (int var8 = 0; var8 < this.loadedTileEntityList.size(); ++var8) {
-+ TileEntity var9 = (TileEntity)this.loadedTileEntityList.get(var8);
-+
-+ if (var9.xCoord >= par1 && var9.yCoord >= par2 && var9.zCoord >= par3 && var9.xCoord < par4 && var9.yCoord < par5 && var9.zCoord < par6) {
- var7.add(var9);
- }
- }
-@@ -477,29 +567,35 @@
- return var7;
- }
-
-- public boolean canMineBlock(EntityPlayer var1, int var2, int var3, int var4) {
-- return !this.a.isBlockProtected(this, var2, var3, var4, var1);
-+ /**
-+ * Called when checking if a certain block can be mined or not. The 'spawn safe zone' check is located here.
-+ */
-+ public boolean canMineBlock(EntityPlayer par1EntityPlayer, int par2, int par3, int par4) {
-+ return !this.mcServer.isBlockProtected(this, par2, par3, par4, par1EntityPlayer);
- }
-
-- protected void initialize(WorldSettings var1) {
-- if(this.entityIdMap == null) {
-+ protected void initialize(WorldSettings par1WorldSettings) {
-+ if (this.entityIdMap == null) {
- this.entityIdMap = new IntHashMap();
- }
-
-- if(this.L == null) {
-- this.L = new HashSet();
-- }
--
-- if(this.M == null) {
-- this.M = new TreeSet();
-- }
--
-- this.createSpawnPosition(var1);
-- super.initialize(var1);
-+ if (this.pendingTickListEntriesHashSet == null) {
-+ this.pendingTickListEntriesHashSet = new HashSet();
-+ }
-+
-+ if (this.pendingTickListEntriesTreeSet == null) {
-+ this.pendingTickListEntriesTreeSet = new TreeSet();
-+ }
-+
-+ this.createSpawnPosition(par1WorldSettings);
-+ super.initialize(par1WorldSettings);
- }
-
-- protected void createSpawnPosition(WorldSettings var1) {
-- if(!this.provider.canRespawnHere()) {
-+ /**
-+ * creates a spawn position at random within 256 blocks of 0,0
-+ */
-+ protected void createSpawnPosition(WorldSettings par1WorldSettings) {
-+ if (!this.provider.canRespawnHere()) {
- this.worldInfo.setSpawnPosition(0, this.provider.getAverageGroundLevel(), 0);
- } else {
- this.findingSpawnPoint = true;
-@@ -510,7 +606,8 @@
- int var6 = 0;
- int var7 = this.provider.getAverageGroundLevel();
- int var8 = 0;
-- if(var5 != null) {
-+
-+ if (var5 != null) {
- var6 = var5.x;
- var8 = var5.z;
- } else {
-@@ -519,193 +616,247 @@
-
- int var9 = 0;
-
-- while(!this.provider.canCoordinateBeSpawn(var6, var8)) {
-+ while (!this.provider.canCoordinateBeSpawn(var6, var8)) {
- var6 += var4.nextInt(64) - var4.nextInt(64);
- var8 += var4.nextInt(64) - var4.nextInt(64);
- ++var9;
-- if(var9 == 1000) {
-+
-+ if (var9 == 1000) {
- break;
- }
- }
-
- this.worldInfo.setSpawnPosition(var6, var7, var8);
- this.findingSpawnPoint = false;
-- if(var1.isBonusChestEnabled()) {
-+
-+ if (par1WorldSettings.isBonusChestEnabled()) {
- this.createBonusChest();
- }
--
- }
- }
-
-+ /**
-+ * Creates the bonus chest in the world.
-+ */
- protected void createBonusChest() {
- WorldGeneratorBonusChest var1 = new WorldGeneratorBonusChest(bonusChestContent, 10);
-
-- for(int var2 = 0; var2 < 10; ++var2) {
-- int var3 = this.worldInfo.getSpawnX() + this.s.nextInt(6) - this.s.nextInt(6);
-- int var4 = this.worldInfo.getSpawnZ() + this.s.nextInt(6) - this.s.nextInt(6);
-+ for (int var2 = 0; var2 < 10; ++var2) {
-+ int var3 = this.worldInfo.getSpawnX() + this.rand.nextInt(6) - this.rand.nextInt(6);
-+ int var4 = this.worldInfo.getSpawnZ() + this.rand.nextInt(6) - this.rand.nextInt(6);
- int var5 = this.getTopSolidOrLiquidBlock(var3, var4) + 1;
-- if(var1.generate(this, this.s, var3, var5, var4)) {
-+
-+ if (var1.generate(this, this.rand, var3, var5, var4)) {
- break;
- }
- }
--
- }
-
-+ /**
-+ * Gets the hard-coded portal location to use when entering this dimension.
-+ */
- public ChunkCoordinates getEntrancePortalLocation() {
- return this.provider.getEntrancePortalLocation();
- }
-
-- public void saveAllChunks(boolean var1, IProgressUpdate var2) throws MinecraftException {
-- if(this.chunkProvider.canSave()) {
-- if(var2 != null) {
-- var2.displaySavingString("Saving level");
-+ /**
-+ * Saves all chunks to disk while updating progress bar.
-+ */
-+ public void saveAllChunks(boolean par1, IProgressUpdate par2IProgressUpdate) throws MinecraftException {
-+ if (this.chunkProvider.canSave()) {
-+ if (par2IProgressUpdate != null) {
-+ par2IProgressUpdate.displayProgressMessage("Saving level");
- }
-
- this.saveLevel();
-- if(var2 != null) {
-- var2.displayLoadingString("Saving chunks");
-+
-+ if (par2IProgressUpdate != null) {
-+ par2IProgressUpdate.resetProgresAndWorkingMessage("Saving chunks");
- }
-
-- this.chunkProvider.saveChunks(var1, var2);
-+ this.chunkProvider.saveChunks(par1, par2IProgressUpdate);
- }
- }
-
-+ /**
-+ * saves chunk data - currently only called during execution of the Save All command
-+ */
- public void saveChunkData() {
-- if(this.chunkProvider.canSave()) {
-+ if (this.chunkProvider.canSave()) {
- this.chunkProvider.saveExtraData();
- }
- }
-
-+ /**
-+ * Saves the chunks to disk.
-+ */
- protected void saveLevel() throws MinecraftException {
- this.checkSessionLock();
-- this.saveHandler.saveWorldInfoWithPlayer(this.worldInfo, this.a.getConfigurationManager().getHostPlayerData());
-+ this.saveHandler.saveWorldInfoWithPlayer(this.worldInfo, this.mcServer.getConfigurationManager().getHostPlayerData());
- this.mapStorage.saveAllData();
- }
-
-- protected void onEntityAdded(Entity var1) {
-- super.onEntityAdded(var1);
-- this.entityIdMap.addKey(var1.entityId, var1);
-- Entity[] var2 = var1.getParts();
-- if(var2 != null) {
-- for(int var3 = 0; var3 < var2.length; ++var3) {
-+ // ToDo: Spoutcraft obtainEntitySkin
-+ protected void onEntityAdded(Entity par1Entity) {
-+ super.onEntityAdded(par1Entity);
-+ this.entityIdMap.addKey(par1Entity.entityId, par1Entity);
-+ Entity[] var2 = par1Entity.getParts();
-+
-+ if (var2 != null) {
-+ for (int var3 = 0; var3 < var2.length; ++var3) {
- this.entityIdMap.addKey(var2[var3].entityId, var2[var3]);
- }
- }
--
- }
-
-- protected void onEntityRemoved(Entity var1) {
-- super.onEntityRemoved(var1);
-- this.entityIdMap.removeObject(var1.entityId);
-- Entity[] var2 = var1.getParts();
-- if(var2 != null) {
-- for(int var3 = 0; var3 < var2.length; ++var3) {
-+ // ToDo: Spoutcraft releaseEntitySkin
-+ protected void onEntityRemoved(Entity par1Entity) {
-+ super.onEntityRemoved(par1Entity);
-+ this.entityIdMap.removeObject(par1Entity.entityId);
-+ Entity[] var2 = par1Entity.getParts();
-+
-+ if (var2 != null) {
-+ for (int var3 = 0; var3 < var2.length; ++var3) {
- this.entityIdMap.removeObject(var2[var3].entityId);
- }
- }
--
-- }
--
-- public Entity getEntityByID(int var1) {
-- return (Entity)this.entityIdMap.lookup(var1);
-- }
--
-- public boolean addWeatherEffect(Entity var1) {
-- if(super.addWeatherEffect(var1)) {
-- this.a.getConfigurationManager().sendPacketToPlayersAroundPoint(var1.posX, var1.posY, var1.posZ, 512.0D, this.provider.dimensionId, new Packet71Weather(var1));
-+ }
-+
-+ /**
-+ * Returns the Entity with the given ID, or null if it doesn't exist in this World.
-+ */
-+ public Entity getEntityByID(int par1) {
-+ return (Entity)this.entityIdMap.lookup(par1);
-+ }
-+
-+ /**
-+ * adds a lightning bolt to the list of lightning bolts in this world.
-+ */
-+ public boolean addWeatherEffect(Entity par1Entity) {
-+ if (super.addWeatherEffect(par1Entity)) {
-+ this.mcServer.getConfigurationManager().sendToAllNear(par1Entity.posX, par1Entity.posY, par1Entity.posZ, 512.0D, this.provider.dimensionId, new Packet71Weather(par1Entity));
- return true;
- } else {
- return false;
- }
- }
-
-- public void setEntityState(Entity var1, byte var2) {
-- Packet38EntityStatus var3 = new Packet38EntityStatus(var1.entityId, var2);
-- this.getEntityTracker().sendPacketToTrackedPlayersAndTrackedEntity(var1, var3);
-+ /**
-+ * sends a Packet 38 (Entity Status) to all tracked players of that entity
-+ */
-+ public void setEntityState(Entity par1Entity, byte par2) {
-+ Packet38EntityStatus var3 = new Packet38EntityStatus(par1Entity.entityId, par2);
-+ this.getEntityTracker().sendPacketToAllAssociatedPlayers(par1Entity, var3);
- }
-
-- public Explosion newExplosion(Entity var1, double var2, double var4, double var6, float var8, boolean var9, boolean var10) {
-- Explosion var11 = new Explosion(this, var1, var2, var4, var6, var8);
-- var11.isFlaming = var9;
-- var11.isSmoking = var10;
-+ /**
-+ * returns a new explosion. Does initiation (at time of writing Explosion is not finished)
-+ */
-+ public Explosion newExplosion(Entity par1Entity, double par2, double par4, double par6, float par8, boolean par9, boolean par10) {
-+ Explosion var11 = new Explosion(this, par1Entity, par2, par4, par6, par8);
-+ var11.isFlaming = par9;
-+ var11.isSmoking = par10;
- var11.doExplosionA();
- var11.doExplosionB(false);
-- if(!var10) {
-- var11.h.clear();
-+
-+ if (!par10) {
-+ var11.affectedBlockPositions.clear();
- }
-
-- Iterator var12 = this.h.iterator();
-+ Iterator var12 = this.playerEntities.iterator();
-
-- while(var12.hasNext()) {
-+ while (var12.hasNext()) {
- EntityPlayer var13 = (EntityPlayer)var12.next();
-- if(var13.getDistanceSq(var2, var4, var6) < 4096.0D) {
-- ((EntityPlayerMP)var13).playerNetServerHandler.sendPacket(new Packet60Explosion(var2, var4, var6, var8, var11.h, (Vec3)var11.func_77277_b().get(var13)));
-+
-+ if (var13.getDistanceSq(par2, par4, par6) < 4096.0D) {
-+ ((EntityPlayerMP)var13).playerNetServerHandler.sendPacketToPlayer(new Packet60Explosion(par2, par4, par6, par8, var11.affectedBlockPositions, (Vec3)var11.func_77277_b().get(var13)));
- }
- }
-
- return var11;
- }
-
-- public void addBlockEvent(int var1, int var2, int var3, int var4, int var5, int var6) {
-- BlockEventData var7 = new BlockEventData(var1, var2, var3, var4, var5, var6);
-+ /**
-+ * Adds a block event with the given Args to the blockEventCache. During the next tick(), the block specified will have
-+ * its onBlockEvent handler called with the given parameters. Args: X,Y,Z, BlockID, EventID, EventParameter
-+ */
-+ public void addBlockEvent(int par1, int par2, int par3, int par4, int par5, int par6) {
-+ BlockEventData var7 = new BlockEventData(par1, par2, par3, par4, par5, par6);
- Iterator var8 = this.blockEventCache[this.blockEventCacheIndex].iterator();
--
- BlockEventData var9;
-+
- do {
-- if(!var8.hasNext()) {
-+ if (!var8.hasNext()) {
- this.blockEventCache[this.blockEventCacheIndex].add(var7);
- return;
- }
-
- var9 = (BlockEventData)var8.next();
-- } while(!var9.equals(var7));
--
-+ } while (!var9.equals(var7));
- }
-
-+ /**
-+ * Send and apply locally all pending BlockEvents to each player with 64m radius of the event.
-+ */
- private void sendAndApplyBlockEvents() {
-- while(!this.blockEventCache[this.blockEventCacheIndex].isEmpty()) {
-+ while (!this.blockEventCache[this.blockEventCacheIndex].isEmpty()) {
- int var1 = this.blockEventCacheIndex;
- this.blockEventCacheIndex ^= 1;
- Iterator var2 = this.blockEventCache[var1].iterator();
-
-- while(var2.hasNext()) {
-+ while (var2.hasNext()) {
- BlockEventData var3 = (BlockEventData)var2.next();
-- if(this.onBlockEventReceived(var3)) {
-- this.a.getConfigurationManager().sendPacketToPlayersAroundPoint((double)var3.getX(), (double)var3.getY(), (double)var3.getZ(), 64.0D, this.provider.dimensionId, new Packet54PlayNoteBlock(var3.getX(), var3.getY(), var3.getZ(), var3.getBlockID(), var3.getEventID(), var3.getEventParameter()));
-+
-+ if (this.onBlockEventReceived(var3)) {
-+ this.mcServer.getConfigurationManager().sendToAllNear((double)var3.getX(), (double)var3.getY(), (double)var3.getZ(), 64.0D, this.provider.dimensionId, new Packet54PlayNoteBlock(var3.getX(), var3.getY(), var3.getZ(), var3.getBlockID(), var3.getEventID(), var3.getEventParameter()));
- }
- }
-
- this.blockEventCache[var1].clear();
- }
--
-- }
--
-- private boolean onBlockEventReceived(BlockEventData var1) {
-- int var2 = this.getBlockId(var1.getX(), var1.getY(), var1.getZ());
-- return var2 == var1.getBlockID() ? Block.blocksList[var2].onBlockEventReceived(this, var1.getX(), var1.getY(), var1.getZ(), var1.getEventID(), var1.getEventParameter()) : false;
-- }
--
-+ }
-+
-+ /**
-+ * Called to apply a pending BlockEvent to apply to the current world.
-+ */
-+ private boolean onBlockEventReceived(BlockEventData par1BlockEventData) {
-+ int var2 = this.getBlockId(par1BlockEventData.getX(), par1BlockEventData.getY(), par1BlockEventData.getZ());
-+ return var2 == par1BlockEventData.getBlockID() ? Block.blocksList[var2].onBlockEventReceived(this, par1BlockEventData.getX(), par1BlockEventData.getY(), par1BlockEventData.getZ(), par1BlockEventData.getEventID(), par1BlockEventData.getEventParameter()) : false;
-+ }
-+
-+ /**
-+ * Syncs all changes to disk and wait for completion.
-+ */
- public void flush() {
- this.saveHandler.flush();
- }
-
-+ /**
-+ * Updates all weather states.
-+ */
- protected void updateWeather() {
- boolean var1 = this.isRaining();
- super.updateWeather();
-- if(var1 != this.isRaining()) {
-- if(var1) {
-- this.a.getConfigurationManager().sendPacketToAllPlayers(new Packet70GameEvent(2, 0));
-+
-+ if (var1 != this.isRaining()) {
-+ if (var1) {
-+ this.mcServer.getConfigurationManager().sendPacketToAllPlayers(new Packet70GameEvent(2, 0));
- } else {
-- this.a.getConfigurationManager().sendPacketToAllPlayers(new Packet70GameEvent(1, 0));
-+ this.mcServer.getConfigurationManager().sendPacketToAllPlayers(new Packet70GameEvent(1, 0));
- }
- }
--
- }
-
-+ /**
-+ * Gets the MinecraftServer.
-+ */
- public MinecraftServer getMinecraftServer() {
-- return this.a;
-+ return this.mcServer;
- }
-
-+ /**
-+ * Gets the EntityTracker
-+ */
- public EntityTracker getEntityTracker() {
- return this.theEntityTracker;
- }
---- /dev/null
-+++ org/spoutcraft/client/gui/server/CountryButton.java
-@@ -1,0 +1,60 @@
-+/*
-+ * This file is part of Spoutcraft.
-+ *
-+ * Copyright (c) 2011 SpoutcraftDev
-+ * Spoutcraft is licensed under the GNU Lesser General Public License.
-+ *
-+ * Spoutcraft is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation, either version 3 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Spoutcraft is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program. If not, see .
-+ */
-+package org.spoutcraft.client.gui.server;
-+
-+import java.util.ArrayList;
-+import java.util.List;
-+
-+import org.spoutcraft.api.gui.GenericComboBox;
-+import org.spoutcraft.client.SpoutClient;
-+import org.spoutcraft.client.gui.database.UrlElement;
-+
-+public class CountryButton extends GenericComboBox implements UrlElement {
-+ ServerListModel model = SpoutClient.getInstance().getServerManager().getServerList();
-+
-+ public CountryButton() {
-+ List countries = new ArrayList();
-+ countries.add("All");
-+ countries.addAll(model.getCountries());
-+ setItems(countries);
-+ setText("Country");
-+ }
-+
-+ public boolean isActive() {
-+ return getSelectedRow() != 0;
-+ }
-+
-+ public String getUrlPart() {
-+ return "country=" + getSelectedItem();
-+ }
-+
-+ @Override
-+ public void onSelectionChanged(int row, String text) {
-+ model.updateUrl();
-+ }
-+
-+ public void setCurrentCountry(int i) {
-+ setSelection(i + 1);
-+ }
-+
-+ public void clear() {
-+ setSelection(0);
-+ }
-+}
---- /dev/null
-+++ org/spoutcraft/client/packet/PacketGenericTool.java
-@@ -1,0 +1,52 @@
-+/*
-+ * This file is part of Spoutcraft.
-+ *
-+ * Copyright (c) 2011 SpoutcraftDev
-+ * Spoutcraft is licensed under the GNU Lesser General Public License.
-+ *
-+ * Spoutcraft is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation, either version 3 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Spoutcraft is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program. If not, see .
-+ */
-+package org.spoutcraft.client.packet;
-+
-+import java.io.IOException;
-+
-+import org.spoutcraft.api.io.SpoutInputStream;
-+import org.spoutcraft.api.io.SpoutOutputStream;
-+import org.spoutcraft.api.material.item.GenericCustomTool;
-+
-+public class PacketGenericTool implements SpoutPacket {
-+ GenericCustomTool item = new GenericCustomTool();
-+
-+ public void readData(SpoutInputStream input) throws IOException {
-+ item.readData(input);
-+ }
-+
-+ public void writeData(SpoutOutputStream output) throws IOException {
-+ item.writeData(output);
-+ }
-+
-+ public void run(int playerId) {
-+ }
-+
-+ public void failure(int playerId) {
-+ }
-+
-+ public PacketType getPacketType() {
-+ return PacketType.PacketGenericTool;
-+ }
-+
-+ public int getVersion() {
-+ return item.getVersion();
-+ }
-+}
---- net/minecraft/src/CommandServerBanIp.java
-+++ net/minecraft/src/CommandServerBanIp.java
-@@ -7,75 +7,88 @@
- import net.minecraft.server.MinecraftServer;
-
- public class CommandServerBanIp extends CommandBase {
-- public static final Pattern a = Pattern.compile("^([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.([01]?\\d\\d?|2[0-4]\\d|25[0-5])$");
-+ public static final Pattern IPv4Pattern = Pattern.compile("^([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.([01]?\\d\\d?|2[0-4]\\d|25[0-5])$");
-
- public String getCommandName() {
- return "ban-ip";
- }
-
-+ /**
-+ * Return the required permission level for this command.
-+ */
- public int getRequiredPermissionLevel() {
- return 3;
- }
-
-- public boolean canCommandSenderUseCommand(ICommandSender var1) {
-- return MinecraftServer.getServer().getConfigurationManager().getBannedIPs().isListActive() && super.canCommandSenderUseCommand(var1);
-+ /**
-+ * Returns true if the given command sender is allowed to use this command.
-+ */
-+ public boolean canCommandSenderUseCommand(ICommandSender par1ICommandSender) {
-+ return MinecraftServer.getServer().getConfigurationManager().getBannedIPs().isListActive() && super.canCommandSenderUseCommand(par1ICommandSender);
- }
-
-- public String getCommandUsage(ICommandSender var1) {
-+ public String getCommandUsage(ICommandSender par1ICommandSender) {
- return "commands.banip.usage";
- }
-
-- public void processCommand(ICommandSender var1, String[] var2) {
-- if(var2.length >= 1 && var2[0].length() > 1) {
-- Matcher var3 = a.matcher(var2[0]);
-+ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) {
-+ if (par2ArrayOfStr.length >= 1 && par2ArrayOfStr[0].length() > 1) {
-+ Matcher var3 = IPv4Pattern.matcher(par2ArrayOfStr[0]);
- String var4 = null;
-- if(var2.length >= 2) {
-- var4 = func_82360_a(var1, var2, 1);
-+
-+ if (par2ArrayOfStr.length >= 2) {
-+ var4 = func_82360_a(par1ICommandSender, par2ArrayOfStr, 1);
- }
-
-- if(var3.matches()) {
-- this.banIP(var1, var2[0], var4);
-+ if (var3.matches()) {
-+ this.banIP(par1ICommandSender, par2ArrayOfStr[0], var4);
- } else {
-- EntityPlayerMP var5 = MinecraftServer.getServer().getConfigurationManager().getPlayerEntity(var2[0]);
-- if(var5 == null) {
-+ EntityPlayerMP var5 = MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(par2ArrayOfStr[0]);
-+
-+ if (var5 == null) {
- throw new PlayerNotFoundException("commands.banip.invalid", new Object[0]);
- }
-
-- this.banIP(var1, var5.getPlayerIP(), var4);
-+ this.banIP(par1ICommandSender, var5.getPlayerIP(), var4);
- }
--
- } else {
- throw new WrongUsageException("commands.banip.usage", new Object[0]);
- }
- }
-
-- public List addTabCompletionOptions(ICommandSender var1, String[] var2) {
-- return var2.length == 1 ? getListOfStringsMatchingLastWord(var2, MinecraftServer.getServer().getAllUsernames()) : null;
-+ /**
-+ * Adds the strings available in this command to the given list of tab completion options.
-+ */
-+ public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) {
-+ return par2ArrayOfStr.length == 1 ? getListOfStringsMatchingLastWord(par2ArrayOfStr, MinecraftServer.getServer().getAllUsernames()) : null;
- }
-
-- protected void banIP(ICommandSender var1, String var2, String var3) {
-- BanEntry var4 = new BanEntry(var2);
-- var4.setBannedBy(var1.getCommandSenderName());
-- if(var3 != null) {
-- var4.setBanReason(var3);
-+ /**
-+ * Actually does the banning work.
-+ */
-+ protected void banIP(ICommandSender par1ICommandSender, String par2Str, String par3Str) {
-+ BanEntry var4 = new BanEntry(par2Str);
-+ var4.setBannedBy(par1ICommandSender.getCommandSenderName());
-+
-+ if (par3Str != null) {
-+ var4.setBanReason(par3Str);
- }
-
- MinecraftServer.getServer().getConfigurationManager().getBannedIPs().put(var4);
-- List var5 = MinecraftServer.getServer().getConfigurationManager().getPlayerList(var2);
-+ List var5 = MinecraftServer.getServer().getConfigurationManager().getPlayerList(par2Str);
- String[] var6 = new String[var5.size()];
- int var7 = 0;
--
- EntityPlayerMP var9;
-- for(Iterator var8 = var5.iterator(); var8.hasNext(); var6[var7++] = var9.getEntityName()) {
-+
-+ for (Iterator var8 = var5.iterator(); var8.hasNext(); var6[var7++] = var9.getEntityName()) {
- var9 = (EntityPlayerMP)var8.next();
-- var9.playerNetServerHandler.kickPlayer("You have been IP banned.");
-+ var9.playerNetServerHandler.kickPlayerFromServer("You have been IP banned.");
- }
-
-- if(var5.isEmpty()) {
-- notifyAdmins(var1, "commands.banip.success", new Object[]{var2});
-+ if (var5.isEmpty()) {
-+ notifyAdmins(par1ICommandSender, "commands.banip.success", new Object[] {par2Str});
- } else {
-- notifyAdmins(var1, "commands.banip.success.players", new Object[]{var2, joinNiceString(var6)});
-+ notifyAdmins(par1ICommandSender, "commands.banip.success.players", new Object[] {par2Str, joinNiceString(var6)});
- }
--
- }
- }
---- net/minecraft/src/StatList.java
-+++ net/minecraft/src/StatList.java
-@@ -8,44 +8,103 @@
- import java.util.Map;
-
- public class StatList {
-- protected static Map a = new HashMap();
-- public static List b = new ArrayList();
-- public static List c = new ArrayList();
-- public static List d = new ArrayList();
-- public static List e = new ArrayList();
-+
-+ /** Tracks one-off stats. */
-+ protected static Map oneShotStats = new HashMap();
-+ public static List allStats = new ArrayList();
-+ public static List generalStats = new ArrayList();
-+ public static List itemStats = new ArrayList();
-+
-+ /** Tracks the number of times a given block or item has been mined. */
-+ public static List objectMineStats = new ArrayList();
-+
-+ /** times the game has been started */
- public static StatBase startGameStat = (new StatBasic(1000, "stat.startGame")).initIndependentStat().registerStat();
-+
-+ /** times a world has been created */
- public static StatBase createWorldStat = (new StatBasic(1001, "stat.createWorld")).initIndependentStat().registerStat();
-+
-+ /** the number of times you have loaded a world */
- public static StatBase loadWorldStat = (new StatBasic(1002, "stat.loadWorld")).initIndependentStat().registerStat();
-+
-+ /** number of times you've joined a multiplayer world */
- public static StatBase joinMultiplayerStat = (new StatBasic(1003, "stat.joinMultiplayer")).initIndependentStat().registerStat();
-+
-+ /** number of times you've left a game */
- public static StatBase leaveGameStat = (new StatBasic(1004, "stat.leaveGame")).initIndependentStat().registerStat();
-+
-+ /** number of minutes you have played */
- public static StatBase minutesPlayedStat = (new StatBasic(1100, "stat.playOneMinute", StatBase.timeStatType)).initIndependentStat().registerStat();
-+
-+ /** distance you've walked */
- public static StatBase distanceWalkedStat = (new StatBasic(2000, "stat.walkOneCm", StatBase.distanceStatType)).initIndependentStat().registerStat();
-+
-+ /** distance you have swam */
- public static StatBase distanceSwumStat = (new StatBasic(2001, "stat.swimOneCm", StatBase.distanceStatType)).initIndependentStat().registerStat();
-+
-+ /** the distance you have fallen */
- public static StatBase distanceFallenStat = (new StatBasic(2002, "stat.fallOneCm", StatBase.distanceStatType)).initIndependentStat().registerStat();
-+
-+ /** the distance you've climbed */
- public static StatBase distanceClimbedStat = (new StatBasic(2003, "stat.climbOneCm", StatBase.distanceStatType)).initIndependentStat().registerStat();
-+
-+ /** the distance you've flown */
- public static StatBase distanceFlownStat = (new StatBasic(2004, "stat.flyOneCm", StatBase.distanceStatType)).initIndependentStat().registerStat();
-+
-+ /** the distance you've dived */
- public static StatBase distanceDoveStat = (new StatBasic(2005, "stat.diveOneCm", StatBase.distanceStatType)).initIndependentStat().registerStat();
-+
-+ /** the distance you've traveled by minecart */
- public static StatBase distanceByMinecartStat = (new StatBasic(2006, "stat.minecartOneCm", StatBase.distanceStatType)).initIndependentStat().registerStat();
-+
-+ /** the distance you've traveled by boat */
- public static StatBase distanceByBoatStat = (new StatBasic(2007, "stat.boatOneCm", StatBase.distanceStatType)).initIndependentStat().registerStat();
-+
-+ /** the distance you've traveled by pig */
- public static StatBase distanceByPigStat = (new StatBasic(2008, "stat.pigOneCm", StatBase.distanceStatType)).initIndependentStat().registerStat();
-+
-+ /** the times you've jumped */
- public static StatBase jumpStat = (new StatBasic(2010, "stat.jump")).initIndependentStat().registerStat();
-+
-+ /** the distance you've dropped (or times you've fallen?) */
- public static StatBase dropStat = (new StatBasic(2011, "stat.drop")).initIndependentStat().registerStat();
-+
-+ /** the amount of damage you've dealt */
- public static StatBase damageDealtStat = (new StatBasic(2020, "stat.damageDealt", StatBase.field_111202_k)).registerStat();
-+
-+ /** the amount of damage you have taken */
- public static StatBase damageTakenStat = (new StatBasic(2021, "stat.damageTaken", StatBase.field_111202_k)).registerStat();
-+
-+ /** the number of times you have died */
- public static StatBase deathsStat = (new StatBasic(2022, "stat.deaths")).registerStat();
-+
-+ /** the number of mobs you have killed */
- public static StatBase mobKillsStat = (new StatBasic(2023, "stat.mobKills")).registerStat();
-+
-+ /** counts the number of times you've killed a player */
- public static StatBase playerKillsStat = (new StatBasic(2024, "stat.playerKills")).registerStat();
- public static StatBase fishCaughtStat = (new StatBasic(2025, "stat.fishCaught")).registerStat();
- public static StatBase[] mineBlockStatArray = initMinableStats("stat.mineBlock", 16777216);
-+
-+ /** Tracks the number of items a given block or item has been crafted. */
- public static StatBase[] objectCraftStats;
-+
-+ /** Tracks the number of times a given block or item has been used. */
- public static StatBase[] objectUseStats;
-+
-+ /** Tracks the number of times a given block or item has been broken. */
- public static StatBase[] objectBreakStats;
- private static boolean blockStatsInitialized;
- private static boolean itemStatsInitialized;
-
-- public static void nopInit() {
-- }
-+ /**
-+ * This method simply NOPs. It is presumably used to call the static constructors on server start.
-+ */
-+ public static void nopInit() {}
-
-+ /**
-+ * Initializes statistic fields related to breakable items and blocks.
-+ */
- public static void initBreakableStats() {
- objectUseStats = initUsableStats(objectUseStats, "stat.useItem", 16908288, 0, 256);
- objectBreakStats = initBreakStats(objectBreakStats, "stat.breakItem", 16973824, 0, 256);
-@@ -60,21 +119,26 @@
- initCraftableStats();
- }
-
-+ /**
-+ * Initializes statistics related to craftable items. Is only called after both block and item stats have been
-+ * initialized.
-+ */
- public static void initCraftableStats() {
-- if(blockStatsInitialized && itemStatsInitialized) {
-+ if (blockStatsInitialized && itemStatsInitialized) {
- HashSet var0 = new HashSet();
- Iterator var1 = CraftingManager.getInstance().getRecipeList().iterator();
-
-- while(var1.hasNext()) {
-+ while (var1.hasNext()) {
- IRecipe var2 = (IRecipe)var1.next();
-- if(var2.getRecipeOutput() != null) {
-+
-+ if (var2.getRecipeOutput() != null) {
- var0.add(Integer.valueOf(var2.getRecipeOutput().itemID));
- }
- }
-
- var1 = FurnaceRecipes.smelting().getSmeltingList().values().iterator();
-
-- while(var1.hasNext()) {
-+ while (var1.hasNext()) {
- ItemStack var4 = (ItemStack)var1.next();
- var0.add(Integer.valueOf(var4.itemID));
- }
-@@ -82,10 +146,11 @@
- objectCraftStats = new StatBase[32000];
- var1 = var0.iterator();
-
-- while(var1.hasNext()) {
-+ while (var1.hasNext()) {
- Integer var5 = (Integer)var1.next();
-- if(Item.itemsList[var5.intValue()] != null) {
-- String var3 = StatCollector.translateToLocalFormatted("stat.craftItem", new Object[]{Item.itemsList[var5.intValue()].getStatName()});
-+
-+ if (Item.itemsList[var5.intValue()] != null) {
-+ String var3 = StatCollector.translateToLocalFormatted("stat.craftItem", new Object[] {Item.itemsList[var5.intValue()].getStatName()});
- objectCraftStats[var5.intValue()] = (new StatCrafting(16842752 + var5.intValue(), var3, var5.intValue())).registerStat();
- }
- }
-@@ -94,14 +159,17 @@
- }
- }
-
-- private static StatBase[] initMinableStats(String var0, int var1) {
-+ /**
-+ * Initializes statistic fields related to minable items and blocks.
-+ */
-+ private static StatBase[] initMinableStats(String par0Str, int par1) {
- StatBase[] var2 = new StatBase[256];
-
-- for(int var3 = 0; var3 < 256; ++var3) {
-- if(Block.blocksList[var3] != null && Block.blocksList[var3].getEnableStats()) {
-- String var4 = StatCollector.translateToLocalFormatted(var0, new Object[]{Block.blocksList[var3].getLocalizedName()});
-- var2[var3] = (new StatCrafting(var1 + var3, var4, var3)).registerStat();
-- e.add((StatCrafting)var2[var3]);
-+ for (int var3 = 0; var3 < 256; ++var3) {
-+ if (Block.blocksList[var3] != null && Block.blocksList[var3].getEnableStats()) {
-+ String var4 = StatCollector.translateToLocalFormatted(par0Str, new Object[] {Block.blocksList[var3].getLocalizedName()});
-+ var2[var3] = (new StatCrafting(par1 + var3, var4, var3)).registerStat();
-+ objectMineStats.add((StatCrafting)var2[var3]);
- }
- }
-
-@@ -109,69 +177,79 @@
- return var2;
- }
-
-- private static StatBase[] initUsableStats(StatBase[] var0, String var1, int var2, int var3, int var4) {
-- if(var0 == null) {
-- var0 = new StatBase[32000];
-+ /**
-+ * Initializes statistic fields related to usable items and blocks.
-+ */
-+ private static StatBase[] initUsableStats(StatBase[] par0ArrayOfStatBase, String par1Str, int par2, int par3, int par4) {
-+ if (par0ArrayOfStatBase == null) {
-+ par0ArrayOfStatBase = new StatBase[32000];
- }
-
-- for(int var5 = var3; var5 < var4; ++var5) {
-- if(Item.itemsList[var5] != null) {
-- String var6 = StatCollector.translateToLocalFormatted(var1, new Object[]{Item.itemsList[var5].getStatName()});
-- var0[var5] = (new StatCrafting(var2 + var5, var6, var5)).registerStat();
-- if(var5 >= 256) {
-- d.add((StatCrafting)var0[var5]);
-+ for (int var5 = par3; var5 < par4; ++var5) {
-+ if (Item.itemsList[var5] != null) {
-+ String var6 = StatCollector.translateToLocalFormatted(par1Str, new Object[] {Item.itemsList[var5].getStatName()});
-+ par0ArrayOfStatBase[var5] = (new StatCrafting(par2 + var5, var6, var5)).registerStat();
-+
-+ if (var5 >= 256) {
-+ itemStats.add((StatCrafting)par0ArrayOfStatBase[var5]);
- }
- }
- }
-
-- replaceAllSimilarBlocks(var0);
-- return var0;
-+ replaceAllSimilarBlocks(par0ArrayOfStatBase);
-+ return par0ArrayOfStatBase;
- }
-
-- private static StatBase[] initBreakStats(StatBase[] var0, String var1, int var2, int var3, int var4) {
-- if(var0 == null) {
-- var0 = new StatBase[32000];
-+ private static StatBase[] initBreakStats(StatBase[] par0ArrayOfStatBase, String par1Str, int par2, int par3, int par4) {
-+ if (par0ArrayOfStatBase == null) {
-+ par0ArrayOfStatBase = new StatBase[32000];
- }
-
-- for(int var5 = var3; var5 < var4; ++var5) {
-- if(Item.itemsList[var5] != null && Item.itemsList[var5].isDamageable()) {
-- String var6 = StatCollector.translateToLocalFormatted(var1, new Object[]{Item.itemsList[var5].getStatName()});
-- var0[var5] = (new StatCrafting(var2 + var5, var6, var5)).registerStat();
-+ for (int var5 = par3; var5 < par4; ++var5) {
-+ if (Item.itemsList[var5] != null && Item.itemsList[var5].isDamageable()) {
-+ String var6 = StatCollector.translateToLocalFormatted(par1Str, new Object[] {Item.itemsList[var5].getStatName()});
-+ par0ArrayOfStatBase[var5] = (new StatCrafting(par2 + var5, var6, var5)).registerStat();
- }
- }
-
-- replaceAllSimilarBlocks(var0);
-- return var0;
-- }
--
-- private static void replaceAllSimilarBlocks(StatBase[] var0) {
-- replaceSimilarBlocks(var0, Block.waterStill.blockID, Block.waterMoving.blockID);
-- replaceSimilarBlocks(var0, Block.lavaStill.blockID, Block.lavaStill.blockID);
-- replaceSimilarBlocks(var0, Block.pumpkinLantern.blockID, Block.pumpkin.blockID);
-- replaceSimilarBlocks(var0, Block.furnaceBurning.blockID, Block.furnaceIdle.blockID);
-- replaceSimilarBlocks(var0, Block.oreRedstoneGlowing.blockID, Block.oreRedstone.blockID);
-- replaceSimilarBlocks(var0, Block.redstoneRepeaterActive.blockID, Block.redstoneRepeaterIdle.blockID);
-- replaceSimilarBlocks(var0, Block.torchRedstoneActive.blockID, Block.torchRedstoneIdle.blockID);
-- replaceSimilarBlocks(var0, Block.mushroomRed.blockID, Block.mushroomBrown.blockID);
-- replaceSimilarBlocks(var0, Block.stoneDoubleSlab.blockID, Block.stoneSingleSlab.blockID);
-- replaceSimilarBlocks(var0, Block.woodDoubleSlab.blockID, Block.woodSingleSlab.blockID);
-- replaceSimilarBlocks(var0, Block.grass.blockID, Block.dirt.blockID);
-- replaceSimilarBlocks(var0, Block.tilledField.blockID, Block.dirt.blockID);
-- }
--
-- private static void replaceSimilarBlocks(StatBase[] var0, int var1, int var2) {
-- if(var0[var1] != null && var0[var2] == null) {
-- var0[var2] = var0[var1];
-+ replaceAllSimilarBlocks(par0ArrayOfStatBase);
-+ return par0ArrayOfStatBase;
-+ }
-+
-+ /**
-+ * Forces all dual blocks to count for each other on the stats list
-+ */
-+ private static void replaceAllSimilarBlocks(StatBase[] par0ArrayOfStatBase) {
-+ replaceSimilarBlocks(par0ArrayOfStatBase, Block.waterStill.blockID, Block.waterMoving.blockID);
-+ replaceSimilarBlocks(par0ArrayOfStatBase, Block.lavaStill.blockID, Block.lavaStill.blockID);
-+ replaceSimilarBlocks(par0ArrayOfStatBase, Block.pumpkinLantern.blockID, Block.pumpkin.blockID);
-+ replaceSimilarBlocks(par0ArrayOfStatBase, Block.furnaceBurning.blockID, Block.furnaceIdle.blockID);
-+ replaceSimilarBlocks(par0ArrayOfStatBase, Block.oreRedstoneGlowing.blockID, Block.oreRedstone.blockID);
-+ replaceSimilarBlocks(par0ArrayOfStatBase, Block.redstoneRepeaterActive.blockID, Block.redstoneRepeaterIdle.blockID);
-+ replaceSimilarBlocks(par0ArrayOfStatBase, Block.torchRedstoneActive.blockID, Block.torchRedstoneIdle.blockID);
-+ replaceSimilarBlocks(par0ArrayOfStatBase, Block.mushroomRed.blockID, Block.mushroomBrown.blockID);
-+ replaceSimilarBlocks(par0ArrayOfStatBase, Block.stoneDoubleSlab.blockID, Block.stoneSingleSlab.blockID);
-+ replaceSimilarBlocks(par0ArrayOfStatBase, Block.woodDoubleSlab.blockID, Block.woodSingleSlab.blockID);
-+ replaceSimilarBlocks(par0ArrayOfStatBase, Block.grass.blockID, Block.dirt.blockID);
-+ replaceSimilarBlocks(par0ArrayOfStatBase, Block.tilledField.blockID, Block.dirt.blockID);
-+ }
-+
-+ /**
-+ * Forces stats for one block to add to another block, such as idle and active furnaces
-+ */
-+ private static void replaceSimilarBlocks(StatBase[] par0ArrayOfStatBase, int par1, int par2) {
-+ if (par0ArrayOfStatBase[par1] != null && par0ArrayOfStatBase[par2] == null) {
-+ par0ArrayOfStatBase[par2] = par0ArrayOfStatBase[par1];
- } else {
-- b.remove(var0[var1]);
-- e.remove(var0[var1]);
-- c.remove(var0[var1]);
-- var0[var1] = var0[var2];
-+ allStats.remove(par0ArrayOfStatBase[par1]);
-+ objectMineStats.remove(par0ArrayOfStatBase[par1]);
-+ generalStats.remove(par0ArrayOfStatBase[par1]);
-+ par0ArrayOfStatBase[par1] = par0ArrayOfStatBase[par2];
- }
- }
-
-- public static StatBase getOneShotStat(int var0) {
-- return (StatBase)a.get(Integer.valueOf(var0));
-+ public static StatBase getOneShotStat(int par0) {
-+ return (StatBase)oneShotStats.get(Integer.valueOf(par0));
- }
-
- static {
---- /dev/null
-+++ org/spoutcraft/client/player/accessories/TopHat.java
-@@ -1,0 +1,56 @@
-+/*
-+ * This file is part of Spoutcraft.
-+ *
-+ * Copyright (c) 2011 SpoutcraftDev
-+ * Spoutcraft is licensed under the GNU Lesser General Public License.
-+ *
-+ * Spoutcraft is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation, either version 3 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Spoutcraft is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program. If not, see .
-+ */
-+package org.spoutcraft.client.player.accessories;
-+
-+import net.minecraft.src.EntityPlayer;
-+import net.minecraft.src.ModelBiped;
-+import net.minecraft.src.ModelRenderer;
-+
-+public class TopHat extends Accessory{
-+ public ModelRenderer bipedBottomHat;
-+ public ModelRenderer bipedTopHat;
-+
-+ public TopHat(ModelBiped model) {
-+ super(model);
-+ bipedBottomHat = new ModelRenderer(model, 0, 0);
-+ bipedBottomHat.addBox(-5.5F, -9F, -5.5F, 11, 2, 11);
-+ bipedTopHat = new ModelRenderer(model, 0, 13);
-+ bipedTopHat.addBox(-3.5F, -17F, -3.5F, 7, 8, 7);
-+ }
-+
-+ @Override
-+ public void render(EntityPlayer plr, float f) {
-+ bipedBottomHat.rotateAngleY = getModel().bipedHead.rotateAngleY;
-+ bipedBottomHat.rotateAngleX = getModel().bipedHead.rotateAngleX;
-+ bipedBottomHat.rotationPointX = 0.0F;
-+ bipedBottomHat.rotationPointY = 0.0F;
-+ bipedBottomHat.render(f);
-+ bipedTopHat.rotateAngleY = getModel().bipedHead.rotateAngleY;
-+ bipedTopHat.rotateAngleX = getModel().bipedHead.rotateAngleX;
-+ bipedTopHat.rotationPointX = 0.0F;
-+ bipedTopHat.rotationPointY = 0.0F;
-+ bipedTopHat.render(f);
-+ }
-+
-+ @Override
-+ public AccessoryType getType() {
-+ return AccessoryType.TOPHAT;
-+ }
-+}
---- net/minecraft/src/BlockWall.java
-+++ net/minecraft/src/BlockWall.java
-@@ -3,84 +3,111 @@
- import java.util.List;
-
- public class BlockWall extends Block {
-- public static final String[] a = new String[]{"normal", "mossy"};
--
-- public BlockWall(int var1, Block var2) {
-- super(var1, var2.blockMaterial);
-- this.setHardness(var2.blockHardness);
-- this.setResistance(var2.blockResistance / 3.0F);
-- this.setStepSound(var2.stepSound);
-+
-+ /** The types of the wall. */
-+ public static final String[] types = new String[] {"normal", "mossy"};
-+
-+ public BlockWall(int par1, Block par2Block) {
-+ super(par1, par2Block.blockMaterial);
-+ this.setHardness(par2Block.blockHardness);
-+ this.setResistance(par2Block.blockResistance / 3.0F);
-+ this.setStepSound(par2Block.stepSound);
- this.setCreativeTab(CreativeTabs.tabBlock);
- }
-
-- public Icon getIcon(int var1, int var2) {
-- return var2 == 1 ? Block.cobblestoneMossy.getBlockTextureFromSide(var1) : Block.cobblestone.getBlockTextureFromSide(var1);
-+ /**
-+ * 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;
- }
-
-+ /**
-+ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc)
-+ */
- public boolean renderAsNormalBlock() {
- return false;
- }
-
-- public boolean getBlocksMovement(IBlockAccess var1, int var2, int var3, int var4) {
-+ public boolean getBlocksMovement(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) {
- return 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() {
- return false;
- }
-
-- public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) {
-- boolean var5 = this.canConnectWallTo(var1, var2, var3, var4 - 1);
-- boolean var6 = this.canConnectWallTo(var1, var2, var3, var4 + 1);
-- boolean var7 = this.canConnectWallTo(var1, var2 - 1, var3, var4);
-- boolean var8 = this.canConnectWallTo(var1, var2 + 1, var3, var4);
-+ /**
-+ * 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) {
-+ boolean var5 = this.canConnectWallTo(par1IBlockAccess, par2, par3, par4 - 1);
-+ boolean var6 = this.canConnectWallTo(par1IBlockAccess, par2, par3, par4 + 1);
-+ boolean var7 = this.canConnectWallTo(par1IBlockAccess, par2 - 1, par3, par4);
-+ boolean var8 = this.canConnectWallTo(par1IBlockAccess, par2 + 1, par3, par4);
- float var9 = 0.25F;
-- float var10 = 12.0F / 16.0F;
-+ float var10 = 0.75F;
- float var11 = 0.25F;
-- float var12 = 12.0F / 16.0F;
-+ float var12 = 0.75F;
- float var13 = 1.0F;
-- if(var5) {
-+
-+ if (var5) {
- var11 = 0.0F;
- }
-
-- if(var6) {
-+ if (var6) {
- var12 = 1.0F;
- }
-
-- if(var7) {
-+ if (var7) {
- var9 = 0.0F;
- }
-
-- if(var8) {
-+ if (var8) {
- var10 = 1.0F;
- }
-
-- if(var5 && var6 && !var7 && !var8) {
-- var13 = 13.0F / 16.0F;
-- var9 = 5.0F / 16.0F;
-- var10 = 11.0F / 16.0F;
-- } else if(!var5 && !var6 && var7 && var8) {
-- var13 = 13.0F / 16.0F;
-- var11 = 5.0F / 16.0F;
-- var12 = 11.0F / 16.0F;
-+ if (var5 && var6 && !var7 && !var8) {
-+ var13 = 0.8125F;
-+ var9 = 0.3125F;
-+ var10 = 0.6875F;
-+ } else if (!var5 && !var6 && var7 && var8) {
-+ var13 = 0.8125F;
-+ var11 = 0.3125F;
-+ var12 = 0.6875F;
- }
-
- this.setBlockBounds(var9, 0.0F, var11, var10, var13, var12);
- }
-
-- public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) {
-- this.setBlockBoundsBasedOnState(var1, var2, var3, var4);
-+ /**
-+ * 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) {
-+ this.setBlockBoundsBasedOnState(par1World, par2, par3, par4);
- this.maxY = 1.5D;
-- return super.getCollisionBoundingBoxFromPool(var1, var2, var3, var4);
-+ return super.getCollisionBoundingBoxFromPool(par1World, par2, par3, par4);
- }
-
-- public boolean canConnectWallTo(IBlockAccess var1, int var2, int var3, int var4) {
-- int var5 = var1.getBlockId(var2, var3, var4);
-- if(var5 != this.blockID && var5 != Block.fenceGate.blockID) {
-+ /**
-+ * Return whether an adjacent block can connect to a wall.
-+ */
-+ public boolean canConnectWallTo(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) {
-+ int var5 = par1IBlockAccess.getBlockId(par2, par3, par4);
-+
-+ if (var5 != this.blockID && var5 != Block.fenceGate.blockID) {
- Block var6 = Block.blocksList[var5];
- return var6 != null && var6.blockMaterial.isOpaque() && var6.renderAsNormalBlock() ? var6.blockMaterial != Material.pumpkin : false;
- } else {
-@@ -88,19 +115,32 @@
- }
- }
-
-- public void getSubBlocks(int var1, CreativeTabs var2, List var3) {
-- var3.add(new ItemStack(var1, 1, 0));
-- var3.add(new ItemStack(var1, 1, 1));
-- }
--
-- public int damageDropped(int var1) {
-- return var1;
-- }
--
-- public boolean shouldSideBeRendered(IBlockAccess var1, int var2, int var3, int var4, int var5) {
-- return var5 == 0 ? super.shouldSideBeRendered(var1, var2, var3, var4, var5) : true;
-- }
--
-- public void registerIcons(IconRegister var1) {
-- }
-+ /**
-+ * 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) {}
- }
---- /dev/null
-+++ org/spoutcraft/client/gui/settings/controls/FancyItemsButton.java
-@@ -1,0 +1,41 @@
-+/*
-+ * This file is part of Spoutcraft.
-+ *
-+ * Copyright (c) 2011 SpoutcraftDev
-+ * Spoutcraft is licensed under the GNU Lesser General Public License.
-+ *
-+ * Spoutcraft is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation, either version 3 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Spoutcraft is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program. If not, see .
-+ */
-+package org.spoutcraft.client.gui.settings.controls;
-+
-+import java.util.UUID;
-+
-+import org.spoutcraft.client.config.Configuration;
-+
-+public class FancyItemsButton extends AutomatedCheckBox {
-+ UUID fancyGraphics;
-+ public FancyItemsButton(UUID fancyGraphics) {
-+ super("Fancy Items");
-+ this.fancyGraphics = fancyGraphics;
-+ setChecked(Configuration.isFancyItems());
-+ setTooltip("Fancy Items\nFast - lower quality, faster\nFancy - higher quality, slower\nFancy Items are rendered 2D.\nRancy Items are rendered 3D.");
-+ }
-+
-+ @Override
-+ public void onButtonClick() {
-+ Configuration.setFancyItems(!Configuration.isFancyItems());
-+ Configuration.write();
-+ ((FancyGraphicsButton)getScreen().getWidget(fancyGraphics)).custom = true;
-+ }
-+}
---- net/minecraft/src/ExceptionRetryCall.java
-+++ net/minecraft/src/ExceptionRetryCall.java
-@@ -3,8 +3,8 @@
- public class ExceptionRetryCall extends ExceptionMcoService {
- public final int field_96393_c;
-
-- public ExceptionRetryCall(int var1) {
-+ public ExceptionRetryCall(int par1) {
- super(503, "Retry operation", -1);
-- this.field_96393_c = var1;
-+ this.field_96393_c = par1;
- }
- }
---- net/minecraft/src/WorldGenSand.java
-+++ net/minecraft/src/WorldGenSand.java
-@@ -3,30 +3,36 @@
- import java.util.Random;
-
- public class WorldGenSand extends WorldGenerator {
-+
-+ /** Stores ID for WorldGenSand */
- private int sandID;
-+
-+ /** The maximum radius used when generating a patch of blocks. */
- private int radius;
-
-- public WorldGenSand(int var1, int var2) {
-- this.sandID = var2;
-- this.radius = var1;
-+ public WorldGenSand(int par1, int par2) {
-+ this.sandID = par2;
-+ this.radius = par1;
- }
-
-- public boolean generate(World var1, Random var2, int var3, int var4, int var5) {
-- if(var1.getBlockMaterial(var3, var4, var5) != Material.water) {
-+ public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5) {
-+ if (par1World.getBlockMaterial(par3, par4, par5) != Material.water) {
- return false;
- } else {
-- int var6 = var2.nextInt(this.radius - 2) + 2;
-+ int var6 = par2Random.nextInt(this.radius - 2) + 2;
- byte var7 = 2;
-
-- for(int var8 = var3 - var6; var8 <= var3 + var6; ++var8) {
-- for(int var9 = var5 - var6; var9 <= var5 + var6; ++var9) {
-- int var10 = var8 - var3;
-- int var11 = var9 - var5;
-- if(var10 * var10 + var11 * var11 <= var6 * var6) {
-- for(int var12 = var4 - var7; var12 <= var4 + var7; ++var12) {
-- int var13 = var1.getBlockId(var8, var12, var9);
-- if(var13 == Block.dirt.blockID || var13 == Block.grass.blockID) {
-- var1.setBlock(var8, var12, var9, this.sandID, 0, 2);
-+ for (int var8 = par3 - var6; var8 <= par3 + var6; ++var8) {
-+ for (int var9 = par5 - var6; var9 <= par5 + var6; ++var9) {
-+ int var10 = var8 - par3;
-+ int var11 = var9 - par5;
-+
-+ if (var10 * var10 + var11 * var11 <= var6 * var6) {
-+ for (int var12 = par4 - var7; var12 <= par4 + var7; ++var12) {
-+ int var13 = par1World.getBlockId(var8, var12, var9);
-+
-+ if (var13 == Block.dirt.blockID || var13 == Block.grass.blockID) {
-+ par1World.setBlock(var8, var12, var9, this.sandID, 0, 2);
- }
- }
- }
---- net/minecraft/src/RenderLiving.java
-+++ net/minecraft/src/RenderLiving.java
-@@ -2,108 +2,117 @@
-
- import org.lwjgl.opengl.GL11;
-
-+import com.prupe.mcpatcher.mob.LineRenderer;
-+
- public abstract class RenderLiving extends RendererLivingEntity {
-- public RenderLiving(ModelBase var1, float var2) {
-- super(var1, var2);
-- }
--
-- protected boolean func_130007_b(EntityLiving var1) {
-- return super.func_110813_b(var1) && (var1.getAlwaysRenderNameTagForRender() || var1.hasCustomNameTag() && var1 == this.renderManager.field_96451_i);
-- }
--
-- public void doRenderLiving(EntityLiving var1, double var2, double var4, double var6, float var8, float var9) {
-- super.doRenderLiving(var1, var2, var4, var6, var8, var9);
-- this.func_110827_b(var1, var2, var4, var6, var8, var9);
-- }
--
-- private double func_110828_a(double var1, double var3, double var5) {
-- return var1 + (var3 - var1) * var5;
-- }
--
-- protected void func_110827_b(EntityLiving var1, double var2, double var4, double var6, float var8, float var9) {
-- Entity var10 = var1.getLeashedToEntity();
-- if(var10 != null) {
-- var4 -= (1.6D - (double)var1.height) * 0.5D;
-+ public RenderLiving(ModelBase par1ModelBase, float par2) {
-+ super(par1ModelBase, par2);
-+ }
-+
-+ protected boolean func_130007_b(EntityLiving par1EntityLiving) {
-+ return super.specialRender(par1EntityLiving) && (par1EntityLiving.getAlwaysRenderNameTagForRender() || par1EntityLiving.hasCustomNameTag() && par1EntityLiving == this.renderManager.field_96451_i);
-+ }
-+
-+ public void doRenderLiving(EntityLiving par1EntityLiving, double par2, double par4, double par6, float par8, float par9) {
-+ super.doRenderLiving(par1EntityLiving, par2, par4, par6, par8, par9);
-+ this.func_110827_b(par1EntityLiving, par2, par4, par6, par8, par9);
-+ }
-+
-+ private double func_110828_a(double par1, double par3, double par5) {
-+ return par1 + (par3 - par1) * par5;
-+ }
-+
-+ protected void func_110827_b(EntityLiving par1EntityLiving, double par2, double par4, double par6, float par8, float par9) {
-+ Entity var10 = par1EntityLiving.getLeashedToEntity();
-+
-+ if (var10 != null) {
-+ par4 -= (1.6D - (double)par1EntityLiving.height) * 0.5D;
- Tessellator var11 = Tessellator.instance;
-- double var12 = this.func_110828_a((double)var10.prevRotationYaw, (double)var10.rotationYaw, (double)(var9 * 0.5F)) * (double)0.017453292F;
-- double var14 = this.func_110828_a((double)var10.prevRotationPitch, (double)var10.rotationPitch, (double)(var9 * 0.5F)) * (double)0.017453292F;
-+ double var12 = this.func_110828_a((double)var10.prevRotationYaw, (double)var10.rotationYaw, (double)(par9 * 0.5F)) * 0.01745329238474369D;
-+ double var14 = this.func_110828_a((double)var10.prevRotationPitch, (double)var10.rotationPitch, (double)(par9 * 0.5F)) * 0.01745329238474369D;
- double var16 = Math.cos(var12);
- double var18 = Math.sin(var12);
- double var20 = Math.sin(var14);
-- if(var10 instanceof EntityHanging) {
-+
-+ if (var10 instanceof EntityHanging) {
- var16 = 0.0D;
- var18 = 0.0D;
- var20 = -1.0D;
- }
-
- double var22 = Math.cos(var14);
-- double var24 = this.func_110828_a(var10.prevPosX, var10.posX, (double)var9) - var16 * 0.7D - var18 * 0.5D * var22;
-- double var26 = this.func_110828_a(var10.prevPosY + (double)var10.getEyeHeight() * 0.7D, var10.posY + (double)var10.getEyeHeight() * 0.7D, (double)var9) - var20 * 0.5D - 0.25D;
-- double var28 = this.func_110828_a(var10.prevPosZ, var10.posZ, (double)var9) - var18 * 0.7D + var16 * 0.5D * var22;
-- double var30 = this.func_110828_a((double)var1.prevRenderYawOffset, (double)var1.renderYawOffset, (double)var9) * (double)0.017453292F + Math.PI * 0.5D;
-- var16 = Math.cos(var30) * (double)var1.width * 0.4D;
-- var18 = Math.sin(var30) * (double)var1.width * 0.4D;
-- double var32 = this.func_110828_a(var1.prevPosX, var1.posX, (double)var9) + var16;
-- double var34 = this.func_110828_a(var1.prevPosY, var1.posY, (double)var9);
-- double var36 = this.func_110828_a(var1.prevPosZ, var1.posZ, (double)var9) + var18;
-- var2 += var16;
-- var6 += var18;
-+ double var24 = this.func_110828_a(var10.prevPosX, var10.posX, (double)par9) - var16 * 0.7D - var18 * 0.5D * var22;
-+ double var26 = this.func_110828_a(var10.prevPosY + (double)var10.getEyeHeight() * 0.7D, var10.posY + (double)var10.getEyeHeight() * 0.7D, (double)par9) - var20 * 0.5D - 0.25D;
-+ double var28 = this.func_110828_a(var10.prevPosZ, var10.posZ, (double)par9) - var18 * 0.7D + var16 * 0.5D * var22;
-+ double var30 = this.func_110828_a((double)par1EntityLiving.prevRenderYawOffset, (double)par1EntityLiving.renderYawOffset, (double)par9) * 0.01745329238474369D + (Math.PI / 2D);
-+ var16 = Math.cos(var30) * (double)par1EntityLiving.width * 0.4D;
-+ var18 = Math.sin(var30) * (double)par1EntityLiving.width * 0.4D;
-+ double var32 = this.func_110828_a(par1EntityLiving.prevPosX, par1EntityLiving.posX, (double)par9) + var16;
-+ double var34 = this.func_110828_a(par1EntityLiving.prevPosY, par1EntityLiving.posY, (double)par9);
-+ double var36 = this.func_110828_a(par1EntityLiving.prevPosZ, par1EntityLiving.posZ, (double)par9) + var18;
-+ par2 += var16;
-+ par6 += var18;
- double var38 = (double)((float)(var24 - var32));
- double var40 = (double)((float)(var26 - var34));
- double var42 = (double)((float)(var28 - var36));
-- GL11.glDisable(GL11.GL_TEXTURE_2D);
-- GL11.glDisable(GL11.GL_LIGHTING);
-- GL11.glDisable(GL11.GL_CULL_FACE);
-- boolean var44 = true;
-- double var45 = 0.025D;
-- var11.startDrawing(5);
--
-- int var47;
-- float var48;
-- for(var47 = 0; var47 <= 24; ++var47) {
-- if(var47 % 2 == 0) {
-- var11.setColorRGBA_F(0.5F, 0.4F, 0.3F, 1.0F);
-- } else {
-- var11.setColorRGBA_F(0.35F, 0.28F, 0.21000001F, 1.0F);
-- }
--
-- var48 = (float)var47 / 24.0F;
-- var11.addVertex(var2 + var38 * (double)var48 + 0.0D, var4 + var40 * (double)(var48 * var48 + var48) * 0.5D + (double)((24.0F - (float)var47) / 18.0F + 2.0F / 16.0F), var6 + var42 * (double)var48);
-- var11.addVertex(var2 + var38 * (double)var48 + 0.025D, var4 + var40 * (double)(var48 * var48 + var48) * 0.5D + (double)((24.0F - (float)var47) / 18.0F + 2.0F / 16.0F) + 0.025D, var6 + var42 * (double)var48);
-- }
--
-- var11.draw();
-- var11.startDrawing(5);
--
-- for(var47 = 0; var47 <= 24; ++var47) {
-- if(var47 % 2 == 0) {
-- var11.setColorRGBA_F(0.5F, 0.4F, 0.3F, 1.0F);
-- } else {
-- var11.setColorRGBA_F(0.35F, 0.28F, 0.21000001F, 1.0F);
-- }
--
-- var48 = (float)var47 / 24.0F;
-- var11.addVertex(var2 + var38 * (double)var48 + 0.0D, var4 + var40 * (double)(var48 * var48 + var48) * 0.5D + (double)((24.0F - (float)var47) / 18.0F + 2.0F / 16.0F) + 0.025D, var6 + var42 * (double)var48);
-- var11.addVertex(var2 + var38 * (double)var48 + 0.025D, var4 + var40 * (double)(var48 * var48 + var48) * 0.5D + (double)((24.0F - (float)var47) / 18.0F + 2.0F / 16.0F), var6 + var42 * (double)var48 + 0.025D);
-- }
--
-- var11.draw();
-- GL11.glEnable(GL11.GL_LIGHTING);
-- GL11.glEnable(GL11.GL_TEXTURE_2D);
-+
-+ if (!LineRenderer.renderLine(1, par2, par4, par6, var38, var40, var42)) {
-+ GL11.glDisable(GL11.GL_TEXTURE_2D);
-+ GL11.glDisable(GL11.GL_LIGHTING);
-+ GL11.glDisable(GL11.GL_CULL_FACE);
-+ boolean var44 = true;
-+ double var45 = 0.025D;
-+ var11.startDrawing(5);
-+ int var47;
-+ float var48;
-+
-+ for (var47 = 0; var47 <= 24; ++var47) {
-+ if (var47 % 2 == 0) {
-+ var11.setColorRGBA_F(0.5F, 0.4F, 0.3F, 1.0F);
-+ } else {
-+ var11.setColorRGBA_F(0.35F, 0.28F, 0.21000001F, 1.0F);
-+ }
-+
-+ var48 = (float)var47 / 24.0F;
-+ var11.addVertex(par2 + var38 * (double)var48 + 0.0D, par4 + var40 * (double)(var48 * var48 + var48) * 0.5D + (double)((24.0F - (float)var47) / 18.0F + 0.125F), par6 + var42 * (double)var48);
-+ var11.addVertex(par2 + var38 * (double)var48 + 0.025D, par4 + var40 * (double)(var48 * var48 + var48) * 0.5D + (double)((24.0F - (float)var47) / 18.0F + 0.125F) + 0.025D, par6 + var42 * (double)var48);
-+ }
-+
-+ var11.draw();
-+ var11.startDrawing(5);
-+
-+ for (var47 = 0; var47 <= 24; ++var47) {
-+ if (var47 % 2 == 0) {
-+ var11.setColorRGBA_F(0.5F, 0.4F, 0.3F, 1.0F);
-+ } else {
-+ var11.setColorRGBA_F(0.35F, 0.28F, 0.21000001F, 1.0F);
-+ }
-+
-+ var48 = (float)var47 / 24.0F;
-+ var11.addVertex(par2 + var38 * (double)var48 + 0.0D, par4 + var40 * (double)(var48 * var48 + var48) * 0.5D + (double)((24.0F - (float)var47) / 18.0F + 0.125F) + 0.025D, par6 + var42 * (double)var48);
-+ var11.addVertex(par2 + var38 * (double)var48 + 0.025D, par4 + var40 * (double)(var48 * var48 + var48) * 0.5D + (double)((24.0F - (float)var47) / 18.0F + 0.125F), par6 + var42 * (double)var48 + 0.025D);
-+ }
-+
-+ var11.draw();
-+ GL11.glEnable(GL11.GL_LIGHTING);
-+ GL11.glEnable(GL11.GL_TEXTURE_2D);
-+ }
-+
- GL11.glEnable(GL11.GL_CULL_FACE);
- }
--
-- }
--
-- protected boolean func_110813_b(EntityLivingBase var1) {
-- return this.func_130007_b((EntityLiving)var1);
-- }
--
-- public void renderPlayer(EntityLivingBase var1, double var2, double var4, double var6, float var8, float var9) {
-- this.doRenderLiving((EntityLiving)var1, var2, var4, var6, var8, var9);
-- }
--
-- public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) {
-- this.doRenderLiving((EntityLiving)var1, var2, var4, var6, var8, var9);
-+ }
-+
-+ public void renderPlayer(EntityLivingBase par1EntityLivingBase, double par2, double par4, double par6, float par8, float par9) {
-+ this.doRenderLiving((EntityLiving)par1EntityLivingBase, par2, par4, par6, par8, par9);
-+ }
-+
-+ /**
-+ * 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= 10) {
-+
-+ if (var1 >= 10) {
- return;
- }
- }
- }
--
- }
-
-- public void doPreChunk(int var1, int var2, boolean var3) {
-- if(var3) {
-- this.clientChunkProvider.loadChunk(var1, var2);
-+ public void doPreChunk(int par1, int par2, boolean par3) {
-+ if (par3) {
-+ this.clientChunkProvider.loadChunk(par1, par2);
-+ // Spout Start
-+ SpoutClient.getInstance().getPacketManager().sendSpoutPacket(new PacketCustomBlockChunkOverride(par1, par2));
-+ // Spout End
- } else {
-- this.clientChunkProvider.unloadChunk(var1, var2);
-- }
--
-- if(!var3) {
-- this.markBlockRangeForRenderUpdate(var1 * 16, 0, var2 * 16, var1 * 16 + 15, 256, var2 * 16 + 15);
-- }
--
-+ this.clientChunkProvider.unloadChunk(par1, par2);
-+ }
-+
-+ if (!par3) {
-+ this.markBlockRangeForRenderUpdate(par1 * 16, 0, par2 * 16, par1 * 16 + 15, 256, par2 * 16 + 15);
-+ }
- }
-
-- public boolean spawnEntityInWorld(Entity var1) {
-- boolean var2 = super.spawnEntityInWorld(var1);
-- this.J.add(var1);
-- if(!var2) {
-- this.K.add(var1);
-+ /**
-+ * Called to place all entities as part of a world
-+ */
-+ public boolean spawnEntityInWorld(Entity par1Entity) {
-+ boolean var2 = super.spawnEntityInWorld(par1Entity);
-+ this.entityList.add(par1Entity);
-+
-+ if (!var2) {
-+ this.entitySpawnQueue.add(par1Entity);
- }
-
- return var2;
- }
-
-- public void removeEntity(Entity var1) {
-- super.removeEntity(var1);
-- this.J.remove(var1);
-+ /**
-+ * Schedule the entity for removal during the next tick. Marks the entity dead in anticipation.
-+ */
-+ public void removeEntity(Entity par1Entity) {
-+ super.removeEntity(par1Entity);
-+ this.entityList.remove(par1Entity);
- }
-
-- protected void onEntityAdded(Entity var1) {
-- super.onEntityAdded(var1);
-- if(this.K.contains(var1)) {
-- this.K.remove(var1);
-+ //ToDo: was Spoutcraft obtainEntitySkin
-+ protected void onEntityAdded(Entity par1Entity) {
-+ super.onEntityAdded(par1Entity);
-+
-+ if (this.entitySpawnQueue.contains(par1Entity)) {
-+ this.entitySpawnQueue.remove(par1Entity);
- }
--
- }
-
-- protected void onEntityRemoved(Entity var1) {
-- super.onEntityRemoved(var1);
-- if(this.J.contains(var1)) {
-- if(var1.isEntityAlive()) {
-- this.K.add(var1);
-+ //ToDO: was Spoutcraft releaseEntitySkin
-+ protected void onEntityRemoved(Entity par1Entity) {
-+ super.onEntityRemoved(par1Entity);
-+
-+ if (this.entityList.contains(par1Entity)) {
-+ if (par1Entity.isEntityAlive()) {
-+ this.entitySpawnQueue.add(par1Entity);
- } else {
-- this.J.remove(var1);
-+ this.entityList.remove(par1Entity);
- }
- }
--
- }
-
-- public void addEntityToWorld(int var1, Entity var2) {
-- Entity var3 = this.getEntityByID(var1);
-- if(var3 != null) {
-+
-+ /**
-+ * Add an ID to Entity mapping to entityHashSet
-+ */
-+ public void addEntityToWorld(int par1, Entity par2Entity) {
-+ Entity var3 = this.getEntityByID(par1);
-+
-+ if (var3 != null) {
- this.removeEntity(var3);
- }
-
-- this.J.add(var2);
-- var2.entityId = var1;
-- if(!this.spawnEntityInWorld(var2)) {
-- this.K.add(var2);
-+ this.entityList.add(par2Entity);
-+ par2Entity.entityId = par1;
-+
-+ if (!this.spawnEntityInWorld(par2Entity)) {
-+ this.entitySpawnQueue.add(par2Entity);
- }
-
-- this.entityHashSet.addKey(var1, var2);
-- }
--
-- public Entity getEntityByID(int var1) {
-- return (Entity)(var1 == this.mc.thePlayer.entityId ? this.mc.thePlayer : (Entity)this.entityHashSet.lookup(var1));
-- }
--
-- public Entity removeEntityFromWorld(int var1) {
-- Entity var2 = (Entity)this.entityHashSet.removeObject(var1);
-- if(var2 != null) {
-- this.J.remove(var2);
-+ this.entityHashSet.addKey(par1, par2Entity);
-+ }
-+
-+ /**
-+ * Returns the Entity with the given ID, or null if it doesn't exist in this World.
-+ */
-+ public Entity getEntityByID(int par1) {
-+ return (Entity)(par1 == this.mc.thePlayer.entityId ? this.mc.thePlayer : (Entity)this.entityHashSet.lookup(par1));
-+ }
-+
-+ public Entity removeEntityFromWorld(int par1) {
-+ Entity var2 = (Entity)this.entityHashSet.removeObject(par1);
-+
-+ if (var2 != null) {
-+ this.entityList.remove(var2);
- this.removeEntity(var2);
- }
-
- return var2;
- }
-
-- public boolean setBlockAndMetadataAndInvalidate(int var1, int var2, int var3, int var4, int var5) {
-- this.invalidateBlockReceiveRegion(var1, var2, var3, var1, var2, var3);
-- return super.setBlock(var1, var2, var3, var4, var5, 3);
-+ public boolean setBlockAndMetadataAndInvalidate(int par1, int par2, int par3, int par4, int par5) {
-+ this.invalidateBlockReceiveRegion(par1, par2, par3, par1, par2, par3);
-+ return super.setBlock(par1, par2, par3, par4, par5, 3);
- }
-
-+ /**
-+ * If on MP, sends a quitting packet.
-+ */
- public void sendQuittingDisconnectingPacket() {
- this.sendQueue.quitWithPacket(new Packet255KickDisconnect("Quitting"));
- }
-
-- public IUpdatePlayerListBox getMinecartSoundUpdater(EntityMinecart var1) {
-- return new SoundUpdaterMinecart(this.mc.sndManager, var1, this.mc.thePlayer);
-+ public IUpdatePlayerListBox getMinecartSoundUpdater(EntityMinecart par1EntityMinecart) {
-+ return new SoundUpdaterMinecart(this.mc.sndManager, par1EntityMinecart, this.mc.thePlayer);
- }
-
-+ /**
-+ * Updates all weather states.
-+ */
- protected void updateWeather() {
-- if(!this.provider.hasNoSky) {
-+ if (!this.provider.hasNoSky) {
- this.prevRainingStrength = this.rainingStrength;
-- if(this.worldInfo.isRaining()) {
-+
-+ if (this.worldInfo.isRaining()) {
- this.rainingStrength = (float)((double)this.rainingStrength + 0.01D);
- } else {
- this.rainingStrength = (float)((double)this.rainingStrength - 0.01D);
- }
-
-- if(this.rainingStrength < 0.0F) {
-+ if (this.rainingStrength < 0.0F) {
- this.rainingStrength = 0.0F;
- }
-
-- if(this.rainingStrength > 1.0F) {
-+ if (this.rainingStrength > 1.0F) {
- this.rainingStrength = 1.0F;
- }
-
- this.prevThunderingStrength = this.thunderingStrength;
-- if(this.worldInfo.isThundering()) {
-+
-+ if (this.worldInfo.isThundering()) {
- this.thunderingStrength = (float)((double)this.thunderingStrength + 0.01D);
- } else {
- this.thunderingStrength = (float)((double)this.thunderingStrength - 0.01D);
- }
-
-- if(this.thunderingStrength < 0.0F) {
-+ if (this.thunderingStrength < 0.0F) {
- this.thunderingStrength = 0.0F;
- }
-
-- if(this.thunderingStrength > 1.0F) {
-+ if (this.thunderingStrength > 1.0F) {
- this.thunderingStrength = 1.0F;
- }
--
- }
- }
-
-- public void doVoidFogParticles(int var1, int var2, int var3) {
-+ public void doVoidFogParticles(int par1, int par2, int par3) {
- byte var4 = 16;
- Random var5 = new Random();
-
-- for(int var6 = 0; var6 < 1000; ++var6) {
-- int var7 = var1 + this.s.nextInt(var4) - this.s.nextInt(var4);
-- int var8 = var2 + this.s.nextInt(var4) - this.s.nextInt(var4);
-- int var9 = var3 + this.s.nextInt(var4) - this.s.nextInt(var4);
-+ // Spout Start
-+ int num = Configuration.isFancyParticles() ? 1000 : 250;
-+ for (int var6 = 0; var6 < num; ++var6) {
-+ // Spout End
-+ int var7 = par1 + this.rand.nextInt(var4) - this.rand.nextInt(var4);
-+ int var8 = par2 + this.rand.nextInt(var4) - this.rand.nextInt(var4);
-+ int var9 = par3 + this.rand.nextInt(var4) - this.rand.nextInt(var4);
- int var10 = this.getBlockId(var7, var8, var9);
-- if(var10 == 0 && this.s.nextInt(8) > var8 && this.provider.getWorldHasVoidParticles()) {
-- this.spawnParticle("depthsuspend", (double)((float)var7 + this.s.nextFloat()), (double)((float)var8 + this.s.nextFloat()), (double)((float)var9 + this.s.nextFloat()), 0.0D, 0.0D, 0.0D);
-- } else if(var10 > 0) {
-+
-+ if (var10 == 0 && this.rand.nextInt(8) > var8 && this.provider.getWorldHasVoidParticles()) {
-+ this.spawnParticle("depthsuspend", (double)((float)var7 + this.rand.nextFloat()), (double)((float)var8 + this.rand.nextFloat()), (double)((float)var9 + this.rand.nextFloat()), 0.0D, 0.0D, 0.0D);
-+ } else if (var10 > 0) {
- Block.blocksList[var10].randomDisplayTick(this, var7, var8, var9, var5);
- }
- }
--
- }
-
-+ /**
-+ * also releases skins.
-+ */
- public void removeAllEntities() {
-- this.e.removeAll(this.f);
--
-+ this.loadedEntityList.removeAll(this.unloadedEntityList);
- int var1;
- Entity var2;
- int var3;
- int var4;
-- for(var1 = 0; var1 < this.f.size(); ++var1) {
-- var2 = (Entity)this.f.get(var1);
-+
-+ for (var1 = 0; var1 < this.unloadedEntityList.size(); ++var1) {
-+ var2 = (Entity)this.unloadedEntityList.get(var1);
- var3 = var2.chunkCoordX;
- var4 = var2.chunkCoordZ;
-- if(var2.addedToChunk && this.chunkExists(var3, var4)) {
-+
-+ if (var2.addedToChunk && this.chunkExists(var3, var4)) {
- this.getChunkFromChunkCoords(var3, var4).removeEntity(var2);
- }
- }
-
-- for(var1 = 0; var1 < this.f.size(); ++var1) {
-- this.onEntityRemoved((Entity)this.f.get(var1));
-+ for (var1 = 0; var1 < this.unloadedEntityList.size(); ++var1) {
-+ this.onEntityRemoved((Entity)this.unloadedEntityList.get(var1));
- }
-
-- this.f.clear();
--
-- for(var1 = 0; var1 < this.e.size(); ++var1) {
-- var2 = (Entity)this.e.get(var1);
-- if(var2.ridingEntity != null) {
-- if(!var2.ridingEntity.isDead && var2.ridingEntity.riddenByEntity == var2) {
-+ this.unloadedEntityList.clear();
-+
-+ for (var1 = 0; var1 < this.loadedEntityList.size(); ++var1) {
-+ var2 = (Entity)this.loadedEntityList.get(var1);
-+
-+ if (var2.ridingEntity != null) {
-+ if (!var2.ridingEntity.isDead && var2.ridingEntity.riddenByEntity == var2) {
- continue;
- }
-
-@@ -261,22 +332,25 @@
- var2.ridingEntity = null;
- }
-
-- if(var2.isDead) {
-+ if (var2.isDead) {
- var3 = var2.chunkCoordX;
- var4 = var2.chunkCoordZ;
-- if(var2.addedToChunk && this.chunkExists(var3, var4)) {
-+
-+ if (var2.addedToChunk && this.chunkExists(var3, var4)) {
- this.getChunkFromChunkCoords(var3, var4).removeEntity(var2);
- }
-
-- this.e.remove(var1--);
-+ this.loadedEntityList.remove(var1--);
- this.onEntityRemoved(var2);
- }
- }
--
- }
-
-- public CrashReportCategory addWorldInfoToCrashReport(CrashReport var1) {
-- CrashReportCategory var2 = super.addWorldInfoToCrashReport(var1);
-+ /**
-+ * Adds some basic stats of the world to the given crash report.
-+ */
-+ public CrashReportCategory addWorldInfoToCrashReport(CrashReport par1CrashReport) {
-+ CrashReportCategory var2 = super.addWorldInfoToCrashReport(par1CrashReport);
- var2.addCrashSectionCallable("Forced entities", new CallableMPL1(this));
- var2.addCrashSectionCallable("Retry entities", new CallableMPL2(this));
- var2.addCrashSectionCallable("Server brand", new WorldClientINNER3(this));
-@@ -284,52 +358,59 @@
- return var2;
- }
-
-- public void playSound(double var1, double var3, double var5, String var7, float var8, float var9, boolean var10) {
-+ /**
-+ * par8 is loudness, all pars passed to minecraftInstance.sndManager.playSound
-+ */
-+ public void playSound(double par1, double par3, double par5, String par7Str, float par8, float par9, boolean par10) {
- float var11 = 16.0F;
-- if(var8 > 1.0F) {
-- var11 *= var8;
-+
-+ if (par8 > 1.0F) {
-+ var11 *= par8;
- }
-
-- double var12 = this.mc.renderViewEntity.getDistanceSq(var1, var3, var5);
-- if(var12 < (double)(var11 * var11)) {
-- if(var10 && var12 > 100.0D) {
-+ double var12 = this.mc.renderViewEntity.getDistanceSq(par1, par3, par5);
-+
-+ if (var12 < (double)(var11 * var11)) {
-+ if (par10 && var12 > 100.0D) {
- double var14 = Math.sqrt(var12) / 40.0D;
-- this.mc.sndManager.func_92070_a(var7, (float)var1, (float)var3, (float)var5, var8, var9, (int)Math.round(var14 * 20.0D));
-+ this.mc.sndManager.func_92070_a(par7Str, (float)par1, (float)par3, (float)par5, par8, par9, (int)Math.round(var14 * 20.0D));
- } else {
-- this.mc.sndManager.playSound(var7, (float)var1, (float)var3, (float)var5, var8, var9);
-+ this.mc.sndManager.playSound(par7Str, (float)par1, (float)par3, (float)par5, par8, par9);
- }
- }
--
-- }
--
-- public void func_92088_a(double var1, double var3, double var5, double var7, double var9, double var11, NBTTagCompound var13) {
-- this.mc.effectRenderer.addEffect(new EntityFireworkStarterFX(this, var1, var3, var5, var7, var9, var11, this.mc.effectRenderer, var13));
-- }
--
-- public void func_96443_a(Scoreboard var1) {
-- this.worldScoreboard = var1;
-- }
--
-- public void setWorldTime(long var1) {
-- if(var1 < 0L) {
-- var1 = -var1;
-+ }
-+
-+ public void func_92088_a(double par1, double par3, double par5, double par7, double par9, double par11, NBTTagCompound par13NBTTagCompound) {
-+ this.mc.effectRenderer.addEffect(new EntityFireworkStarterFX(this, par1, par3, par5, par7, par9, par11, this.mc.effectRenderer, par13NBTTagCompound));
-+ }
-+
-+ public void func_96443_a(Scoreboard par1Scoreboard) {
-+ this.worldScoreboard = par1Scoreboard;
-+ }
-+
-+ /**
-+ * Sets the world time.
-+ */
-+ public void setWorldTime(long par1) {
-+ if (par1 < 0L) {
-+ par1 = -par1;
- this.getGameRules().setOrCreateGameRule("doDaylightCycle", "false");
- } else {
- this.getGameRules().setOrCreateGameRule("doDaylightCycle", "true");
- }
-
-- super.setWorldTime(var1);
-- }
--
-- static Set getEntityList(WorldClient var0) {
-- return var0.J;
-- }
--
-- static Set getEntitySpawnQueue(WorldClient var0) {
-- return var0.K;
-- }
--
-- static Minecraft func_142030_c(WorldClient var0) {
-- return var0.mc;
-+ super.setWorldTime(par1);
-+ }
-+
-+ static Set getEntityList(WorldClient par0WorldClient) {
-+ return par0WorldClient.entityList;
-+ }
-+
-+ static Set getEntitySpawnQueue(WorldClient par0WorldClient) {
-+ return par0WorldClient.entitySpawnQueue;
-+ }
-+
-+ static Minecraft func_142030_c(WorldClient par0WorldClient) {
-+ return par0WorldClient.mc;
- }
- }
---- /dev/null
-+++ org/spoutcraft/client/gui/minimap/CoordsToggleCheckBox.java
-@@ -1,0 +1,45 @@
-+/*
-+ * This file is part of Spoutcraft.
-+ *
-+ * Copyright (c) 2011 SpoutcraftDev
-+ * Spoutcraft is licensed under the GNU Lesser General Public License.
-+ *
-+ * Spoutcraft is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation, either version 3 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Spoutcraft is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program. If not, see .
-+ */
-+package org.spoutcraft.client.gui.minimap;
-+
-+import org.spoutcraft.api.gui.GenericCheckBox;
-+import org.spoutcraft.client.SpoutClient;
-+
-+public class CoordsToggleCheckBox extends GenericCheckBox {
-+ public CoordsToggleCheckBox() {
-+ super("Show Coordinates");
-+ setChecked(MinimapConfig.getInstance().isCoords());
-+ setEnabled(SpoutClient.getInstance().isCoordsCheat());
-+ setTooltip("Minimap Enabled\nEnables or disables the minimap on the HUD.");
-+ }
-+
-+ @Override
-+ public String getTooltip() {
-+ if (!isEnabled()) {
-+ return "This option is not allowed by your server, it is considered cheating.\nContact your admins if you feel this is an error.";
-+ }
-+ return super.getTooltip();
-+ }
-+
-+ @Override
-+ public void onButtonClick() {
-+ MinimapConfig.getInstance().setCoords(isChecked());
-+ }
-+}
---- /dev/null
-+++ org/spoutcraft/api/inventory/Recipe.java
-@@ -1,0 +1,31 @@
-+/*
-+ * This file is part of Spoutcraft.
-+ *
-+ * Copyright (c) 2011 SpoutcraftDev
-+ * Spoutcraft is licensed under the GNU Lesser General Public License.
-+ *
-+ * Spoutcraft is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation, either version 3 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Spoutcraft is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program. If not, see .
-+ */
-+package org.spoutcraft.api.inventory;
-+
-+/**
-+ * Represents some type of crafting recipe.
-+ */
-+public interface Recipe {
-+ /**
-+ * Get the result of this recipe.
-+ * @return The result stack
-+ */
-+ ItemStack getResult();
-+}
---- net/minecraft/src/ItemColored.java
-+++ net/minecraft/src/ItemColored.java
-@@ -1,41 +1,55 @@
- package net.minecraft.src;
-
- public class ItemColored extends ItemBlock {
-- private final Block blockRef = Block.blocksList[this.getBlockID()];
-- private String[] b;
--
-- public ItemColored(int var1, boolean var2) {
-- super(var1);
-- if(var2) {
-+ private final Block blockRef;
-+ private String[] blockNames;
-+
-+ public ItemColored(int par1, boolean par2) {
-+ super(par1);
-+ this.blockRef = Block.blocksList[this.getBlockID()];
-+
-+ if (par2) {
- this.setMaxDamage(0);
- this.setHasSubtypes(true);
- }
--
-- }
--
-- public int getColorFromItemStack(ItemStack var1, int var2) {
-- return this.blockRef.getRenderColor(var1.getItemDamage());
-- }
--
-- public Icon getIconFromDamage(int var1) {
-- return this.blockRef.getIcon(0, var1);
-- }
--
-- public int getMetadata(int var1) {
-- return var1;
-- }
--
-- public ItemColored setBlockNames(String[] var1) {
-- this.b = var1;
-+ }
-+
-+ 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) {
-+ return par1;
-+ }
-+
-+ /**
-+ * Sets the array of strings to be used for name lookups from item damage to metadata
-+ */
-+ public ItemColored setBlockNames(String[] par1ArrayOfStr) {
-+ this.blockNames = par1ArrayOfStr;
- return this;
- }
-
-- public String getUnlocalizedName(ItemStack var1) {
-- if(this.b == null) {
-- return super.getUnlocalizedName(var1);
-+ /**
-+ * 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) {
-+ if (this.blockNames == null) {
-+ return super.getUnlocalizedName(par1ItemStack);
- } else {
-- int var2 = var1.getItemDamage();
-- return var2 >= 0 && var2 < this.b.length ? super.getUnlocalizedName(var1) + "." + this.b[var2] : super.getUnlocalizedName(var1);
-+ int var2 = par1ItemStack.getItemDamage();
-+ return var2 >= 0 && var2 < this.blockNames.length ? super.getUnlocalizedName(par1ItemStack) + "." + this.blockNames[var2] : super.getUnlocalizedName(par1ItemStack);
- }
- }
- }
---- net/minecraft/src/ComponentStrongholdRoomCrossing.java
-+++ net/minecraft/src/ComponentStrongholdRoomCrossing.java
-@@ -4,128 +4,142 @@
- import java.util.Random;
-
- public class ComponentStrongholdRoomCrossing extends ComponentStronghold {
-- private static final WeightedRandomChestContent[] strongholdRoomCrossingChestContents = new WeightedRandomChestContent[]{new WeightedRandomChestContent(Item.ingotIron.itemID, 0, 1, 5, 10), new WeightedRandomChestContent(Item.ingotGold.itemID, 0, 1, 3, 5), new WeightedRandomChestContent(Item.redstone.itemID, 0, 4, 9, 5), new WeightedRandomChestContent(Item.coal.itemID, 0, 3, 8, 10), new WeightedRandomChestContent(Item.bread.itemID, 0, 1, 3, 15), new WeightedRandomChestContent(Item.appleRed.itemID, 0, 1, 3, 15), new WeightedRandomChestContent(Item.pickaxeIron.itemID, 0, 1, 1, 1)};
-+
-+ /**
-+ * Items that could generate in the chest that is located in Stronghold Room Crossing.
-+ */
-+ private static final WeightedRandomChestContent[] strongholdRoomCrossingChestContents = new WeightedRandomChestContent[] {new WeightedRandomChestContent(Item.ingotIron.itemID, 0, 1, 5, 10), new WeightedRandomChestContent(Item.ingotGold.itemID, 0, 1, 3, 5), new WeightedRandomChestContent(Item.redstone.itemID, 0, 4, 9, 5), new WeightedRandomChestContent(Item.coal.itemID, 0, 3, 8, 10), new WeightedRandomChestContent(Item.bread.itemID, 0, 1, 3, 15), new WeightedRandomChestContent(Item.appleRed.itemID, 0, 1, 3, 15), new WeightedRandomChestContent(Item.pickaxeIron.itemID, 0, 1, 1, 1)};
- protected int roomType;
-
-- public ComponentStrongholdRoomCrossing() {
-- }
--
-- public ComponentStrongholdRoomCrossing(int var1, Random var2, StructureBoundingBox var3, int var4) {
-- super(var1);
-- this.coordBaseMode = var4;
-- this.field_143013_d = this.getRandomDoor(var2);
-- this.boundingBox = var3;
-- this.roomType = var2.nextInt(5);
-- }
--
-- protected void func_143012_a(NBTTagCompound var1) {
-- super.func_143012_a(var1);
-- var1.setInteger("Type", this.roomType);
-- }
--
-- protected void func_143011_b(NBTTagCompound var1) {
-- super.func_143011_b(var1);
-- this.roomType = var1.getInteger("Type");
-- }
--
-- public void buildComponent(StructureComponent var1, List var2, Random var3) {
-- this.getNextComponentNormal((ComponentStrongholdStairs2)var1, var2, var3, 4, 1);
-- this.getNextComponentX((ComponentStrongholdStairs2)var1, var2, var3, 1, 4);
-- this.getNextComponentZ((ComponentStrongholdStairs2)var1, var2, var3, 1, 4);
-- }
--
-- public static ComponentStrongholdRoomCrossing findValidPlacement(List var0, Random var1, int var2, int var3, int var4, int var5, int var6) {
-- StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(var2, var3, var4, -4, -1, 0, 11, 7, 11, var5);
-- return canStrongholdGoDeeper(var7) && StructureComponent.findIntersecting(var0, var7) == null ? new ComponentStrongholdRoomCrossing(var6, var1, var7, var5) : null;
-- }
--
-- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) {
-- if(this.isLiquidInStructureBoundingBox(var1, var3)) {
-+ public ComponentStrongholdRoomCrossing() {}
-+
-+ public ComponentStrongholdRoomCrossing(int par1, Random par2Random, StructureBoundingBox par3StructureBoundingBox, int par4) {
-+ super(par1);
-+ this.coordBaseMode = par4;
-+ this.field_143013_d = this.getRandomDoor(par2Random);
-+ this.boundingBox = par3StructureBoundingBox;
-+ this.roomType = par2Random.nextInt(5);
-+ }
-+
-+ protected void func_143012_a(NBTTagCompound par1NBTTagCompound) {
-+ super.func_143012_a(par1NBTTagCompound);
-+ par1NBTTagCompound.setInteger("Type", this.roomType);
-+ }
-+
-+ protected void func_143011_b(NBTTagCompound par1NBTTagCompound) {
-+ super.func_143011_b(par1NBTTagCompound);
-+ this.roomType = par1NBTTagCompound.getInteger("Type");
-+ }
-+
-+ /**
-+ * Initiates construction of the Structure Component picked, at the current Location of StructGen
-+ */
-+ public void buildComponent(StructureComponent par1StructureComponent, List par2List, Random par3Random) {
-+ this.getNextComponentNormal((ComponentStrongholdStairs2)par1StructureComponent, par2List, par3Random, 4, 1);
-+ this.getNextComponentX((ComponentStrongholdStairs2)par1StructureComponent, par2List, par3Random, 1, 4);
-+ this.getNextComponentZ((ComponentStrongholdStairs2)par1StructureComponent, par2List, par3Random, 1, 4);
-+ }
-+
-+ public static ComponentStrongholdRoomCrossing findValidPlacement(List par0List, Random par1Random, int par2, int par3, int par4, int par5, int par6) {
-+ StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(par2, par3, par4, -4, -1, 0, 11, 7, 11, par5);
-+ return canStrongholdGoDeeper(var7) && StructureComponent.findIntersecting(par0List, var7) == null ? new ComponentStrongholdRoomCrossing(par6, par1Random, var7, par5) : null;
-+ }
-+
-+ /**
-+ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the
-+ * end, it adds Fences...
-+ */
-+ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) {
-+ if (this.isLiquidInStructureBoundingBox(par1World, par3StructureBoundingBox)) {
- return false;
- } else {
-- this.fillWithRandomizedBlocks(var1, var3, 0, 0, 0, 10, 6, 10, true, var2, StructureStrongholdPieces.getStrongholdStones());
-- this.placeDoor(var1, var2, var3, this.field_143013_d, 4, 1, 0);
-- this.fillWithBlocks(var1, var3, 4, 1, 10, 6, 3, 10, 0, 0, false);
-- this.fillWithBlocks(var1, var3, 0, 1, 4, 0, 3, 6, 0, 0, false);
-- this.fillWithBlocks(var1, var3, 10, 1, 4, 10, 3, 6, 0, 0, false);
-+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 10, 6, 10, true, par2Random, StructureStrongholdPieces.getStrongholdStones());
-+ this.placeDoor(par1World, par2Random, par3StructureBoundingBox, this.field_143013_d, 4, 1, 0);
-+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 1, 10, 6, 3, 10, 0, 0, false);
-+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 1, 4, 0, 3, 6, 0, 0, false);
-+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 10, 1, 4, 10, 3, 6, 0, 0, false);
- int var4;
-- switch(this.roomType) {
-- case 0:
-- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 5, 1, 5, var3);
-- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 5, 2, 5, var3);
-- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 5, 3, 5, var3);
-- this.placeBlockAtCurrentPosition(var1, Block.torchWood.blockID, 0, 4, 3, 5, var3);
-- this.placeBlockAtCurrentPosition(var1, Block.torchWood.blockID, 0, 6, 3, 5, var3);
-- this.placeBlockAtCurrentPosition(var1, Block.torchWood.blockID, 0, 5, 3, 4, var3);
-- this.placeBlockAtCurrentPosition(var1, Block.torchWood.blockID, 0, 5, 3, 6, var3);
-- this.placeBlockAtCurrentPosition(var1, Block.stoneSingleSlab.blockID, 0, 4, 1, 4, var3);
-- this.placeBlockAtCurrentPosition(var1, Block.stoneSingleSlab.blockID, 0, 4, 1, 5, var3);
-- this.placeBlockAtCurrentPosition(var1, Block.stoneSingleSlab.blockID, 0, 4, 1, 6, var3);
-- this.placeBlockAtCurrentPosition(var1, Block.stoneSingleSlab.blockID, 0, 6, 1, 4, var3);
-- this.placeBlockAtCurrentPosition(var1, Block.stoneSingleSlab.blockID, 0, 6, 1, 5, var3);
-- this.placeBlockAtCurrentPosition(var1, Block.stoneSingleSlab.blockID, 0, 6, 1, 6, var3);
-- this.placeBlockAtCurrentPosition(var1, Block.stoneSingleSlab.blockID, 0, 5, 1, 4, var3);
-- this.placeBlockAtCurrentPosition(var1, Block.stoneSingleSlab.blockID, 0, 5, 1, 6, var3);
-- break;
-- case 1:
-- for(var4 = 0; var4 < 5; ++var4) {
-- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 3, 1, 3 + var4, var3);
-- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 7, 1, 3 + var4, var3);
-- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 3 + var4, 1, 3, var3);
-- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 3 + var4, 1, 7, var3);
-- }
--
-- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 5, 1, 5, var3);
-- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 5, 2, 5, var3);
-- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 5, 3, 5, var3);
-- this.placeBlockAtCurrentPosition(var1, Block.waterMoving.blockID, 0, 5, 4, 5, var3);
-- break;
-- case 2:
-- for(var4 = 1; var4 <= 9; ++var4) {
-- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 1, 3, var4, var3);
-- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 9, 3, var4, var3);
-- }
--
-- for(var4 = 1; var4 <= 9; ++var4) {
-- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, var4, 3, 1, var3);
-- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, var4, 3, 9, var3);
-- }
--
-- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 5, 1, 4, var3);
-- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 5, 1, 6, var3);
-- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 5, 3, 4, var3);
-- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 5, 3, 6, var3);
-- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 4, 1, 5, var3);
-- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 6, 1, 5, var3);
-- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 4, 3, 5, var3);
-- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 6, 3, 5, var3);
--
-- for(var4 = 1; var4 <= 3; ++var4) {
-- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 4, var4, 4, var3);
-- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 6, var4, 4, var3);
-- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 4, var4, 6, var3);
-- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 6, var4, 6, var3);
-- }
--
-- this.placeBlockAtCurrentPosition(var1, Block.torchWood.blockID, 0, 5, 3, 5, var3);
--
-- for(var4 = 2; var4 <= 8; ++var4) {
-- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 2, 3, var4, var3);
-- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 3, 3, var4, var3);
-- if(var4 <= 3 || var4 >= 7) {
-- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 4, 3, var4, var3);
-- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 5, 3, var4, var3);
-- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 6, 3, var4, var3);
-- }
--
-- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 7, 3, var4, var3);
-- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 8, 3, var4, var3);
-- }
--
-- this.placeBlockAtCurrentPosition(var1, Block.ladder.blockID, this.getMetadataWithOffset(Block.ladder.blockID, 4), 9, 1, 3, var3);
-- this.placeBlockAtCurrentPosition(var1, Block.ladder.blockID, this.getMetadataWithOffset(Block.ladder.blockID, 4), 9, 2, 3, var3);
-- this.placeBlockAtCurrentPosition(var1, Block.ladder.blockID, this.getMetadataWithOffset(Block.ladder.blockID, 4), 9, 3, 3, var3);
-- this.generateStructureChestContents(var1, var3, var2, 3, 4, 8, WeightedRandomChestContent.func_92080_a(strongholdRoomCrossingChestContents, new WeightedRandomChestContent[]{Item.enchantedBook.func_92114_b(var2)}), 1 + var2.nextInt(4));
-+
-+ switch (this.roomType) {
-+ case 0:
-+ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 5, 1, 5, par3StructureBoundingBox);
-+ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 5, 2, 5, par3StructureBoundingBox);
-+ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 5, 3, 5, par3StructureBoundingBox);
-+ this.placeBlockAtCurrentPosition(par1World, Block.torchWood.blockID, 0, 4, 3, 5, par3StructureBoundingBox);
-+ this.placeBlockAtCurrentPosition(par1World, Block.torchWood.blockID, 0, 6, 3, 5, par3StructureBoundingBox);
-+ this.placeBlockAtCurrentPosition(par1World, Block.torchWood.blockID, 0, 5, 3, 4, par3StructureBoundingBox);
-+ this.placeBlockAtCurrentPosition(par1World, Block.torchWood.blockID, 0, 5, 3, 6, par3StructureBoundingBox);
-+ this.placeBlockAtCurrentPosition(par1World, Block.stoneSingleSlab.blockID, 0, 4, 1, 4, par3StructureBoundingBox);
-+ this.placeBlockAtCurrentPosition(par1World, Block.stoneSingleSlab.blockID, 0, 4, 1, 5, par3StructureBoundingBox);
-+ this.placeBlockAtCurrentPosition(par1World, Block.stoneSingleSlab.blockID, 0, 4, 1, 6, par3StructureBoundingBox);
-+ this.placeBlockAtCurrentPosition(par1World, Block.stoneSingleSlab.blockID, 0, 6, 1, 4, par3StructureBoundingBox);
-+ this.placeBlockAtCurrentPosition(par1World, Block.stoneSingleSlab.blockID, 0, 6, 1, 5, par3StructureBoundingBox);
-+ this.placeBlockAtCurrentPosition(par1World, Block.stoneSingleSlab.blockID, 0, 6, 1, 6, par3StructureBoundingBox);
-+ this.placeBlockAtCurrentPosition(par1World, Block.stoneSingleSlab.blockID, 0, 5, 1, 4, par3StructureBoundingBox);
-+ this.placeBlockAtCurrentPosition(par1World, Block.stoneSingleSlab.blockID, 0, 5, 1, 6, par3StructureBoundingBox);
-+ break;
-+
-+ case 1:
-+ for (var4 = 0; var4 < 5; ++var4) {
-+ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 3, 1, 3 + var4, par3StructureBoundingBox);
-+ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 7, 1, 3 + var4, par3StructureBoundingBox);
-+ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 3 + var4, 1, 3, par3StructureBoundingBox);
-+ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 3 + var4, 1, 7, par3StructureBoundingBox);
-+ }
-+
-+ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 5, 1, 5, par3StructureBoundingBox);
-+ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 5, 2, 5, par3StructureBoundingBox);
-+ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 5, 3, 5, par3StructureBoundingBox);
-+ this.placeBlockAtCurrentPosition(par1World, Block.waterMoving.blockID, 0, 5, 4, 5, par3StructureBoundingBox);
-+ break;
-+
-+ case 2:
-+ for (var4 = 1; var4 <= 9; ++var4) {
-+ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 1, 3, var4, par3StructureBoundingBox);
-+ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 9, 3, var4, par3StructureBoundingBox);
-+ }
-+
-+ for (var4 = 1; var4 <= 9; ++var4) {
-+ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, var4, 3, 1, par3StructureBoundingBox);
-+ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, var4, 3, 9, par3StructureBoundingBox);
-+ }
-+
-+ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 5, 1, 4, par3StructureBoundingBox);
-+ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 5, 1, 6, par3StructureBoundingBox);
-+ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 5, 3, 4, par3StructureBoundingBox);
-+ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 5, 3, 6, par3StructureBoundingBox);
-+ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 4, 1, 5, par3StructureBoundingBox);
-+ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 6, 1, 5, par3StructureBoundingBox);
-+ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 4, 3, 5, par3StructureBoundingBox);
-+ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 6, 3, 5, par3StructureBoundingBox);
-+
-+ for (var4 = 1; var4 <= 3; ++var4) {
-+ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 4, var4, 4, par3StructureBoundingBox);
-+ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 6, var4, 4, par3StructureBoundingBox);
-+ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 4, var4, 6, par3StructureBoundingBox);
-+ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 6, var4, 6, par3StructureBoundingBox);
-+ }
-+
-+ this.placeBlockAtCurrentPosition(par1World, Block.torchWood.blockID, 0, 5, 3, 5, par3StructureBoundingBox);
-+
-+ for (var4 = 2; var4 <= 8; ++var4) {
-+ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 2, 3, var4, par3StructureBoundingBox);
-+ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 3, 3, var4, par3StructureBoundingBox);
-+
-+ if (var4 <= 3 || var4 >= 7) {
-+ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 4, 3, var4, par3StructureBoundingBox);
-+ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 5, 3, var4, par3StructureBoundingBox);
-+ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 6, 3, var4, par3StructureBoundingBox);
-+ }
-+
-+ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 7, 3, var4, par3StructureBoundingBox);
-+ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 8, 3, var4, par3StructureBoundingBox);
-+ }
-+
-+ this.placeBlockAtCurrentPosition(par1World, Block.ladder.blockID, this.getMetadataWithOffset(Block.ladder.blockID, 4), 9, 1, 3, par3StructureBoundingBox);
-+ this.placeBlockAtCurrentPosition(par1World, Block.ladder.blockID, this.getMetadataWithOffset(Block.ladder.blockID, 4), 9, 2, 3, par3StructureBoundingBox);
-+ this.placeBlockAtCurrentPosition(par1World, Block.ladder.blockID, this.getMetadataWithOffset(Block.ladder.blockID, 4), 9, 3, 3, par3StructureBoundingBox);
-+ this.generateStructureChestContents(par1World, par3StructureBoundingBox, par2Random, 3, 4, 8, WeightedRandomChestContent.func_92080_a(strongholdRoomCrossingChestContents, new WeightedRandomChestContent[] {Item.enchantedBook.func_92114_b(par2Random)}), 1 + par2Random.nextInt(4));
- }
-
- return true;
---- net/minecraft/src/RenderEndPortal.java
-+++ net/minecraft/src/RenderEndPortal.java
-@@ -7,43 +7,47 @@
- public class RenderEndPortal extends TileEntitySpecialRenderer {
- private static final ResourceLocation enderPortalEndSkyTextures = new ResourceLocation("textures/environment/end_sky.png");
- private static final ResourceLocation endPortalTextures = new ResourceLocation("textures/entity/end_portal.png");
-- private static final Random e = new Random(31100L);
-- FloatBuffer a = GLAllocation.createDirectFloatBuffer(16);
-+ private static final Random field_110644_e = new Random(31100L);
-+ FloatBuffer field_76908_a = GLAllocation.createDirectFloatBuffer(16);
-
-- public void renderEndPortalTileEntity(TileEntityEndPortal var1, double var2, double var4, double var6, float var8) {
-+ /**
-+ * Renders the End Portal.
-+ */
-+ public void renderEndPortalTileEntity(TileEntityEndPortal par1TileEntityEndPortal, double par2, double par4, double par6, float par8) {
- float var9 = (float)this.tileEntityRenderer.playerX;
- float var10 = (float)this.tileEntityRenderer.playerY;
- float var11 = (float)this.tileEntityRenderer.playerZ;
- GL11.glDisable(GL11.GL_LIGHTING);
-- e.setSeed(31100L);
-- float var12 = 12.0F / 16.0F;
-+ field_110644_e.setSeed(31100L);
-+ float var12 = 0.75F;
-
-- for(int var13 = 0; var13 < 16; ++var13) {
-+ for (int var13 = 0; var13 < 16; ++var13) {
- GL11.glPushMatrix();
- float var14 = (float)(16 - var13);
-- float var15 = 1.0F / 16.0F;
-+ float var15 = 0.0625F;
- float var16 = 1.0F / (var14 + 1.0F);
-- if(var13 == 0) {
-+
-+ if (var13 == 0) {
- this.bindTexture(enderPortalEndSkyTextures);
- var16 = 0.1F;
- var14 = 65.0F;
-- var15 = 2.0F / 16.0F;
-+ var15 = 0.125F;
- GL11.glEnable(GL11.GL_BLEND);
- GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
- }
-
-- if(var13 == 1) {
-+ if (var13 == 1) {
- this.bindTexture(endPortalTextures);
- GL11.glEnable(GL11.GL_BLEND);
- GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE);
- var15 = 0.5F;
- }
-
-- float var17 = (float)(-(var4 + (double)var12));
-+ float var17 = (float)(-(par4 + (double)var12));
- float var18 = var17 + ActiveRenderInfo.objectY;
- float var19 = var17 + var14 + ActiveRenderInfo.objectY;
- float var20 = var18 / var19;
-- var20 += (float)(var4 + (double)var12);
-+ var20 += (float)(par4 + (double)var12);
- GL11.glTranslatef(var9, var20, var11);
- GL11.glTexGeni(GL11.GL_S, GL11.GL_TEXTURE_GEN_MODE, GL11.GL_OBJECT_LINEAR);
- GL11.glTexGeni(GL11.GL_T, GL11.GL_TEXTURE_GEN_MODE, GL11.GL_OBJECT_LINEAR);
-@@ -71,20 +75,21 @@
- GL11.glTranslatef(ActiveRenderInfo.objectX * var14 / var18, ActiveRenderInfo.objectZ * var14 / var18, -var10);
- Tessellator var23 = Tessellator.instance;
- var23.startDrawingQuads();
-- var20 = e.nextFloat() * 0.5F + 0.1F;
-- float var21 = e.nextFloat() * 0.5F + 0.4F;
-- float var22 = e.nextFloat() * 0.5F + 0.5F;
-- if(var13 == 0) {
-+ var20 = field_110644_e.nextFloat() * 0.5F + 0.1F;
-+ float var21 = field_110644_e.nextFloat() * 0.5F + 0.4F;
-+ float var22 = field_110644_e.nextFloat() * 0.5F + 0.5F;
-+
-+ if (var13 == 0) {
- var22 = 1.0F;
-- var21 = var22;
-- var20 = var22;
-+ var21 = 1.0F;
-+ var20 = 1.0F;
- }
-
- var23.setColorRGBA_F(var20 * var16, var21 * var16, var22 * var16, 1.0F);
-- var23.addVertex(var2, var4 + (double)var12, var6);
-- var23.addVertex(var2, var4 + (double)var12, var6 + 1.0D);
-- var23.addVertex(var2 + 1.0D, var4 + (double)var12, var6 + 1.0D);
-- var23.addVertex(var2 + 1.0D, var4 + (double)var12, var6);
-+ var23.addVertex(par2, par4 + (double)var12, par6);
-+ var23.addVertex(par2, par4 + (double)var12, par6 + 1.0D);
-+ var23.addVertex(par2 + 1.0D, par4 + (double)var12, par6 + 1.0D);
-+ var23.addVertex(par2 + 1.0D, par4 + (double)var12, par6);
- var23.draw();
- GL11.glPopMatrix();
- GL11.glMatrixMode(GL11.GL_MODELVIEW);
-@@ -98,14 +103,14 @@
- GL11.glEnable(GL11.GL_LIGHTING);
- }
-
-- private FloatBuffer func_76907_a(float var1, float var2, float var3, float var4) {
-- this.a.clear();
-- this.a.put(var1).put(var2).put(var3).put(var4);
-- this.a.flip();
-- return this.a;
-+ private FloatBuffer func_76907_a(float par1, float par2, float par3, float par4) {
-+ this.field_76908_a.clear();
-+ this.field_76908_a.put(par1).put(par2).put(par3).put(par4);
-+ this.field_76908_a.flip();
-+ return this.field_76908_a;
- }
-
-- public void renderTileEntityAt(TileEntity var1, double var2, double var4, double var6, float var8) {
-- this.renderEndPortalTileEntity((TileEntityEndPortal)var1, var2, var4, var6, var8);
-+ public void renderTileEntityAt(TileEntity par1TileEntity, double par2, double par4, double par6, float par8) {
-+ this.renderEndPortalTileEntity((TileEntityEndPortal)par1TileEntity, par2, par4, par6, par8);
- }
- }
---- net/minecraft/src/BlockStairs.java
-+++ net/minecraft/src/BlockStairs.java
-@@ -4,69 +4,91 @@
- import java.util.Random;
-
- public class BlockStairs extends Block {
-- private static final int[][] field_72159_a = new int[][]{{2, 6}, {3, 7}, {2, 3}, {6, 7}, {0, 4}, {1, 5}, {0, 1}, {4, 5}};
-+ private static final int[][] field_72159_a = new int[][] {{2, 6}, {3, 7}, {2, 3}, {6, 7}, {0, 4}, {1, 5}, {0, 1}, {4, 5}};
-+
-+ /** The block that is used as model for the stair. */
- private final Block modelBlock;
- private final int modelBlockMetadata;
- private boolean field_72156_cr;
- private int field_72160_cs;
-
-- protected BlockStairs(int var1, Block var2, int var3) {
-- super(var1, var2.blockMaterial);
-- this.modelBlock = var2;
-- this.modelBlockMetadata = var3;
-- this.setHardness(var2.blockHardness);
-- this.setResistance(var2.blockResistance / 3.0F);
-- this.setStepSound(var2.stepSound);
-+ protected BlockStairs(int par1, Block par2Block, int par3) {
-+ super(par1, par2Block.blockMaterial);
-+ this.modelBlock = par2Block;
-+ this.modelBlockMetadata = par3;
-+ this.setHardness(par2Block.blockHardness);
-+ this.setResistance(par2Block.blockResistance / 3.0F);
-+ this.setStepSound(par2Block.stepSound);
- this.setLightOpacity(255);
- this.setCreativeTab(CreativeTabs.tabBlock);
- }
-
-- public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) {
-- if(this.field_72156_cr) {
-+ /**
-+ * 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.field_72156_cr) {
- this.setBlockBounds(0.5F * (float)(this.field_72160_cs % 2), 0.5F * (float)(this.field_72160_cs / 2 % 2), 0.5F * (float)(this.field_72160_cs / 4 % 2), 0.5F + 0.5F * (float)(this.field_72160_cs % 2), 0.5F + 0.5F * (float)(this.field_72160_cs / 2 % 2), 0.5F + 0.5F * (float)(this.field_72160_cs / 4 % 2));
- } else {
- this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
- }
--
- }
-
-+ /**
-+ * 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;
- }
-
-+ /**
-+ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc)
-+ */
- public boolean renderAsNormalBlock() {
- return false;
- }
-
-+ /**
-+ * The type of render function that is called for this block
-+ */
- public int getRenderType() {
- return 10;
- }
-
-- public void func_82541_d(IBlockAccess var1, int var2, int var3, int var4) {
-- int var5 = var1.getBlockMetadata(var2, var3, var4);
-- if((var5 & 4) != 0) {
-+ public void func_82541_d(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) {
-+ int var5 = par1IBlockAccess.getBlockMetadata(par2, par3, par4);
-+
-+ if ((var5 & 4) != 0) {
- this.setBlockBounds(0.0F, 0.5F, 0.0F, 1.0F, 1.0F, 1.0F);
- } else {
- this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F);
- }
--
-- }
--
-- public static boolean isBlockStairsID(int var0) {
-- return var0 > 0 && Block.blocksList[var0] instanceof BlockStairs;
-- }
--
-- private boolean isBlockStairsDirection(IBlockAccess var1, int var2, int var3, int var4, int var5) {
-- int var6 = var1.getBlockId(var2, var3, var4);
-- return isBlockStairsID(var6) && var1.getBlockMetadata(var2, var3, var4) == var5;
-- }
--
-- public boolean func_82542_g(IBlockAccess var1, int var2, int var3, int var4) {
-- int var5 = var1.getBlockMetadata(var2, var3, var4);
-+ }
-+
-+ /**
-+ * Checks if supplied ID is one of a BlockStairs
-+ */
-+ public static boolean isBlockStairsID(int par0) {
-+ return par0 > 0 && Block.blocksList[par0] instanceof BlockStairs;
-+ }
-+
-+ /**
-+ * returns true if the given block is a stairs block and is in the given direction of par5. Parameters are
-+ * IBlockAccess, x, y, z, direction
-+ */
-+ private boolean isBlockStairsDirection(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) {
-+ int var6 = par1IBlockAccess.getBlockId(par2, par3, par4);
-+ return isBlockStairsID(var6) && par1IBlockAccess.getBlockMetadata(par2, par3, par4) == par5;
-+ }
-+
-+ public boolean func_82542_g(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) {
-+ int var5 = par1IBlockAccess.getBlockMetadata(par2, par3, par4);
- int var6 = var5 & 3;
- float var7 = 0.5F;
- float var8 = 1.0F;
-- if((var5 & 4) != 0) {
-+
-+ if ((var5 & 4) != 0) {
- var7 = 0.0F;
- var8 = 0.5F;
- }
-@@ -79,60 +101,69 @@
- int var14;
- int var15;
- int var16;
-- if(var6 == 0) {
-+
-+ if (var6 == 0) {
- var9 = 0.5F;
- var12 = 1.0F;
-- var14 = var1.getBlockId(var2 + 1, var3, var4);
-- var15 = var1.getBlockMetadata(var2 + 1, var3, var4);
-- if(isBlockStairsID(var14) && (var5 & 4) == (var15 & 4)) {
-+ var14 = par1IBlockAccess.getBlockId(par2 + 1, par3, par4);
-+ var15 = par1IBlockAccess.getBlockMetadata(par2 + 1, par3, par4);
-+
-+ if (isBlockStairsID(var14) && (var5 & 4) == (var15 & 4)) {
- var16 = var15 & 3;
-- if(var16 == 3 && !this.isBlockStairsDirection(var1, var2, var3, var4 + 1, var5)) {
-+
-+ if (var16 == 3 && !this.isBlockStairsDirection(par1IBlockAccess, par2, par3, par4 + 1, var5)) {
- var12 = 0.5F;
- var13 = false;
-- } else if(var16 == 2 && !this.isBlockStairsDirection(var1, var2, var3, var4 - 1, var5)) {
-+ } else if (var16 == 2 && !this.isBlockStairsDirection(par1IBlockAccess, par2, par3, par4 - 1, var5)) {
- var11 = 0.5F;
- var13 = false;
- }
- }
-- } else if(var6 == 1) {
-+ } else if (var6 == 1) {
- var10 = 0.5F;
- var12 = 1.0F;
-- var14 = var1.getBlockId(var2 - 1, var3, var4);
-- var15 = var1.getBlockMetadata(var2 - 1, var3, var4);
-- if(isBlockStairsID(var14) && (var5 & 4) == (var15 & 4)) {
-+ var14 = par1IBlockAccess.getBlockId(par2 - 1, par3, par4);
-+ var15 = par1IBlockAccess.getBlockMetadata(par2 - 1, par3, par4);
-+
-+ if (isBlockStairsID(var14) && (var5 & 4) == (var15 & 4)) {
- var16 = var15 & 3;
-- if(var16 == 3 && !this.isBlockStairsDirection(var1, var2, var3, var4 + 1, var5)) {
-+
-+ if (var16 == 3 && !this.isBlockStairsDirection(par1IBlockAccess, par2, par3, par4 + 1, var5)) {
- var12 = 0.5F;
- var13 = false;
-- } else if(var16 == 2 && !this.isBlockStairsDirection(var1, var2, var3, var4 - 1, var5)) {
-+ } else if (var16 == 2 && !this.isBlockStairsDirection(par1IBlockAccess, par2, par3, par4 - 1, var5)) {
- var11 = 0.5F;
- var13 = false;
- }
- }
-- } else if(var6 == 2) {
-+ } else if (var6 == 2) {
- var11 = 0.5F;
- var12 = 1.0F;
-- var14 = var1.getBlockId(var2, var3, var4 + 1);
-- var15 = var1.getBlockMetadata(var2, var3, var4 + 1);
-- if(isBlockStairsID(var14) && (var5 & 4) == (var15 & 4)) {
-+ var14 = par1IBlockAccess.getBlockId(par2, par3, par4 + 1);
-+ var15 = par1IBlockAccess.getBlockMetadata(par2, par3, par4 + 1);
-+
-+ if (isBlockStairsID(var14) && (var5 & 4) == (var15 & 4)) {
- var16 = var15 & 3;
-- if(var16 == 1 && !this.isBlockStairsDirection(var1, var2 + 1, var3, var4, var5)) {
-+
-+ if (var16 == 1 && !this.isBlockStairsDirection(par1IBlockAccess, par2 + 1, par3, par4, var5)) {
- var10 = 0.5F;
- var13 = false;
-- } else if(var16 == 0 && !this.isBlockStairsDirection(var1, var2 - 1, var3, var4, var5)) {
-+ } else if (var16 == 0 && !this.isBlockStairsDirection(par1IBlockAccess, par2 - 1, par3, par4, var5)) {
- var9 = 0.5F;
- var13 = false;
- }
- }
-- } else if(var6 == 3) {
-- var14 = var1.getBlockId(var2, var3, var4 - 1);
-- var15 = var1.getBlockMetadata(var2, var3, var4 - 1);
-- if(isBlockStairsID(var14) && (var5 & 4) == (var15 & 4)) {
-+ } else if (var6 == 3) {
-+ var14 = par1IBlockAccess.getBlockId(par2, par3, par4 - 1);
-+ var15 = par1IBlockAccess.getBlockMetadata(par2, par3, par4 - 1);
-+
-+ if (isBlockStairsID(var14) && (var5 & 4) == (var15 & 4)) {
- var16 = var15 & 3;
-- if(var16 == 1 && !this.isBlockStairsDirection(var1, var2 + 1, var3, var4, var5)) {
-+
-+ if (var16 == 1 && !this.isBlockStairsDirection(par1IBlockAccess, par2 + 1, par3, par4, var5)) {
- var10 = 0.5F;
- var13 = false;
-- } else if(var16 == 0 && !this.isBlockStairsDirection(var1, var2 - 1, var3, var4, var5)) {
-+ } else if (var16 == 0 && !this.isBlockStairsDirection(par1IBlockAccess, par2 - 1, par3, par4, var5)) {
- var9 = 0.5F;
- var13 = false;
- }
-@@ -143,12 +174,13 @@
- return var13;
- }
-
-- public boolean func_82544_h(IBlockAccess var1, int var2, int var3, int var4) {
-- int var5 = var1.getBlockMetadata(var2, var3, var4);
-+ public boolean func_82544_h(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) {
-+ int var5 = par1IBlockAccess.getBlockMetadata(par2, par3, par4);
- int var6 = var5 & 3;
- float var7 = 0.5F;
- float var8 = 1.0F;
-- if((var5 & 4) != 0) {
-+
-+ if ((var5 & 4) != 0) {
- var7 = 0.0F;
- var8 = 0.5F;
- }
-@@ -161,61 +193,70 @@
- int var14;
- int var15;
- int var16;
-- if(var6 == 0) {
-- var14 = var1.getBlockId(var2 - 1, var3, var4);
-- var15 = var1.getBlockMetadata(var2 - 1, var3, var4);
-- if(isBlockStairsID(var14) && (var5 & 4) == (var15 & 4)) {
-+
-+ if (var6 == 0) {
-+ var14 = par1IBlockAccess.getBlockId(par2 - 1, par3, par4);
-+ var15 = par1IBlockAccess.getBlockMetadata(par2 - 1, par3, par4);
-+
-+ if (isBlockStairsID(var14) && (var5 & 4) == (var15 & 4)) {
- var16 = var15 & 3;
-- if(var16 == 3 && !this.isBlockStairsDirection(var1, var2, var3, var4 - 1, var5)) {
-+
-+ if (var16 == 3 && !this.isBlockStairsDirection(par1IBlockAccess, par2, par3, par4 - 1, var5)) {
- var11 = 0.0F;
- var12 = 0.5F;
- var13 = true;
-- } else if(var16 == 2 && !this.isBlockStairsDirection(var1, var2, var3, var4 + 1, var5)) {
-+ } else if (var16 == 2 && !this.isBlockStairsDirection(par1IBlockAccess, par2, par3, par4 + 1, var5)) {
- var11 = 0.5F;
- var12 = 1.0F;
- var13 = true;
- }
- }
-- } else if(var6 == 1) {
-- var14 = var1.getBlockId(var2 + 1, var3, var4);
-- var15 = var1.getBlockMetadata(var2 + 1, var3, var4);
-- if(isBlockStairsID(var14) && (var5 & 4) == (var15 & 4)) {
-+ } else if (var6 == 1) {
-+ var14 = par1IBlockAccess.getBlockId(par2 + 1, par3, par4);
-+ var15 = par1IBlockAccess.getBlockMetadata(par2 + 1, par3, par4);
-+
-+ if (isBlockStairsID(var14) && (var5 & 4) == (var15 & 4)) {
- var9 = 0.5F;
- var10 = 1.0F;
- var16 = var15 & 3;
-- if(var16 == 3 && !this.isBlockStairsDirection(var1, var2, var3, var4 - 1, var5)) {
-+
-+ if (var16 == 3 && !this.isBlockStairsDirection(par1IBlockAccess, par2, par3, par4 - 1, var5)) {
- var11 = 0.0F;
- var12 = 0.5F;
- var13 = true;
-- } else if(var16 == 2 && !this.isBlockStairsDirection(var1, var2, var3, var4 + 1, var5)) {
-+ } else if (var16 == 2 && !this.isBlockStairsDirection(par1IBlockAccess, par2, par3, par4 + 1, var5)) {
- var11 = 0.5F;
- var12 = 1.0F;
- var13 = true;
- }
- }
-- } else if(var6 == 2) {
-- var14 = var1.getBlockId(var2, var3, var4 - 1);
-- var15 = var1.getBlockMetadata(var2, var3, var4 - 1);
-- if(isBlockStairsID(var14) && (var5 & 4) == (var15 & 4)) {
-+ } else if (var6 == 2) {
-+ var14 = par1IBlockAccess.getBlockId(par2, par3, par4 - 1);
-+ var15 = par1IBlockAccess.getBlockMetadata(par2, par3, par4 - 1);
-+
-+ if (isBlockStairsID(var14) && (var5 & 4) == (var15 & 4)) {
- var11 = 0.0F;
- var12 = 0.5F;
- var16 = var15 & 3;
-- if(var16 == 1 && !this.isBlockStairsDirection(var1, var2 - 1, var3, var4, var5)) {
-+
-+ if (var16 == 1 && !this.isBlockStairsDirection(par1IBlockAccess, par2 - 1, par3, par4, var5)) {
- var13 = true;
-- } else if(var16 == 0 && !this.isBlockStairsDirection(var1, var2 + 1, var3, var4, var5)) {
-+ } else if (var16 == 0 && !this.isBlockStairsDirection(par1IBlockAccess, par2 + 1, par3, par4, var5)) {
- var9 = 0.5F;
- var10 = 1.0F;
- var13 = true;
- }
- }
-- } else if(var6 == 3) {
-- var14 = var1.getBlockId(var2, var3, var4 + 1);
-- var15 = var1.getBlockMetadata(var2, var3, var4 + 1);
-- if(isBlockStairsID(var14) && (var5 & 4) == (var15 & 4)) {
-+ } else if (var6 == 3) {
-+ var14 = par1IBlockAccess.getBlockId(par2, par3, par4 + 1);
-+ var15 = par1IBlockAccess.getBlockMetadata(par2, par3, par4 + 1);
-+
-+ if (isBlockStairsID(var14) && (var5 & 4) == (var15 & 4)) {
- var16 = var15 & 3;
-- if(var16 == 1 && !this.isBlockStairsDirection(var1, var2 - 1, var3, var4, var5)) {
-+
-+ if (var16 == 1 && !this.isBlockStairsDirection(par1IBlockAccess, par2 - 1, par3, par4, var5)) {
- var13 = true;
-- } else if(var16 == 0 && !this.isBlockStairsDirection(var1, var2 + 1, var3, var4, var5)) {
-+ } else if (var16 == 0 && !this.isBlockStairsDirection(par1IBlockAccess, par2 + 1, par3, par4, var5)) {
- var9 = 0.5F;
- var10 = 1.0F;
- var13 = true;
-@@ -223,160 +264,239 @@
- }
- }
-
-- if(var13) {
-+ if (var13) {
- this.setBlockBounds(var9, var7, var11, var10, var8, var12);
- }
-
- return var13;
- }
-
-- public void addCollisionBoxesToList(World var1, int var2, int var3, int var4, AxisAlignedBB var5, List var6, Entity var7) {
-- this.func_82541_d(var1, var2, var3, var4);
-- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7);
-- boolean var8 = this.func_82542_g(var1, var2, var3, var4);
-- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7);
-- if(var8 && this.func_82544_h(var1, var2, var3, var4)) {
-- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7);
-+ /**
-+ * 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) {
-+ this.func_82541_d(par1World, par2, par3, par4);
-+ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity);
-+ boolean var8 = this.func_82542_g(par1World, par2, par3, par4);
-+ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity);
-+
-+ if (var8 && this.func_82544_h(par1World, par2, par3, par4)) {
-+ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity);
- }
-
- this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
- }
-
-- public void randomDisplayTick(World var1, int var2, int var3, int var4, Random var5) {
-- this.modelBlock.randomDisplayTick(var1, var2, var3, var4, var5);
-- }
--
-- public void onBlockClicked(World var1, int var2, int var3, int var4, EntityPlayer var5) {
-- this.modelBlock.onBlockClicked(var1, var2, var3, var4, var5);
-- }
--
-- public void onBlockDestroyedByPlayer(World var1, int var2, int var3, int var4, int var5) {
-- this.modelBlock.onBlockDestroyedByPlayer(var1, var2, var3, var4, var5);
-- }
--
-- public int getMixedBrightnessForBlock(IBlockAccess var1, int var2, int var3, int var4) {
-- return this.modelBlock.getMixedBrightnessForBlock(var1, var2, var3, var4);
-- }
--
-- public float getBlockBrightness(IBlockAccess var1, int var2, int var3, int var4) {
-- return this.modelBlock.getBlockBrightness(var1, var2, var3, var4);
-- }
--
-- public float getExplosionResistance(Entity var1) {
-- return this.modelBlock.getExplosionResistance(var1);
-- }
--
-+ /**
-+ * 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);
-+ }
-+
-+ /**
-+ * 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) {
-+ 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();
- }
-
-- public Icon getIcon(int var1, int var2) {
-- return this.modelBlock.getIcon(var1, this.modelBlockMetadata);
-- }
--
-- public int tickRate(World var1) {
-- return this.modelBlock.tickRate(var1);
-- }
--
-- public AxisAlignedBB getSelectedBoundingBoxFromPool(World var1, int var2, int var3, int var4) {
-- return this.modelBlock.getSelectedBoundingBoxFromPool(var1, var2, var3, var4);
-- }
--
-- public void velocityToAddToEntity(World var1, int var2, int var3, int var4, Entity var5, Vec3 var6) {
-- this.modelBlock.velocityToAddToEntity(var1, var2, var3, var4, var5, var6);
-- }
--
-+ /**
-+ * 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);
-+ }
-+
-+ /**
-+ * Returns if this block is collidable (only used by Fire). Args: x, y, z
-+ */
- public boolean isCollidable() {
- return this.modelBlock.isCollidable();
- }
-
-- public boolean canCollideCheck(int var1, boolean var2) {
-- return this.modelBlock.canCollideCheck(var1, var2);
-- }
--
-- public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) {
-- return this.modelBlock.canPlaceBlockAt(var1, var2, var3, var4);
-- }
--
-- public void onBlockAdded(World var1, int var2, int var3, int var4) {
-- this.onNeighborBlockChange(var1, var2, var3, var4, 0);
-- this.modelBlock.onBlockAdded(var1, var2, var3, var4);
-- }
--
-- public void breakBlock(World var1, int var2, int var3, int var4, int var5, int var6) {
-- this.modelBlock.breakBlock(var1, var2, var3, var4, var5, var6);
-- }
--
-- public void onEntityWalking(World var1, int var2, int var3, int var4, Entity var5) {
-- this.modelBlock.onEntityWalking(var1, var2, var3, var4, var5);
-- }
--
-- public void updateTick(World var1, int var2, int var3, int var4, Random var5) {
-- this.modelBlock.updateTick(var1, var2, var3, var4, var5);
-- }
--
-- public boolean onBlockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5, int var6, float var7, float var8, float var9) {
-- return this.modelBlock.onBlockActivated(var1, var2, var3, var4, var5, 0, 0.0F, 0.0F, 0.0F);
-- }
--
-- public void onBlockDestroyedByExplosion(World var1, int var2, int var3, int var4, Explosion var5) {
-- this.modelBlock.onBlockDestroyedByExplosion(var1, var2, var3, var4, var5);
-- }
--
-- public void onBlockPlacedBy(World var1, int var2, int var3, int var4, EntityLivingBase var5, ItemStack var6) {
-- int var7 = MathHelper.floor_double((double)(var5.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
-- int var8 = var1.getBlockMetadata(var2, var3, var4) & 4;
-- if(var7 == 0) {
-- var1.setBlockMetadata(var2, var3, var4, 2 | var8, 2);
-- }
--
-- if(var7 == 1) {
-- var1.setBlockMetadata(var2, var3, var4, 1 | var8, 2);
-- }
--
-- if(var7 == 2) {
-- var1.setBlockMetadata(var2, var3, var4, 3 | var8, 2);
-- }
--
-- if(var7 == 3) {
-- var1.setBlockMetadata(var2, var3, var4, 0 | var8, 2);
-- }
--
-- }
--
-- public int onBlockPlaced(World var1, int var2, int var3, int var4, int var5, float var6, float var7, float var8, int var9) {
-- return var5 != 0 && (var5 == 1 || (double)var7 <= 0.5D) ? var9 : var9 | 4;
-- }
--
-- public MovingObjectPosition collisionRayTrace(World var1, int var2, int var3, int var4, Vec3 var5, Vec3 var6) {
-+ /**
-+ * 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);
-+ }
-+
-+ /**
-+ * 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 this.modelBlock.canPlaceBlockAt(par1World, par2, par3, par4);
-+ }
-+
-+ /**
-+ * 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.onNeighborBlockChange(par1World, par2, par3, par4, 0);
-+ this.modelBlock.onBlockAdded(par1World, par2, par3, par4);
-+ }
-+
-+ /**
-+ * 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) {
-+ this.modelBlock.breakBlock(par1World, par2, par3, par4, par5, par6);
-+ }
-+
-+ /**
-+ * Called whenever an entity is walking on top of this block. Args: world, x, y, z, entity
-+ */
-+ public void onEntityWalking(World par1World, int par2, int par3, int par4, Entity par5Entity) {
-+ this.modelBlock.onEntityWalking(par1World, par2, par3, par4, par5Entity);
-+ }
-+
-+ /**
-+ * Ticks the block if it's been scheduled
-+ */
-+ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) {
-+ this.modelBlock.updateTick(par1World, par2, par3, par4, par5Random);
-+ }
-+
-+ /**
-+ * 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 this.modelBlock.onBlockActivated(par1World, par2, par3, par4, par5EntityPlayer, 0, 0.0F, 0.0F, 0.0F);
-+ }
-+
-+ /**
-+ * Called upon the block being destroyed by an explosion
-+ */
-+ public void onBlockDestroyedByExplosion(World par1World, int par2, int par3, int par4, Explosion par5Explosion) {
-+ this.modelBlock.onBlockDestroyedByExplosion(par1World, par2, par3, par4, par5Explosion);
-+ }
-+
-+ /**
-+ * 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;
-+ 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
-+ */
-+ public int onBlockPlaced(World par1World, int par2, int par3, int par4, int par5, float par6, float par7, float par8, int par9) {
-+ return par5 != 0 && (par5 == 1 || (double)par7 <= 0.5D) ? par9 : par9 | 4;
-+ }
-+
-+ /**
-+ * Ray traces through the blocks collision from start vector to end vector returning a ray trace hit. Args: world, x,
-+ * y, z, startVec, endVec
-+ */
-+ public MovingObjectPosition collisionRayTrace(World par1World, int par2, int par3, int par4, Vec3 par5Vec3, Vec3 par6Vec3) {
- MovingObjectPosition[] var7 = new MovingObjectPosition[8];
-- int var8 = var1.getBlockMetadata(var2, var3, var4);
-+ int var8 = par1World.getBlockMetadata(par2, par3, par4);
- int var9 = var8 & 3;
- boolean var10 = (var8 & 4) == 4;
- int[] var11 = field_72159_a[var9 + (var10 ? 4 : 0)];
- this.field_72156_cr = true;
--
- int var14;
- int var15;
- int var16;
-- for(int var12 = 0; var12 < 8; ++var12) {
-+
-+ for (int var12 = 0; var12 < 8; ++var12) {
- this.field_72160_cs = var12;
- int[] var13 = var11;
- var14 = var11.length;
-
-- for(var15 = 0; var15 < var14; ++var15) {
-+ for (var15 = 0; var15 < var14; ++var15) {
- var16 = var13[var15];
-- if(var16 == var12) {
-+
-+ if (var16 == var12) {
-+ ;
- }
- }
-
-- var7[var12] = super.collisionRayTrace(var1, var2, var3, var4, var5, var6);
-+ var7[var12] = super.collisionRayTrace(par1World, par2, par3, par4, par5Vec3, par6Vec3);
- }
-
- int[] var21 = var11;
- int var23 = var11.length;
-
-- for(var14 = 0; var14 < var23; ++var14) {
-+ for (var14 = 0; var14 < var23; ++var14) {
- var15 = var21[var14];
- var7[var15] = null;
- }
-@@ -386,11 +506,13 @@
- MovingObjectPosition[] var25 = var7;
- var16 = var7.length;
-
-- for(int var17 = 0; var17 < var16; ++var17) {
-+ for (int var17 = 0; var17 < var16; ++var17) {
- MovingObjectPosition var18 = var25[var17];
-- if(var18 != null) {
-- double var19 = var18.hitVec.squareDistanceTo(var6);
-- if(var19 > var24) {
-+
-+ if (var18 != null) {
-+ double var19 = var18.hitVec.squareDistanceTo(par6Vec3);
-+
-+ if (var19 > var24) {
- var22 = var18;
- var24 = var19;
- }
-@@ -400,6 +522,9 @@
- return var22;
- }
-
-- public void registerIcons(IconRegister 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) {}
- }
---- net/minecraft/src/GuiWinGame.java
-+++ net/minecraft/src/GuiWinGame.java
-@@ -11,39 +11,57 @@
- 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;
-- private List d;
-+
-+ /** 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();
-- }
--
-- }
--
-- protected void keyTyped(char var1, int var2) {
-- if(var2 == 1) {
-- this.respawnPlayer();
-- }
--
-- }
--
-+
-+ 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.d == null) {
-- this.d = new ArrayList();
-+ if (this.lines == null) {
-+ this.lines = new ArrayList();
-
- try {
- String var1 = "";
-@@ -51,65 +69,60 @@
- 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);
--
-- while(true) {
-- var1 = var4.readLine();
-- int var6;
-- if(var1 == null) {
-- for(var6 = 0; var6 < 8; ++var6) {
-- this.d.add("");
-- }
--
-- var4 = new BufferedReader(new InputStreamReader(this.mc.getResourceManager().getResource(new ResourceLocation("texts/credits.txt")).getInputStream(), Charsets.UTF_8));
--
-- while(true) {
-- var1 = var4.readLine();
-- if(var1 == null) {
-- this.field_73989_c = this.d.size() * 12;
-- return;
-- }
--
-- var1 = var1.replaceAll("PLAYERNAME", this.mc.getSession().getUsername());
-- var1 = var1.replaceAll("\t", " ");
-- this.d.addAll(this.mc.fontRenderer.listFormattedStringToWidth(var1, var3));
-- this.d.add("");
-- }
-- }
--
-+ 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) {
-+
-+ 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.d.addAll(this.mc.fontRenderer.listFormattedStringToWidth(var1, var3));
-- this.d.add("");
-- }
-+ 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 var1, int var2, float var3) {
-+ 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 + var3) * 0.5F * this.field_73987_d;
-- float var7 = (float)this.height - ((float)this.updateCounter + var3) * 0.5F * this.field_73987_d;
-+ 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 + var3 - 0.0F) * 0.02F;
-+ 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 + var3)) * 0.005F;
-- if(var11 < var9) {
-+ float var11 = (var10 - 20.0F - ((float)this.updateCounter + par3)) * 0.005F;
-+
-+ if (var11 < var9) {
- var9 = var11;
- }
-
-- if(var9 > 1.0F) {
-+ if (var9 > 1.0F) {
- var9 = 1.0F;
- }
-
-@@ -123,13 +136,16 @@
- var4.draw();
- }
-
-- public void drawScreen(int var1, int var2, float var3) {
-- this.func_73986_b(var1, var2, var3);
-+ /**
-+ * 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 + var3) * this.field_73987_d;
-+ float var8 = -((float)this.updateCounter + par3) * this.field_73987_d;
- GL11.glPushMatrix();
- GL11.glTranslatef(0.0F, var8, 0.0F);
- this.mc.getTextureManager().bindTexture(minecraftLogoTexture);
-@@ -138,22 +154,24 @@
- this.drawTexturedModalRect(var6 + 155, var7, 0, 45, 155, 44);
- var4.setColorOpaque_I(16777215);
- int var9 = var7 + 200;
--
- int var10;
-- for(var10 = 0; var10 < this.d.size(); ++var10) {
-- if(var10 == this.d.size() - 1) {
-+
-+ 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) {
-+
-+ 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.d.get(var10);
-- if(var12.startsWith("[C]")) {
-+ 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.b.setSeed((long)var10 * 4238972211L + (long)(this.updateCounter / 4));
-+ this.fontRenderer.fontRandom.setSeed((long)var10 * 4238972211L + (long)(this.updateCounter / 4));
- this.fontRenderer.drawStringWithShadow(var12, var6, var9, 16777215);
- }
- }
-@@ -175,6 +193,6 @@
- var4.addVertexWithUV(0.0D, 0.0D, (double)this.zLevel, 0.0D, 0.0D);
- var4.draw();
- GL11.glDisable(GL11.GL_BLEND);
-- super.drawScreen(var1, var2, var3);
-+ super.drawScreen(par1, par2, par3);
- }
- }
---- /dev/null
-+++ org/spoutcraft/client/inventory/ItemData.java
-@@ -1,0 +1,69 @@
-+/*
-+ * This file is part of Spoutcraft.
-+ *
-+ * Copyright (c) 2011 SpoutcraftDev
-+ * Spoutcraft is licensed under the GNU Lesser General Public License.
-+ *
-+ * Spoutcraft is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation, either version 3 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Spoutcraft is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program. If not, see .
-+ */
-+package org.spoutcraft.client.inventory;
-+
-+import java.util.HashMap;
-+
-+public class ItemData {
-+ public final int id;
-+ public final short data;
-+ private static final HashMap> itemDatas= new HashMap>();
-+ protected ItemData(int id) {
-+ this.id = id;
-+ this.data = 0;
-+ }
-+
-+ private ItemData(int id, int data) {
-+ this.id = id;
-+ this.data = (short)data;
-+ }
-+
-+ @Override
-+ public boolean equals(Object obj) {
-+ if (obj instanceof ItemData) {
-+ ItemData temp = (ItemData)obj;
-+ return temp.id == id && temp.data == data;
-+ }
-+ return false;
-+ }
-+
-+ @Override
-+ public int hashCode() {
-+ return 37 * id * 7 * (2 + data);
-+ }
-+
-+ public static ItemData getItemData(int id) {
-+ return getItemData(id, 0);
-+ }
-+
-+ public static ItemData getItemData(int id, int data) {
-+ HashMap itemDatasForId = itemDatas.get(id);
-+ if (itemDatasForId == null) {
-+ itemDatasForId = new HashMap();
-+ itemDatas.put(id, itemDatasForId);
-+ }
-+ ItemData itemData = itemDatasForId.get(data);
-+ if (itemData == null) {
-+ itemData = new ItemData(id, data);
-+ itemDatasForId.put(data, itemData);
-+ }
-+ return itemData;
-+ }
-+}
---- net/minecraft/src/ModelSquid.java
-+++ net/minecraft/src/ModelSquid.java
-@@ -1,7 +1,11 @@
- 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() {
-@@ -10,7 +14,7 @@
- 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) {
-+ 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;
-@@ -19,30 +23,35 @@
- 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 * 0.5D;
-+ var3 = (double)var2 * Math.PI * -2.0D / (double)this.squidTentacles.length + (Math.PI / 2D);
- this.squidTentacles[var2].rotateAngleY = (float)var3;
- }
--
- }
-
-- public void setRotationAngles(float var1, float var2, float var3, float var4, float var5, float var6, Entity var7) {
-+ /**
-+ * 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) {
-+ for (int var10 = 0; var10 < var9; ++var10) {
- ModelRenderer var11 = var8[var10];
-- var11.rotateAngleX = var3;
-+ var11.rotateAngleX = par3;
- }
--
- }
-
-- public void render(Entity var1, float var2, float var3, float var4, float var5, float var6, float var7) {
-- this.setRotationAngles(var2, var3, var4, var5, var6, var7, var1);
-- this.squidBody.render(var7);
-+ /**
-+ * 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(var7);
-+ for (int var8 = 0; var8 < this.squidTentacles.length; ++var8) {
-+ this.squidTentacles[var8].render(par7);
- }
--
- }
- }
---- net/minecraft/src/RecipesArmor.java
-+++ net/minecraft/src/RecipesArmor.java
-@@ -1,18 +1,24 @@
- package net.minecraft.src;
-
- public class RecipesArmor {
-- private String[][] a = new String[][]{{"XXX", "X X"}, {"X X", "XXX", "XXX"}, {"XXX", "X X", "X X"}, {"X X", "X X"}};
-- private Object[][] b = new Object[][]{{Item.leather, Block.fire, Item.ingotIron, Item.diamond, Item.ingotGold}, {Item.helmetLeather, Item.helmetChain, Item.helmetIron, Item.helmetDiamond, Item.helmetGold}, {Item.plateLeather, Item.plateChain, Item.plateIron, Item.plateDiamond, Item.plateGold}, {Item.legsLeather, Item.legsChain, Item.legsIron, Item.legsDiamond, Item.legsGold}, {Item.bootsLeather, Item.bootsChain, Item.bootsIron, Item.bootsDiamond, Item.bootsGold}};
--
-- public void addRecipes(CraftingManager var1) {
-- for(int var2 = 0; var2 < this.b[0].length; ++var2) {
-- Object var3 = this.b[0][var2];
--
-- for(int var4 = 0; var4 < this.b.length - 1; ++var4) {
-- Item var5 = (Item)this.b[var4 + 1][var2];
-- var1.addRecipe(new ItemStack(var5), new Object[]{this.a[var4], Character.valueOf('X'), var3});
-+ private String[][] recipePatterns = new String[][] {{"XXX", "X X"}, {"X X", "XXX", "XXX"}, {"XXX", "X X", "X X"}, {"X X", "X X"}};
-+ private Object[][] recipeItems;
-+
-+ public RecipesArmor() {
-+ this.recipeItems = new Object[][] {{Item.leather, Block.fire, Item.ingotIron, Item.diamond, Item.ingotGold}, {Item.helmetLeather, Item.helmetChain, Item.helmetIron, Item.helmetDiamond, Item.helmetGold}, {Item.plateLeather, Item.plateChain, Item.plateIron, Item.plateDiamond, Item.plateGold}, {Item.legsLeather, Item.legsChain, Item.legsIron, Item.legsDiamond, Item.legsGold}, {Item.bootsLeather, Item.bootsChain, Item.bootsIron, Item.bootsDiamond, Item.bootsGold}};
-+ }
-+
-+ /**
-+ * Adds the armor recipes to the CraftingManager.
-+ */
-+ public void addRecipes(CraftingManager par1CraftingManager) {
-+ for (int var2 = 0; var2 < this.recipeItems[0].length; ++var2) {
-+ Object var3 = this.recipeItems[0][var2];
-+
-+ for (int var4 = 0; var4 < this.recipeItems.length - 1; ++var4) {
-+ Item var5 = (Item)this.recipeItems[var4 + 1][var2];
-+ par1CraftingManager.addRecipe(new ItemStack(var5), new Object[] {this.recipePatterns[var4], 'X', var3});
- }
- }
--
- }
- }
---- /dev/null
-+++ org/spoutcraft/client/gui/minimap/ResetButton.java
-@@ -1,0 +1,41 @@
-+/*
-+ * This file is part of Spoutcraft.
-+ *
-+ * Copyright (c) 2011 SpoutcraftDev
-+ * Spoutcraft is licensed under the GNU Lesser General Public License.
-+ *
-+ * Spoutcraft is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation, either version 3 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Spoutcraft is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program. If not, see .
-+ */
-+package org.spoutcraft.client.gui.minimap;
-+
-+import org.spoutcraft.client.SpoutClient;
-+import org.spoutcraft.client.gui.SafeButton;
-+
-+public class ResetButton extends SafeButton {
-+ GuiMinimapMenu parent;
-+
-+ public ResetButton(GuiMinimapMenu parent) {
-+ setText("Reset to Default");
-+ setTooltip("Resets all options to default settings.");
-+ this.parent = parent;
-+ }
-+
-+ @Override
-+ protected void executeAction() {
-+ MinimapConfig.initialize(false);
-+ MinimapConfig.getInstance().save();
-+
-+ SpoutClient.getHandle().displayGuiScreen(new GuiMinimapMenu(parent.parent));
-+ }
-+}
---- net/minecraft/src/BlockWood.java
-+++ net/minecraft/src/BlockWood.java
-@@ -3,39 +3,53 @@
- import java.util.List;
-
- public class BlockWood extends Block {
-- public static final String[] a = new String[]{"oak", "spruce", "birch", "jungle"};
-+
-+ /** 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 var1) {
-- super(var1, Material.wood);
-+ public BlockWood(int par1) {
-+ super(par1, Material.wood);
- this.setCreativeTab(CreativeTabs.tabBlock);
- }
-
-- public Icon getIcon(int var1, int var2) {
-- if(var2 < 0 || var2 >= this.iconArray.length) {
-- var2 = 0;
-- }
--
-- return this.iconArray[var2];
-- }
--
-- public int damageDropped(int var1) {
-- return var1;
-- }
--
-- public void getSubBlocks(int var1, CreativeTabs var2, List var3) {
-- var3.add(new ItemStack(var1, 1, 0));
-- var3.add(new ItemStack(var1, 1, 1));
-- var3.add(new ItemStack(var1, 1, 2));
-- var3.add(new ItemStack(var1, 1, 3));
-- }
--
-- public void registerIcons(IconRegister var1) {
-- this.iconArray = new Icon[a.length];
--
-- for(int var2 = 0; var2 < this.iconArray.length; ++var2) {
-- this.iconArray[var2] = var1.registerIcon(this.getTextureName() + "_" + a[var2]);
-- }
--
-+ /**
-+ * 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]);
-+ }
- }
- }
---- /dev/null
-+++ org/spoutcraft/api/gui/GenericSlot.java
-@@ -1,0 +1,151 @@
-+/*
-+ * This file is part of Spoutcraft.
-+ *
-+ * Copyright (c) 2011 SpoutcraftDev
-+ * Spoutcraft is licensed under the GNU Lesser General Public License.
-+ *
-+ * Spoutcraft is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation, either version 3 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Spoutcraft is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program. If not, see .
-+ */
-+package org.spoutcraft.api.gui;
-+
-+import java.io.IOException;
-+import java.util.ArrayList;
-+import java.util.HashMap;
-+import java.util.List;
-+
-+import net.minecraft.src.Enchantment;
-+
-+import org.spoutcraft.api.Spoutcraft;
-+import org.spoutcraft.api.inventory.ItemStack;
-+import org.spoutcraft.api.io.SpoutInputStream;
-+import org.spoutcraft.api.io.SpoutOutputStream;
-+
-+public class GenericSlot extends GenericControl implements Slot {
-+ private ItemStack stack = new ItemStack(0);
-+ private int depth = 16;
-+ private boolean renderAmount = true;
-+
-+ public WidgetType getType() {
-+ return WidgetType.Slot;
-+ }
-+
-+ public void render() {
-+ Spoutcraft.getRenderDelegate().render(this);
-+ }
-+
-+ public ItemStack getItem() {
-+ if (stack == null) {
-+ stack = new ItemStack(0);
-+ }
-+ return stack.clone();
-+ }
-+
-+ public Slot setItem(ItemStack item) {
-+ if (item == null) {
-+ stack = new ItemStack(0);
-+ setTooltip("");
-+ return this;
-+ }
-+ stack = item.clone();
-+ setTooltip(Spoutcraft.getMaterialManager().getToolTip(stack));
-+ return this;
-+ }
-+
-+ public boolean doesRenderAmount() {
-+ return renderAmount;
-+ }
-+
-+ public GenericSlot setRenderAmount(boolean renderAmount) {
-+ this.renderAmount = renderAmount;
-+ return this;
-+ }
-+
-+ public boolean onItemPut(ItemStack item) {
-+ return true;
-+ }
-+
-+ public boolean onItemTake(ItemStack item) {
-+ return true;
-+ }
-+
-+ public void onItemShiftClicked() {
-+ }
-+
-+ public boolean onItemExchange(ItemStack current, ItemStack cursor) {
-+ return true;
-+ }
-+
-+ public int getDepth() {
-+ return depth;
-+ }
-+
-+ public Slot setDepth(int depth) {
-+ this.depth = depth;
-+ return this;
-+ }
-+
-+ @Override
-+ public void readData(SpoutInputStream input) throws IOException {
-+ super.readData(input);
-+
-+ setItem(new ItemStack(input.readInt(), (int) input.readShort(), input.readShort()));
-+ depth = input.readInt();
-+
-+ renderAmount = input.readBoolean();
-+ boolean hasDisplayName = input.readBoolean();
-+ if (hasDisplayName) {
-+ stack.setDisplayName(input.readString());
-+ }
-+
-+ boolean hasLore = input.readBoolean();
-+ if (hasLore) {
-+ // TODO: Gather lore
-+ int lsize = input.readInt();
-+ List lore = new ArrayList();
-+ for (int i = 0; i enchants = new HashMap();
-+ for (int i = 0; i 0) {
-+ stack.setEnchants(enchants);
-+ }
-+ }
-+
-+ setTooltip(Spoutcraft.getMaterialManager().getToolTip(stack));
-+
-+ }
-+
-+ @Override
-+ public void writeData(SpoutOutputStream output) throws IOException {
-+ super.writeData(output);
-+ output.writeInt(stack.getTypeId());
-+ output.writeShort((short)stack.getAmount());
-+ output.writeShort(stack.getDurability());
-+ output.writeInt(depth);
-+ //TODO Server probably doesn't need to know this but eh what the hell...
-+ output.writeBoolean(renderAmount);
-+ }
-+}
---- /dev/null
-+++ org/spoutcraft/api/block/design/GenericBlockDesign.java
-@@ -1,0 +1,463 @@
-+/*
-+ * This file is part of Spoutcraft.
-+ *
-+ * Copyright (c) 2011 SpoutcraftDev
-+ * Spoutcraft is licensed under the GNU Lesser General Public License.
-+ *
-+ * Spoutcraft is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation, either version 3 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Spoutcraft is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program. If not, see .
-+ */
-+package org.spoutcraft.api.block.design;
-+
-+import java.io.DataInputStream;
-+import java.io.IOException;
-+import java.util.Random;
-+
-+import org.lwjgl.opengl.GL11;
-+
-+import org.spoutcraft.api.Spoutcraft;
-+import org.spoutcraft.api.gui.MinecraftTessellator;
-+import org.spoutcraft.api.io.SpoutInputStream;
-+import org.spoutcraft.api.material.Block;
-+import org.spoutcraft.api.packet.PacketUtil;
-+import org.spoutcraft.api.util.MutableIntegerVector;
-+import org.spoutcraft.client.SpoutcraftWorld;
-+
-+public class GenericBlockDesign implements BlockDesign {
-+ protected boolean reset = false;
-+
-+ protected float lowXBound;
-+ protected float lowYBound;
-+ protected float lowZBound;
-+
-+ protected float highXBound;
-+ protected float highYBound;
-+ protected float highZBound;
-+
-+ protected String textureURL;
-+ protected String textureAddon;
-+
-+ protected Texture texture;
-+
-+ protected float[][] xPos;
-+ protected float[][] yPos;
-+ protected float[][] zPos;
-+
-+ protected float[][] textXPos;
-+ protected float[][] textYPos;
-+
-+ protected int[] lightSourceXOffset;
-+ protected int[] lightSourceYOffset;
-+ protected int[] lightSourceZOffset;
-+
-+ protected float maxBrightness = 1.0F;
-+ protected float minBrightness = 0F;
-+
-+ protected float brightness = 0.5F;
-+
-+ protected int renderPass = 0;
-+
-+ public GenericBlockDesign() {
-+ }
-+
-+ public GenericBlockDesign(float lowXBound, float lowYBound, float lowZBound, float highXBound, float highYBound, float highZBound, String textureURL, String textureAddon, float[][] xPos, float[][] yPos, float[][] zPos, float[][] textXPos, float[][] textYPos, int renderPass) {
-+ this.lowXBound = lowXBound;
-+ this.lowYBound = lowYBound;
-+ this.lowZBound = lowZBound;
-+
-+ this.highXBound = highXBound;
-+ this.highYBound = highYBound;
-+ this.highZBound = highZBound;
-+
-+ this.textureURL = textureURL;
-+ this.textureAddon = textureAddon;
-+ this.xPos = xPos;
-+ this.yPos = yPos;
-+ this.zPos = zPos;
-+ this.textXPos = textXPos;
-+ this.textYPos = textYPos;
-+ this.renderPass = renderPass;
-+ }
-+
-+ public float[][] getX() {
-+ return xPos;
-+ }
-+
-+ public float[][] getY() {
-+ return yPos;
-+ }
-+
-+ public float[][] getZ() {
-+ return zPos;
-+ }
-+
-+ public float[][] getTextureXPos() {
-+ return textXPos;
-+ }
-+
-+ public float[][] getTextureYPos() {
-+ return textYPos;
-+ }
-+
-+ public float getBrightness() {
-+ return brightness;
-+ }
-+
-+ public float getMaxBrightness() {
-+ return maxBrightness;
-+ }
-+
-+ public float getMinBrightness() {
-+ return minBrightness;
-+ }
-+
-+ public float getLowXBound() {
-+ return lowXBound;
-+ }
-+
-+ public float getLowYBound() {
-+ return lowYBound;
-+ }
-+
-+ public float getLowZBound() {
-+ return lowZBound;
-+ }
-+
-+ public float getHighXBound() {
-+ return highXBound;
-+ }
-+
-+ public float getHighYBound() {
-+ return highYBound;
-+ }
-+
-+ public float getHighZBound() {
-+ return highZBound;
-+ }
-+
-+ public BlockDesign setMaxBrightness(float maxBrightness) {
-+ this.maxBrightness = maxBrightness;
-+ return this;
-+ }
-+
-+ public BlockDesign setMinBrightness(float minBrightness) {
-+ this.minBrightness = minBrightness;
-+ return this;
-+ }
-+
-+ public BlockDesign setBrightness(float brightness) {
-+ this.brightness = brightness * maxBrightness + (1 - brightness) * minBrightness;
-+ return this;
-+ }
-+
-+ public BlockDesign setRenderPass(int renderPass) {
-+ this.renderPass = renderPass;
-+ return this;
-+ }
-+
-+ public int getRenderPass() {
-+ return renderPass;
-+ }
-+
-+ public int getVersion() {
-+ return 3;
-+ }
-+
-+ public void read(SpoutInputStream input) throws IOException {
-+ textureURL = PacketUtil.readString(input);
-+ if (textureURL.equals(resetString)) {
-+ reset = true;
-+ return;
-+ }
-+ reset = false;
-+ textureAddon = PacketUtil.readString(input);
-+ xPos = PacketUtil.readDoubleArray(input);
-+ yPos = PacketUtil.readDoubleArray(input);
-+ zPos = PacketUtil.readDoubleArray(input);
-+ textXPos = PacketUtil.readDoubleArray(input);
-+ textYPos = PacketUtil.readDoubleArray(input);
-+ lowXBound = input.readFloat();
-+ lowYBound = input.readFloat();
-+ lowZBound = input.readFloat();
-+ highXBound = input.readFloat();
-+ highYBound = input.readFloat();
-+ highZBound = input.readFloat();
-+ maxBrightness = input.readFloat();
-+ minBrightness = input.readFloat();
-+ renderPass = input.readInt();
-+ lightSourceXOffset = PacketUtil.readIntArray(input);
-+ lightSourceYOffset = PacketUtil.readIntArray(input);
-+ lightSourceZOffset = PacketUtil.readIntArray(input);
-+ }
-+
-+ public void read(DataInputStream input) throws IOException {
-+ textureURL = PacketUtil.readString(input);
-+ if (textureURL.equals(resetString)) {
-+ reset = true;
-+ return;
-+ }
-+ reset = false;
-+ textureAddon = PacketUtil.readString(input);
-+ xPos = PacketUtil.readDoubleArray(input);
-+ yPos = PacketUtil.readDoubleArray(input);
-+ zPos = PacketUtil.readDoubleArray(input);
-+ textXPos = PacketUtil.readDoubleArray(input);
-+ textYPos = PacketUtil.readDoubleArray(input);
-+ lowXBound = input.readFloat();
-+ lowYBound = input.readFloat();
-+ lowZBound = input.readFloat();
-+ highXBound = input.readFloat();
-+ highYBound = input.readFloat();
-+ highZBound = input.readFloat();
-+ maxBrightness = input.readFloat();
-+ minBrightness = input.readFloat();
-+ renderPass = input.readInt();
-+ lightSourceXOffset = PacketUtil.readIntArray(input);
-+ lightSourceYOffset = PacketUtil.readIntArray(input);
-+ lightSourceZOffset = PacketUtil.readIntArray(input);
-+ }
-+
-+ private final static String resetString = "[reset]";
-+
-+ public BlockDesign setTexture(String addon, String textureURL) {
-+ this.textureAddon = addon;
-+ this.textureURL = textureURL;
-+ return this;
-+ }
-+
-+ public BlockDesign setBoundingBox(float lowX, float lowY, float lowZ, float highX, float highY, float highZ) {
-+ this.lowXBound = lowX;
-+ this.lowYBound = lowY;
-+ this.lowZBound = lowZ;
-+ this.highXBound = highX;
-+ this.highYBound = highY;
-+ this.highZBound = highZ;
-+ return this;
-+ }
-+
-+ public BlockDesign setQuadNumber(int quads) {
-+ xPos = new float[quads][];
-+ yPos = new float[quads][];
-+ zPos = new float[quads][];
-+ textXPos = new float[quads][];
-+ textYPos = new float[quads][];
-+ lightSourceXOffset = new int[quads];
-+ lightSourceYOffset = new int[quads];
-+ lightSourceZOffset = new int[quads];
-+
-+ for (int i = 0; i < quads; i++) {
-+ xPos[i] = new float[4];
-+ yPos[i] = new float[4];
-+ zPos[i] = new float[4];
-+ textXPos[i] = new float[4];
-+ textYPos[i] = new float[4];
-+ lightSourceXOffset[i] = 0;
-+ lightSourceYOffset[i] = 0;
-+ lightSourceZOffset[i] = 0;
-+ }
-+ return this;
-+ }
-+
-+ public BlockDesign setQuad(int quadNumber, float x1, float y1, float z1, int tx1, int ty1, float x2, float y2, float z2, int tx2, int ty2, float x3, float y3, float z3, int tx3, int ty3, float x4, float y4, float z4, int tx4, int ty4, int textureSizeX, int textureSizeY) {
-+ setVertex(quadNumber, 0, x1, y1, z1, tx1, ty1, textureSizeX, textureSizeY);
-+ setVertex(quadNumber, 1, x2, y2, z2, tx2, ty2, textureSizeX, textureSizeY);
-+ setVertex(quadNumber, 2, x3, y3, z3, tx3, ty3, textureSizeX, textureSizeY);
-+ setVertex(quadNumber, 3, x4, y4, z4, tx4, ty4, textureSizeX, textureSizeY);
-+ return this;
-+ }
-+
-+ public BlockDesign setVertex(int quadNumber, int vertexNumber, float x, float y, float z, int tx, int ty, int textureSizeX, int textureSizeY) {
-+ xPos[quadNumber][vertexNumber] = x;
-+ yPos[quadNumber][vertexNumber] = y;
-+ zPos[quadNumber][vertexNumber] = z;
-+ textXPos[quadNumber][vertexNumber] = (float) tx / (float) textureSizeX;
-+ textYPos[quadNumber][vertexNumber] = (float) ty / (float) textureSizeY;
-+ return this;
-+ }
-+
-+ public String getTextureURL() {
-+ return textureURL;
-+ }
-+
-+ public String getTextureAddon() {
-+ return textureAddon;
-+ }
-+
-+ public boolean isReset() {
-+ return reset;
-+ }
-+
-+ public BlockDesign setLightSource(int quad, int x, int y, int z) {
-+ lightSourceXOffset[quad] = x;
-+ lightSourceYOffset[quad] = y;
-+ lightSourceZOffset[quad] = z;
-+ return this;
-+ }
-+
-+ public MutableIntegerVector getLightSource(int quad, int x, int y, int z) {
-+ MutableIntegerVector blockVector = new MutableIntegerVector(x + lightSourceXOffset[quad], y + lightSourceYOffset[quad], z + lightSourceZOffset[quad]);
-+ return blockVector;
-+ }
-+
-+ public BlockDesign setTexture(String addon, Texture texture) {
-+ this.texture = texture;
-+ return setTexture(addon, texture.getTexture());
-+ }
-+
-+ public Texture getTexture() {
-+ return texture;
-+ }
-+
-+ public BlockDesign setQuad(Quad quad) {
-+ return setVertex(quad.getVertex(0)).setVertex(quad.getVertex(1)).setVertex(quad.getVertex(2)).setVertex(quad.getVertex(3));
-+ }
-+
-+ public BlockDesign setVertex(Vertex vertex) {
-+ return setVertex(vertex.getQuadNum(), vertex.getIndex(), vertex.getX(), vertex.getY(), vertex.getZ(), vertex.getTextureX(), vertex.getTextureY(), vertex.getTextureWidth(), vertex.getTextureHeight());
-+ }
-+
-+ public boolean renderBlock(Block block, int x, int y, int z) {
-+ SpoutcraftWorld world = Spoutcraft.getWorld();
-+ if (block != null) {
-+ boolean enclosed = true;
-+ enclosed &= world.isOpaque(x, y + 1, z);
-+ enclosed &= world.isOpaque(x, y - 1, z);
-+ enclosed &= world.isOpaque(x, y, z + 1);
-+ enclosed &= world.isOpaque(x, y, z - 1);
-+ enclosed &= world.isOpaque(x + 1, y, z);
-+ enclosed &= world.isOpaque(x - 1, y, z);
-+ if (enclosed) {
-+ return false;
-+ }
-+ }
-+
-+ if (getX() == null) {
-+ return false;
-+ }
-+
-+ setBrightness(1F);
-+
-+ MinecraftTessellator tessellator = Spoutcraft.getTessellator();
-+
-+ int internalLightLevel = 0;
-+ if (block == null) {
-+ internalLightLevel = 0x00F000F0;
-+ } else {
-+ internalLightLevel = world.getMixedBrightnessAt(block, x, y, z);
-+ }
-+
-+ for (int i = 0; i < getX().length; i++) {
-+ MutableIntegerVector sourceBlock = getLightSource(i, x, y, z);
-+
-+ int sideBrightness;
-+
-+ if (block != null && sourceBlock != null) {
-+ sideBrightness = world.getMixedBrightnessAt(block, sourceBlock.getBlockX(), sourceBlock.getBlockY(), sourceBlock.getBlockZ());
-+ } else {
-+ sideBrightness = internalLightLevel;
-+ }
-+
-+ if (block == null) {
-+ if (i == 5) {
-+ tessellator.setNormal(0, 1, 0);
-+ } else if (i == 3) {
-+ tessellator.setNormal(0, 0, 1);
-+ } else if (i == 2) {
-+ tessellator.setNormal(1, 0, 0);
-+ }
-+ }
-+
-+ tessellator.setBrightness(sideBrightness);
-+
-+ tessellator.setColorOpaqueFloat(1.0F, 1.0F, 1.0F);
-+
-+ float[] xx = getX()[i];
-+ float[] yy = getY()[i];
-+ float[] zz = getZ()[i];
-+ float[] tx = getTextureXPos()[i];
-+ float[] ty = getTextureYPos()[i];
-+
-+ for (int j = 0; j < 4; j++) {
-+ tessellator.addVertexWithUV(x + xx[j], y + yy[j], z + zz[j], tx[j], ty[j]);
-+ }
-+ }
-+ return true;
-+ }
-+
-+ public boolean renderItemstack(net.minecraft.src.ItemStack item, float x, float y, float depth, float rotation, float scale, Random rand) {
-+ int items = 1;
-+ if (item != null) {
-+ int amt = item.stackSize;
-+ if (amt > 1) {
-+ items = 2;
-+ }
-+
-+ if (amt > 5) {
-+ items = 3;
-+ }
-+
-+ if (amt > 20) {
-+ items = 4;
-+ }
-+ }
-+
-+ boolean result = false;
-+
-+ GL11.glPushMatrix();
-+ GL11.glColor4f(1, 1, 1, 1);
-+ GL11.glTranslatef(x, y, depth);
-+
-+ GL11.glRotatef(rotation, 0.0F, 1.0F, 0.0F);
-+ GL11.glScalef(scale, scale, scale);
-+
-+ Spoutcraft.getTessellator().startDrawingQuads();
-+ Spoutcraft.getTessellator().setNormal(0.0F, -1.0F, 0.0F);
-+
-+ for (int i = 0; i < items; ++i) {
-+ GL11.glPushMatrix();
-+ if (i > 0) {
-+ float rotX = (rand.nextFloat() * 2.0F - 1.0F) * 0.2F / 0.25F;
-+ float rotY = (rand.nextFloat() * 2.0F - 1.0F) * 0.2F / 0.25F;
-+ float rotZ = (rand.nextFloat() * 2.0F - 1.0F) * 0.2F / 0.25F;
-+ GL11.glTranslatef(rotX, rotY, rotZ);
-+ }
-+
-+ result &= renderBlock(null, 0, 0, 0);
-+
-+ GL11.glPopMatrix();
-+ }
-+
-+ Spoutcraft.getTessellator().draw();
-+ GL11.glPopMatrix();
-+
-+ return result;
-+ }
-+
-+ public boolean renderItemOnHUD(float x, float y, float depth) {
-+ GL11.glPushMatrix();
-+ Spoutcraft.getTessellator().startDrawingQuads();
-+
-+ GL11.glTranslatef(x, y+1, depth);
-+ GL11.glScalef(10.0F, 10.0F, 10.0F);
-+ GL11.glTranslatef(1.0F, 0.5F, 1.0F);
-+ GL11.glScalef(1.0F, 1.0F, -1.0F);
-+ GL11.glRotatef(210.0F, 1.0F, 0.0F, 0.0F);
-+ GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F);
-+ GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F);
-+ boolean result = renderBlock(null, 0, 0, 0);
-+ Spoutcraft.getTessellator().draw();
-+ GL11.glPopMatrix();
-+
-+ return result;
-+ }
-+}
---- net/minecraft/src/ItemEgg.java
-+++ net/minecraft/src/ItemEgg.java
-@@ -1,22 +1,26 @@
- package net.minecraft.src;
-
- public class ItemEgg extends Item {
-- public ItemEgg(int var1) {
-- super(var1);
-+ public ItemEgg(int par1) {
-+ super(par1);
- this.maxStackSize = 16;
- this.setCreativeTab(CreativeTabs.tabMaterials);
- }
-
-- public ItemStack onItemRightClick(ItemStack var1, World var2, EntityPlayer var3) {
-- if(!var3.capabilities.isCreativeMode) {
-- --var1.stackSize;
-- }
--
-- var2.playSoundAtEntity(var3, "random.bow", 0.5F, 0.4F / (f.nextFloat() * 0.4F + 0.8F));
-- if(!var2.isRemote) {
-- var2.spawnEntityInWorld(new EntityEgg(var2, var3));
-- }
--
-- return var1;
-+ /**
-+ * 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.capabilities.isCreativeMode) {
-+ --par1ItemStack.stackSize;
-+ }
-+
-+ par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
-+
-+ if (!par2World.isRemote) {
-+ par2World.spawnEntityInWorld(new EntityEgg(par2World, par3EntityPlayer));
-+ }
-+
-+ return par1ItemStack;
- }
- }
---- net/minecraft/src/WorldTemplateList.java
-+++ net/minecraft/src/WorldTemplateList.java
-@@ -9,24 +9,27 @@
- import java.util.List;
-
- public class WorldTemplateList extends ValueObject {
-- public List a;
-+ public List field_110736_a;
-
-- public static WorldTemplateList func_110735_a(String var0) {
-+ public static WorldTemplateList func_110735_a(String par0Str) {
- WorldTemplateList var1 = new WorldTemplateList();
-- var1.a = new ArrayList();
-+ var1.field_110736_a = new ArrayList();
-
- try {
-- JsonRootNode var2 = (new JdomParser()).parse(var0);
-- if(var2.isArrayNode(new Object[]{"templates"})) {
-- Iterator var3 = var2.getArrayNode(new Object[]{"templates"}).iterator();
--
-- while(var3.hasNext()) {
-+ JsonRootNode var2 = (new JdomParser()).parse(par0Str);
-+
-+ if (var2.isArrayNode(new Object[] {"templates"})) {
-+ Iterator var3 = var2.getArrayNode(new Object[] {"templates"}).iterator();
-+
-+ while (var3.hasNext()) {
- JsonNode var4 = (JsonNode)var3.next();
-- var1.a.add(WorldTemplate.func_110730_a(var4));
-+ var1.field_110736_a.add(WorldTemplate.func_110730_a(var4));
- }
- }
- } catch (InvalidSyntaxException var5) {
-+ ;
- } catch (IllegalArgumentException var6) {
-+ ;
- }
-
- return var1;
---- net/minecraft/src/ContainerWorkbench.java
-+++ net/minecraft/src/ContainerWorkbench.java
-@@ -1,6 +1,8 @@
- package net.minecraft.src;
-
- public class ContainerWorkbench extends Container {
-+
-+ /** The crafting matrix inventory (3x3). */
- public InventoryCrafting craftMatrix = new InventoryCrafting(this, 3, 3);
- public IInventory craftResult = new InventoryCraftResult();
- private World worldObj;
-@@ -8,96 +10,114 @@
- private int posY;
- private int posZ;
-
-- public ContainerWorkbench(InventoryPlayer var1, World var2, int var3, int var4, int var5) {
-- this.worldObj = var2;
-- this.posX = var3;
-- this.posY = var4;
-- this.posZ = var5;
-- this.addSlotToContainer(new SlotCrafting(var1.player, this.craftMatrix, this.craftResult, 0, 124, 35));
--
-- int var6;
-+ public ContainerWorkbench(InventoryPlayer par1InventoryPlayer, World par2World, int par3, int par4, int par5) {
-+ this.worldObj = par2World;
-+ this.posX = par3;
-+ this.posY = par4;
-+ this.posZ = par5;
-+ this.addSlotToContainer(new SlotCrafting(par1InventoryPlayer.player, this.craftMatrix, this.craftResult, 0, 124, 35));
- int var7;
-- for(var6 = 0; var6 < 3; ++var6) {
-- for(var7 = 0; var7 < 3; ++var7) {
-+ int var6;
-+
-+ for (var6 = 0; var6 < 3; ++var6) {
-+ for (var7 = 0; var7 < 3; ++var7) {
- this.addSlotToContainer(new Slot(this.craftMatrix, var7 + var6 * 3, 30 + var7 * 18, 17 + var6 * 18));
- }
- }
-
-- for(var6 = 0; var6 < 3; ++var6) {
-- for(var7 = 0; var7 < 9; ++var7) {
-- this.addSlotToContainer(new Slot(var1, var7 + var6 * 9 + 9, 8 + var7 * 18, 84 + var6 * 18));
-+ for (var6 = 0; var6 < 3; ++var6) {
-+ for (var7 = 0; var7 < 9; ++var7) {
-+ this.addSlotToContainer(new Slot(par1InventoryPlayer, var7 + var6 * 9 + 9, 8 + var7 * 18, 84 + var6 * 18));
- }
- }
-
-- for(var6 = 0; var6 < 9; ++var6) {
-- this.addSlotToContainer(new Slot(var1, var6, 8 + var6 * 18, 142));
-+ for (var6 = 0; var6 < 9; ++var6) {
-+ this.addSlotToContainer(new Slot(par1InventoryPlayer, var6, 8 + var6 * 18, 142));
- }
-
- this.onCraftMatrixChanged(this.craftMatrix);
- }
-
-- public void onCraftMatrixChanged(IInventory var1) {
-+ // Spout Start
-+ public IInventory getIInventory() {
-+ return null;
-+ }
-+ // Spout End
-+
-+ /**
-+ * Callback for when the crafting matrix is changed.
-+ */
-+ public void onCraftMatrixChanged(IInventory par1IInventory) {
- this.craftResult.setInventorySlotContents(0, CraftingManager.getInstance().findMatchingRecipe(this.craftMatrix, this.worldObj));
- }
-
-- public void onContainerClosed(EntityPlayer var1) {
-- super.onContainerClosed(var1);
-- if(!this.worldObj.isRemote) {
-- for(int var2 = 0; var2 < 9; ++var2) {
-+ /**
-+ * Called when the container is closed.
-+ */
-+ public void onContainerClosed(EntityPlayer par1EntityPlayer) {
-+ super.onContainerClosed(par1EntityPlayer);
-+
-+ if (!this.worldObj.isRemote) {
-+ for (int var2 = 0; var2 < 9; ++var2) {
- ItemStack var3 = this.craftMatrix.getStackInSlotOnClosing(var2);
-- if(var3 != null) {
-- var1.dropPlayerItem(var3);
-+
-+ if (var3 != null) {
-+ par1EntityPlayer.dropPlayerItem(var3);
- }
- }
--
- }
- }
-
-- public boolean canInteractWith(EntityPlayer var1) {
-- return this.worldObj.getBlockId(this.posX, this.posY, this.posZ) != Block.workbench.blockID ? false : var1.getDistanceSq((double)this.posX + 0.5D, (double)this.posY + 0.5D, (double)this.posZ + 0.5D) <= 64.0D;
-+ public boolean canInteractWith(EntityPlayer par1EntityPlayer) {
-+ 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;
- }
-
-- public ItemStack transferStackInSlot(EntityPlayer var1, int var2) {
-+ /**
-+ * 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.c.get(var2);
-- if(var4 != null && var4.getHasStack()) {
-+ Slot var4 = (Slot)this.inventorySlots.get(par2);
-+
-+ if (var4 != null && var4.getHasStack()) {
- ItemStack var5 = var4.getStack();
- var3 = var5.copy();
-- if(var2 == 0) {
-- if(!this.mergeItemStack(var5, 10, 46, true)) {
-+
-+ if (par2 == 0) {
-+ if (!this.mergeItemStack(var5, 10, 46, true)) {
- return null;
- }
-
- var4.onSlotChange(var5, var3);
-- } else if(var2 >= 10 && var2 < 37) {
-- if(!this.mergeItemStack(var5, 37, 46, false)) {
-- return null;
-- }
-- } else if(var2 >= 37 && var2 < 46) {
-- if(!this.mergeItemStack(var5, 10, 37, false)) {
-- return null;
-- }
-- } else if(!this.mergeItemStack(var5, 10, 46, false)) {
-+ } else if (par2 >= 10 && par2 < 37) {
-+ if (!this.mergeItemStack(var5, 37, 46, false)) {
-+ return null;
-+ }
-+ } else if (par2 >= 37 && par2 < 46) {
-+ if (!this.mergeItemStack(var5, 10, 37, false)) {
-+ return null;
-+ }
-+ } else if (!this.mergeItemStack(var5, 10, 46, false)) {
- return null;
- }
-
-- if(var5.stackSize == 0) {
-+ if (var5.stackSize == 0) {
- var4.putStack((ItemStack)null);
- } else {
- var4.onSlotChanged();
- }
-
-- if(var5.stackSize == var3.stackSize) {
-+ if (var5.stackSize == var3.stackSize) {
- return null;
- }
-
-- var4.onPickupFromSlot(var1, var5);
-+ var4.onPickupFromSlot(par1EntityPlayer, var5);
- }
-
- return var3;
- }
-
-- public boolean func_94530_a(ItemStack var1, Slot var2) {
-- return var2.inventory != this.craftResult && super.func_94530_a(var1, var2);
-+ public boolean func_94530_a(ItemStack par1ItemStack, Slot par2Slot) {
-+ return par2Slot.inventory != this.craftResult && super.func_94530_a(par1ItemStack, par2Slot);
- }
- }
---- net/minecraft/src/McoServerAddress.java
-+++ net/minecraft/src/McoServerAddress.java
-@@ -5,16 +5,18 @@
- import argo.saj.InvalidSyntaxException;
-
- public class McoServerAddress extends ValueObject {
-- public String a;
-+ public String field_96417_a;
-
-- public static McoServerAddress func_98162_a(String var0) {
-+ public static McoServerAddress func_98162_a(String par0Str) {
- McoServerAddress var1 = new McoServerAddress();
-
- try {
-- JsonRootNode var2 = (new JdomParser()).parse(var0);
-- var1.a = var2.getStringValue(new Object[]{"address"});
-+ JsonRootNode var2 = (new JdomParser()).parse(par0Str);
-+ var1.field_96417_a = var2.getStringValue(new Object[] {"address"});
- } catch (InvalidSyntaxException var3) {
-+ ;
- } catch (IllegalArgumentException var4) {
-+ ;
- }
-
- return var1;
---- net/minecraft/src/ContainerPlayer.java
-+++ net/minecraft/src/ContainerPlayer.java
-@@ -1,116 +1,144 @@
- package net.minecraft.src;
-
- public class ContainerPlayer extends Container {
-+
-+ /** The crafting matrix inventory. */
- public InventoryCrafting craftMatrix = new InventoryCrafting(this, 2, 2);
- public IInventory craftResult = new InventoryCraftResult();
-+
-+ /** Determines if inventory manipulation should be handled. */
- public boolean isLocalWorld;
- private final EntityPlayer thePlayer;
-
-- public ContainerPlayer(InventoryPlayer var1, boolean var2, EntityPlayer var3) {
-- this.isLocalWorld = var2;
-- this.thePlayer = var3;
-- this.addSlotToContainer(new SlotCrafting(var1.player, this.craftMatrix, this.craftResult, 0, 144, 36));
--
-+ public ContainerPlayer(InventoryPlayer par1InventoryPlayer, boolean par2, EntityPlayer par3EntityPlayer) {
-+ this.isLocalWorld = par2;
-+ this.thePlayer = par3EntityPlayer;
-+ this.addSlotToContainer(new SlotCrafting(par1InventoryPlayer.player, this.craftMatrix, this.craftResult, 0, 144, 36));
- int var4;
- int var5;
-- for(var4 = 0; var4 < 2; ++var4) {
-- for(var5 = 0; var5 < 2; ++var5) {
-+
-+ for (var4 = 0; var4 < 2; ++var4) {
-+ for (var5 = 0; var5 < 2; ++var5) {
- this.addSlotToContainer(new Slot(this.craftMatrix, var5 + var4 * 2, 88 + var5 * 18, 26 + var4 * 18));
- }
- }
-
-- for(var4 = 0; var4 < 4; ++var4) {
-- this.addSlotToContainer(new SlotArmor(this, var1, var1.getSizeInventory() - 1 - var4, 8, 8 + var4 * 18, var4));
-+ for (var4 = 0; var4 < 4; ++var4) {
-+ this.addSlotToContainer(new SlotArmor(this, par1InventoryPlayer, par1InventoryPlayer.getSizeInventory() - 1 - var4, 8, 8 + var4 * 18, var4));
- }
-
-- for(var4 = 0; var4 < 3; ++var4) {
-- for(var5 = 0; var5 < 9; ++var5) {
-- this.addSlotToContainer(new Slot(var1, var5 + (var4 + 1) * 9, 8 + var5 * 18, 84 + var4 * 18));
-+ for (var4 = 0; var4 < 3; ++var4) {
-+ for (var5 = 0; var5 < 9; ++var5) {
-+ this.addSlotToContainer(new Slot(par1InventoryPlayer, var5 + (var4 + 1) * 9, 8 + var5 * 18, 84 + var4 * 18));
- }
- }
-
-- for(var4 = 0; var4 < 9; ++var4) {
-- this.addSlotToContainer(new Slot(var1, var4, 8 + var4 * 18, 142));
-+ for (var4 = 0; var4 < 9; ++var4) {
-+ this.addSlotToContainer(new Slot(par1InventoryPlayer, var4, 8 + var4 * 18, 142));
- }
-
- this.onCraftMatrixChanged(this.craftMatrix);
- }
-
-- public void onCraftMatrixChanged(IInventory var1) {
-+ // Spout Start - Inventory sorting
-+ public IInventory getIInventory() {
-+ return Minecraft.getMinecraft().thePlayer.inventory;
-+ }
-+
-+ @Override
-+ public boolean isSortableInventory() {
-+ return true;
-+ }
-+ // Spout End
-+
-+ /**
-+ * Callback for when the crafting matrix is changed.
-+ */
-+ public void onCraftMatrixChanged(IInventory par1IInventory) {
- this.craftResult.setInventorySlotContents(0, CraftingManager.getInstance().findMatchingRecipe(this.craftMatrix, this.thePlayer.worldObj));
- }
-
-- public void onContainerClosed(EntityPlayer var1) {
-- super.onContainerClosed(var1);
-+ /**
-+ * Called when the container is closed.
-+ */
-+ public void onContainerClosed(EntityPlayer par1EntityPlayer) {
-+ super.onContainerClosed(par1EntityPlayer);
-
-- for(int var2 = 0; var2 < 4; ++var2) {
-+ for (int var2 = 0; var2 < 4; ++var2) {
- ItemStack var3 = this.craftMatrix.getStackInSlotOnClosing(var2);
-- if(var3 != null) {
-- var1.dropPlayerItem(var3);
-+
-+ if (var3 != null) {
-+ par1EntityPlayer.dropPlayerItem(var3);
- }
- }
-
- this.craftResult.setInventorySlotContents(0, (ItemStack)null);
- }
-
-- public boolean canInteractWith(EntityPlayer var1) {
-+ public boolean canInteractWith(EntityPlayer par1EntityPlayer) {
- return true;
- }
-
-- public ItemStack transferStackInSlot(EntityPlayer var1, int var2) {
-+ /**
-+ * 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.c.get(var2);
-- if(var4 != null && var4.getHasStack()) {
-+ Slot var4 = (Slot)this.inventorySlots.get(par2);
-+
-+ if (var4 != null && var4.getHasStack()) {
- ItemStack var5 = var4.getStack();
- var3 = var5.copy();
-- if(var2 == 0) {
-- if(!this.mergeItemStack(var5, 9, 45, true)) {
-+
-+ if (par2 == 0) {
-+ if (!this.mergeItemStack(var5, 9, 45, true)) {
- return null;
- }
-
- var4.onSlotChange(var5, var3);
-- } else if(var2 >= 1 && var2 < 5) {
-- if(!this.mergeItemStack(var5, 9, 45, false)) {
-- return null;
-- }
-- } else if(var2 >= 5 && var2 < 9) {
-- if(!this.mergeItemStack(var5, 9, 45, false)) {
-- return null;
-- }
-- } else if(var3.getItem() instanceof ItemArmor && !((Slot)this.c.get(5 + ((ItemArmor)var3.getItem()).armorType)).getHasStack()) {
-+ } else if (par2 >= 1 && par2 < 5) {
-+ if (!this.mergeItemStack(var5, 9, 45, false)) {
-+ return null;
-+ }
-+ } else if (par2 >= 5 && par2 < 9) {
-+ if (!this.mergeItemStack(var5, 9, 45, false)) {
-+ return null;
-+ }
-+ } else if (var3.getItem() instanceof ItemArmor && !((Slot)this.inventorySlots.get(5 + ((ItemArmor)var3.getItem()).armorType)).getHasStack()) {
- int var6 = 5 + ((ItemArmor)var3.getItem()).armorType;
-- if(!this.mergeItemStack(var5, var6, var6 + 1, false)) {
-- return null;
-- }
-- } else if(var2 >= 9 && var2 < 36) {
-- if(!this.mergeItemStack(var5, 36, 45, false)) {
-- return null;
-- }
-- } else if(var2 >= 36 && var2 < 45) {
-- if(!this.mergeItemStack(var5, 9, 36, false)) {
-- return null;
-- }
-- } else if(!this.mergeItemStack(var5, 9, 45, false)) {
-+
-+ if (!this.mergeItemStack(var5, var6, var6 + 1, false)) {
-+ return null;
-+ }
-+ } else if (par2 >= 9 && par2 < 36) {
-+ if (!this.mergeItemStack(var5, 36, 45, false)) {
-+ return null;
-+ }
-+ } else if (par2 >= 36 && par2 < 45) {
-+ if (!this.mergeItemStack(var5, 9, 36, false)) {
-+ return null;
-+ }
-+ } else if (!this.mergeItemStack(var5, 9, 45, false)) {
- return null;
- }
-
-- if(var5.stackSize == 0) {
-+ if (var5.stackSize == 0) {
- var4.putStack((ItemStack)null);
- } else {
- var4.onSlotChanged();
- }
-
-- if(var5.stackSize == var3.stackSize) {
-+ if (var5.stackSize == var3.stackSize) {
- return null;
- }
-
-- var4.onPickupFromSlot(var1, var5);
-+ var4.onPickupFromSlot(par1EntityPlayer, var5);
- }
-
- return var3;
- }
-
-- public boolean func_94530_a(ItemStack var1, Slot var2) {
-- return var2.inventory != this.craftResult && super.func_94530_a(var1, var2);
-+ public boolean func_94530_a(ItemStack par1ItemStack, Slot par2Slot) {
-+ return par2Slot.inventory != this.craftResult && super.func_94530_a(par1ItemStack, par2Slot);
- }
- }
---- /dev/null
-+++ org/spoutcraft/client/gui/settings/controls/FancyGraphicsButton.java
-@@ -1,0 +1,66 @@
-+/*
-+ * This file is part of Spoutcraft.
-+ *
-+ * Copyright (c) 2011 SpoutcraftDev
-+ * Spoutcraft is licensed under the GNU Lesser General Public License.
-+ *
-+ * Spoutcraft is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation, either version 3 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Spoutcraft is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program. If not, see .
-+ */
-+package org.spoutcraft.client.gui.settings.controls;
-+
-+import java.util.List;
-+
-+import net.minecraft.src.Minecraft;
-+
-+import org.spoutcraft.api.gui.CheckBox;
-+import org.spoutcraft.client.config.Configuration;
-+
-+public class FancyGraphicsButton extends AutomatedButton {
-+ public boolean custom = false;
-+ private List linkedButtons = null;
-+ public FancyGraphicsButton() {
-+ setTooltip("Visual quality\nFast - lower quality, faster\nFancy - higher quality, slower\nChanges the appearance of clouds, leaves, water,\nshadows and grass sides.");
-+ }
-+
-+ @Override
-+ public String getText() {
-+ return "Graphics: " + (custom ? "Custom" : (Configuration.isFancyGraphics() ? "Fancy" :"Fast"));
-+ }
-+
-+ @Override
-+ public void onButtonClick() {
-+ Configuration.setFancyGraphics(!Configuration.isFancyGraphics());
-+ for (CheckBox check : linkedButtons) {
-+ if (check.isChecked() != Configuration.isFancyGraphics()) {
-+ check.setChecked(Configuration.isFancyGraphics());
-+ check.onButtonClick();
-+ }
-+ }
-+ Minecraft.getMinecraft().gameSettings.fancyGraphics = Configuration.isFancyGraphics();
-+ if (Minecraft.getMinecraft().theWorld != null) {
-+ Minecraft.getMinecraft().renderGlobal.updateAllRenderers();
-+ }
-+ custom = false;
-+ }
-+
-+ public void setLinkedButtons(List linked) {
-+ linkedButtons = linked;
-+ for (CheckBox check : linkedButtons) {
-+ if (check.isChecked() != Configuration.isFancyGraphics()) {
-+ custom = true;
-+ break;
-+ }
-+ }
-+ }
-+}
---- net/minecraft/src/InventoryMerchant.java
-+++ net/minecraft/src/InventoryMerchant.java
-@@ -7,41 +7,54 @@
- private MerchantRecipe currentRecipe;
- private int currentRecipeIndex;
-
-- public InventoryMerchant(EntityPlayer var1, IMerchant var2) {
-- this.thePlayer = var1;
-- this.theMerchant = var2;
-+ public InventoryMerchant(EntityPlayer par1EntityPlayer, IMerchant par2IMerchant) {
-+ this.thePlayer = par1EntityPlayer;
-+ this.theMerchant = par2IMerchant;
- }
-
-+ /**
-+ * Returns the number of slots in the inventory.
-+ */
- public int getSizeInventory() {
- return this.theInventory.length;
- }
-
-- public ItemStack getStackInSlot(int var1) {
-- return this.theInventory[var1];
-+ /**
-+ * Returns the stack in slot i
-+ */
-+ public ItemStack getStackInSlot(int par1) {
-+ return this.theInventory[par1];
- }
-
-- public ItemStack decrStackSize(int var1, int var2) {
-- if(this.theInventory[var1] != null) {
-+ /**
-+ * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a new
-+ * stack.
-+ */
-+ public ItemStack decrStackSize(int par1, int par2) {
-+ if (this.theInventory[par1] != null) {
- ItemStack var3;
-- if(var1 == 2) {
-- var3 = this.theInventory[var1];
-- this.theInventory[var1] = null;
-+
-+ if (par1 == 2) {
-+ var3 = this.theInventory[par1];
-+ this.theInventory[par1] = null;
- return var3;
-- } else if(this.theInventory[var1].stackSize <= var2) {
-- var3 = this.theInventory[var1];
-- this.theInventory[var1] = null;
-- if(this.inventoryResetNeededOnSlotChange(var1)) {
-+ } else if (this.theInventory[par1].stackSize <= par2) {
-+ var3 = this.theInventory[par1];
-+ this.theInventory[par1] = null;
-+
-+ if (this.inventoryResetNeededOnSlotChange(par1)) {
- this.resetRecipeAndSlots();
- }
-
- return var3;
- } else {
-- var3 = this.theInventory[var1].splitStack(var2);
-- if(this.theInventory[var1].stackSize == 0) {
-- this.theInventory[var1] = null;
-+ var3 = this.theInventory[par1].splitStack(par2);
-+
-+ if (this.theInventory[par1].stackSize == 0) {
-+ this.theInventory[par1] = null;
- }
-
-- if(this.inventoryResetNeededOnSlotChange(var1)) {
-+ if (this.inventoryResetNeededOnSlotChange(par1)) {
- this.resetRecipeAndSlots();
- }
-
-@@ -52,58 +65,86 @@
- }
- }
-
-- private boolean inventoryResetNeededOnSlotChange(int var1) {
-- return var1 == 0 || var1 == 1;
-+ /**
-+ * if par1 slot has changed, does resetRecipeAndSlots need to be called?
-+ */
-+ private boolean inventoryResetNeededOnSlotChange(int par1) {
-+ return par1 == 0 || par1 == 1;
- }
-
-- public ItemStack getStackInSlotOnClosing(int var1) {
-- if(this.theInventory[var1] != null) {
-- ItemStack var2 = this.theInventory[var1];
-- this.theInventory[var1] = null;
-+ /**
-+ * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - like
-+ * when you close a workbench GUI.
-+ */
-+ public ItemStack getStackInSlotOnClosing(int par1) {
-+ if (this.theInventory[par1] != null) {
-+ ItemStack var2 = this.theInventory[par1];
-+ this.theInventory[par1] = null;
- return var2;
- } else {
- return null;
- }
- }
-
-- public void setInventorySlotContents(int var1, ItemStack var2) {
-- this.theInventory[var1] = var2;
-- if(var2 != null && var2.stackSize > this.getInventoryStackLimit()) {
-- var2.stackSize = this.getInventoryStackLimit();
-+ /**
-+ * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections).
-+ */
-+ public void setInventorySlotContents(int par1, ItemStack par2ItemStack) {
-+ this.theInventory[par1] = par2ItemStack;
-+
-+ if (par2ItemStack != null && par2ItemStack.stackSize > this.getInventoryStackLimit()) {
-+ par2ItemStack.stackSize = this.getInventoryStackLimit();
- }
-
-- if(this.inventoryResetNeededOnSlotChange(var1)) {
-+ if (this.inventoryResetNeededOnSlotChange(par1)) {
- this.resetRecipeAndSlots();
- }
--
- }
-
-+ /**
-+ * Returns the name of the inventory.
-+ */
- public String getInvName() {
- return "mob.villager";
- }
-
-+ /**
-+ * If this returns false, the inventory name will be used as an unlocalized name, and translated into the player's
-+ * language. Otherwise it will be used directly.
-+ */
- public boolean isInvNameLocalized() {
- return false;
- }
-
-+ /**
-+ * Returns the maximum stack size for a inventory slot. Seems to always be 64, possibly will be extended. *Isn't this
-+ * more of a set than a get?*
-+ */
- public int getInventoryStackLimit() {
- return 64;
- }
-
-- public boolean isUseableByPlayer(EntityPlayer var1) {
-- return this.theMerchant.getCustomer() == var1;
-- }
--
-- public void openChest() {
-- }
--
-- public void closeChest() {
-- }
--
-- public boolean isItemValidForSlot(int var1, ItemStack var2) {
-+ /**
-+ * Do not make give this method the name canInteractWith because it clashes with Container
-+ */
-+ public boolean isUseableByPlayer(EntityPlayer par1EntityPlayer) {
-+ return this.theMerchant.getCustomer() == par1EntityPlayer;
-+ }
-+
-+ public void openChest() {}
-+
-+ public void closeChest() {}
-+
-+ /**
-+ * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot.
-+ */
-+ public boolean isItemValidForSlot(int par1, ItemStack par2ItemStack) {
- return true;
- }
-
-+ /**
-+ * Called when an the contents of an Inventory change, usually
-+ */
- public void onInventoryChanged() {
- this.resetRecipeAndSlots();
- }
-@@ -112,23 +153,27 @@
- this.currentRecipe = null;
- ItemStack var1 = this.theInventory[0];
- ItemStack var2 = this.theInventory[1];
-- if(var1 == null) {
-+
-+ if (var1 == null) {
- var1 = var2;
- var2 = null;
- }
-
-- if(var1 == null) {
-+ if (var1 == null) {
- this.setInventorySlotContents(2, (ItemStack)null);
- } else {
- MerchantRecipeList var3 = this.theMerchant.getRecipes(this.thePlayer);
-- if(var3 != null) {
-+
-+ if (var3 != null) {
- MerchantRecipe var4 = var3.canRecipeBeUsed(var1, var2, this.currentRecipeIndex);
-- if(var4 != null && !var4.func_82784_g()) {
-+
-+ if (var4 != null && !var4.func_82784_g()) {
- this.currentRecipe = var4;
- this.setInventorySlotContents(2, var4.getItemToSell().copy());
-- } else if(var2 != null) {
-+ } else if (var2 != null) {
- var4 = var3.canRecipeBeUsed(var2, var1, this.currentRecipeIndex);
-- if(var4 != null && !var4.func_82784_g()) {
-+
-+ if (var4 != null && !var4.func_82784_g()) {
- this.currentRecipe = var4;
- this.setInventorySlotContents(2, var4.getItemToSell().copy());
- } else {
-@@ -147,8 +192,8 @@
- return this.currentRecipe;
- }
-
-- public void setCurrentRecipeIndex(int var1) {
-- this.currentRecipeIndex = var1;
-+ public void setCurrentRecipeIndex(int par1) {
-+ this.currentRecipeIndex = par1;
- this.resetRecipeAndSlots();
- }
- }
---- net/minecraft/src/Timer.java
-+++ net/minecraft/src/Timer.java
-@@ -1,39 +1,79 @@
- package net.minecraft.src;
-
- public class Timer {
-+
-+ /** The number of timer ticks per second of real time */
- float ticksPerSecond;
-+
-+ /**
-+ * The time reported by the high-resolution clock at the last call of updateTimer(), in seconds
-+ */
- private double lastHRTime;
-+
-+ /**
-+ * How many full ticks have turned over since the last call to updateTimer(), capped at 10.
-+ */
- public int elapsedTicks;
-+
-+ /**
-+ * How much time has elapsed since the last tick, in ticks, for use by display rendering routines (range: 0.0 - 1.0).
-+ * This field is frozen if the display is paused to eliminate jitter.
-+ */
- public float renderPartialTicks;
-+
-+ /**
-+ * A multiplier to make the timer (and therefore the game) go faster or slower. 0.5 makes the game run at half-speed.
-+ */
- public float timerSpeed = 1.0F;
-+
-+ /**
-+ * How much time has elapsed since the last tick, in ticks (range: 0.0 - 1.0).
-+ */
- public float elapsedPartialTicks;
-+
-+ /**
-+ * The time reported by the system clock at the last sync, in milliseconds
-+ */
- private long lastSyncSysClock;
-+
-+ /**
-+ * The time reported by the high-resolution clock at the last sync, in milliseconds
-+ */
- private long lastSyncHRClock;
- private long field_74285_i;
-+
-+ /**
-+ * A ratio used to sync the high-resolution clock to the system clock, updated once per second
-+ */
- private double timeSyncAdjustment = 1.0D;
-
-- public Timer(float var1) {
-- this.ticksPerSecond = var1;
-+ public Timer(float par1) {
-+ this.ticksPerSecond = par1;
- this.lastSyncSysClock = Minecraft.getSystemTime();
- this.lastSyncHRClock = System.nanoTime() / 1000000L;
- }
-
-+ /**
-+ * Updates all fields of the Timer using the current time
-+ */
- public void updateTimer() {
- long var1 = Minecraft.getSystemTime();
- long var3 = var1 - this.lastSyncSysClock;
- long var5 = System.nanoTime() / 1000000L;
- double var7 = (double)var5 / 1000.0D;
-- if(var3 <= 1000L && var3 >= 0L) {
-+
-+ if (var3 <= 1000L && var3 >= 0L) {
- this.field_74285_i += var3;
-- if(this.field_74285_i > 1000L) {
-+
-+ if (this.field_74285_i > 1000L) {
- long var9 = var5 - this.lastSyncHRClock;
- double var11 = (double)this.field_74285_i / (double)var9;
-- this.timeSyncAdjustment += (var11 - this.timeSyncAdjustment) * (double)0.2F;
-+ this.timeSyncAdjustment += (var11 - this.timeSyncAdjustment) * 0.20000000298023224D;
- this.lastSyncHRClock = var5;
- this.field_74285_i = 0L;
- }
-
-- if(this.field_74285_i < 0L) {
-+ if (this.field_74285_i < 0L) {
- this.lastSyncHRClock = var5;
- }
- } else {
-@@ -43,18 +83,20 @@
- this.lastSyncSysClock = var1;
- double var13 = (var7 - this.lastHRTime) * this.timeSyncAdjustment;
- this.lastHRTime = var7;
-- if(var13 < 0.0D) {
-+
-+ if (var13 < 0.0D) {
- var13 = 0.0D;
- }
-
-- if(var13 > 1.0D) {
-+ if (var13 > 1.0D) {
- var13 = 1.0D;
- }
-
- this.elapsedPartialTicks = (float)((double)this.elapsedPartialTicks + var13 * (double)this.timerSpeed * (double)this.ticksPerSecond);
- this.elapsedTicks = (int)this.elapsedPartialTicks;
- this.elapsedPartialTicks -= (float)this.elapsedTicks;
-- if(this.elapsedTicks > 10) {
-+
-+ if (this.elapsedTicks > 10) {
- this.elapsedTicks = 10;
- }
-
---- net/minecraft/src/CommandBase.java
-+++ net/minecraft/src/CommandBase.java
-@@ -10,6 +10,9 @@
- public abstract class CommandBase implements ICommand {
- private static IAdminCommand theAdmin;
-
-+ /**
-+ * Return the required permission level for this command.
-+ */
- public int getRequiredPermissionLevel() {
- return 4;
- }
-@@ -18,69 +21,90 @@
- return null;
- }
-
-- public boolean canCommandSenderUseCommand(ICommandSender var1) {
-- return var1.canCommandSenderUseCommand(this.getRequiredPermissionLevel(), this.getCommandName());
-+ /**
-+ * Returns true if the given command sender is allowed to use this command.
-+ */
-+ public boolean canCommandSenderUseCommand(ICommandSender par1ICommandSender) {
-+ return par1ICommandSender.canCommandSenderUseCommand(this.getRequiredPermissionLevel(), this.getCommandName());
- }
-
-- public List addTabCompletionOptions(ICommandSender var1, String[] var2) {
-+ /**
-+ * Adds the strings available in this command to the given list of tab completion options.
-+ */
-+ public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) {
- return null;
- }
-
-- public static int parseInt(ICommandSender var0, String var1) {
-+ /**
-+ * Parses an int from the given string.
-+ */
-+ public static int parseInt(ICommandSender par0ICommandSender, String par1Str) {
- try {
-- return Integer.parseInt(var1);
-+ return Integer.parseInt(par1Str);
- } catch (NumberFormatException var3) {
-- throw new NumberInvalidException("commands.generic.num.invalid", new Object[]{var1});
-+ throw new NumberInvalidException("commands.generic.num.invalid", new Object[] {par1Str});
- }
- }
-
-- public static int parseIntWithMin(ICommandSender var0, String var1, int var2) {
-- return parseIntBounded(var0, var1, var2, Integer.MAX_VALUE);
-+ /**
-+ * Parses an int from the given sring with a specified minimum.
-+ */
-+ public static int parseIntWithMin(ICommandSender par0ICommandSender, String par1Str, int par2) {
-+ return parseIntBounded(par0ICommandSender, par1Str, par2, Integer.MAX_VALUE);
- }
-
-- public static int parseIntBounded(ICommandSender var0, String var1, int var2, int var3) {
-- int var4 = parseInt(var0, var1);
-- if(var4 < var2) {
-- throw new NumberInvalidException("commands.generic.num.tooSmall", new Object[]{Integer.valueOf(var4), Integer.valueOf(var2)});
-- } else if(var4 > var3) {
-- throw new NumberInvalidException("commands.generic.num.tooBig", new Object[]{Integer.valueOf(var4), Integer.valueOf(var3)});
-+ /**
-+ * Parses an int from the given string within a specified bound.
-+ */
-+ public static int parseIntBounded(ICommandSender par0ICommandSender, String par1Str, int par2, int par3) {
-+ int var4 = parseInt(par0ICommandSender, par1Str);
-+
-+ if (var4 < par2) {
-+ throw new NumberInvalidException("commands.generic.num.tooSmall", new Object[] {Integer.valueOf(var4), Integer.valueOf(par2)});
-+ } else if (var4 > par3) {
-+ throw new NumberInvalidException("commands.generic.num.tooBig", new Object[] {Integer.valueOf(var4), Integer.valueOf(par3)});
- } else {
- return var4;
- }
- }
-
-- public static double parseDouble(ICommandSender var0, String var1) {
-+ /**
-+ * Parses a double from the given string or throws an exception if it's not a double.
-+ */
-+ public static double parseDouble(ICommandSender par0ICommandSender, String par1Str) {
- try {
-- double var2 = Double.parseDouble(var1);
-- if(!Doubles.isFinite(var2)) {
-- throw new NumberInvalidException("commands.generic.double.invalid", new Object[]{var1});
-+ double var2 = Double.parseDouble(par1Str);
-+
-+ if (!Doubles.isFinite(var2)) {
-+ throw new NumberInvalidException("commands.generic.double.invalid", new Object[] {par1Str});
- } else {
- return var2;
- }
- } catch (NumberFormatException var4) {
-- throw new NumberInvalidException("commands.generic.double.invalid", new Object[]{var1});
-+ throw new NumberInvalidException("commands.generic.double.invalid", new Object[] {par1Str});
- }
- }
-
-- public static double func_110664_a(ICommandSender var0, String var1, double var2) {
-- return func_110661_a(var0, var1, var2, Double.MAX_VALUE);
-+ public static double func_110664_a(ICommandSender par0ICommandSender, String par1Str, double par2) {
-+ return func_110661_a(par0ICommandSender, par1Str, par2, Double.MAX_VALUE);
- }
-
-- public static double func_110661_a(ICommandSender var0, String var1, double var2, double var4) {
-- double var6 = parseDouble(var0, var1);
-- if(var6 < var2) {
-- throw new NumberInvalidException("commands.generic.double.tooSmall", new Object[]{Double.valueOf(var6), Double.valueOf(var2)});
-- } else if(var6 > var4) {
-- throw new NumberInvalidException("commands.generic.double.tooBig", new Object[]{Double.valueOf(var6), Double.valueOf(var4)});
-+ public static double func_110661_a(ICommandSender par0ICommandSender, String par1Str, double par2, double par4) {
-+ double var6 = parseDouble(par0ICommandSender, par1Str);
-+
-+ if (var6 < par2) {
-+ throw new NumberInvalidException("commands.generic.double.tooSmall", new Object[] {Double.valueOf(var6), Double.valueOf(par2)});
-+ } else if (var6 > par4) {
-+ throw new NumberInvalidException("commands.generic.double.tooBig", new Object[] {Double.valueOf(var6), Double.valueOf(par4)});
- } else {
- return var6;
- }
- }
-
-- public static boolean func_110662_c(ICommandSender var0, String var1) {
-- if(!var1.equals("true") && !var1.equals("1")) {
-- if(!var1.equals("false") && !var1.equals("0")) {
-- throw new CommandException("commands.generic.boolean.invalid", new Object[]{var1});
-+ public static boolean func_110662_c(ICommandSender par0ICommandSender, String par1Str) {
-+ if (!par1Str.equals("true") && !par1Str.equals("1")) {
-+ if (!par1Str.equals("false") && !par1Str.equals("0")) {
-+ throw new CommandException("commands.generic.boolean.invalid", new Object[] {par1Str});
- } else {
- return false;
- }
-@@ -89,21 +113,26 @@
- }
- }
-
-- public static EntityPlayerMP getCommandSenderAsPlayer(ICommandSender var0) {
-- if(var0 instanceof EntityPlayerMP) {
-- return (EntityPlayerMP)var0;
-+ /**
-+ * Returns the given ICommandSender as a EntityPlayer or throw an exception.
-+ */
-+ public static EntityPlayerMP getCommandSenderAsPlayer(ICommandSender par0ICommandSender) {
-+ if (par0ICommandSender instanceof EntityPlayerMP) {
-+ return (EntityPlayerMP)par0ICommandSender;
- } else {
- throw new PlayerNotFoundException("You must specify which player you wish to perform this action on.", new Object[0]);
- }
- }
-
-- public static EntityPlayerMP getPlayer(ICommandSender var0, String var1) {
-- EntityPlayerMP var2 = PlayerSelector.matchOnePlayer(var0, var1);
-- if(var2 != null) {
-+ public static EntityPlayerMP getPlayer(ICommandSender par0ICommandSender, String par1Str) {
-+ EntityPlayerMP var2 = PlayerSelector.matchOnePlayer(par0ICommandSender, par1Str);
-+
-+ if (var2 != null) {
- return var2;
- } else {
-- var2 = MinecraftServer.getServer().getConfigurationManager().getPlayerEntity(var1);
-- if(var2 == null) {
-+ var2 = MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(par1Str);
-+
-+ if (var2 == null) {
- throw new PlayerNotFoundException();
- } else {
- return var2;
-@@ -111,35 +140,38 @@
- }
- }
-
-- public static String func_96332_d(ICommandSender var0, String var1) {
-- EntityPlayerMP var2 = PlayerSelector.matchOnePlayer(var0, var1);
-- if(var2 != null) {
-+ public static String func_96332_d(ICommandSender par0ICommandSender, String par1Str) {
-+ EntityPlayerMP var2 = PlayerSelector.matchOnePlayer(par0ICommandSender, par1Str);
-+
-+ if (var2 != null) {
- return var2.getEntityName();
-- } else if(PlayerSelector.hasArguments(var1)) {
-+ } else if (PlayerSelector.hasArguments(par1Str)) {
- throw new PlayerNotFoundException();
- } else {
-- return var1;
-+ return par1Str;
- }
- }
-
-- public static String func_82360_a(ICommandSender var0, String[] var1, int var2) {
-- return func_82361_a(var0, var1, var2, false);
-+ public static String func_82360_a(ICommandSender par0ICommandSender, String[] par1ArrayOfStr, int par2) {
-+ return func_82361_a(par0ICommandSender, par1ArrayOfStr, par2, false);
- }
-
-- public static String func_82361_a(ICommandSender var0, String[] var1, int var2, boolean var3) {
-+ public static String func_82361_a(ICommandSender par0ICommandSender, String[] par1ArrayOfStr, int par2, boolean par3) {
- StringBuilder var4 = new StringBuilder();
-
-- for(int var5 = var2; var5 < var1.length; ++var5) {
-- if(var5 > var2) {
-+ for (int var5 = par2; var5 < par1ArrayOfStr.length; ++var5) {
-+ if (var5 > par2) {
- var4.append(" ");
- }
-
-- String var6 = var1[var5];
-- if(var3) {
-- String var7 = PlayerSelector.matchPlayersAsString(var0, var6);
-- if(var7 != null) {
-+ String var6 = par1ArrayOfStr[var5];
-+
-+ if (par3) {
-+ String var7 = PlayerSelector.matchPlayersAsString(par0ICommandSender, var6);
-+
-+ if (var7 != null) {
- var6 = var7;
-- } else if(PlayerSelector.hasArguments(var6)) {
-+ } else if (PlayerSelector.hasArguments(var6)) {
- throw new PlayerNotFoundException();
- }
- }
-@@ -150,35 +182,39 @@
- return var4.toString();
- }
-
-- public static double func_110666_a(ICommandSender var0, double var1, String var3) {
-- return func_110665_a(var0, var1, var3, -30000000, 30000000);
-+ public static double func_110666_a(ICommandSender par0ICommandSender, double par1, String par3Str) {
-+ return func_110665_a(par0ICommandSender, par1, par3Str, -30000000, 30000000);
- }
-
-- public static double func_110665_a(ICommandSender var0, double var1, String var3, int var4, int var5) {
-- boolean var6 = var3.startsWith("~");
-- if(var6 && Double.isNaN(var1)) {
-- throw new NumberInvalidException("commands.generic.num.invalid", new Object[]{Double.valueOf(var1)});
-+ public static double func_110665_a(ICommandSender par0ICommandSender, double par1, String par3Str, int par4, int par5) {
-+ boolean var6 = par3Str.startsWith("~");
-+
-+ if (var6 && Double.isNaN(par1)) {
-+ throw new NumberInvalidException("commands.generic.num.invalid", new Object[] {Double.valueOf(par1)});
- } else {
-- double var7 = var6 ? var1 : 0.0D;
-- if(!var6 || var3.length() > 1) {
-- boolean var9 = var3.contains(".");
-- if(var6) {
-- var3 = var3.substring(1);
-+ double var7 = var6 ? par1 : 0.0D;
-+
-+ if (!var6 || par3Str.length() > 1) {
-+ boolean var9 = par3Str.contains(".");
-+
-+ if (var6) {
-+ par3Str = par3Str.substring(1);
- }
-
-- var7 += parseDouble(var0, var3);
-- if(!var9 && !var6) {
-+ var7 += parseDouble(par0ICommandSender, par3Str);
-+
-+ if (!var9 && !var6) {
- var7 += 0.5D;
- }
- }
-
-- if(var4 != 0 || var5 != 0) {
-- if(var7 < (double)var4) {
-- throw new NumberInvalidException("commands.generic.double.tooSmall", new Object[]{Double.valueOf(var7), Integer.valueOf(var4)});
-+ if (par4 != 0 || par5 != 0) {
-+ if (var7 < (double)par4) {
-+ throw new NumberInvalidException("commands.generic.double.tooSmall", new Object[] {Double.valueOf(var7), Integer.valueOf(par4)});
- }
-
-- if(var7 > (double)var5) {
-- throw new NumberInvalidException("commands.generic.double.tooBig", new Object[]{Double.valueOf(var7), Integer.valueOf(var5)});
-+ if (var7 > (double)par5) {
-+ throw new NumberInvalidException("commands.generic.double.tooBig", new Object[] {Double.valueOf(var7), Integer.valueOf(par5)});
- }
- }
-
-@@ -186,13 +222,17 @@
- }
- }
-
-- public static String joinNiceString(Object[] var0) {
-+ /**
-+ * Joins the given string array into a "x, y, and z" seperated string.
-+ */
-+ public static String joinNiceString(Object[] par0ArrayOfObj) {
- StringBuilder var1 = new StringBuilder();
-
-- for(int var2 = 0; var2 < var0.length; ++var2) {
-- String var3 = var0[var2].toString();
-- if(var2 > 0) {
-- if(var2 == var0.length - 1) {
-+ for (int var2 = 0; var2 < par0ArrayOfObj.length; ++var2) {
-+ String var3 = par0ArrayOfObj[var2].toString();
-+
-+ if (var2 > 0) {
-+ if (var2 == par0ArrayOfObj.length - 1) {
- var1.append(" and ");
- } else {
- var1.append(", ");
-@@ -205,35 +245,43 @@
- return var1.toString();
- }
-
-- public static String func_96333_a(Collection var0) {
-- return joinNiceString(var0.toArray(new String[var0.size()]));
-+ public static String func_96333_a(Collection par0Collection) {
-+ return joinNiceString(par0Collection.toArray(new String[par0Collection.size()]));
- }
-
-- public static String func_110663_b(Collection var0) {
-- String[] var1 = new String[var0.size()];
-+ public static String func_110663_b(Collection par0Collection) {
-+ String[] var1 = new String[par0Collection.size()];
- int var2 = 0;
--
- EntityLivingBase var4;
-- for(Iterator var3 = var0.iterator(); var3.hasNext(); var1[var2++] = var4.getTranslatedEntityName()) {
-+
-+ for (Iterator var3 = par0Collection.iterator(); var3.hasNext(); var1[var2++] = var4.getTranslatedEntityName()) {
- var4 = (EntityLivingBase)var3.next();
- }
-
- return joinNiceString(var1);
- }
-
-- public static boolean doesStringStartWith(String var0, String var1) {
-- return var1.regionMatches(true, 0, var0, 0, var0.length());
-+ /**
-+ * Returns true if the given substring is exactly equal to the start of the given string (case insensitive).
-+ */
-+ public static boolean doesStringStartWith(String par0Str, String par1Str) {
-+ return par1Str.regionMatches(true, 0, par0Str, 0, par0Str.length());
- }
-
-- public static List getListOfStringsMatchingLastWord(String[] var0, String... var1) {
-- String var2 = var0[var0.length - 1];
-+ /**
-+ * Returns a List of strings (chosen from the given strings) which the last word in the given string array is a
-+ * beginning-match for. (Tab completion).
-+ */
-+ public static List getListOfStringsMatchingLastWord(String[] par0ArrayOfStr, String ... par1ArrayOfStr) {
-+ String var2 = par0ArrayOfStr[par0ArrayOfStr.length - 1];
- ArrayList var3 = new ArrayList();
-- String[] var4 = var1;
-- int var5 = var1.length;
-+ String[] var4 = par1ArrayOfStr;
-+ int var5 = par1ArrayOfStr.length;
-
-- for(int var6 = 0; var6 < var5; ++var6) {
-+ for (int var6 = 0; var6 < var5; ++var6) {
- String var7 = var4[var6];
-- if(doesStringStartWith(var2, var7)) {
-+
-+ if (doesStringStartWith(var2, var7)) {
- var3.add(var7);
- }
- }
-@@ -241,14 +289,19 @@
- return var3;
- }
-
-- public static List getListOfStringsFromIterableMatchingLastWord(String[] var0, Iterable var1) {
-- String var2 = var0[var0.length - 1];
-+ /**
-+ * Returns a List of strings (chosen from the given string iterable) which the last word in the given string array is a
-+ * beginning-match for. (Tab completion).
-+ */
-+ public static List getListOfStringsFromIterableMatchingLastWord(String[] par0ArrayOfStr, Iterable par1Iterable) {
-+ String var2 = par0ArrayOfStr[par0ArrayOfStr.length - 1];
- ArrayList var3 = new ArrayList();
-- Iterator var4 = var1.iterator();
-+ Iterator var4 = par1Iterable.iterator();
-
-- while(var4.hasNext()) {
-+ while (var4.hasNext()) {
- String var5 = (String)var4.next();
-- if(doesStringStartWith(var2, var5)) {
-+
-+ if (doesStringStartWith(var2, var5)) {
- var3.add(var5);
- }
- }
-@@ -256,30 +309,38 @@
- return var3;
- }
-
-- public boolean isUsernameIndex(String[] var1, int var2) {
-+ /**
-+ * Return whether the specified command parameter index is a username parameter.
-+ */
-+ public boolean isUsernameIndex(String[] par1ArrayOfStr, int par2) {
- return false;
- }
-
-- public static void notifyAdmins(ICommandSender var0, String var1, Object... var2) {
-- notifyAdmins(var0, 0, var1, var2);
-+ public static void notifyAdmins(ICommandSender par0ICommandSender, String par1Str, Object ... par2ArrayOfObj) {
-+ notifyAdmins(par0ICommandSender, 0, par1Str, par2ArrayOfObj);
- }
-
-- public static void notifyAdmins(ICommandSender var0, int var1, String var2, Object... var3) {
-- if(theAdmin != null) {
-- theAdmin.notifyAdmins(var0, var1, var2, var3);
-+ public static void notifyAdmins(ICommandSender par0ICommandSender, int par1, String par2Str, Object ... par3ArrayOfObj) {
-+ if (theAdmin != null) {
-+ theAdmin.notifyAdmins(par0ICommandSender, par1, par2Str, par3ArrayOfObj);
- }
--
-- }
--
-- public static void setAdminCommander(IAdminCommand var0) {
-- theAdmin = var0;
-- }
--
-- public int compareTo(ICommand var1) {
-- return this.getCommandName().compareTo(var1.getCommandName());
-- }
--
-- public int compareTo(Object var1) {
-- return this.compareTo((ICommand)var1);
-+ }
-+
-+ /**
-+ * Sets the static IAdminCommander.
-+ */
-+ public static void setAdminCommander(IAdminCommand par0IAdminCommand) {
-+ theAdmin = par0IAdminCommand;
-+ }
-+
-+ /**
-+ * Compares the name of this command to the name of the given command.
-+ */
-+ public int compareTo(ICommand par1ICommand) {
-+ return this.getCommandName().compareTo(par1ICommand.getCommandName());
-+ }
-+
-+ public int compareTo(Object par1Obj) {
-+ return this.compareTo((ICommand)par1Obj);
- }
- }
---- net/minecraft/src/Packet12PlayerLook.java
-+++ net/minecraft/src/Packet12PlayerLook.java
-@@ -9,25 +9,34 @@
- this.rotating = true;
- }
-
-- public Packet12PlayerLook(float var1, float var2, boolean var3) {
-- this.yaw = var1;
-- this.pitch = var2;
-- this.onGround = var3;
-+ public Packet12PlayerLook(float par1, float par2, boolean par3) {
-+ this.yaw = par1;
-+ this.pitch = par2;
-+ this.onGround = par3;
- this.rotating = true;
- }
-
-- public void readPacketData(DataInput var1) throws IOException {
-- this.yaw = var1.readFloat();
-- this.pitch = var1.readFloat();
-- super.readPacketData(var1);
-- }
--
-- public void writePacketData(DataOutput var1) throws IOException {
-- var1.writeFloat(this.yaw);
-- var1.writeFloat(this.pitch);
-- super.writePacketData(var1);
-- }
--
-+ /**
-+ * Abstract. Reads the raw packet data from the data stream.
-+ */
-+ public void readPacketData(DataInput par1DataInput) throws IOException {
-+ this.yaw = par1DataInput.readFloat();
-+ this.pitch = par1DataInput.readFloat();
-+ super.readPacketData(par1DataInput);
-+ }
-+
-+ /**
-+ * Abstract. Writes the raw packet data to the data stream.
-+ */
-+ public void writePacketData(DataOutput par1DataOutput) throws IOException {
-+ par1DataOutput.writeFloat(this.yaw);
-+ par1DataOutput.writeFloat(this.pitch);
-+ super.writePacketData(par1DataOutput);
-+ }
-+
-+ /**
-+ * Abstract. Return the size of the packet (not counting the header).
-+ */
- public int getPacketSize() {
- return 9;
- }
---- /dev/null
-+++ org/spoutcraft/client/packet/PacketSendPrecache.java
-@@ -1,0 +1,151 @@
-+/*
-+ * This file is part of Spoutcraft.
-+ *
-+ * Copyright (c) 2011 SpoutcraftDev
-+ * Spoutcraft is licensed under the GNU Lesser General Public License.
-+ *
-+ * Spoutcraft is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation, either version 3 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Spoutcraft is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program. If not, see .
-+ */
-+package org.spoutcraft.client.packet;
-+
-+import java.io.File;
-+import java.io.IOException;
-+import java.util.zip.DataFormatException;
-+import java.util.zip.Deflater;
-+import java.util.zip.Inflater;
-+
-+import org.apache.commons.io.FileUtils;
-+import org.apache.commons.io.output.ByteArrayOutputStream;
-+
-+import org.spoutcraft.api.io.SpoutInputStream;
-+import org.spoutcraft.api.io.SpoutOutputStream;
-+import org.spoutcraft.client.precache.PrecacheManager;
-+import org.spoutcraft.client.precache.PrecacheTuple;
-+
-+public class PacketSendPrecache implements CompressablePacket {
-+ private byte[] fileData;
-+ private String plugin;
-+ private String version;
-+ private boolean compressed = false;
-+
-+ public PacketSendPrecache() {
-+ }
-+
-+ public PacketSendPrecache(File file) {
-+ try {
-+ this.fileData = FileUtils.readFileToByteArray(file);
-+ } catch (IOException e) {
-+ e.printStackTrace();
-+ }
-+ }
-+
-+ // TODO move to separate thread?
-+ public void compress() {
-+ if (!compressed) {
-+ Deflater deflater = new Deflater();
-+ deflater.setInput(fileData);
-+ deflater.setLevel(Deflater.BEST_COMPRESSION);
-+ deflater.finish();
-+ ByteArrayOutputStream bos = new ByteArrayOutputStream(fileData.length);
-+ byte[] buffer = new byte[1024];
-+ while (!deflater.finished()) {
-+ int bytesCompressed = deflater.deflate(buffer);
-+ bos.write(buffer, 0, bytesCompressed);
-+ }
-+ try {
-+ bos.close();
-+ } catch (IOException e) {
-+ e.printStackTrace();
-+ }
-+ fileData = bos.toByteArray();
-+ compressed = true;
-+ }
-+ }
-+
-+ public boolean isCompressed() {
-+ return compressed;
-+ }
-+
-+ public void decompress() {
-+ if (compressed) {
-+ Inflater decompressor = new Inflater();
-+ decompressor.setInput(fileData);
-+
-+ ByteArrayOutputStream bos = new ByteArrayOutputStream(fileData.length);
-+
-+ byte[] buf = new byte[1024];
-+ while (!decompressor.finished()) {
-+ try {
-+ int count = decompressor.inflate(buf);
-+ bos.write(buf, 0, count);
-+ } catch (DataFormatException e) {
-+ }
-+ }
-+ try {
-+ bos.close();
-+ } catch (IOException e) {
-+ }
-+
-+ fileData = bos.toByteArray();
-+ }
-+ }
-+
-+ public void readData(SpoutInputStream input) throws IOException {
-+ this.plugin = input.readString();
-+ this.version = input.readString();
-+ compressed = input.readBoolean();
-+ int size = input.readInt();
-+ this.fileData = new byte[size];
-+ input.read(fileData);
-+ }
-+
-+ public void writeData(SpoutOutputStream output) throws IOException {
-+ output.writeString(plugin);
-+ output.writeString(version);
-+ output.writeBoolean(compressed);
-+ output.writeInt(fileData.length);
-+ output.write(fileData);
-+ }
-+
-+ public void failure(int playerId) {
-+ }
-+
-+ public PacketType getPacketType() {
-+ return PacketType.PacketSendPrecache;
-+ }
-+
-+ public int getVersion() {
-+ return 0;
-+ }
-+
-+ public void run(int playerId) {
-+ // Packet recieved, grabbing the zip file
-+ File zip = PrecacheManager.getPluginPreCacheFile(plugin, version);
-+ if (zip.exists()) {
-+ zip.delete();
-+ }
-+
-+ try {
-+ FileUtils.writeByteArrayToFile(zip, fileData);
-+ } catch (IOException e) {
-+ e.printStackTrace();
-+ }
-+
-+ PrecacheTuple plugin = PrecacheManager.getPrecacheTuple(this.plugin, version);
-+ if (plugin != null) {
-+ PrecacheManager.setCached(plugin);
-+ }
-+ PrecacheManager.doNextCache();
-+ }
-+}
---- /dev/null
-+++ org/spoutcraft/client/gui/settings/controls/RenderDistanceButton.java
-@@ -1,0 +1,55 @@
-+/*
-+ * This file is part of Spoutcraft.
-+ *
-+ * Copyright (c) 2011 SpoutcraftDev
-+ * Spoutcraft is licensed under the GNU Lesser General Public License.
-+ *
-+ * Spoutcraft is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation, either version 3 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Spoutcraft is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program. If not, see .
-+ */
-+package org.spoutcraft.client.gui.settings.controls;
-+
-+import net.minecraft.src.Minecraft;
-+
-+import org.spoutcraft.api.player.RenderDistance;
-+import org.spoutcraft.client.SpoutClient;
-+import org.spoutcraft.client.config.Configuration;
-+
-+public class RenderDistanceButton extends AutomatedButton {
-+ RenderDistance distance = RenderDistance.getRenderDistanceFromValue(Configuration.getRenderDistance());
-+ public RenderDistanceButton() {
-+ setTooltip("Visible distance\nFar - 256m (slower\nNormal - 128m\nShort - 64m (faster)\nTiny - 32m (fastest)");
-+ }
-+
-+ @Override
-+ public String getText() {
-+ return "Render Distance: " + distance.toString();
-+ }
-+
-+ @Override
-+ public void onButtonClick() {
-+ if (SpoutClient.getInstance().getActivePlayer() != null) {
-+ distance = SpoutClient.getInstance().getActivePlayer().getNextRenderDistance();
-+ Configuration.setRenderDistance(distance.getValue());
-+ } else {
-+ Configuration.setRenderDistance(Configuration.getRenderDistance() + 1);
-+ if (Configuration.getRenderDistance() > 3) {
-+ Configuration.setRenderDistance(0);
-+ }
-+ distance = RenderDistance.getRenderDistanceFromValue(Configuration.getRenderDistance());
-+ }
-+ Minecraft.getMinecraft().gameSettings.renderDistance = distance.getValue();
-+ Configuration.write();
-+ Minecraft.getMinecraft().gameSettings.saveOptions();
-+ }
-+}
---- net/minecraft/src/MaterialTransparent.java
-+++ net/minecraft/src/MaterialTransparent.java
-@@ -1,8 +1,8 @@
- package net.minecraft.src;
-
- public class MaterialTransparent extends Material {
-- public MaterialTransparent(MapColor var1) {
-- super(var1);
-+ public MaterialTransparent(MapColor par1MapColor) {
-+ super(par1MapColor);
- this.setReplaceable();
- }
-
-@@ -10,10 +10,16 @@
- return false;
- }
-
-+ /**
-+ * Will prevent grass from growing on dirt underneath and kill any grass below it if it returns true
-+ */
- public boolean getCanBlockGrass() {
- return false;
- }
-
-+ /**
-+ * Returns if this material is considered solid or not
-+ */
- public boolean blocksMovement() {
- return false;
- }
---- net/minecraft/src/EntityGiantZombie.java
-+++ net/minecraft/src/EntityGiantZombie.java
-@@ -1,8 +1,8 @@
- package net.minecraft.src;
-
- public class EntityGiantZombie extends EntityMob {
-- public EntityGiantZombie(World var1) {
-- super(var1);
-+ public EntityGiantZombie(World par1World) {
-+ super(par1World);
- this.yOffset *= 6.0F;
- this.setSize(this.width * 6.0F, this.height * 6.0F);
- }
-@@ -14,7 +14,11 @@
- this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setAttribute(50.0D);
- }
-
-- public float getBlockPathWeight(int var1, int var2, int var3) {
-- return this.worldObj.getLightBrightness(var1, var2, var3) - 0.5F;
-+ /**
-+ * Takes a coordinate in and returns a weight to determine how likely this creature will try to path to the block.
-+ * Args: x, y, z
-+ */
-+ public float getBlockPathWeight(int par1, int par2, int par3) {
-+ return this.worldObj.getLightBrightness(par1, par2, par3) - 0.5F;
- }
- }
---- net/minecraft/src/CommandSetPlayerTimeout.java
-+++ net/minecraft/src/CommandSetPlayerTimeout.java
-@@ -7,19 +7,22 @@
- return "setidletimeout";
- }
-
-+ /**
-+ * Return the required permission level for this command.
-+ */
- public int getRequiredPermissionLevel() {
- return 3;
- }
-
-- public String getCommandUsage(ICommandSender var1) {
-+ public String getCommandUsage(ICommandSender par1ICommandSender) {
- return "commands.setidletimeout.usage";
- }
-
-- public void processCommand(ICommandSender var1, String[] var2) {
-- if(var2.length == 1) {
-- int var3 = parseIntWithMin(var1, var2[0], 0);
-+ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) {
-+ if (par2ArrayOfStr.length == 1) {
-+ int var3 = parseIntWithMin(par1ICommandSender, par2ArrayOfStr[0], 0);
- MinecraftServer.getServer().func_143006_e(var3);
-- notifyAdmins(var1, "commands.setidletimeout.success", new Object[]{Integer.valueOf(var3)});
-+ notifyAdmins(par1ICommandSender, "commands.setidletimeout.success", new Object[] {Integer.valueOf(var3)});
- } else {
- throw new WrongUsageException("commands.setidletimeout.usage", new Object[0]);
- }
---- net/minecraft/src/ResourceLocation.java
-+++ net/minecraft/src/ResourceLocation.java
-@@ -3,59 +3,62 @@
- import org.apache.commons.lang3.Validate;
-
- public class ResourceLocation {
-- private final String a;
-- private final String b;
--
-- public ResourceLocation(String var1, String var2) {
-- Validate.notNull(var2);
-- if(var1 != null && var1.length() != 0) {
-- this.a = var1;
-+ private final String resourceDomain;
-+ private final String resourcePath;
-+
-+ public ResourceLocation(String par1Str, String par2Str) {
-+ Validate.notNull(par2Str);
-+
-+ if (par1Str != null && par1Str.length() != 0) {
-+ this.resourceDomain = par1Str;
- } else {
-- this.a = "minecraft";
-+ this.resourceDomain = "minecraft";
- }
-
-- this.b = var2;
-+ this.resourcePath = par2Str;
- }
-
-- public ResourceLocation(String var1) {
-+ public ResourceLocation(String par1Str) {
- String var2 = "minecraft";
-- String var3 = var1;
-- int var4 = var1.indexOf(58);
-- if(var4 >= 0) {
-- var3 = var1.substring(var4 + 1, var1.length());
-- if(var4 > 1) {
-- var2 = var1.substring(0, var4);
-+ String var3 = par1Str;
-+ int var4 = par1Str.indexOf(58);
-+
-+ if (var4 >= 0) {
-+ var3 = par1Str.substring(var4 + 1, par1Str.length());
-+
-+ if (var4 > 1) {
-+ var2 = par1Str.substring(0, var4);
- }
- }
-
-- this.a = var2.toLowerCase();
-- this.b = var3;
-+ this.resourceDomain = var2.toLowerCase();
-+ this.resourcePath = var3;
- }
-
- public String getResourcePath() {
-- return this.b;
-+ return this.resourcePath;
- }
-
- public String getResourceDomain() {
-- return this.a;
-+ return this.resourceDomain;
- }
-
- public String toString() {
-- return this.a + ":" + this.b;
-+ return this.resourceDomain + ":" + this.resourcePath;
- }
-
-- public boolean equals(Object var1) {
-- if(this == var1) {
-+ public boolean equals(Object par1Obj) {
-+ if (this == par1Obj) {
- return true;
-- } else if(!(var1 instanceof ResourceLocation)) {
-+ } else if (!(par1Obj instanceof ResourceLocation)) {
- return false;
- } else {
-- ResourceLocation var2 = (ResourceLocation)var1;
-- return this.a.equals(var2.a) && this.b.equals(var2.b);
-+ ResourceLocation var2 = (ResourceLocation)par1Obj;
-+ return this.resourceDomain.equals(var2.resourceDomain) && this.resourcePath.equals(var2.resourcePath);
- }
- }
-
- public int hashCode() {
-- return 31 * this.a.hashCode() + this.b.hashCode();
-+ return 31 * this.resourceDomain.hashCode() + this.resourcePath.hashCode();
- }
- }
---- /dev/null
-+++ org/spoutcraft/client/util/NetworkUtils.java
-@@ -1,0 +1,163 @@
-+/*
-+ * This file is part of Spoutcraft.
-+ *
-+ * Copyright (c) 2011 SpoutcraftDev
-+ * Spoutcraft is licensed under the GNU Lesser General Public License.
-+ *
-+ * Spoutcraft is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation, either version 3 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Spoutcraft is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program. If not, see .
-+ */
-+package org.spoutcraft.client.util;
-+
-+import java.awt.Desktop;
-+import java.io.BufferedReader;
-+import java.io.IOException;
-+import java.io.InputStreamReader;
-+import java.net.HttpURLConnection;
-+import java.net.InetSocketAddress;
-+import java.net.URISyntaxException;
-+import java.net.URL;
-+import java.util.regex.Pattern;
-+
-+import org.xbill.DNS.Lookup;
-+import org.xbill.DNS.Record;
-+import org.xbill.DNS.SRVRecord;
-+import org.xbill.DNS.TextParseException;
-+import org.xbill.DNS.Type;
-+
-+import org.spoutcraft.client.gui.server.ServerItem;
-+
-+public class NetworkUtils {
-+ /**
-+ * A {@link Pattern} matching valid DNS hostnames (as opposed to IP addresses).
-+ */
-+ private static final Pattern HOSTNAME_PATTERN = Pattern.compile("[a-zA-Z-]");
-+
-+ public static void pingUrl(String Url) {
-+ try {
-+ URL url = new URL(Url);
-+ HttpURLConnection con = (HttpURLConnection)(url.openConnection());
-+ System.setProperty("http.agent", "");
-+ con.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.100 Safari/534.30");
-+ BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
-+ String str;
-+ while ((str = in.readLine()) != null);
-+ in.close();
-+ } catch (Exception e) {
-+ }
-+ }
-+
-+ public static void openInBrowser(String url) {
-+ try {
-+ java.net.URI uri = new java.net.URI(url);
-+ Desktop desktop = Desktop.getDesktop();
-+ desktop.browse(uri);
-+ } catch (IOException e) {
-+ e.printStackTrace();
-+ } catch (URISyntaxException e) {
-+ e.printStackTrace();
-+ }
-+ }
-+
-+ /**
-+ * Resolves a hostname to an {@link InetSocketAddress}, encapsulating an IP address and
-+ * port. hostname may represent a valid DNS hostname or an IP address. If
-+ * hostname is a valid DNS hostname andport is equal
-+ * to {@link ServerItem#DEFAULT_PORT} (implying the user may not have specified a server
-+ * port), a SRV record lookup may
-+ * be attempted—see {@link #resolve(String)} for implementation details.
-+ *
-+ * This method is the equivalent of passing true to {@link #resolve(String, int, boolean)}.
-+ *
-+ * @param hostname the DNS hostname to resolve.
-+ * @param port the port number to encapsulate within the InetSocketAddress.
-+ * @return an {@link InetSocketAddress}, which may be marked unresolved if hostname lookup failed.
-+ */
-+ public static InetSocketAddress resolve(String hostname, int port) {
-+ return resolve(hostname, port, true);
-+ }
-+
-+ /**
-+ * Resolves a hostname to an {@link InetSocketAddress}, encapsulating an IP address and
-+ * port. An optional SRV record
-+ * lookup may be attempted—see {@link #resolve(String)} for implementation details.
-+ * A SRV record lookup will only be attempted if hostname represents a valid
-+ * DNS hostname, and port is equal to {@link ServerItem#DEFAULT_PORT} (implying
-+ * the user may not have specified a server port).
-+ *
-+ * If srv is true and SRV record lookup fails or returns no
-+ * results, a regular DNS lookup will be attempted.
-+ *
-+ * If the given hostname represents an IP address, it will not be resolved.
-+ *
-+ * @param hostname the DNS hostname to resolve.
-+ * @param port the port number to encapsulate within the InetSocketAddress.
-+ * @param srv whether to attempt a SRV record lookup.
-+ * @return an {@link InetSocketAddress}, which may be marked unresolved if hostname lookup failed.
-+ */
-+ public static InetSocketAddress resolve(String hostname, int port, boolean srv) {
-+ if (srv && (port == ServerItem.DEFAULT_PORT) && (HOSTNAME_PATTERN.matcher(hostname).find())) {
-+ try {
-+ InetSocketAddress address = resolve(hostname);
-+ if (address != null) {
-+ return address;
-+ }
-+ } catch (TextParseException e) {
-+ // Do nothing: fall back on a regular DNS lookup before failing
-+ }
-+ }
-+
-+ return new InetSocketAddress(hostname, port);
-+ }
-+
-+ /**
-+ * Resolves a hostname to an {@link InetSocketAddress}, encapsulating an IP address and
-+ * port, using a SRV record lookup.
-+ * This method assumes minecraft as the service name during the DNS query,
-+ * such that a matching record looks like:
-+ *