diff --git a/src/main/java/net/minecraft/client/Minecraft.java b/src/main/java/net/minecraft/client/Minecraft.java
index 508df708d..e486c2786 100644
--- a/src/main/java/net/minecraft/client/Minecraft.java
+++ b/src/main/java/net/minecraft/client/Minecraft.java
@@ -1480,9 +1480,6 @@ public class Minecraft
                         {
                             displayInGameMenu();
                         }
-                        else if (Keyboard.getEventKey() == Keyboard.KEY_F7) {
-                            renderer.reload();
-                        }
                         else if (gameSettings.keyCommand.isPressed())
                         {
                             displayGuiScreen(new GuiChat("/"));
diff --git a/src/main/java/net/minecraft/client/gui/MainMenuBackground.java b/src/main/java/net/minecraft/client/gui/MainMenuBackground.java
index b20dc8165..d193389e6 100644
--- a/src/main/java/net/minecraft/client/gui/MainMenuBackground.java
+++ b/src/main/java/net/minecraft/client/gui/MainMenuBackground.java
@@ -160,7 +160,7 @@ public class MainMenuBackground {
 		
 		Tessellator tessellator = Tessellator.instance;
 		tessellator.startDrawingQuads();
-		tessellator.setColorOpaque_F(0.75f, 0.75f, 0.75f);
+		tessellator.setColorRGBA_F(0.75f, 0.75f, 0.75f, alpha);
 		tessellator.drawRectangleWithUV(x, y, w, h, uborder, vborder, 1.0 - uborder * 2.0f, 1.0 - vborder * 2.0f);
 		tessellator.draw();
 	}
diff --git a/src/main/java/net/minecraft/client/net/handler/NetClientHandler.java b/src/main/java/net/minecraft/client/net/handler/NetClientHandler.java
index d81358efb..ee06c910e 100644
--- a/src/main/java/net/minecraft/client/net/handler/NetClientHandler.java
+++ b/src/main/java/net/minecraft/client/net/handler/NetClientHandler.java
@@ -1009,11 +1009,11 @@ public class NetClientHandler extends NetHandler
     {
         if (packet104windowitems.windowId == 0)
         {
-            mc.thePlayer.inventorySlots.putStacksInSlots(packet104windowitems.itemStack);
+            mc.thePlayer.inventorySlots.putStacksInSlots(packet104windowitems.stackList);
         }
         else if (packet104windowitems.windowId == mc.thePlayer.craftingInventory.windowId)
         {
-            mc.thePlayer.craftingInventory.putStacksInSlots(packet104windowitems.itemStack);
+            mc.thePlayer.craftingInventory.putStacksInSlots(packet104windowitems.stackList);
         }
     }
 
diff --git a/src/main/java/net/minecraft/client/render/RenderBlocks.java b/src/main/java/net/minecraft/client/render/RenderBlocks.java
index 515d52b1e..44d6a01db 100644
--- a/src/main/java/net/minecraft/client/render/RenderBlocks.java
+++ b/src/main/java/net/minecraft/client/render/RenderBlocks.java
@@ -272,7 +272,7 @@ public class RenderBlocks
                                     int dirX, int dirY, int dirZ, float depth,
                                     int topX, int topY, int topZ, float topP, float botP,
                                     int lefX, int lefY, int lefZ, float lefP, float rigP){
-    	boolean ao = mc.isAmbientOcclusionEnabled();
+    	boolean ao = mc.isAmbientOcclusionEnabled() && Block.lightEmission[block.id] == 0;
         
     	if(LightmapHelper.isLightmapEnabled()) {
     		if(overbright) {
diff --git a/src/main/java/net/minecraft/client/render/RenderEngine.java b/src/main/java/net/minecraft/client/render/RenderEngine.java
index 6d0bb2dcd..631ef94c9 100644
--- a/src/main/java/net/minecraft/client/render/RenderEngine.java
+++ b/src/main/java/net/minecraft/client/render/RenderEngine.java
@@ -555,8 +555,12 @@ public class RenderEngine {
 	}
 
 	public void updateDynamicTextures() {
-		for(DynamicTexture dynamicTexture : dynamicTextures) {
-			updateDynamicTexture(dynamicTexture);
+		try {
+			for(DynamicTexture dynamicTexture : dynamicTextures) {
+				updateDynamicTexture(dynamicTexture);
+			}
+		} catch (Exception e){
+			new RuntimeException("Exception while updating dynamic textures. Skipping!", e).printStackTrace();
 		}
 	}
 	
diff --git a/src/main/java/net/minecraft/client/render/entity/PaintingRenderer.java b/src/main/java/net/minecraft/client/render/entity/PaintingRenderer.java
index a4557809b..cc305742a 100644
--- a/src/main/java/net/minecraft/client/render/entity/PaintingRenderer.java
+++ b/src/main/java/net/minecraft/client/render/entity/PaintingRenderer.java
@@ -127,6 +127,7 @@ public class PaintingRenderer extends EntityRenderer<EntityPainting>
         }
         float brightness = renderDispatcher.world.getLightBrightness(worldX, worldY, worldZ);
         if (Global.accessor.isFullbrightEnabled() || LightmapHelper.isLightmapEnabled()) {
+            LightmapHelper.setLightmapCoord(entity.world.getLightmapCoord(worldX, worldY, worldZ, entity.world.getBlockLightValue(worldX, worldY, worldZ)));
         	brightness = 1.0f;
         }
         GL11.glColor3f(brightness, brightness, brightness);
diff --git a/src/main/java/net/minecraft/core/block/BlockFire.java b/src/main/java/net/minecraft/core/block/BlockFire.java
index af484cb45..4b8912297 100644
--- a/src/main/java/net/minecraft/core/block/BlockFire.java
+++ b/src/main/java/net/minecraft/core/block/BlockFire.java
@@ -44,6 +44,8 @@ public class BlockFire extends Block {
 		setBurnRate(Block.logCherry.id, 5, 5);
 		setBurnRate(Block.logOakMossy.id, 5, 5);
 		setBurnRate(Block.logEucalyptus.id, 5, 5);
+		setBurnRate(Block.logPalm.id, 5, 5);
+		setBurnRate(Block.logThorn.id, 5, 5);
 		setBurnRate(Block.leavesOak.id, 30, 60);
 		setBurnRate(Block.leavesPine.id, 30, 60);
 		setBurnRate(Block.leavesBirch.id, 30, 60);
@@ -53,6 +55,8 @@ public class BlockFire extends Block {
 		setBurnRate(Block.leavesShrub.id, 30, 60);
 		setBurnRate(Block.leavesEucalyptus.id, 30, 60);
 		setBurnRate(Block.leavesCacao.id, 30, 60);
+		setBurnRate(Block.leavesPalm.id, 30, 60);
+		setBurnRate(Block.leavesThorn.id, 30, 60);
 		setBurnRate(Block.bookshelfPlanksOak.id, 30, 20);
 		setBurnRate(Block.tnt.id, 15, 100);
 		setBurnRate(Block.wool.id, 30, 60);
diff --git a/src/main/java/net/minecraft/core/block/BlockLayerLeaves.java b/src/main/java/net/minecraft/core/block/BlockLayerLeaves.java
index 35d150a6f..faefd92a3 100644
--- a/src/main/java/net/minecraft/core/block/BlockLayerLeaves.java
+++ b/src/main/java/net/minecraft/core/block/BlockLayerLeaves.java
@@ -1,8 +1,10 @@
 package net.minecraft.core.block;
 
 import net.minecraft.core.block.entity.TileEntity;
+import net.minecraft.core.entity.EntityLiving;
 import net.minecraft.core.enums.EnumDropCause;
 import net.minecraft.core.item.ItemStack;
+import net.minecraft.core.util.helper.Side;
 import net.minecraft.core.world.World;
 import net.minecraft.core.block.material.Material;
 import net.minecraft.core.util.phys.AABB;
@@ -17,6 +19,7 @@ import java.util.Random;
 
 public class BlockLayerLeaves extends BlockLayerBase
 {
+    public static final int MASK_PERMANENT = 0b1000_0000;
 
 	public BlockLayerLeaves(String key, int id, Material material)
     {
@@ -89,7 +92,7 @@ public class BlockLayerLeaves extends BlockLayerBase
         switch (dropCause)
         {
             case SILK_TOUCH:
-                return new ItemStack[] { new ItemStack(this, (meta & 0b01111111) + 1) };
+                return new ItemStack[] { new ItemStack(this, (meta & ~MASK_PERMANENT) + 1) }; // Drop amount equal to number of layers
             case PICK_BLOCK:
                 return new ItemStack[] { new ItemStack(this) };
             default:
@@ -103,7 +106,7 @@ public class BlockLayerLeaves extends BlockLayerBase
     	if (world.getSeasonManager().getCurrentSeason() != null && !world.getSeasonManager().getCurrentSeason().hasFallingLeaves)
     	{
     		int metadata = world.getBlockMetadata(x, y, z);
-            if ((metadata & 0b10000000) == 0)
+            if (!isPermanent(metadata))
             {
                 if (rand.nextInt(2) == 0)
                 {
@@ -119,4 +122,15 @@ public class BlockLayerLeaves extends BlockLayerBase
             }
     	}
     }
+
+    public static boolean isPermanent(int meta){
+        return (meta & MASK_PERMANENT) != 0;
+    }
+    public static int setPermanent(int meta, boolean flag) {
+        if (flag){
+            return meta | MASK_PERMANENT;
+        } else {
+            return meta & ~MASK_PERMANENT;
+        }
+    }
 }
diff --git a/src/main/java/net/minecraft/core/block/BlockLeavesBase.java b/src/main/java/net/minecraft/core/block/BlockLeavesBase.java
index d9383c65a..9d9f1df12 100644
--- a/src/main/java/net/minecraft/core/block/BlockLeavesBase.java
+++ b/src/main/java/net/minecraft/core/block/BlockLeavesBase.java
@@ -187,8 +187,16 @@ public abstract class BlockLeavesBase extends Block
         world.setBlockWithNotify(i, j, k, 0);
     }
 
+    public static final int MASK_PERMANENT = 0b0000_0001;
     public static boolean isPermanent(int meta) {
-    	return (meta & 1) != 0;
+    	return (meta & MASK_PERMANENT) != 0;
+    }
+    public static int setPermanent(int meta, boolean flag){
+        if (flag){
+            return meta | MASK_PERMANENT;
+        } else {
+            return meta & ~MASK_PERMANENT;
+        }
     }
     
     public static boolean isDecaying(int meta) {
diff --git a/src/main/java/net/minecraft/core/crafting/LookupFuelFurnace.java b/src/main/java/net/minecraft/core/crafting/LookupFuelFurnace.java
index dd2b5a515..2edf6ab2d 100644
--- a/src/main/java/net/minecraft/core/crafting/LookupFuelFurnace.java
+++ b/src/main/java/net/minecraft/core/crafting/LookupFuelFurnace.java
@@ -32,6 +32,8 @@ public class LookupFuelFurnace {
 		addFuelEntry(Block.chestPlanksOakPainted.id, 300);
 		addFuelEntry(Block.workbench.id, 300);
 		addFuelEntry(Block.pressureplatePlanksOak.id, 300);
+		addFuelEntry(Block.trapdoorPlanksOak.id, 300);
+		addFuelEntry(Block.trapdoorPlanksOakPainted.id, 300);
 
 		addFuelEntry(Block.logOak.id, 300);
 		addFuelEntry(Block.logBirch.id, 300);
@@ -39,6 +41,8 @@ public class LookupFuelFurnace {
 		addFuelEntry(Block.logCherry.id, 300);
 		addFuelEntry(Block.logOakMossy.id, 300);
 		addFuelEntry(Block.logEucalyptus.id, 300);
+		addFuelEntry(Block.logThorn.id, 300);
+		addFuelEntry(Block.logPalm.id, 300);
 
 		addFuelEntry(Block.saplingOak.id, 100);
 		addFuelEntry(Block.saplingPine.id, 100);
@@ -48,6 +52,8 @@ public class LookupFuelFurnace {
 		addFuelEntry(Block.saplingShrub.id, 100);
 		addFuelEntry(Block.saplingOakRetro.id, 100);
 		addFuelEntry(Block.saplingCacao.id, 100);
+		addFuelEntry(Block.saplingThorn.id, 100);
+		addFuelEntry(Block.saplingPalm.id, 100);
 		addFuelEntry(Block.deadbush.id, 100);
 		addFuelEntry(Block.spinifex.id, 100);
 
@@ -67,8 +73,10 @@ public class LookupFuelFurnace {
 
 		addFuelEntry(Item.boat.id, 300);
 		addFuelEntry(Item.doorOak.id, 300);
+		addFuelEntry(Item.doorOakPainted.id, 300);
 		addFuelEntry(Item.sign.id, 300);
 		addFuelEntry(Item.bowl.id, 300);
+		addFuelEntry(Item.toolCalendar.id, 300);
 
 		addFuelEntry(Item.coal.id, 1600);
 		addFuelEntry(Item.nethercoal.id, 6400);
diff --git a/src/main/java/net/minecraft/core/data/registry/Registries.java b/src/main/java/net/minecraft/core/data/registry/Registries.java
index 7d6201c68..f70eeb9bd 100644
--- a/src/main/java/net/minecraft/core/data/registry/Registries.java
+++ b/src/main/java/net/minecraft/core/data/registry/Registries.java
@@ -67,7 +67,7 @@ public class Registries extends Registry<Registry<?>>
         ITEM_GROUPS.register("minecraft:dirt",stackListOf(Block.dirt, Block.dirtScorched));
         ITEM_GROUPS.register("minecraft:trommel_dirt",stackListOf(Block.dirt, Block.dirtScorched, Block.grass, Block.grassRetro, Block.grassScorched, Block.pathDirt, Block.farmlandDirt));
         ITEM_GROUPS.register("minecraft:moss_stones",stackListOf(Block.mossStone, Block.mossBasalt, Block.mossLimestone, Block.mossGranite));
-        ITEM_GROUPS.register("minecraft:logs",stackListOf(Block.logOak, Block.logPine, Block.logBirch, Block.logCherry, Block.logEucalyptus, Block.logOakMossy));
+        ITEM_GROUPS.register("minecraft:logs",stackListOf(Block.logOak, Block.logPine, Block.logBirch, Block.logCherry, Block.logEucalyptus, Block.logOakMossy, Block.logThorn, Block.logPalm));
         ITEM_GROUPS.register("minecraft:leaves",stackListOf(Block.leavesOak, Block.leavesOakRetro, Block.leavesPine, Block.leavesBirch, Block.leavesCherry, Block.leavesEucalyptus, Block.leavesShrub));
         ITEM_GROUPS.register("minecraft:coal_ores",stackListOf(Block.oreCoalStone, Block.oreCoalBasalt, Block.oreCoalLimestone, Block.oreCoalGranite));
         ITEM_GROUPS.register("minecraft:iron_ores",stackListOf(Block.oreIronStone, Block.oreIronBasalt, Block.oreIronLimestone, Block.oreIronGranite));
diff --git a/src/main/java/net/minecraft/core/item/ItemStack.java b/src/main/java/net/minecraft/core/item/ItemStack.java
index 2317af41f..3a2701f5d 100644
--- a/src/main/java/net/minecraft/core/item/ItemStack.java
+++ b/src/main/java/net/minecraft/core/item/ItemStack.java
@@ -12,6 +12,8 @@ import net.minecraft.core.player.inventory.IInventory;
 import net.minecraft.core.util.helper.Side;
 import net.minecraft.core.world.World;
 import net.minecraft.core.world.save.conversion.ChunkConverter;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
 
 public final class ItemStack
 {
@@ -21,6 +23,7 @@ public final class ItemStack
     public int animationsToGo;
     public int itemID;
     private int metadata;
+    @NotNull
     private CompoundTag tag;
 
     public ItemStack(IItemConvertible item)
@@ -53,7 +56,7 @@ public final class ItemStack
         this(block.id, stackSize, metadata);
     }
 
-    public ItemStack(Block block, int stackSize, int metadata, CompoundTag tag)
+    public ItemStack(Block block, int stackSize, int metadata, @Nullable CompoundTag tag)
     {
         this(block.id, stackSize, metadata, tag);
     }
@@ -73,7 +76,7 @@ public final class ItemStack
         this(item.id, stackSize, metadata);
     }
 
-    public ItemStack(Item item, int stackSize, int metadata, CompoundTag tag)
+    public ItemStack(Item item, int stackSize, int metadata, @Nullable CompoundTag tag)
     {
         this(item.id, stackSize, metadata, tag);
     }
@@ -90,16 +93,18 @@ public final class ItemStack
         this.tag = new CompoundTag(itemStack.tag);
     }
 
-    public ItemStack(int itemID, int stackSize, int metadata, CompoundTag tag)
+    public ItemStack(int itemID, int stackSize, int metadata, @Nullable CompoundTag tag)
     {
         this.itemID = itemID;
         this.stackSize = stackSize;
         this.metadata = metadata;
+        if (tag == null) tag = new CompoundTag();
         this.tag = tag;
     }
 
     private ItemStack()
     {
+        tag = new CompoundTag();
     }
 
     public ItemStack splitStack(int i)
@@ -141,7 +146,7 @@ public final class ItemStack
 		nbt.putShort("Damage", (short) metadata);
 		nbt.putByte("Expanded", (byte) 1);
 		nbt.putInt("Version", Global.CURRENT_SAVE_VERSION);
-		if(tag != null && tag.getValue().size() > 0) {
+		if(!tag.getValue().isEmpty()) {
 			nbt.putCompound("Data", tag);
 		}
 		return nbt;
@@ -417,10 +422,7 @@ public final class ItemStack
         
         CompoundTag nbt1 = tag;
         CompoundTag nbt2 = itemStack.tag;
-        
-        if(nbt1 == null && nbt2 == null) return true;	// If both are null, stackable
-        if(nbt1 == null || nbt2 == null) return false;	// If one is null, not stackable
-        
+
         return nbt1.equals(nbt2);
     }
     
@@ -476,7 +478,7 @@ public final class ItemStack
     	return 0;
     }
     
-    public void setCustomName(String name) {
+    public void setCustomName(@Nullable String name) {
     	if(name == null || name.length() == 0) {
     		removeCustomName();
     		return;
@@ -503,20 +505,15 @@ public final class ItemStack
 		tag.getValue().remove("overrideColor");
 		tag.getValue().remove("color");
     }
-    
+
+    @NotNull
     public CompoundTag getData() {
-    	if(this.tag == null) {
-    		this.tag = new CompoundTag();
-    	}
-		return tag;
+        return tag;
 	}
     
-    public void setData(CompoundTag tag) {
-    	if(tag == null) {
-    		// Dont store tag as null for now
-    		tag = new CompoundTag();
-    	}
-		this.tag = tag;
+    public void setData(@Nullable CompoundTag tag) {
+        if (tag == null) tag = new CompoundTag();
+        this.tag = tag;
 	}
 
 }
diff --git a/src/main/java/net/minecraft/core/item/block/ItemBlockLayerLeaves.java b/src/main/java/net/minecraft/core/item/block/ItemBlockLayerLeaves.java
index 43f001ff3..22bd7337f 100644
--- a/src/main/java/net/minecraft/core/item/block/ItemBlockLayerLeaves.java
+++ b/src/main/java/net/minecraft/core/item/block/ItemBlockLayerLeaves.java
@@ -6,6 +6,8 @@ import net.minecraft.core.Global;
 import net.minecraft.core.block.Block;
 import net.minecraft.core.block.BlockFluid;
 import net.minecraft.core.block.BlockLayerBase;
+import net.minecraft.core.block.BlockLayerLeaves;
+import net.minecraft.core.block.BlockLeavesBase;
 import net.minecraft.core.block.tag.BlockTags;
 import net.minecraft.core.entity.player.EntityPlayer;
 import net.minecraft.core.enums.EnumBlockSoundEffectType;
@@ -58,17 +60,17 @@ public class ItemBlockLayerLeaves extends ItemBlock
 
 			if ((newMeta & 0b00001111) < 7)
 			{
-				world.setBlockAndMetadataWithNotify(blockX, blockY, blockZ, blockID, newMeta);
+				world.setBlockAndMetadataWithNotify(blockX, blockY, blockZ, blockID, BlockLayerLeaves.setPermanent(newMeta, true));
 			}
 			else
 			{
 				if (blockLayer.fullBlockID != -1)
 				{
-					world.setBlockAndMetadataWithNotify(blockX, blockY, blockZ, blockLayer.fullBlockID, 0);
+					world.setBlockAndMetadataWithNotify(blockX, blockY, blockZ, blockLayer.fullBlockID, BlockLeavesBase.setPermanent(0, true));
 				}
 				else
 				{
-					world.setBlockAndMetadataWithNotify(blockX, blockY + 1, blockZ, blockID, 0b10000000);
+					world.setBlockAndMetadataWithNotify(blockX, blockY + 1, blockZ, blockID, BlockLayerLeaves.setPermanent(0, true));
 				}
 			}
 			world.playBlockSoundEffect(entityplayer, blockX + 0.5F, blockY + 0.5F, blockZ + 0.5F, blockLayer, EnumBlockSoundEffectType.PLACE);
@@ -103,17 +105,17 @@ public class ItemBlockLayerLeaves extends ItemBlock
 
 			if ((newMeta & 0b00001111) < 7)
 			{
-				world.setBlockAndMetadataWithNotify(blockX, blockY, blockZ, blockID, newMeta);
+				world.setBlockAndMetadataWithNotify(blockX, blockY, blockZ, blockID, BlockLayerLeaves.setPermanent(newMeta, true));
 			}
 			else
 			{
 				if (blockLayer.fullBlockID != -1)
 				{
-					world.setBlockAndMetadataWithNotify(blockX, blockY, blockZ, blockLayer.fullBlockID, 0);
+					world.setBlockAndMetadataWithNotify(blockX, blockY, blockZ, blockLayer.fullBlockID, BlockLeavesBase.setPermanent(0, true));
 				}
 				else
 				{
-					world.setBlockAndMetadataWithNotify(blockX, blockY + 1, blockZ, blockID, 0b10000000);
+					world.setBlockAndMetadataWithNotify(blockX, blockY + 1, blockZ, blockID, BlockLayerLeaves.setPermanent(0, true));
 				}
 			}
 			world.playBlockSoundEffect(entityplayer, blockX + 0.5F, blockY + 0.5F, blockZ + 0.5F, blockLayer, EnumBlockSoundEffectType.PLACE);
@@ -127,7 +129,7 @@ public class ItemBlockLayerLeaves extends ItemBlock
 			final Block block = Block.blocksList[blockID];
 			Block currentBlock = world.getBlock(blockX, blockY, blockZ);
 			boolean placedInside = currentBlock != null && !(currentBlock instanceof BlockFluid);
-			if (world.setBlockAndMetadataWithNotify(blockX, blockY, blockZ, blockID, getPlacedBlockMetadata(itemstack.getMetadata())))
+			if (world.setBlockAndMetadataWithNotify(blockX, blockY, blockZ, blockID, BlockLayerLeaves.setPermanent(getPlacedBlockMetadata(itemstack.getMetadata()), true)))
 			{
 				if (placedInside && !world.isClientSide){
 					world.playSoundEffect(EVENT_BLOCK_BREAK, blockX, blockY, blockZ, currentBlock.id);
diff --git a/src/main/java/net/minecraft/core/net/packet/Packet104WindowItems.java b/src/main/java/net/minecraft/core/net/packet/Packet104WindowItems.java
index 188d58772..f329755fa 100644
--- a/src/main/java/net/minecraft/core/net/packet/Packet104WindowItems.java
+++ b/src/main/java/net/minecraft/core/net/packet/Packet104WindowItems.java
@@ -1,6 +1,7 @@
 package net.minecraft.core.net.packet;
 
 import com.mojang.nbt.CompoundTag;
+import net.minecraft.core.item.Item;
 import net.minecraft.core.item.ItemStack;
 import net.minecraft.core.net.handler.NetHandler;
 
@@ -12,19 +13,22 @@ import java.util.List;
 
 public class Packet104WindowItems extends Packet
 {
+    public int windowId;
+    public ItemStack[] stackList;
+
 
     public Packet104WindowItems()
     {
     }
-    
+
     public Packet104WindowItems(int i, List<ItemStack> list)
     {
         windowId = i;
-        itemStack = new ItemStack[list.size()];
-        for(int j = 0; j < itemStack.length; j++)
+        stackList = new ItemStack[list.size()];
+        for(int j = 0; j < stackList.length; j++)
         {
             ItemStack itemstack = list.get(j);
-            itemStack[j] = itemstack != null ? itemstack.copy() : null;
+            stackList[j] = itemstack != null ? itemstack.copy() : null;
         }
 
     }
@@ -34,20 +38,19 @@ public class Packet104WindowItems extends Packet
         throws IOException
     {
         windowId = dis.readByte();
-        short word0 = dis.readShort();
-        itemStack = new ItemStack[word0];
-        for(int i = 0; i < word0; i++)
+        short listSize = dis.readShort();
+        stackList = new ItemStack[listSize];
+        for(int i = 0; i < listSize; i++)
         {
-            short word1 = dis.readShort();
-            if(word1 >= 0)
+            short itemId = dis.readShort();
+            if(itemId >= 0)
             {
-                byte byte0 = dis.readByte();
-                short word2 = dis.readShort();
-                CompoundTag tag = null;
-                if (dis.readByte() == 1){
-                    tag = readCompressedCompoundTag(dis);
-                }
-                itemStack[i] = new ItemStack(word1, byte0, word2, tag);
+                byte size = dis.readByte();
+                short meta = dis.readShort();
+                CompoundTag tag = readCompressedCompoundTag(dis);
+                ItemStack s = new ItemStack(itemId, size, meta, tag);
+                stackList[i] = s;
+//                System.out.printf("Received|| Name:%s, ID:%s, CustomName:%s, Tag:%s\n", s.getItemKey(), s.itemID, s.getCustomName(), s.getData());
             }
         }
 
@@ -58,23 +61,20 @@ public class Packet104WindowItems extends Packet
         throws IOException
     {
         dos.writeByte(windowId);
-        dos.writeShort(itemStack.length);
-        for(int i = 0; i < itemStack.length; i++)
+        dos.writeShort(stackList.length);
+        for(int i = 0; i < stackList.length; i++)
         {
-            if(itemStack[i] == null)
+            if(stackList[i] == null)
             {
                 dos.writeShort(-1);
             } else
             {
-                dos.writeShort((short)itemStack[i].itemID);
-                dos.writeByte((byte)itemStack[i].stackSize);
-                dos.writeShort((short)itemStack[i].getMetadata());
-                if (!itemStack[i].getData().getValues().isEmpty()){
-                    dos.writeByte(0);
-                } else {
-                    dos.writeByte(1);
-                    writeCompressedCompoundTag(itemStack[i].getData(), dos);
-                }
+                dos.writeShort((short) stackList[i].itemID);
+                dos.writeByte((byte) stackList[i].stackSize);
+                dos.writeShort((short) stackList[i].getMetadata());
+                writeCompressedCompoundTag(stackList[i].getData(), dos);
+//                ItemStack s = stackList[i];
+//                System.out.printf("Sent|| Name:%s, ID:%s, CustomName:%s, Tag:%s\n", s.getItemKey(), s.itemID, s.getCustomName(), s.getData());
             }
         }
 
@@ -89,9 +89,6 @@ public class Packet104WindowItems extends Packet
     @Override
 	public int getPacketSize()
     {
-        return 3 + itemStack.length * 5;
+        return 3 + stackList.length * 5;
     }
-
-    public int windowId;
-    public ItemStack[] itemStack;
 }
