diff --git a/src/main/java/net/minecraft/client/gui/GuiIngame.java b/src/main/java/net/minecraft/client/gui/GuiIngame.java
index 6ee1f3c48..97d4ea9c2 100644
--- a/src/main/java/net/minecraft/client/gui/GuiIngame.java
+++ b/src/main/java/net/minecraft/client/gui/GuiIngame.java
@@ -30,6 +30,8 @@ import net.minecraft.core.util.helper.MathHelper;
 import net.minecraft.core.util.helper.Side;
 import net.minecraft.core.world.season.Season;
 import net.minecraft.core.world.weather.Weather;
+import net.minecraft.core.world.wind.WindManager;
+
 import org.lwjgl.input.Keyboard;
 import org.lwjgl.opengl.GL11;
 
@@ -285,6 +287,15 @@ public class GuiIngame extends Gui
                     float humidity = (float) floor100(mc.theWorld.getBlockHumidity(blockX, blockZ));
                     
                     drawDebugScreenLine("Temperature: " + temperature + " Humidity: " + humidity);
+                    
+                    WindManager windManager = mc.theWorld.worldType.getWindManager();
+                    if(windManager != null) {
+                    	float direction = (float) floor100(windManager.getWindDirection(mc.theWorld, 0.0f, 500.0f, 0.0f));
+                    	float intensity = (float) floor100(windManager.getWindIntensity(mc.theWorld, 0.0f, 500.0f, 0.0f));
+
+                        int yaw = DynamicTexture.pmod(java.lang.Math.round((direction * 360.0f) + 270.0f), 360);
+                    	drawDebugScreenLine("Wind: " + yaw + "°, " + java.lang.Math.round(intensity * 100.0f) + "%");
+                    }
                 }
                 else
                 {
diff --git a/src/main/java/net/minecraft/client/render/ItemRenderer.java b/src/main/java/net/minecraft/client/render/ItemRenderer.java
index 3a74f8d2c..17af8e541 100644
--- a/src/main/java/net/minecraft/client/render/ItemRenderer.java
+++ b/src/main/java/net/minecraft/client/render/ItemRenderer.java
@@ -143,7 +143,6 @@ public class ItemRenderer
             Block block = Block.blocksList[id];
             BlockModel<Block> model = BlockModelDispatcher.getInstance().getDispatch(block);
 			if(mc.theWorld.isBlockNormalCube(blockX, blockY, blockZ)) {
-                System.out.println(block.getKey());
 				renderInsideOfBlock(partialTicks, model.getBlockTextureFromSideAndMetadata(Side.NORTH, meta));
 			} else {
                 id = 0;
diff --git a/src/main/java/net/minecraft/client/render/LightmapHelper.java b/src/main/java/net/minecraft/client/render/LightmapHelper.java
index faa679fff..ec161011e 100644
--- a/src/main/java/net/minecraft/client/render/LightmapHelper.java
+++ b/src/main/java/net/minecraft/client/render/LightmapHelper.java
@@ -27,6 +27,9 @@ public class LightmapHelper {
 	private int lightmapTexture = 0;
 	private int[] lightmapData = new int[256];
 	public BufferedImage customLightmap;
+	
+	private float prevSkyDarken;
+	public float skyDarkenSmooth;
 
 	public LightmapHelper(Minecraft mc, WorldRenderer worldRenderer) {
 		this.mc = mc;
@@ -61,6 +64,23 @@ public class LightmapHelper {
 	public boolean isEnabled() {
 		return mc.gameSettings.lightmapStyle.value != LightmapStyle.DISABLED;
 	}
+	
+	public void tick() {
+		World world = mc.theWorld;
+		if(world == null) {
+			return;
+		}
+		
+		prevSkyDarken = skyDarkenSmooth;
+		
+		float skyDarken = world.skyDarken;
+		
+		if(Math.abs(this.skyDarkenSmooth - skyDarken) > 1.5f) {
+			this.skyDarkenSmooth = this.prevSkyDarken = skyDarken;
+		}else {
+			skyDarkenSmooth = MathHelper.lerp(skyDarken, skyDarkenSmooth, 0.99f);
+		}
+	}
 
 	public void update(float partialTicks) {
 		World world = mc.theWorld;
@@ -136,18 +156,27 @@ public class LightmapHelper {
 	}
 
 	public void generateGrayLightmap(World world, float partialTicks) {
+		boolean smooth = mc.gameSettings.ambientOcclusion.value;
+		
 		for(int i = 0; i < 256; i++) {
-			int skyLight = i / 16;
-			int blockLight = i & 15;
-
-			skyLight = Math.max(0, skyLight - world.skyDarken);
-
-			int light = Math.max(skyLight, blockLight);
+			final int skyLightLevel = i / 16;
+			final int blockLightLevel = i & 15;
 
-			float brightness = world.worldType.getBrightnessRamp()[light];
+			float brightness;
 			
-			brightness = applyGamma(brightness, mc.gameSettings.brightness.value - 0.5f);
+			if(smooth) {
+				float skyDarken = prevSkyDarken + (skyDarkenSmooth - prevSkyDarken) * partialTicks;
+				
+				float modifiedSkylight = Math.max(0, skyLightLevel - skyDarken);
+				float light = Math.max(blockLightLevel, modifiedSkylight);
+				brightness = MathHelper.getInterpolate(world.worldType.getBrightnessRamp(), light);
+			}else {
+				int modifiedSkylight = Math.max(0, skyLightLevel - world.skyDarken);
+				int light = Math.max(blockLightLevel, modifiedSkylight);
+				brightness = world.worldType.getBrightnessRamp()[light];
+			}
 			
+			brightness = applyGamma(brightness, mc.gameSettings.brightness.value - 0.5f);
 			brightness = MathHelper.clamp(brightness, 0.0f, 1.0f);
 
 			int brightnessI = (int) (brightness * 255);
@@ -157,7 +186,7 @@ public class LightmapHelper {
 			lightmapData[i] = color;
 		}
 	}
-
+	
 	public void generateCosyLightmap(World world, float partialTicks) {
 		float ambientBrightness = world.getAmbientBrightness(partialTicks);
 		float brightness = mc.gameSettings.brightness.value - 0.5f;
diff --git a/src/main/java/net/minecraft/client/render/WorldRenderer.java b/src/main/java/net/minecraft/client/render/WorldRenderer.java
index 5eb8374aa..946e859dd 100644
--- a/src/main/java/net/minecraft/client/render/WorldRenderer.java
+++ b/src/main/java/net/minecraft/client/render/WorldRenderer.java
@@ -104,6 +104,7 @@ public class WorldRenderer
         rendererUpdateCount++;
         itemRenderer.updateEquippedItem();
         addRainParticles();
+        lightmapHelper.tick();
     }
 
     private float b = 1.0f;
diff --git a/src/main/java/net/minecraft/client/render/entity/BoatRenderer.java b/src/main/java/net/minecraft/client/render/entity/BoatRenderer.java
index e2ed8ae80..1f8d25d2f 100644
--- a/src/main/java/net/minecraft/client/render/entity/BoatRenderer.java
+++ b/src/main/java/net/minecraft/client/render/entity/BoatRenderer.java
@@ -58,7 +58,7 @@ public class BoatRenderer extends EntityRenderer<EntityBoat>
             float boatSpeed = MathHelper.sqrt_float((float) (entity.xd * entity.xd + entity.zd * entity.zd));
             float angle = MathHelper.lerp(windAngle, boatAngle, (float)MathHelper.clamp(boatSpeed, 0, 0.25) * 4);
 
-            flagRenderer.doRender(entity.tileEntityFlag, -1.19, 0.187, -0.5, partialTick, false, angle);
+            flagRenderer.doRender(entity.tileEntityFlag, -1.19, 0.187, -0.5, partialTick, false, angle, 1.0f);
         }
         TextureRegistry.blockAtlas.bindTexture();
         float f4 = 0.75F;
diff --git a/src/main/java/net/minecraft/client/render/item/model/ItemModelBlock.java b/src/main/java/net/minecraft/client/render/item/model/ItemModelBlock.java
index 861cf8a92..0c15f018a 100644
--- a/src/main/java/net/minecraft/client/render/item/model/ItemModelBlock.java
+++ b/src/main/java/net/minecraft/client/render/item/model/ItemModelBlock.java
@@ -135,8 +135,9 @@ public class ItemModelBlock extends ItemModelStandard {
         GL11.glEnable(GL_CULL_FACE);
         GL11.glDisable(GL_BLEND);
     }
+    
     @Override
-    public void renderAsItemEntity(Tessellator tessellator, @Nullable Entity entity, Random random, ItemStack itemstack, int renderCount, float yaw, float brightness, float partialTick) {
+    public void renderAsItemEntity(Tessellator tessellator, Entity entity, Random random, ItemStack itemstack, int renderCount, float yaw, float brightness, float partialTick) {
         if (Block.blocksList[itemstack.itemID] != null && BlockModelDispatcher.getInstance().getDispatch(Block.blocksList[itemstack.itemID]).shouldItemRender3d()) {
             GL11.glRotatef(yaw, 0.0F, 1.0F, 0.0F);
             TextureRegistry.blockAtlas.bindTexture();
@@ -164,6 +165,7 @@ public class ItemModelBlock extends ItemModelStandard {
             super.renderAsItemEntity(tessellator, entity, random, itemstack, renderCount, yaw, brightness, partialTick);
         }
     }
+    
     @Override
     public void renderItemInWorld(Tessellator tessellator, Entity entity, ItemStack itemStack, float brightness, float alpha, boolean worldTransform) {
         if (itemStack == null) return;
diff --git a/src/main/java/net/minecraft/client/render/tileentity/TileEntityRendererFlag.java b/src/main/java/net/minecraft/client/render/tileentity/TileEntityRendererFlag.java
index 7af477402..3c473cf82 100644
--- a/src/main/java/net/minecraft/client/render/tileentity/TileEntityRendererFlag.java
+++ b/src/main/java/net/minecraft/client/render/tileentity/TileEntityRendererFlag.java
@@ -14,9 +14,9 @@ import org.lwjgl.opengl.GL11;
 public class TileEntityRendererFlag extends TileEntityRenderer<TileEntityFlag>
 {
 
+	public final Minecraft mc = Minecraft.getMinecraft(this);
     private final ModelFlag flagModel;
     private FlagRenderer flagRenderer = null;
-    private long lastTick = 0;
     
     public TileEntityRendererFlag() 
     {
@@ -29,27 +29,27 @@ public class TileEntityRendererFlag extends TileEntityRenderer<TileEntityFlag>
         int blockUnder = theWorld.getBlockId(tileEntity.x, tileEntity.y - 1, tileEntity.z);
         boolean shortPole = blockUnder == Block.flag.id;
 
-        WindManager theWind = theWorld.getWorldType().getWindManager();
+        WindManager theWind = mc.theWorld.getWorldType().getWindManager();
 
-        float angle = theWind.getWindDirection(theWorld, (float) x, (float) y, (float) z) * 360f;
-
-        doRender(tileEntity, x, y, z, partialTick, shortPole, angle);
+        float windDirection = theWind.getWindDirection(mc.theWorld, 0.0f, 500.0f, 0.0f) * 360f;
+        float windIntensity = theWind.getWindIntensity(mc.theWorld, 0.0f, 500.0f, 0.0f);
+        
+        doRender(tileEntity, x, y, z, partialTick, shortPole, windDirection, windIntensity);
     }
 
-    public void doRender(TileEntityFlag tileEntity, double x, double y, double z, float partialTick, boolean shortPole, float rotationAngle)
+    public void doRender(TileEntityFlag tileEntity, double x, double y, double z, float partialTick, boolean shortPole, float windDirection, float windIntensity)
     {
         if (flagRenderer == null)
         {
             flagRenderer = new FlagRenderer(renderDispatcher.renderEngine);
         }
         flagRenderer.updateTexture(tileEntity);
-
-        long currentTick = Minecraft.getMinecraft(this).theWorld.getWorldTime();
-
-        float sway = (float) (((lastTick + (currentTick - lastTick) * (double)partialTick) / 1.5D) % (2 * Math.PI));
-
-        lastTick = currentTick;
-
+        
+        float swayInterpolated = tileEntity.sway + partialTick;
+        
+        float sway = (float) ((swayInterpolated / 1.5) % (2 * Math.PI));
+        sway = (float) (Math.sin(sway) * windIntensity * 2.0f);
+        
         GL11.glPushMatrix();
         final float scale = 1F;
         GL11.glTranslatef((float) x + 0.5F, (float) y + 0.75F * scale, (float) z + 0.5F);
@@ -64,9 +64,9 @@ public class TileEntityRendererFlag extends TileEntityRenderer<TileEntityFlag>
             flagModel.renderBase();
             flagModel.renderPole();
         }
+        
         GL11.glPushMatrix();
-        GL11.glRotatef(rotationAngle, 0.0F, 1.0F, 0.0F);
-        GL11.glRotatef((float) Math.sin(sway) * 2, 0.0f, 1.0f, 0.0f);
+        GL11.glRotatef(windDirection + sway, 0.0f, 1.0f, 0.0f);
         flagModel.renderFlag();
         renderDispatcher.renderEngine.bindTexture(flagRenderer.getTexture());
         GL11.glEnable(GL11.GL_BLEND);
diff --git a/src/main/java/net/minecraft/client/render/tileentity/TileEntityRendererMesh.java b/src/main/java/net/minecraft/client/render/tileentity/TileEntityRendererMesh.java
index c2423709b..96fd83a11 100644
--- a/src/main/java/net/minecraft/client/render/tileentity/TileEntityRendererMesh.java
+++ b/src/main/java/net/minecraft/client/render/tileentity/TileEntityRendererMesh.java
@@ -1,19 +1,21 @@
 package net.minecraft.client.render.tileentity;
 
+import org.lwjgl.opengl.GL11;
+
 import net.minecraft.client.Minecraft;
 import net.minecraft.client.render.EntityRenderDispatcher;
-import net.minecraft.client.render.RenderBlocks;
 import net.minecraft.client.render.block.model.BlockModel;
 import net.minecraft.client.render.item.model.ItemModelDispatcher;
 import net.minecraft.client.render.tessellator.Tessellator;
 import net.minecraft.core.Global;
 import net.minecraft.core.block.entity.TileEntityMeshGold;
+import net.minecraft.core.entity.EntityItem;
 import net.minecraft.core.util.helper.MathHelper;
-import net.minecraft.core.world.World;
-import org.lwjgl.opengl.GL11;
 
 public class TileEntityRendererMesh extends TileEntityRenderer<TileEntityMeshGold> {
-
+	
+	public EntityItem renderEntity = new EntityItem(null);
+	
     @Override
     public void doRender(Tessellator tessellator, TileEntityMeshGold tileEntity, double x, double y, double z, float renderPartialTicks) {
         if(tileEntity.filterItem == null) return;
@@ -23,13 +25,20 @@ public class TileEntityRendererMesh extends TileEntityRenderer<TileEntityMeshGol
         final float f3 = (float) Math.toDegrees(((tileEntity.ticksRan + renderPartialTicks) / 20F));
 
         GL11.glTranslatef((float) x + 0.5f, (float) y + bobbingOffset + 0.25f, (float) z + 0.5f);
-
+        
+        renderEntity.world = tileEntity.worldObj;
+        renderEntity.x = renderEntity.xo = tileEntity.x + 0.5;
+        renderEntity.y = renderEntity.yo = tileEntity.y + 0.5;
+        renderEntity.z = renderEntity.zo = tileEntity.z + 0.5;
+        
         float lightLevel = Minecraft.getMinecraft(this).theWorld.getLightBrightness(tileEntity.x, tileEntity.y, tileEntity.z);
         if (Global.accessor.isFullbrightEnabled()) lightLevel = 1.0f;
         BlockModel.setRenderBlocks(EntityRenderDispatcher.instance.itemRenderer.renderBlocksInstance);
         GL11.glEnable(32826 /*GL_RESCALE_NORMAL_EXT*/);
-        ItemModelDispatcher.getInstance().getDispatch(tileEntity.filterItem).renderAsItemEntity(Tessellator.instance, null, tileEntity.worldObj.rand, tileEntity.filterItem, 1, f3, lightLevel, renderPartialTicks);
+        ItemModelDispatcher.getInstance().getDispatch(tileEntity.filterItem).renderAsItemEntity(Tessellator.instance, renderEntity, tileEntity.worldObj.rand, tileEntity.filterItem, 1, f3, lightLevel, renderPartialTicks);
         GL11.glDisable(32826 /*GL_RESCALE_NORMAL_EXT*/);
         GL11.glPopMatrix();
+        
+        renderEntity.world = null;
     }
 }
diff --git a/src/main/java/net/minecraft/core/block/entity/TileEntityFlag.java b/src/main/java/net/minecraft/core/block/entity/TileEntityFlag.java
index 12cfdcb94..fc6134628 100644
--- a/src/main/java/net/minecraft/core/block/entity/TileEntityFlag.java
+++ b/src/main/java/net/minecraft/core/block/entity/TileEntityFlag.java
@@ -1,10 +1,13 @@
 package net.minecraft.core.block.entity;
 
+import java.util.Random;
+
+import com.mojang.nbt.CompoundTag;
+import com.mojang.nbt.ListTag;
+
 import net.minecraft.core.entity.player.EntityPlayer;
 import net.minecraft.core.item.Item;
 import net.minecraft.core.item.ItemStack;
-import com.mojang.nbt.CompoundTag;
-import com.mojang.nbt.ListTag;
 import net.minecraft.core.net.packet.Packet;
 import net.minecraft.core.net.packet.Packet140TileEntityData;
 import net.minecraft.core.player.inventory.IInventory;
@@ -19,9 +22,16 @@ public class TileEntityFlag extends TileEntity
     public ItemStack[] items = new ItemStack[3];
     public String owner = "";
     
+    public int sway = new Random().nextInt(100); // Random start value
+    
     public TileEntityFlag()
     {
     }
+    
+    @Override
+    public void tick() {
+    	sway++;
+    }
 
     public byte getColor(int x, int y)
     {
diff --git a/src/main/java/net/minecraft/core/util/helper/MathHelper.java b/src/main/java/net/minecraft/core/util/helper/MathHelper.java
index edabd7a24..9e05ea24c 100644
--- a/src/main/java/net/minecraft/core/util/helper/MathHelper.java
+++ b/src/main/java/net/minecraft/core/util/helper/MathHelper.java
@@ -89,6 +89,20 @@ public class MathHelper
     {
         return a + ((b - a) * amount);
     }
+	
+	public static float getInterpolate(float[] array, float index) {
+		int index0 = (int) index;
+		if(index0 == index) {
+			return array[index0];
+		}
+		
+		int index1 = index0 + 1;
+		
+		float val0 = array[index0];
+		float val1 = array[index1];
+		
+		return MathHelper.lerp(val0, val1, index - index0);
+	}
 
     public static boolean stringNullOrLengthZero(String s)
     {
