diff --git a/src/common/resources/lang/en_US/item.lang b/src/common/resources/lang/en_US/item.lang
index dbe4c551b..5c68d7bfb 100644
--- a/src/common/resources/lang/en_US/item.lang
+++ b/src/common/resources/lang/en_US/item.lang
@@ -251,37 +251,37 @@ item.bone.desc=Spooky...
 item.dye.name=Dye
 item.dye.desc=How did you get this?!
 item.dye.black.name=Ink Sac
-item.dye.black.desc=Can be used to colour certain blocks black.
+item.dye.black.desc=Can be used to color certain blocks black.
 item.dye.red.name=Rose Red
-item.dye.red.desc=Can be used to colour certain blocks red.
+item.dye.red.desc=Can be used to color certain blocks red.
 item.dye.green.name=Cactus Green
-item.dye.green.desc=Can be used to colour certain blocks green.
+item.dye.green.desc=Can be used to color certain blocks green.
 item.dye.brown.name=Cocoa Beans
-item.dye.brown.desc=Smells like chocolate... Can also be used to colour certain blocks brown.
+item.dye.brown.desc=Smells like chocolate... Can also be used to color certain blocks brown.
 item.dye.blue.name=Lapis Lazuli
-item.dye.blue.desc=Can be used to colour certain blocks blue.
+item.dye.blue.desc=Can be used to color certain blocks blue.
 item.dye.purple.name=Purple Dye
-item.dye.purple.desc=Can be used to colour certain blocks purple.
+item.dye.purple.desc=Can be used to color certain blocks purple.
 item.dye.cyan.name=Cyan Dye
-item.dye.cyan.desc=Can be used to colour certain blocks cyan.
+item.dye.cyan.desc=Can be used to color certain blocks cyan.
 item.dye.silver.name=Light Gray Dye
-item.dye.silver.desc=Can be used to colour certain blocks light gray.
+item.dye.silver.desc=Can be used to color certain blocks light gray.
 item.dye.gray.name=Gray Dye
-item.dye.gray.desc=Can be used to colour certain blocks gray.
+item.dye.gray.desc=Can be used to color certain blocks gray.
 item.dye.pink.name=Pink Dye
-item.dye.pink.desc=Can be used to colour certain blocks pink.
+item.dye.pink.desc=Can be used to color certain blocks pink.
 item.dye.lime.name=Lime Dye
-item.dye.lime.desc=Can be used to colour certain blocks lime.
+item.dye.lime.desc=Can be used to color certain blocks lime.
 item.dye.yellow.name=Dandelion Yellow
-item.dye.yellow.desc=Can be used to colour certain blocks yellow.
+item.dye.yellow.desc=Can be used to color certain blocks yellow.
 item.dye.lightblue.name=Light Blue Dye
-item.dye.lightblue.desc=Can be used to colour certain blocks light blue.
+item.dye.lightblue.desc=Can be used to color certain blocks light blue.
 item.dye.magenta.name=Magenta Dye
-item.dye.magenta.desc=Can be used to colour certain blocks magenta.
+item.dye.magenta.desc=Can be used to color certain blocks magenta.
 item.dye.orange.name=Orange Dye
-item.dye.orange.desc=Can be used to colour certain blocks orange.
+item.dye.orange.desc=Can be used to color certain blocks orange.
 item.dye.white.name=Bone Meal
-item.dye.white.desc=A nourishing meal for plants. Can also be used to colour certain blocks white.
+item.dye.white.desc=A nourishing meal for plants. Can also be used to color certain blocks white.
 item.dust.sugar.name=Sugar
 item.dust.sugar.desc=Can craft sweet treats.
 item.food.cake.name=Cake
diff --git a/src/main/java/net/betterthanadventure/utils/BiomeFinder.java b/src/main/java/net/betterthanadventure/utils/BiomeFinder.java
index 48d9792e8..f1e10fa1b 100644
--- a/src/main/java/net/betterthanadventure/utils/BiomeFinder.java
+++ b/src/main/java/net/betterthanadventure/utils/BiomeFinder.java
@@ -495,7 +495,7 @@ public class BiomeFinder implements MinecraftAccessor {
 		} else {
 			SaveFormatBase saveFormat = new SaveFormat19134(worldFolder.getParentFile());
 			LevelStorage saveHandler = saveFormat.getSaveHandler(worldFolder.getName(), false);
-			world = new World(saveHandler, saveHandler.getLevelData().getWorldName(), saveHandler.getLevelData().getRandomSeed(), null, null, new SpawnerMobs.SpawnerConfig());
+			world = new World(saveHandler, saveHandler.getLevelData().getWorldName(), saveHandler.getLevelData().getRandomSeed(), null, null);
 			biomeProvider = worldType.createBiomeProvider(world);
 		}
 		allBiomes.clear();
diff --git a/src/main/java/net/minecraft/client/Minecraft.java b/src/main/java/net/minecraft/client/Minecraft.java
index efe8d6ff9..3841e2e43 100644
--- a/src/main/java/net/minecraft/client/Minecraft.java
+++ b/src/main/java/net/minecraft/client/Minecraft.java
@@ -2117,7 +2117,7 @@ public class Minecraft
                     }
                 }
             }
-            World world = new World(saveHandler, worldName, seed, null, null, new SpawnerMobs.SpawnerConfig());
+            World world = new World(saveHandler, worldName, seed, null, null);
             if(world.isNewWorld)
             {
                 statsCounter.add(StatList.createWorldStat, 1);
diff --git a/src/main/java/net/minecraft/client/entity/player/LocalPlayer.java b/src/main/java/net/minecraft/client/entity/player/LocalPlayer.java
index 7d2bb10e1..b61ffaf0b 100644
--- a/src/main/java/net/minecraft/client/entity/player/LocalPlayer.java
+++ b/src/main/java/net/minecraft/client/entity/player/LocalPlayer.java
@@ -438,26 +438,26 @@ public class LocalPlayer extends Player
         return mc.statsCounter.readStat(stat);
     }
 
-    private boolean isBlockTranslucent(int i, int j, int k)
+    private boolean isBlockTranslucent(int x, int y, int z)
     {
-        return world.isBlockNormalCube(i, j, k);
+        return world.isBlockNormalCube(x, y, z);
     }
 
     @Override
-    protected boolean checkInTile(double d, double d1, double d2)
+    protected boolean checkInTile(double x, double y, double z)
     {
         if (noPhysics) return false;
-        int i = MathHelper.floor(d);
-        int j = MathHelper.floor(d1);
-        int k = MathHelper.floor(d2);
-        double d3 = d - (double)i;
-        double d4 = d2 - (double)k;
-        if(isBlockTranslucent(i, j, k) || (isBlockTranslucent(i, j + 1, k) && !isDwarf))
+        int blockX = MathHelper.floor(x);
+        int blockY = MathHelper.floor(y);
+        int blockZ = MathHelper.floor(z);
+        double d3 = x - (double)blockX;
+        double d4 = z - (double)blockZ;
+        if(isBlockTranslucent(blockX, blockY, blockZ) || (isBlockTranslucent(blockX, blockY + 1, blockZ) && !isDwarf))
         {
-            boolean flag = !isBlockTranslucent(i - 1, j, k) && !isBlockTranslucent(i - 1, j + 1, k);
-            boolean flag1 = !isBlockTranslucent(i + 1, j, k) && !isBlockTranslucent(i + 1, j + 1, k);
-            boolean flag2 = !isBlockTranslucent(i, j, k - 1) && !isBlockTranslucent(i, j + 1, k - 1);
-            boolean flag3 = !isBlockTranslucent(i, j, k + 1) && !isBlockTranslucent(i, j + 1, k + 1);
+            boolean flag = !isBlockTranslucent(blockX - 1, blockY, blockZ) && !isBlockTranslucent(blockX - 1, blockY + 1, blockZ);
+            boolean flag1 = !isBlockTranslucent(blockX + 1, blockY, blockZ) && !isBlockTranslucent(blockX + 1, blockY + 1, blockZ);
+            boolean flag2 = !isBlockTranslucent(blockX, blockY, blockZ - 1) && !isBlockTranslucent(blockX, blockY + 1, blockZ - 1);
+            boolean flag3 = !isBlockTranslucent(blockX, blockY, blockZ + 1) && !isBlockTranslucent(blockX, blockY + 1, blockZ + 1);
             byte byte0 = -1;
             double d5 = 9999D;
             if(flag && d3 < d5)
diff --git a/src/main/java/net/minecraft/client/entity/player/MultiplayerLocalPlayer.java b/src/main/java/net/minecraft/client/entity/player/MultiplayerLocalPlayer.java
index fb58f2013..e9152027a 100644
--- a/src/main/java/net/minecraft/client/entity/player/MultiplayerLocalPlayer.java
+++ b/src/main/java/net/minecraft/client/entity/player/MultiplayerLocalPlayer.java
@@ -8,7 +8,7 @@ import net.minecraft.core.data.registry.Registries;
 import net.minecraft.core.entity.Entity;
 import net.minecraft.core.entity.ItemEntity;
 import net.minecraft.core.net.packet.ChatPacket;
-import net.minecraft.core.net.packet.PlayerCommandPacket;
+import net.minecraft.core.net.packet.UpdatePlayerStatePacket;
 import net.minecraft.core.net.packet.MovePlayerPacket;
 import net.minecraft.core.net.packet.ContainerClosePacket;
 import net.minecraft.core.net.packet.UpdateCreativeInventoryPacket;
@@ -87,10 +87,10 @@ public class MultiplayerLocalPlayer extends LocalPlayer
         {
             if(flag)
             {
-                sendQueue.addToSendQueue(new PlayerCommandPacket(this, 1));
+                sendQueue.addToSendQueue(new UpdatePlayerStatePacket(UpdatePlayerStatePacket.STATE_SNEAK));
             } else
             {
-                sendQueue.addToSendQueue(new PlayerCommandPacket(this, 2));
+                sendQueue.addToSendQueue(new UpdatePlayerStatePacket(UpdatePlayerStatePacket.STATE_UN_SNEAK));
             }
             wasSneaking = flag;
         }
@@ -106,21 +106,21 @@ public class MultiplayerLocalPlayer extends LocalPlayer
         {
             if(flag2)
             {
-                sendQueue.addToSendQueue(new MovePlayerPacket.Pos(xd, -999D, -999D, zd, onGround));
+                sendQueue.addToSendQueue(new MovePlayerPacket.Pos(xd, -999D, zd, onGround));
             } else
             {
-                sendQueue.addToSendQueue(new MovePlayerPacket.PosRot(xd, -999D, -999D, zd, yRot, xRot, onGround));
+                sendQueue.addToSendQueue(new MovePlayerPacket.PosRot(xd, -999D, zd, yRot, xRot, onGround));
             }
             flag1 = false;
         } else
         if(flag1 && flag2)
         {
-            sendQueue.addToSendQueue(new MovePlayerPacket.PosRot(x, bb.minY, y, z, yRot, xRot, onGround));
+            sendQueue.addToSendQueue(new MovePlayerPacket.PosRot(x, bb.minY, z, yRot, xRot, onGround));
             noSendTime = 0;
         } else
         if(flag1)
         {
-            sendQueue.addToSendQueue(new MovePlayerPacket.Pos(x, bb.minY, y, z, onGround));
+            sendQueue.addToSendQueue(new MovePlayerPacket.Pos(x, bb.minY, z, onGround));
             noSendTime = 0;
         } else
         if(flag2)
@@ -155,7 +155,7 @@ public class MultiplayerLocalPlayer extends LocalPlayer
 
     @Override
     public void dropCurrentItem(boolean dropFullStack) {
-        sendQueue.addToSendQueue(new PlayerActionPacket(dropFullStack ? 5 : 4, 0, 0, 0, Side.NONE, 0.0, 0.0));
+        sendQueue.addToSendQueue(new PlayerActionPacket(dropFullStack ? PlayerActionPacket.ACTION_DROP_ITEM_STACK : PlayerActionPacket.ACTION_DROP_ITEM_SINGLE, 0, 0, 0, Side.NONE, 0.0, 0.0));
     }
 
     private void sendInventoryChanged()
@@ -272,6 +272,6 @@ public class MultiplayerLocalPlayer extends LocalPlayer
     
     @Override
     public void pickBlock(int x, int y, int z) {
-    	sendQueue.addToSendQueue(new PlayerActionPacket(6, x, y, z, Side.NONE, 0.0, 0.0));
+    	sendQueue.addToSendQueue(new PlayerActionPacket(PlayerActionPacket.ACTION_PICK_BLOCK, x, y, z, Side.NONE, 0.0, 0.0));
     }
 }
diff --git a/src/main/java/net/minecraft/client/gui/ButtonElement.java b/src/main/java/net/minecraft/client/gui/ButtonElement.java
index 0230f3e2c..5093cec2a 100644
--- a/src/main/java/net/minecraft/client/gui/ButtonElement.java
+++ b/src/main/java/net/minecraft/client/gui/ButtonElement.java
@@ -3,6 +3,7 @@ package net.minecraft.client.gui;
 import net.minecraft.client.render.Font;
 import net.minecraft.client.render.texture.stitcher.IconCoordinate;
 import net.minecraft.client.render.texture.stitcher.TextureRegistry;
+import org.jetbrains.annotations.Nullable;
 import org.lwjgl.opengl.GL11;
 
 import net.minecraft.client.Minecraft;
@@ -22,9 +23,9 @@ public class ButtonElement extends Gui implements GuiElement
     public int xPosition;
     public int yPosition;
     public String displayString;
-    public IconCoordinate defaultTexture = TextureRegistry.getTexture("minecraft:gui/widgets/button");
-    public IconCoordinate hoveredTexture = TextureRegistry.getTexture("minecraft:gui/widgets/button_highlighted");
-    public IconCoordinate disabledTexture = TextureRegistry.getTexture("minecraft:gui/widgets/button_disabled");
+    public IconCoordinate defaultTexture;
+    public IconCoordinate hoveredTexture;
+    public IconCoordinate disabledTexture;
     public int id;
     public boolean enabled;
     public boolean visible;
@@ -46,12 +47,25 @@ public class ButtonElement extends Gui implements GuiElement
         this.width = width;
         this.height = height;
         displayString = text;
+        setDefaultTextures();
     }
 
-    public ButtonElement setTextures(String defaultTexture, String hoveredTexture, String disabledTexture) {
-        this.defaultTexture = TextureRegistry.getTexture(defaultTexture);
-        this.hoveredTexture = TextureRegistry.getTexture(hoveredTexture);
-        this.disabledTexture = TextureRegistry.getTexture(disabledTexture);
+    protected void setDefaultTextures() {
+        defaultTexture = TextureRegistry.getTexture("minecraft:gui/widgets/button/button");
+        hoveredTexture = TextureRegistry.getTexture("minecraft:gui/widgets/button/button_highlighted");
+        disabledTexture = TextureRegistry.getTexture("minecraft:gui/widgets/button/button_disabled");
+    }
+
+    public ButtonElement setTextures(@Nullable String defaultTexture, @Nullable String hoveredTexture, @Nullable String disabledTexture) {
+        if (defaultTexture != null) {
+            this.defaultTexture = TextureRegistry.getTexture(defaultTexture);
+        }
+        if (hoveredTexture != null) {
+            this.hoveredTexture = TextureRegistry.getTexture(hoveredTexture);
+        }
+        if (disabledTexture != null) {
+            this.disabledTexture = TextureRegistry.getTexture(disabledTexture);
+        }
         return this;
     }
 
diff --git a/src/main/java/net/minecraft/client/gui/Gui.java b/src/main/java/net/minecraft/client/gui/Gui.java
index 8fb5e1005..63ab05fa1 100644
--- a/src/main/java/net/minecraft/client/gui/Gui.java
+++ b/src/main/java/net/minecraft/client/gui/Gui.java
@@ -369,16 +369,6 @@ public class Gui
         tessellator.draw();
     }
 
-    public void drawSlot(int x, int y, int argb){
-
-        float a = Color.alphaFromInt(argb) / 255F;
-        float r = Color.redFromInt(argb) / 255F;
-        float g = Color.greenFromInt(argb) / 255F;
-        float b = Color.blueFromInt(argb) / 255F;
-        GL11.glColor4f(r,g,b,a);
-        drawGuiIcon(x, y, 18, 18, TextureRegistry.getTexture("minecraft:gui/slot"));
-    }
-
     public void drawGuiTexture(TextureManager re, int x, int y, int width, int height, String texture) {
         Texture tex = re.loadTexture(texture);
         tex.bind();
@@ -427,35 +417,39 @@ public class Gui
                     int remainderX = topWidth % innerWidth;
 
                     { // Inner
-                        for (int j = 0; j < repeatsY; j++) {
-                            drawTexturedModalRectDouble(
-                                x + innerLeft + repeatsX * innerWidth, y + innerTop + j * innerHeight,
-                                innerLeft + 1, innerTop,
-                                remainderX, innerHeight,
-                                uScale, vScale, 0.0); // Inner
-                        }
-
-                        for (int i = 0; i < repeatsX; i++) {
-                            drawTexturedModalRectDouble(
-                                x + innerLeft + i * innerWidth, y + innerTop + repeatsY * innerHeight,
-                                innerLeft, innerTop,
-                                innerWidth, remainderY,
-                                uScale, vScale, 0.0); // Inner
-                        }
-                        drawTexturedModalRectDouble(
-                            x + innerLeft + repeatsX * innerWidth, y + innerTop + repeatsY * innerHeight,
-                            innerLeft, innerTop,
-                            remainderX, remainderY,
-                            uScale, vScale, 0.0); // Inner
+                        if (properties.stretchInner) { // Stretch Inner // TODO implement
 
-                        for (int i = 0; i < repeatsX; i++) {
+                        } else { // Tile Inner
                             for (int j = 0; j < repeatsY; j++) {
                                 drawTexturedModalRectDouble(
-                                    x + innerLeft + i * innerWidth, y + innerTop + j * innerHeight,
+                                    x + innerLeft + repeatsX * innerWidth, y + innerTop + j * innerHeight,
+                                    innerLeft + 1, innerTop,
+                                    remainderX, innerHeight,
+                                    uScale, vScale, 0.0); // Inner
+                            }
+
+                            for (int i = 0; i < repeatsX; i++) {
+                                drawTexturedModalRectDouble(
+                                    x + innerLeft + i * innerWidth, y + innerTop + repeatsY * innerHeight,
                                     innerLeft, innerTop,
-                                    innerWidth, innerHeight,
+                                    innerWidth, remainderY,
                                     uScale, vScale, 0.0); // Inner
                             }
+                            drawTexturedModalRectDouble(
+                                x + innerLeft + repeatsX * innerWidth, y + innerTop + repeatsY * innerHeight,
+                                innerLeft, innerTop,
+                                remainderX, remainderY,
+                                uScale, vScale, 0.0); // Inner
+
+                            for (int i = 0; i < repeatsX; i++) {
+                                for (int j = 0; j < repeatsY; j++) {
+                                    drawTexturedModalRectDouble(
+                                        x + innerLeft + i * innerWidth, y + innerTop + j * innerHeight,
+                                        innerLeft, innerTop,
+                                        innerWidth, innerHeight,
+                                        uScale, vScale, 0.0); // Inner
+                                }
+                            }
                         }
                     }
 
@@ -576,13 +570,16 @@ public class Gui
                     int repeatsX = MathHelper.floor(width / properties.width);
                     double remainderX = width % properties.width;
 
+                    double uScale = (double) coordinate.width / properties.width;
+                    double vScale = (double) coordinate.height / properties.height;
+
                     for (int i = 0; i < repeatsX; i++) {
                         for (int j = 0; j < repeatsY; j++) {
                             drawIconTextureDouble(
                                 x + properties.width * i, y + properties.height * j,
                                 x + properties.width * (i + 1), y + properties.height * (j + 1),
                                 0, 0,
-                                properties.width, properties.height,
+                                properties.width * uScale, properties.height * vScale,
                                 coordinate);
                         }
                     }
@@ -592,7 +589,7 @@ public class Gui
                             x + properties.width * repeatsX, y + properties.height * j,
                             x + properties.width * repeatsX + remainderX, y + properties.height * (j + 1),
                             0, 0,
-                            remainderX, properties.height,
+                            remainderX * uScale, properties.height * vScale,
                             coordinate);
                     }
 
@@ -601,7 +598,7 @@ public class Gui
                             x + properties.width * i, y + properties.height * repeatsY,
                             x + properties.width * (i + 1), y + properties.height * repeatsY + remainderY,
                             0, 0,
-                            properties.width, remainderY,
+                            properties.width * uScale, remainderY * vScale,
                             coordinate);
                     }
 
@@ -609,7 +606,7 @@ public class Gui
                         x + properties.width * repeatsX, y + properties.height * repeatsY,
                         x + properties.width * repeatsX + remainderX, y + properties.height * repeatsY + remainderY,
                         0, 0,
-                        remainderX, remainderY,
+                        remainderX * uScale, remainderY * vScale,
                         coordinate);
 
                     break;
@@ -622,6 +619,9 @@ public class Gui
                     int innerRight = properties.width - properties.border.right;
                     int innerBottom = properties.height - properties.border.bottom;
 
+                    double uScale = (double) coordinate.width / properties.width;
+                    double vScale = (double) coordinate.height / properties.height;
+
                     double leftHeight = height - (properties.border.top + properties.border.bottom);
                     int repeatsY = MathHelper.floor(leftHeight / innerHeight);
                     double remainderY = leftHeight % innerHeight;
@@ -632,39 +632,48 @@ public class Gui
 
 
                     { // Inner
-                        for (int j = 0; j < repeatsY; j++) {
+                        if (properties.stretchInner) { // Stretch Inner // TODO implement
                             drawIconTextureDouble(
-                                x + innerLeft + repeatsX * innerWidth, y + innerTop + j * innerHeight,
-                                x + innerLeft + repeatsX * innerWidth + remainderX, y + innerTop + j * innerHeight + innerHeight,
-                                innerLeft, innerTop,
-                                innerLeft + remainderX, innerTop + innerHeight,
+                                x + innerLeft, y + innerTop,
+                                x + innerLeft + width - properties.border.right - properties.border.left, y + innerTop + height - properties.border.bottom - properties.border.top,
+                                innerLeft * uScale, innerTop * vScale,
+                                innerRight * uScale, innerBottom * vScale,
                                 coordinate);
-                        }
-
-                        for (int i = 0; i < repeatsX; i++) {
-                            drawIconTextureDouble(
-                                x + innerLeft + i * innerWidth, y + innerTop + repeatsY * innerHeight,
-                                x + innerLeft + i * innerWidth + innerWidth, y + innerTop + repeatsY * innerHeight + remainderY,
-                                innerLeft, innerTop,
-                                innerLeft + innerWidth, innerTop + remainderY, coordinate);
-                        }
-                        drawIconTextureDouble(
-                            x + innerLeft + repeatsX * innerWidth, y + innerTop + repeatsY * innerHeight,
-                            x + innerLeft + repeatsX * innerWidth + remainderX, y + innerTop + repeatsY * innerHeight + remainderY,
-                            innerLeft, innerTop,
-                            innerLeft + remainderX, innerTop + remainderY, coordinate);
-
-                        for (int i = 0; i < repeatsX; i++) {
+                        } else {
                             for (int j = 0; j < repeatsY; j++) {
-                                final double xMin = (x + innerLeft) + i * innerWidth;
-                                final double yMin = (y + innerTop) + j * innerHeight;
                                 drawIconTextureDouble(
-                                    xMin, yMin,
-                                    xMin + innerWidth, yMin + innerHeight,
-                                    innerLeft, innerTop,
-                                    innerLeft + innerWidth, innerTop + innerHeight,
+                                    x + innerLeft + repeatsX * innerWidth, y + innerTop + j * innerHeight,
+                                    x + innerLeft + repeatsX * innerWidth + remainderX, y + innerTop + j * innerHeight + innerHeight,
+                                    innerLeft * uScale, innerTop * vScale,
+                                    (innerLeft + remainderX) * uScale, (innerTop + innerHeight) * vScale,
                                     coordinate);
                             }
+
+                            for (int i = 0; i < repeatsX; i++) {
+                                drawIconTextureDouble(
+                                    x + innerLeft + i * innerWidth, y + innerTop + repeatsY * innerHeight,
+                                    x + innerLeft + i * innerWidth + innerWidth, y + innerTop + repeatsY * innerHeight + remainderY,
+                                    innerLeft * uScale, innerTop * vScale,
+                                    (innerLeft + innerWidth) * uScale, (innerTop + remainderY) * vScale, coordinate);
+                            }
+                            drawIconTextureDouble(
+                                x + innerLeft + repeatsX * innerWidth, y + innerTop + repeatsY * innerHeight,
+                                x + innerLeft + repeatsX * innerWidth + remainderX, y + innerTop + repeatsY * innerHeight + remainderY,
+                                innerLeft * uScale, innerTop * vScale,
+                                (innerLeft + remainderX) * uScale, (innerTop + remainderY) * vScale, coordinate);
+
+                            for (int i = 0; i < repeatsX; i++) {
+                                for (int j = 0; j < repeatsY; j++) {
+                                    final double xMin = (x + innerLeft) + i * innerWidth;
+                                    final double yMin = (y + innerTop) + j * innerHeight;
+                                    drawIconTextureDouble(
+                                        xMin, yMin,
+                                        xMin + innerWidth, yMin + innerHeight,
+                                        innerLeft * uScale, innerTop * vScale,
+                                        (innerLeft + innerWidth) * uScale, (innerTop + innerHeight) * vScale,
+                                        coordinate);
+                                }
+                            }
                         }
                     }
 
@@ -673,60 +682,60 @@ public class Gui
                             drawIconTextureDouble(
                                 x, y + innerTop + i * innerHeight,
                                 x + innerLeft, y + innerTop + i * innerHeight + innerHeight,
-                                0, innerTop,
-                                innerLeft, innerTop + innerHeight,
+                                0, innerTop * vScale,
+                                innerLeft * uScale, (innerTop + innerHeight) * vScale,
                                 coordinate);
 
                             drawIconTextureDouble(
                                 x + width - properties.border.right, y + innerTop + i * innerHeight,
                                 x + width, y + innerTop + i * innerHeight + innerHeight,
-                                innerRight, innerTop,
-                                innerRight + properties.border.right, innerTop + innerHeight,
+                                innerRight * uScale, innerTop * vScale,
+                                (innerRight + properties.border.right) * uScale, (innerTop + innerHeight) * vScale,
                                 coordinate);
                         }
 
                         drawIconTextureDouble(
                             x, y + innerTop + repeatsY * innerHeight,
                             x + innerLeft, y + innerTop + repeatsY * innerHeight + remainderY,
-                            0, innerTop,
-                            innerLeft, innerTop + remainderY,
+                            0, innerTop * vScale,
+                            innerLeft * uScale, (innerTop + remainderY) * vScale,
                             coordinate);
 
                         drawIconTextureDouble(
                             x + width - properties.border.right, y + innerTop + repeatsY * innerHeight,
                             x + width, y + innerTop + repeatsY * innerHeight + remainderY,
-                            innerRight, innerTop,
-                            innerRight + properties.border.right, innerTop + remainderY,
+                            innerRight * uScale, innerTop * vScale,
+                            (innerRight + properties.border.right) * uScale, (innerTop + remainderY) * vScale,
                             coordinate);
                     }
                     { // Top Bottom
                         for (int i = 0; i < repeatsX; i++) {
                             drawIconTextureDouble(x + innerLeft + i * innerWidth, y,
                                 x + innerLeft + i * innerWidth + innerWidth, y + properties.border.top,
-                                innerLeft, 0,
-                                innerLeft + innerWidth, properties.border.top,
+                                innerLeft * uScale, 0,
+                                (innerLeft + innerWidth) * uScale, properties.border.top * vScale,
                                 coordinate);
 
                             drawIconTextureDouble(
                                 x + innerLeft + i * innerWidth, y + height - properties.border.bottom,
                                 x + innerLeft + i * innerWidth + innerWidth, y + height,
-                                innerLeft, innerBottom,
-                                innerLeft + innerWidth, innerBottom + properties.border.bottom,
+                                innerLeft * uScale, innerBottom * vScale,
+                                (innerLeft + innerWidth) * uScale, (innerBottom + properties.border.bottom) * vScale,
                                 coordinate);
                         }
 
                         drawIconTextureDouble(
                             x + innerLeft + repeatsX * innerWidth, y,
                             x + innerLeft + repeatsX * innerWidth + remainderX, y + properties.border.top,
-                            innerLeft, 0,
-                            innerLeft + remainderX, properties.border.top,
+                            innerLeft * uScale, 0,
+                            (innerLeft + remainderX) * uScale, properties.border.top * vScale,
                             coordinate);
 
                         drawIconTextureDouble(
                             x + innerLeft + repeatsX * innerWidth, y + height - properties.border.bottom,
                             x + innerLeft + repeatsX * innerWidth + remainderX, y + height,
-                            innerLeft, innerBottom,
-                            innerLeft + remainderX, innerBottom + properties.border.bottom,
+                            innerLeft * uScale, innerBottom * vScale,
+                            (innerLeft + remainderX) * uScale, (innerBottom + properties.border.bottom) * vScale,
                             coordinate);
                     }
 
@@ -734,23 +743,23 @@ public class Gui
                         x, y,
                         x + properties.border.left, y + properties.border.top,
                         0, 0,
-                        properties.border.left, properties.border.top, coordinate);
+                        properties.border.left * uScale, properties.border.top * vScale, coordinate);
                     drawIconTextureDouble(
                         x, y + height - properties.border.bottom,
                         x + properties.border.left, y + height,
-                        0, innerBottom,
-                        properties.border.left, innerBottom + properties.border.bottom, coordinate);
+                        0, innerBottom * vScale,
+                        properties.border.left * uScale, (innerBottom + properties.border.bottom) * vScale, coordinate);
 
                     drawIconTextureDouble(
                         x + width - properties.border.right, y,
                         x + width, y + properties.border.top,
-                        innerRight, 0,
-                        innerRight + properties.border.right, properties.border.top, coordinate);
+                        innerRight * uScale, 0,
+                        (innerRight + properties.border.right) * uScale, properties.border.top * uScale, coordinate);
                     drawIconTextureDouble(
                         x + width - properties.border.right, y + height - properties.border.bottom,
                         x + width, y + height,
-                        innerRight, innerBottom,
-                        innerRight + properties.border.right, innerBottom + properties.border.bottom, coordinate);
+                        innerRight * uScale, innerBottom * vScale,
+                        (innerRight + properties.border.right) * uScale, (innerBottom + properties.border.bottom) * vScale, coordinate);
 
 
                     break;
diff --git a/src/main/java/net/minecraft/client/gui/IntegerSliderElement.java b/src/main/java/net/minecraft/client/gui/IntegerSliderElement.java
index 02cf45af5..9348a1cfe 100644
--- a/src/main/java/net/minecraft/client/gui/IntegerSliderElement.java
+++ b/src/main/java/net/minecraft/client/gui/IntegerSliderElement.java
@@ -2,6 +2,7 @@ package net.minecraft.client.gui;
 
 import net.minecraft.client.render.Font;
 import net.minecraft.client.render.texture.stitcher.IconCoordinate;
+import net.minecraft.client.render.texture.stitcher.TextureRegistry;
 import org.lwjgl.opengl.GL11;
 
 import net.minecraft.client.Minecraft;
@@ -13,6 +14,8 @@ public class IntegerSliderElement extends ButtonElement {
 	public boolean dragging;
 	private ToggleableOption<?> option;
 
+	public IconCoordinate backgroundTexture;
+
 	public IntegerSliderElement(int id, int xPosition, int yPosition, ToggleableOption<?> option) {
 		this(id, xPosition, yPosition, 150, 20, option);
 	}
@@ -26,6 +29,14 @@ public class IntegerSliderElement extends ButtonElement {
 		displayString = option.getDisplayStringValue();
 	}
 
+	@Override
+	protected void setDefaultTextures() {
+		backgroundTexture = TextureRegistry.getTexture("minecraft:gui/widgets/slider/slider_background");
+		defaultTexture = TextureRegistry.getTexture("minecraft:gui/widgets/slider/slider");
+		hoveredTexture = TextureRegistry.getTexture("minecraft:gui/widgets/slider/slider_highlighted");
+		disabledTexture = TextureRegistry.getTexture("minecraft:gui/widgets/slider/slider_disabled");
+	}
+
 	private int getSliderWidth()
 	{
 		return 8;
@@ -76,19 +87,11 @@ public class IntegerSliderElement extends ButtonElement {
 		}
 
 		// Draw background
-//		drawTexturedModalRect(xPosition, yPosition, 0, 46, width / 2, height);
-//		drawTexturedModalRect(xPosition + width / 2, yPosition, 200 - width / 2, 46, width / 2, height);
+		drawGuiIcon(xPosition, yPosition, width, height, backgroundTexture);
 
 		// Draw foreground
 		int sliderWidth = getSliderWidth();
 		int maxValue = option.size() - 1;
-//		drawTexturedModalRect(xPosition + (int) ((sliderValue / (float) maxValue) * (float) (width - sliderWidth)), yPosition, 0, 46 + state * 20, sliderWidth / 2, 20);
-//		drawTexturedModalRect(xPosition + (int) ((sliderValue / (float) maxValue) * (float) (width - sliderWidth)) + sliderWidth / 2, yPosition, 200 - sliderWidth / 2, 46 + state * 20, sliderWidth / 2, 20);
-
-		// Draw background
-		drawGuiIcon(xPosition, yPosition, width, height, disabledTexture);
-
-		// Draw foreground
 		drawGuiIcon(xPosition + (int) ((sliderValue / (float) maxValue) * (float) (width - sliderWidth)), yPosition, sliderWidth, height, tex);
 
 		mouseDragged(mc, mouseX, mouseY);
diff --git a/src/main/java/net/minecraft/client/gui/SliderElement.java b/src/main/java/net/minecraft/client/gui/SliderElement.java
index 9758b52a2..210f80005 100644
--- a/src/main/java/net/minecraft/client/gui/SliderElement.java
+++ b/src/main/java/net/minecraft/client/gui/SliderElement.java
@@ -2,6 +2,7 @@ package net.minecraft.client.gui;
 
 import net.minecraft.client.render.Font;
 import net.minecraft.client.render.texture.stitcher.IconCoordinate;
+import net.minecraft.client.render.texture.stitcher.TextureRegistry;
 import org.lwjgl.opengl.GL11;
 
 import net.minecraft.client.Minecraft;
@@ -11,7 +12,8 @@ public class SliderElement extends ButtonElement {
 
 	public float sliderValue;
 	public boolean dragging;
-	private FloatOption option;
+	private final FloatOption option;
+	public IconCoordinate backgroundTexture;
 
 	public SliderElement(int id, int xPosition, int yPosition, FloatOption floatOption) {
 		this(id, xPosition, yPosition, 150, 20, floatOption);
@@ -31,6 +33,14 @@ public class SliderElement extends ButtonElement {
 		sliderValue = defaultValue;
 	}
 
+	@Override
+	protected void setDefaultTextures() {
+		backgroundTexture = TextureRegistry.getTexture("minecraft:gui/widgets/slider/slider_background");
+		defaultTexture = TextureRegistry.getTexture("minecraft:gui/widgets/slider/slider");
+		hoveredTexture = TextureRegistry.getTexture("minecraft:gui/widgets/slider/slider_highlighted");
+		disabledTexture = TextureRegistry.getTexture("minecraft:gui/widgets/slider/slider_disabled");
+	}
+
 	@Override
 	public void mouseDragged(Minecraft mc, int mouseX, int mouseY) {
 		if(!visible) {
@@ -75,7 +85,7 @@ public class SliderElement extends ButtonElement {
 		}
 
 		// Draw background
-		drawGuiIcon(xPosition, yPosition, width, height, disabledTexture);
+		drawGuiIcon(xPosition, yPosition, width, height, backgroundTexture);
 
 		// Draw foreground
 		drawGuiIcon(xPosition + (int) (sliderValue * (float) (width - 8)), yPosition, 8, height, tex);
diff --git a/src/main/java/net/minecraft/client/gui/StatsScreen.java b/src/main/java/net/minecraft/client/gui/StatsScreen.java
index 61c6b52fa..4c8d5c3d7 100644
--- a/src/main/java/net/minecraft/client/gui/StatsScreen.java
+++ b/src/main/java/net/minecraft/client/gui/StatsScreen.java
@@ -116,7 +116,7 @@ public class StatsScreen extends Screen {
     private void renderBackgroundIcon(int x, int y)
     {
         GL11.glColor4f(1f, 1f, 1f, 1f);
-        drawGuiIcon(x, y, 18, 18, TextureRegistry.getTexture("minecraft:gui/slot"));
+        drawGuiIcon(x, y, 18, 18, TextureRegistry.getTexture("minecraft:gui/screen/stats/slot"));
     }
 
     abstract class StatsSelectionList extends ScrolledSelectionList
@@ -162,19 +162,19 @@ public class StatsScreen extends Screen {
                 clickedColumn = -1;
             }
             if(clickedColumn == 0) {
-                drawGuiIcon((x + COLUMN0_RIGHT) - STATS_ICON_SIZE + 1, y + 2, 18, 18, TextureRegistry.getTexture("minecraft:gui/slot"));
+                drawGuiIcon((x + COLUMN0_RIGHT) - STATS_ICON_SIZE + 1, y + 2, 18, 18, TextureRegistry.getTexture("minecraft:gui/screen/stats/slot"));
             } else {
-                drawGuiIcon((x + COLUMN0_RIGHT) - STATS_ICON_SIZE, y + 1, 18, 18, TextureRegistry.getTexture("minecraft:gui/slot_raised"));
+                drawGuiIcon((x + COLUMN0_RIGHT) - STATS_ICON_SIZE, y + 1, 18, 18, TextureRegistry.getTexture("minecraft:gui/screen/stats/slot_raised"));
             }
             if(clickedColumn == 1) {
-                drawGuiIcon((x + COLUMN1_RIGHT) - STATS_ICON_SIZE + 1, y + 2, 18, 18, TextureRegistry.getTexture("minecraft:gui/slot"));
+                drawGuiIcon((x + COLUMN1_RIGHT) - STATS_ICON_SIZE + 1, y + 2, 18, 18, TextureRegistry.getTexture("minecraft:gui/screen/stats/slot"));
             } else {
-                drawGuiIcon((x + COLUMN1_RIGHT) - STATS_ICON_SIZE, y + 1, 18, 18, TextureRegistry.getTexture("minecraft:gui/slot_raised"));
+                drawGuiIcon((x + COLUMN1_RIGHT) - STATS_ICON_SIZE, y + 1, 18, 18, TextureRegistry.getTexture("minecraft:gui/screen/stats/slot_raised"));
             }
             if(clickedColumn == 2) {
-                drawGuiIcon((x + COLUMN2_RIGHT) - STATS_ICON_SIZE + 1, y + 2, 18, 18, TextureRegistry.getTexture("minecraft:gui/slot"));
+                drawGuiIcon((x + COLUMN2_RIGHT) - STATS_ICON_SIZE + 1, y + 2, 18, 18, TextureRegistry.getTexture("minecraft:gui/screen/stats/slot"));
             } else {
-                drawGuiIcon((x + COLUMN2_RIGHT) - STATS_ICON_SIZE, y + 1, 18, 18, TextureRegistry.getTexture("minecraft:gui/slot_raised"));
+                drawGuiIcon((x + COLUMN2_RIGHT) - STATS_ICON_SIZE, y + 1, 18, 18, TextureRegistry.getTexture("minecraft:gui/screen/stats/slot_raised"));
             }
             if(sortingColumn != -1)
             {
@@ -191,7 +191,7 @@ public class StatsScreen extends Screen {
                 {
                     up = true;
                 }
-                drawGuiIcon(x + c, y + 1, 18, 18, TextureRegistry.getTexture("minecraft:gui/arrow_" + (up ? "up" : "down")));
+                drawGuiIcon(x + c, y + 1, 18, 18, TextureRegistry.getTexture("minecraft:gui/screen/stats/arrow_" + (up ? "up" : "down")));
             }
         }
 
@@ -424,24 +424,24 @@ public class StatsScreen extends Screen {
             super.renderHeader(x, y, tessellator);
             if(clickedColumn == 0)
             {
-                drawGuiIcon((x + COLUMN0_RIGHT) - STATS_ICON_SIZE + 1, y + 2, 18, 18, TextureRegistry.getTexture("minecraft:gui/depleted"));
+                drawGuiIcon((x + COLUMN0_RIGHT) - STATS_ICON_SIZE + 1, y + 2, 18, 18, TextureRegistry.getTexture("minecraft:gui/screen/stats/depleted"));
             } else
             {
-                drawGuiIcon((x + COLUMN0_RIGHT) - STATS_ICON_SIZE, y + 1, 18, 18, TextureRegistry.getTexture("minecraft:gui/depleted"));
+                drawGuiIcon((x + COLUMN0_RIGHT) - STATS_ICON_SIZE, y + 1, 18, 18, TextureRegistry.getTexture("minecraft:gui/screen/stats/depleted"));
             }
             if(clickedColumn == 1)
             {
-                drawGuiIcon((x + COLUMN1_RIGHT) - STATS_ICON_SIZE + 1, y + 2, 18, 18, TextureRegistry.getTexture("minecraft:gui/crafted"));
+                drawGuiIcon((x + COLUMN1_RIGHT) - STATS_ICON_SIZE + 1, y + 2, 18, 18, TextureRegistry.getTexture("minecraft:gui/screen/stats/crafted"));
             } else
             {
-                drawGuiIcon((x + COLUMN1_RIGHT) - STATS_ICON_SIZE, y + 1, 18, 18, TextureRegistry.getTexture("minecraft:gui/crafted"));
+                drawGuiIcon((x + COLUMN1_RIGHT) - STATS_ICON_SIZE, y + 1, 18, 18, TextureRegistry.getTexture("minecraft:gui/screen/stats/crafted"));
             }
             if(clickedColumn == 2)
             {
-                drawGuiIcon((x + COLUMN2_RIGHT) - STATS_ICON_SIZE + 1, y + 2, 18, 18, TextureRegistry.getTexture("minecraft:gui/used"));
+                drawGuiIcon((x + COLUMN2_RIGHT) - STATS_ICON_SIZE + 1, y + 2, 18, 18, TextureRegistry.getTexture("minecraft:gui/screen/stats/used"));
             } else
             {
-                drawGuiIcon((x + COLUMN2_RIGHT) - STATS_ICON_SIZE, y + 1, 18, 18, TextureRegistry.getTexture("minecraft:gui/used"));
+                drawGuiIcon((x + COLUMN2_RIGHT) - STATS_ICON_SIZE, y + 1, 18, 18, TextureRegistry.getTexture("minecraft:gui/screen/stats/used"));
             }
         }
 
@@ -541,24 +541,24 @@ public class StatsScreen extends Screen {
             super.renderHeader(x, y, tessellator);
             if(clickedColumn == 0)
             {
-                drawGuiIcon((x + COLUMN0_RIGHT) - STATS_ICON_SIZE + 1, y + 2, 18, 18, TextureRegistry.getTexture("minecraft:gui/crafted"));
+                drawGuiIcon((x + COLUMN0_RIGHT) - STATS_ICON_SIZE + 1, y + 2, 18, 18, TextureRegistry.getTexture("minecraft:gui/screen/stats/crafted"));
             } else
             {
-                drawGuiIcon((x + COLUMN0_RIGHT) - STATS_ICON_SIZE, y + 1, 18, 18, TextureRegistry.getTexture("minecraft:gui/crafted"));
+                drawGuiIcon((x + COLUMN0_RIGHT) - STATS_ICON_SIZE, y + 1, 18, 18, TextureRegistry.getTexture("minecraft:gui/screen/stats/crafted"));
             }
             if(clickedColumn == 1)
             {
-                drawGuiIcon(((x + COLUMN1_RIGHT) - STATS_ICON_SIZE) + 1, y + 2, 18, 18, TextureRegistry.getTexture("minecraft:gui/used"));
+                drawGuiIcon(((x + COLUMN1_RIGHT) - STATS_ICON_SIZE) + 1, y + 2, 18, 18, TextureRegistry.getTexture("minecraft:gui/screen/stats/used"));
             } else
             {
-                drawGuiIcon(((x + COLUMN1_RIGHT) - STATS_ICON_SIZE), y + 1, 18, 18, TextureRegistry.getTexture("minecraft:gui/used"));
+                drawGuiIcon(((x + COLUMN1_RIGHT) - STATS_ICON_SIZE), y + 1, 18, 18, TextureRegistry.getTexture("minecraft:gui/screen/stats/used"));
             }
             if(clickedColumn == 2)
             {
-                drawGuiIcon(((x + COLUMN2_RIGHT) - STATS_ICON_SIZE) + 1, y + 2, 18, 18, TextureRegistry.getTexture("minecraft:gui/mined"));
+                drawGuiIcon(((x + COLUMN2_RIGHT) - STATS_ICON_SIZE) + 1, y + 2, 18, 18, TextureRegistry.getTexture("minecraft:gui/screen/stats/mined"));
             } else
             {
-                drawGuiIcon(((x + COLUMN2_RIGHT) - STATS_ICON_SIZE), y + 1, 18, 18, TextureRegistry.getTexture("minecraft:gui/mined"));
+                drawGuiIcon(((x + COLUMN2_RIGHT) - STATS_ICON_SIZE), y + 1, 18, 18, TextureRegistry.getTexture("minecraft:gui/screen/stats/mined"));
             }
         }
 
diff --git a/src/main/java/net/minecraft/client/gui/SwitchElement.java b/src/main/java/net/minecraft/client/gui/SwitchElement.java
index 582577ffc..138684442 100644
--- a/src/main/java/net/minecraft/client/gui/SwitchElement.java
+++ b/src/main/java/net/minecraft/client/gui/SwitchElement.java
@@ -3,6 +3,7 @@ package net.minecraft.client.gui;
 import net.minecraft.client.Minecraft;
 import net.minecraft.client.render.Font;
 import net.minecraft.client.render.texture.stitcher.IconCoordinate;
+import net.minecraft.client.render.texture.stitcher.TextureRegistry;
 import org.lwjgl.opengl.GL11;
 
 public class SwitchElement
@@ -10,6 +11,8 @@ public class SwitchElement
     private final String onText;
     private final String offText;
 
+    public IconCoordinate backgroundTexture;
+
     private boolean on;
 
     public SwitchElement(int id, int xPosition, int yPosition, boolean on, String onText, String offText) {
@@ -29,6 +32,13 @@ public class SwitchElement
         this.offText = offText;
         updateText();
     }
+    @Override
+    protected void setDefaultTextures() {
+        backgroundTexture = TextureRegistry.getTexture("minecraft:gui/widgets/switch/switch_background");
+        defaultTexture = TextureRegistry.getTexture("minecraft:gui/widgets/switch/switch");
+        hoveredTexture = TextureRegistry.getTexture("minecraft:gui/widgets/switch/switch_highlighted");
+        disabledTexture = TextureRegistry.getTexture("minecraft:gui/widgets/switch/switch_disabled");
+    }
 
     private void updateText() {
         if (this.on) {
@@ -72,7 +82,7 @@ public class SwitchElement
         }
 
         // Draw background
-        drawGuiIcon(xPosition, yPosition, width, height, disabledTexture);
+        drawGuiIcon(xPosition, yPosition, width, height, backgroundTexture);
 
         // Draw foreground
         drawGuiIcon(xPosition + xBar, yPosition, (width * 2)/3, height, tex);
diff --git a/src/main/java/net/minecraft/client/gui/TextFieldElement.java b/src/main/java/net/minecraft/client/gui/TextFieldElement.java
index fe042f86e..e70d408e5 100644
--- a/src/main/java/net/minecraft/client/gui/TextFieldElement.java
+++ b/src/main/java/net/minecraft/client/gui/TextFieldElement.java
@@ -84,11 +84,11 @@ public class TextFieldElement extends Gui implements ITextField
         }
     }
 
-    public void mouseClicked(int i, int j, int k)
+    public void mouseClicked(int x, int y, int mouseButton)
     {
-        boolean flag = isEnabled && i >= xPosition && i < xPosition + width && j >= yPosition && j < yPosition + height;
+        boolean flag = isEnabled && x >= xPosition && x < xPosition + width && y >= yPosition && y < yPosition + height;
         setFocused(flag);
-        if(flag && k == 1) {
+        if(flag && mouseButton == 1) {
         	setText("");
         }
     }
diff --git a/src/main/java/net/minecraft/client/gui/achievements/AchievementsScreen.java b/src/main/java/net/minecraft/client/gui/achievements/AchievementsScreen.java
index e0f690869..a68d746f5 100644
--- a/src/main/java/net/minecraft/client/gui/achievements/AchievementsScreen.java
+++ b/src/main/java/net/minecraft/client/gui/achievements/AchievementsScreen.java
@@ -898,7 +898,7 @@ public class AchievementsScreen extends Screen
             renderItem.render(page.getIcon(), x, y2 + (PAGE_BUTTON_HEIGHT / 2) - 9);
             if (page.getCompletionFraction(statsCounter) >= 1) {
                 GL11.glColor4f(1f, 1f, 1f, 1f);
-                drawGuiIcon(x + 8, y2 + (PAGE_BUTTON_HEIGHT / 2) - 9 + 8, 11, 11, TextureRegistry.getTexture("minecraft:gui/achievement/star"));
+                drawGuiIcon(x + 8, y2 + (PAGE_BUTTON_HEIGHT / 2) - 9 + 8, 11, 11, TextureRegistry.getTexture("minecraft:gui/screen/achievement/star"));
             }
             mc.font.drawStringWithShadow(name, x + 19, y2 + (PAGE_BUTTON_HEIGHT / 2) - 4, textColor);
             y2 += PAGE_BUTTON_HEIGHT;
diff --git a/src/main/java/net/minecraft/client/gui/chat/SleepScreenMP.java b/src/main/java/net/minecraft/client/gui/chat/SleepScreenMP.java
index e67cd2f9f..a6afc0f4c 100644
--- a/src/main/java/net/minecraft/client/gui/chat/SleepScreenMP.java
+++ b/src/main/java/net/minecraft/client/gui/chat/SleepScreenMP.java
@@ -3,16 +3,12 @@ package net.minecraft.client.gui.chat;
 import net.minecraft.client.entity.player.MultiplayerLocalPlayer;
 import net.minecraft.client.gui.ButtonElement;
 import net.minecraft.client.net.handler.ClientPacketHandler;
-import net.minecraft.core.net.packet.PlayerCommandPacket;
+import net.minecraft.core.net.packet.UpdatePlayerStatePacket;
 import net.minecraft.core.util.helper.MathHelper;
 import net.minecraft.core.net.ChatEmotes;
 import net.minecraft.core.lang.I18n;
 import org.lwjgl.input.Keyboard;
 
-// Referenced classes of package net.minecraft.src:
-//            GuiChat, StringTranslate, GuiButton, LocalPlayer,
-//            MultiplayerLocalPlayer, PlayerCommandPacket, ClientPacketHandler
-
 public class SleepScreenMP extends ChatScreen
 {
 
@@ -24,8 +20,8 @@ public class SleepScreenMP extends ChatScreen
 	public void init()
     {
         Keyboard.enableRepeatEvents(true);
-        I18n stringtranslate = I18n.getInstance();
-        buttons.add(new ButtonElement(1, width / 2 - 100, height - 40, stringtranslate.translateKey("gui.sleeping.multiplayer.leave_bed")));
+        I18n i18n = I18n.getInstance();
+        buttons.add(new ButtonElement(1, width / 2 - 100, height - 40, i18n.translateKey("gui.sleeping.multiplayer.leave_bed")));
 		int emotePickerYCells = (int)MathHelper.clamp(Math.ceil(ChatEmotes.getEmotes().size() / 5.0), 0, 4);
 		emotePicker = new ChatEmotePickerElement(mc, this, 5, emotePickerYCells);
 		showEmotePicker = false;
@@ -42,7 +38,7 @@ public class SleepScreenMP extends ChatScreen
 	public void keyPressed(char eventCharacter, int eventKey, int mx, int my) {
     	super.keyPressed(eventCharacter, eventKey, mx, my);
     	if(eventKey == Keyboard.KEY_ESCAPE) {
-    		func_22115_j();
+    		leaveBed();
     	}
     }
 
@@ -57,19 +53,19 @@ public class SleepScreenMP extends ChatScreen
     {
         if(button.id == 1)
         {
-            func_22115_j();
+            leaveBed();
         } else
         {
             super.buttonClicked(button);
         }
     }
 
-    private void func_22115_j()
+    private void leaveBed()
     {
         if(mc.thePlayer instanceof MultiplayerLocalPlayer)
         {
-            ClientPacketHandler netclienthandler = ((MultiplayerLocalPlayer)mc.thePlayer).sendQueue;
-            netclienthandler.addToSendQueue(new PlayerCommandPacket(mc.thePlayer, 3));
+            ClientPacketHandler sendQueue = ((MultiplayerLocalPlayer)mc.thePlayer).sendQueue;
+            sendQueue.addToSendQueue(new UpdatePlayerStatePacket(UpdatePlayerStatePacket.STATE_LEAVE_BED));
         }
     }
 }
diff --git a/src/main/java/net/minecraft/client/gui/container/ContainerScreen.java b/src/main/java/net/minecraft/client/gui/container/ContainerScreen.java
index 3b94caaa3..86d38a502 100644
--- a/src/main/java/net/minecraft/client/gui/container/ContainerScreen.java
+++ b/src/main/java/net/minecraft/client/gui/container/ContainerScreen.java
@@ -11,16 +11,15 @@ import org.lwjgl.opengl.GL11;
 public class ContainerScreen extends AbstractContainerScreen
 {
 
-    public ContainerScreen(Container iinventory, Container iinventory1)
+    public ContainerScreen(Container containerUpper, Container containerLower)
     {
-        super(new ContainerMenu(iinventory, iinventory1));
+        super(new ContainerMenu(containerUpper, containerLower));
         inventoryRows = 0;
-        upperChestInventory = iinventory;
-        lowerChestInventory = iinventory1;
+        upperChestInventory = containerUpper;
+        lowerChestInventory = containerLower;
         passEvents = false;
-        char c = '\336';
-        int i = c - 108;
-        inventoryRows = iinventory1.getContainerSize() / 9;
+        int i = 97 /*Bottom section height of gui*/ + 17 /*Top Section height of gui*/ - 1 /*fixes very slight off by 1 issue*/;
+        inventoryRows = containerLower.getContainerSize() / 9;
         ySize = i + inventoryRows * 18;
     }
 
@@ -34,6 +33,7 @@ public class ContainerScreen extends AbstractContainerScreen
     @Override
 	protected void drawGuiContainerBackgroundLayer(float f)
     {
+        GL11.glEnable(GL11.GL_BLEND);
         GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
         mc.textureManager.loadTexture("/assets/minecraft/textures/gui/container/container.png").bind();
         int x = (width - xSize) / 2;
diff --git a/src/main/java/net/minecraft/client/gui/container/InventoryScreenCreative.java b/src/main/java/net/minecraft/client/gui/container/InventoryScreenCreative.java
index f7722ea52..d8b0d023c 100644
--- a/src/main/java/net/minecraft/client/gui/container/InventoryScreenCreative.java
+++ b/src/main/java/net/minecraft/client/gui/container/InventoryScreenCreative.java
@@ -22,7 +22,7 @@ public class InventoryScreenCreative extends InventoryScreen implements ITextCha
 {
 	protected ButtonElement lastPageButton;
 	protected ButtonElement nextPageButton;
-	protected OptionsButtonElement clearSearchButton;
+	protected ButtonElement clearSearchButton;
 	protected TextFieldElement searchField;
 	protected CreativeInventoryMenu container;
 	protected String pageString = "1/1";
@@ -43,7 +43,7 @@ public class InventoryScreenCreative extends InventoryScreen implements ITextCha
 		super.init();
 		buttons.add(lastPageButton = new ButtonElement(500, 0, 0, 20, 20, "<"));
 		buttons.add(nextPageButton = new ButtonElement(501, 0, 0, 20, 20, ">"));
-		buttons.add(clearSearchButton = new OptionsButtonElement(0, 0, 10, 12, 20, "X"));
+		buttons.add(clearSearchButton = new OptionsButtonElement(0, 0, 10, 12, 20, "").setTextures("minecraft:gui/screen/creative/clear", "minecraft:gui/screen/creative/clear_highlighted", null));
 		searchField = new TextFieldElement(this, font, 0, 0, 96, 18, container.searchText, I18n.getInstance().translateKey("gui.inventory.creative.label.search"));
 		searchField.drawBackground =false;
 		searchField.setMaxStringLength(14);
diff --git a/src/main/java/net/minecraft/client/gui/guidebook/GuidebookPage.java b/src/main/java/net/minecraft/client/gui/guidebook/GuidebookPage.java
index a843288b1..c46fc54f6 100644
--- a/src/main/java/net/minecraft/client/gui/guidebook/GuidebookPage.java
+++ b/src/main/java/net/minecraft/client/gui/guidebook/GuidebookPage.java
@@ -3,6 +3,8 @@ package net.minecraft.client.gui.guidebook;
 import net.minecraft.client.gui.Gui;
 import net.minecraft.client.render.Font;
 import net.minecraft.client.render.TextureManager;
+import net.minecraft.client.render.texture.stitcher.TextureRegistry;
+import net.minecraft.core.util.helper.Color;
 import org.lwjgl.opengl.GL11;
 
 public abstract class GuidebookPage
@@ -49,4 +51,15 @@ public abstract class GuidebookPage
     public void onBecomeVisible() { }
 
     public void onStopBeingVisible() { }
+
+
+    public void drawSlot(int x, int y, int argb){
+
+        float a = Color.alphaFromInt(argb) / 255F;
+        float r = Color.redFromInt(argb) / 255F;
+        float g = Color.greenFromInt(argb) / 255F;
+        float b = Color.blueFromInt(argb) / 255F;
+        GL11.glColor4f(r,g,b,a);
+        drawGuiIcon(x, y, 18, 18, TextureRegistry.getTexture("minecraft:gui/screen/guidebook/slot"));
+    }
 }
diff --git a/src/main/java/net/minecraft/client/gui/hud/DoomIngameHud.java b/src/main/java/net/minecraft/client/gui/hud/DoomIngameHud.java
index af5b68453..b294dcc49 100644
--- a/src/main/java/net/minecraft/client/gui/hud/DoomIngameHud.java
+++ b/src/main/java/net/minecraft/client/gui/hud/DoomIngameHud.java
@@ -4,6 +4,7 @@ import net.minecraft.client.Minecraft;
 import net.minecraft.client.gui.PhotoModeScreen;
 import net.minecraft.client.render.texture.stitcher.TextureRegistry;
 import net.minecraft.core.block.Blocks;
+import net.minecraft.core.item.IArmorItem;
 import net.minecraft.core.item.ItemStack;
 import net.minecraft.core.net.command.TextFormatting;
 import net.minecraft.core.util.helper.MathHelper;
@@ -46,7 +47,7 @@ public class DoomIngameHud
         }
 
         // Render pumpkin overlay
-        ItemStack headSlotItem = mc.thePlayer.inventory.armorItemInSlot(3);
+        ItemStack headSlotItem = mc.thePlayer.inventory.armorItemInSlot(IArmorItem.PIECE_HEAD);
         if (mc.gameSettings.thirdPersonView.value == 0 && headSlotItem != null && headSlotItem.itemID == Blocks.PUMPKIN_CARVED_IDLE.id)
         {
             renderPumpkinBlur(width, height);
diff --git a/src/main/java/net/minecraft/client/gui/hud/IngameHud.java b/src/main/java/net/minecraft/client/gui/hud/IngameHud.java
index c4e3f7aaa..213eac8ca 100644
--- a/src/main/java/net/minecraft/client/gui/hud/IngameHud.java
+++ b/src/main/java/net/minecraft/client/gui/hud/IngameHud.java
@@ -16,6 +16,7 @@ import net.minecraft.client.gui.Gui;
 import net.minecraft.client.gui.HeldItemTooltipElement;
 import net.minecraft.client.gui.PhotoModeScreen;
 import net.minecraft.core.enums.ChatVisibility;
+import net.minecraft.core.item.IArmorItem;
 import net.minecraft.core.util.helper.Direction;
 import org.lwjgl.opengl.GL11;
 
@@ -102,7 +103,7 @@ public class IngameHud extends Gui
         }
 
         // Render pumpkin overlay
-        ItemStack headSlotItem = mc.thePlayer.inventory.armorItemInSlot(3);
+        ItemStack headSlotItem = mc.thePlayer.inventory.armorItemInSlot(IArmorItem.PIECE_HEAD);
         if (mc.gameSettings.thirdPersonView.value == 0 && headSlotItem != null && headSlotItem.itemID == Blocks.PUMPKIN_CARVED_IDLE.id)
         {
             renderPumpkinBlur(width, height);
@@ -512,7 +513,7 @@ public class IngameHud extends Gui
         {
             for (int i = 0; i < 4; i++)
             {
-                ItemStack stack = mc.thePlayer.inventory.armorInventory[3 - i];
+                ItemStack stack = mc.thePlayer.inventory.armorInventory[IArmorItem.PIECE_HEAD - i];
 
                 if (stack != null)
                 {
diff --git a/src/main/java/net/minecraft/client/input/MouseFilter.java b/src/main/java/net/minecraft/client/input/MouseFilter.java
index 09e9445af..683511d65 100644
--- a/src/main/java/net/minecraft/client/input/MouseFilter.java
+++ b/src/main/java/net/minecraft/client/input/MouseFilter.java
@@ -4,11 +4,14 @@ package net.minecraft.client.input;
 public class MouseFilter
 {
 
+    private float field_22388_a;
+    private float field_22387_b;
+    private float field_22389_c;
+
     public MouseFilter()
     {
     }
-
-    public float func_22386_a(float delta, float sensitivity)
+    public float getSmoothedDelta(float delta, float sensitivity)
     {
         field_22388_a += delta;
         delta = (field_22388_a - field_22387_b) * sensitivity;
@@ -20,13 +23,10 @@ public class MouseFilter
         field_22387_b += delta;
         return delta;
     }
+
     public void reset(){
         field_22388_a = 0;
         field_22387_b = 0;
         field_22389_c = 0;
     }
-
-    private float field_22388_a;
-    private float field_22387_b;
-    private float field_22389_c;
 }
diff --git a/src/main/java/net/minecraft/client/net/handler/ClientPacketHandler.java b/src/main/java/net/minecraft/client/net/handler/ClientPacketHandler.java
index c56abf098..ca39d4ace 100644
--- a/src/main/java/net/minecraft/client/net/handler/ClientPacketHandler.java
+++ b/src/main/java/net/minecraft/client/net/handler/ClientPacketHandler.java
@@ -166,48 +166,48 @@ public class ClientPacketHandler extends PacketHandler
     }
 
     @Override
-    public void handlePickupSpawn(AddItemEntityPacket itemEntityPacket)
+    public void handlePickupSpawn(AddItemEntityPacket addItemEntityPacket)
     {
-        double x = itemEntityPacket.xPosition / 32D;
-        double y = itemEntityPacket.yPosition / 32D;
-        double z = itemEntityPacket.zPosition / 32D;
-        ItemEntity itemEntity = new ItemEntity(worldClient, x, y, z, new ItemStack(itemEntityPacket.itemID, itemEntityPacket.count, itemEntityPacket.itemDamage, itemEntityPacket.tag));
-        itemEntity.xd = (double) itemEntityPacket.xd / 128D;
-        itemEntity.yd = (double) itemEntityPacket.yd / 128D;
-        itemEntity.zd = (double) itemEntityPacket.zd / 128D;
-        itemEntity.serverPosX = itemEntityPacket.xPosition;
-        itemEntity.serverPosY = itemEntityPacket.yPosition;
-        itemEntity.serverPosZ = itemEntityPacket.zPosition;
-        worldClient.addEntityToWorld(itemEntityPacket.entityId, itemEntity);
+        double x = addItemEntityPacket.xPosition / 32D;
+        double y = addItemEntityPacket.yPosition / 32D;
+        double z = addItemEntityPacket.zPosition / 32D;
+        ItemEntity itemEntity = new ItemEntity(worldClient, x, y, z, new ItemStack(addItemEntityPacket.itemID, addItemEntityPacket.count, addItemEntityPacket.itemDamage, addItemEntityPacket.tag));
+        itemEntity.xd = (double) addItemEntityPacket.xd / 128D;
+        itemEntity.yd = (double) addItemEntityPacket.yd / 128D;
+        itemEntity.zd = (double) addItemEntityPacket.zd / 128D;
+        itemEntity.serverPosX = addItemEntityPacket.xPosition;
+        itemEntity.serverPosY = addItemEntityPacket.yPosition;
+        itemEntity.serverPosZ = addItemEntityPacket.zPosition;
+        worldClient.addEntityToWorld(addItemEntityPacket.entityId, itemEntity);
     }
 
 
     @Override
-    public void handleVehicleSpawn(AddEntityPacket packet23) {
-        if (!NetEntityHandler.hasType(packet23.type)){ return; }
-        double xPosition = ((double) packet23.xPosition) / 32D;
-        double yPosition = ((double) packet23.yPosition) / 32D;
-        double zPosition = ((double) packet23.zPosition) / 32D;
+    public void handleVehicleSpawn(AddEntityPacket addEntityPacket) {
+        if (!NetEntityHandler.hasType(addEntityPacket.type)){ return; }
+        double xPosition = ((double) addEntityPacket.xPosition) / 32D;
+        double yPosition = ((double) addEntityPacket.yPosition) / 32D;
+        double zPosition = ((double) addEntityPacket.zPosition) / 32D;
         Entity owner;
-        if (packet23.ownerId >= 0){
-            owner = getEntityByID(packet23.ownerId);
+        if (addEntityPacket.ownerId >= 0){
+            owner = getEntityByID(addEntityPacket.ownerId);
         } else {
             owner = null;
         }
-        Entity newEntity = NetEntityHandler.getTypeEntry(packet23.type).getEntity(worldClient, xPosition, yPosition, zPosition, packet23.metaData, packet23.hasVelocity, packet23.xVelocity / 8000D, packet23.yVelocity / 8000D, packet23.zVelocity / 8000D, owner);
+        Entity newEntity = NetEntityHandler.getTypeEntry(addEntityPacket.type).getEntity(worldClient, xPosition, yPosition, zPosition, addEntityPacket.metaData, addEntityPacket.hasVelocity, addEntityPacket.xVelocity / 8000D, addEntityPacket.yVelocity / 8000D, addEntityPacket.zVelocity / 8000D, owner);
         if (newEntity != null) {
-            newEntity.serverPosX = packet23.xPosition;
-            newEntity.serverPosY = packet23.yPosition;
-            newEntity.serverPosZ = packet23.zPosition;
-            newEntity.yRot = packet23.yaw;
-            newEntity.xRot = packet23.pitch;
-            newEntity.id = packet23.entityId;
-            worldClient.addEntityToWorld(packet23.entityId, newEntity);
+            newEntity.serverPosX = addEntityPacket.xPosition;
+            newEntity.serverPosY = addEntityPacket.yPosition;
+            newEntity.serverPosZ = addEntityPacket.zPosition;
+            newEntity.yRot = addEntityPacket.yaw;
+            newEntity.xRot = addEntityPacket.pitch;
+            newEntity.id = addEntityPacket.entityId;
+            worldClient.addEntityToWorld(addEntityPacket.entityId, newEntity);
             if (owner instanceof Mob && newEntity instanceof Projectile){
                 ((Projectile) newEntity).owner = (Mob) owner;
             }
-            if (packet23.hasVelocity){
-                newEntity.lerpMotion(((double) packet23.xVelocity) / 8000D, ((double) packet23.yVelocity) / 8000D, ((double) packet23.zVelocity) / 8000D);
+            if (addEntityPacket.hasVelocity){
+                newEntity.lerpMotion(((double) addEntityPacket.xVelocity) / 8000D, ((double) addEntityPacket.yVelocity) / 8000D, ((double) addEntityPacket.zVelocity) / 8000D);
             }
         }
     }
@@ -244,69 +244,69 @@ public class ClientPacketHandler extends PacketHandler
     }
 
     @Override
-    public void handleEntityPainting(AddPaintingPacket packet)
+    public void handleEntityPainting(AddPaintingPacket addPaintingPacket)
     {
-        Entity entity = worldClient.getEntityFromId(packet.entityId);
+        Entity entity = worldClient.getEntityFromId(addPaintingPacket.entityId);
         if (entity instanceof PaintingEntity){
             PaintingEntity painting = (PaintingEntity) entity;
-            painting.blockX = packet.xPosition;
-            painting.blockY = packet.yPosition;
-            painting.blockZ = packet.zPosition;
+            painting.blockX = addPaintingPacket.xPosition;
+            painting.blockY = addPaintingPacket.yPosition;
+            painting.blockZ = addPaintingPacket.zPosition;
 
-            if (ArtType.map.containsKey(packet.key)) painting.art = ArtType.map.get(packet.key);
+            if (ArtType.map.containsKey(addPaintingPacket.key)) painting.art = ArtType.map.get(addPaintingPacket.key);
 
-            painting.setDirection(packet.direction);
-            if (packet.itemID > 0){
-                painting.setStack(new ItemStack(packet.itemID, 1, packet.meta));
+            painting.setDirection(addPaintingPacket.direction);
+            if (addPaintingPacket.itemID > 0){
+                painting.setStack(new ItemStack(addPaintingPacket.itemID, 1, addPaintingPacket.meta));
             }
         } else {
-            PaintingEntity entitypainting = new PaintingEntity(worldClient, packet.xPosition, packet.yPosition, packet.zPosition, packet.direction, packet.key);
-            worldClient.addEntityToWorld(packet.entityId, entitypainting);
-            if (packet.itemID > 0){
-                entitypainting.setStack(new ItemStack(packet.itemID, 1, packet.meta));
+            PaintingEntity entitypainting = new PaintingEntity(worldClient, addPaintingPacket.xPosition, addPaintingPacket.yPosition, addPaintingPacket.zPosition, addPaintingPacket.direction, addPaintingPacket.key);
+            worldClient.addEntityToWorld(addPaintingPacket.entityId, entitypainting);
+            if (addPaintingPacket.itemID > 0){
+                entitypainting.setStack(new ItemStack(addPaintingPacket.itemID, 1, addPaintingPacket.meta));
             }
         }
 
     }
 
     @Override
-    public void handleEntityVelocity(SetEntityMotionPacket setEntityvelocity)
+    public void handleEntityVelocity(SetEntityMotionPacket setEntityMotionPacket)
     {
-        Entity entity = getEntityByID(setEntityvelocity.entityId);
+        Entity entity = getEntityByID(setEntityMotionPacket.entityId);
         if (entity == null)
         {
             return;
         }
         else
         {
-            entity.lerpMotion((double) setEntityvelocity.motionX / 8000D, (double) setEntityvelocity.motionY / 8000D, (double) setEntityvelocity.motionZ / 8000D);
+            entity.lerpMotion((double) setEntityMotionPacket.motionX / 8000D, (double) setEntityMotionPacket.motionY / 8000D, (double) setEntityMotionPacket.motionZ / 8000D);
             return;
         }
     }
 
     @Override
-    public void handleEntityMetadata(SetEntityDataPacket entityDataPacket)
+    public void handleEntityMetadata(SetEntityDataPacket setEntityDataPacket)
     {
-        Entity entity = getEntityByID(entityDataPacket.entityId);
-        if (entity != null && entityDataPacket.getUnpackedData() != null)
+        Entity entity = getEntityByID(setEntityDataPacket.entityId);
+        if (entity != null && setEntityDataPacket.getUnpackedData() != null)
         {
-            entity.getEntityData().assignValues(entityDataPacket.getUnpackedData());
+            entity.getEntityData().assignValues(setEntityDataPacket.getUnpackedData());
         }
     }
 
     @Override
-    public void handleNamedEntitySpawn(AddPlayerPacket playerPacket)
-    {
-        double d = (double) playerPacket.xPosition / 32D;
-        double d1 = (double) playerPacket.yPosition / 32D;
-        double d2 = (double) playerPacket.zPosition / 32D;
-        float f = (float) (playerPacket.rotation * 360) / 256F;
-        float f1 = (float) (playerPacket.pitch * 360) / 256F;
-        RemotePlayer remotePlayer = new RemotePlayer(mc.theWorld, playerPacket.name, playerPacket.uuid);
-        remotePlayer.xo = remotePlayer.serverPosX = playerPacket.xPosition;
-        remotePlayer.yo = remotePlayer.serverPosY = playerPacket.yPosition;
-        remotePlayer.zo = remotePlayer.serverPosZ = playerPacket.zPosition;
-        int i = playerPacket.currentItem;
+    public void handleNamedEntitySpawn(AddPlayerPacket addPlayerPacket)
+    {
+        double d = (double) addPlayerPacket.xPosition / 32D;
+        double d1 = (double) addPlayerPacket.yPosition / 32D;
+        double d2 = (double) addPlayerPacket.zPosition / 32D;
+        float f = (float) (addPlayerPacket.rotation * 360) / 256F;
+        float f1 = (float) (addPlayerPacket.pitch * 360) / 256F;
+        RemotePlayer remotePlayer = new RemotePlayer(mc.theWorld, addPlayerPacket.name, addPlayerPacket.uuid);
+        remotePlayer.xo = remotePlayer.serverPosX = addPlayerPacket.xPosition;
+        remotePlayer.yo = remotePlayer.serverPosY = addPlayerPacket.yPosition;
+        remotePlayer.zo = remotePlayer.serverPosZ = addPlayerPacket.zPosition;
+        int i = addPlayerPacket.currentItem;
         if (i == 0)
         {
             remotePlayer.inventory.mainInventory[remotePlayer.inventory.getCurrentItemIndex()] = null;
@@ -316,31 +316,31 @@ public class ClientPacketHandler extends PacketHandler
             remotePlayer.inventory.mainInventory[remotePlayer.inventory.getCurrentItemIndex()] = new ItemStack(i, 1, 0);
         }
         remotePlayer.absMoveTo(d, d1, d2, f, f1);
-        worldClient.addEntityToWorld(playerPacket.entityId, remotePlayer);
-        remotePlayer.nickname = StringUtils.substring(playerPacket.nickname, 0, 32);
-        remotePlayer.chatColor = playerPacket.chatColor;
+        worldClient.addEntityToWorld(addPlayerPacket.entityId, remotePlayer);
+        remotePlayer.nickname = StringUtils.substring(addPlayerPacket.nickname, 0, 32);
+        remotePlayer.chatColor = addPlayerPacket.chatColor;
 
-        remotePlayer.setHeldObject(playerPacket.heldObjectTag == null ? null : ICarriable.createAndLoadCarriable(remotePlayer, playerPacket.heldObjectTag));
+        remotePlayer.setHeldObject(addPlayerPacket.heldObjectTag == null ? null : ICarriable.createAndLoadCarriable(remotePlayer, addPlayerPacket.heldObjectTag));
     }
 
     @Override
-    public void handleEntityTeleport(TeleportEntityPacket packet34EntityteleportEntityPacket)
+    public void handleEntityTeleport(TeleportEntityPacket teleportEntityPacket)
     {
-        Entity entity = getEntityByID(packet34EntityteleportEntityPacket.id);
+        Entity entity = getEntityByID(teleportEntityPacket.id);
         if (entity == null)
         {
             return;
         }
         else
         {
-            entity.serverPosX = packet34EntityteleportEntityPacket.x;
-            entity.serverPosY = packet34EntityteleportEntityPacket.y;
-            entity.serverPosZ = packet34EntityteleportEntityPacket.z;
+            entity.serverPosX = teleportEntityPacket.x;
+            entity.serverPosY = teleportEntityPacket.y;
+            entity.serverPosZ = teleportEntityPacket.z;
             double d = (double) entity.serverPosX / 32D;
             double d1 = (double) entity.serverPosY / 32D + 0.015625D;
             double d2 = (double) entity.serverPosZ / 32D;
-            float f = (float) (packet34EntityteleportEntityPacket.yaw * 360) / 256F;
-            float f1 = (float) (packet34EntityteleportEntityPacket.pitch * 360) / 256F;
+            float f = (float) (teleportEntityPacket.yaw * 360) / 256F;
+            float f1 = (float) (teleportEntityPacket.pitch * 360) / 256F;
             entity.lerpTo(d, d1, d2, f, f1, 3);
             return;
         }
@@ -370,10 +370,10 @@ public class ClientPacketHandler extends PacketHandler
     }
 
     @Override
-    public void handleEntityTagData(EntityTagDataPacket packet) {
-        Entity entity = getEntityByID(packet.entityId);
+    public void handleEntityTagData(EntityTagDataPacket entityTagDataPacket) {
+        Entity entity = getEntityByID(entityTagDataPacket.entityId);
         if (entity != null) {
-            entity.readAdditionalSaveData(packet.tag);
+            entity.readAdditionalSaveData(entityTagDataPacket.tag);
         }
     }
 
@@ -399,9 +399,9 @@ public class ClientPacketHandler extends PacketHandler
     }
 
     @Override
-    public void handleDestroyEntity(RemoveEntityPacket packet29DestroyentityPacket)
+    public void handleDestroyEntity(RemoveEntityPacket removeEntityPacket)
     {
-        worldClient.removeEntityFromWorld(packet29DestroyentityPacket.entityId);
+        worldClient.removeEntityFromWorld(removeEntityPacket.entityId);
     }
 
     @Override
@@ -430,7 +430,6 @@ public class ClientPacketHandler extends PacketHandler
         movePlayerPacket.x = ((Player) (entityplayersp)).x;
         movePlayerPacket.y = ((Player) (entityplayersp)).bb.minY;
         movePlayerPacket.z = ((Player) (entityplayersp)).z;
-        movePlayerPacket.yView = ((Player) (entityplayersp)).y;
         netManager.addToSendQueue(movePlayerPacket);
         if (!started)
         {
@@ -443,42 +442,42 @@ public class ClientPacketHandler extends PacketHandler
     }
 
     @Override
-    public void handlePreChunk(ChunkVisibilityPacket packet50PrechunkVisibilityPacket)
+    public void handlePreChunk(ChunkVisibilityPacket chunkVisibilityPacket)
     {
-        worldClient.doPreChunk(packet50PrechunkVisibilityPacket.xPosition, packet50PrechunkVisibilityPacket.yPosition, packet50PrechunkVisibilityPacket.mode);
+        worldClient.doPreChunk(chunkVisibilityPacket.chunkX, chunkVisibilityPacket.chunkZ, chunkVisibilityPacket.playerAdded);
     }
 
     @Override
-    public void handleMultiBlockChange(ChunkBlocksUpdatePacket packet)
+    public void handleMultiBlockChange(ChunkBlocksUpdatePacket chunkBlocksUpdatePacket)
     {
-        int xBase = packet.xChunk * 16;
-        int zBase = packet.zChunk * 16;
-        for (int k = 0; k < packet.size; k++)
+        int xBase = chunkBlocksUpdatePacket.xChunk * 16;
+        int zBase = chunkBlocksUpdatePacket.zChunk * 16;
+        for (int k = 0; k < chunkBlocksUpdatePacket.size; k++)
         {
-            int coord = packet.coordinateArray[k];
-            int type = packet.typeArray[k] & 0x3fff;
-            byte data = packet.metadataArray[k];
+            int coord = chunkBlocksUpdatePacket.coordinateArray[k];
+            int type = chunkBlocksUpdatePacket.typeArray[k] & 0x3fff;
+            byte data = chunkBlocksUpdatePacket.metadataArray[k];
             int x = coord >> 0 & 0xf;
             int y = coord >> 8 & 0xff;
             int z = coord >> 4 & 0xf;
             worldClient.setBlockAndMetadataWithNotify(x + xBase, y, z + zBase, type, data);
-            worldClient.func_711_c(x + xBase, y, z + zBase, x + xBase, y, z + zBase);
+            worldClient.removePositionTypesInBounds(x + xBase, y, z + zBase, x + xBase, y, z + zBase);
             worldClient.markBlocksDirty(x + xBase, y, z + zBase, x + xBase, y, z + zBase);
         }
 
     }
 
     @Override
-    public void handleMapChunk(BlockRegionUpdatePacket packet)
+    public void handleMapChunk(BlockRegionUpdatePacket blockRegionUpdatePacket)
     {
-        worldClient.func_711_c(packet.xPosition, packet.yPosition, packet.zPosition, (packet.xPosition + packet.xSize) - 1, (packet.yPosition + packet.ySize) - 1, (packet.zPosition + packet.zSize) - 1);
-        worldClient.setChunkData(packet.xPosition, packet.yPosition, packet.zPosition, packet.xSize, packet.ySize, packet.zSize, packet.chunk);
+        worldClient.removePositionTypesInBounds(blockRegionUpdatePacket.xPosition, blockRegionUpdatePacket.yPosition, blockRegionUpdatePacket.zPosition, (blockRegionUpdatePacket.xPosition + blockRegionUpdatePacket.xSize) - 1, (blockRegionUpdatePacket.yPosition + blockRegionUpdatePacket.ySize) - 1, (blockRegionUpdatePacket.zPosition + blockRegionUpdatePacket.zSize) - 1);
+        worldClient.setChunkData(blockRegionUpdatePacket.xPosition, blockRegionUpdatePacket.yPosition, blockRegionUpdatePacket.zPosition, blockRegionUpdatePacket.xSize, blockRegionUpdatePacket.ySize, blockRegionUpdatePacket.zSize, blockRegionUpdatePacket.chunk);
     }
 
     @Override
-    public void handleBlockChange(BlockUpdatePacket blockchange)
+    public void handleBlockUpdate(BlockUpdatePacket blockUpdatePacket)
     {
-        worldClient.blockChange(blockchange.xPosition, blockchange.yPosition, blockchange.zPosition, blockchange.type, blockchange.metadata);
+        worldClient.blockChange(blockUpdatePacket.xPosition, blockUpdatePacket.yPosition, blockUpdatePacket.zPosition, blockUpdatePacket.blockId, blockUpdatePacket.metadata);
     }
 
     @Override
@@ -493,7 +492,7 @@ public class ClientPacketHandler extends PacketHandler
     }
 
     @Override
-    public void handleErrorMessage(String s, Object[] errorLines)
+    public void handleErrorMessage(String message, Object[] objects)
     {
         if (!disconnected) {
             disconnected = true;
@@ -508,11 +507,11 @@ public class ClientPacketHandler extends PacketHandler
                 LOGGER.error("Exception when leaving GUI!", e);
             }
 
-            mc.displayScreen(new ConnectFailedScreen("disconnect.lost", s, errorLines)); // Open error message gui
+            mc.displayScreen(new ConnectFailedScreen("disconnect.lost", message, objects)); // Open error message gui
         }
     }
 
-    public void func_28117_a(Packet packet)
+    public void sendFinalPacket(Packet packet)
     {
         if (!disconnected) {
             netManager.addToSendQueue(packet);
@@ -706,56 +705,56 @@ public class ClientPacketHandler extends PacketHandler
     }
 
     @Override
-    public void handleMobSpawn(AddMobPacket addMobspawn)
-    {
-        double d = (double) addMobspawn.x / 32D;
-        double d1 = (double) addMobspawn.y / 32D;
-        double d2 = (double) addMobspawn.z / 32D;
-        float f = (float) (addMobspawn.yaw * 360) / 256F;
-        float f1 = (float) (addMobspawn.pitch * 360) / 256F;
-        Mob mob = (Mob) EntityDispatcher.createEntity(addMobspawn.type, mc.theWorld);
-        mob.serverPosX = addMobspawn.x;
-        mob.serverPosY = addMobspawn.y;
-        mob.serverPosZ = addMobspawn.z;
-        mob.id = addMobspawn.id;
+    public void handleMobSpawn(AddMobPacket addMobPacket)
+    {
+        double d = (double) addMobPacket.x / 32D;
+        double d1 = (double) addMobPacket.y / 32D;
+        double d2 = (double) addMobPacket.z / 32D;
+        float f = (float) (addMobPacket.yaw * 360) / 256F;
+        float f1 = (float) (addMobPacket.pitch * 360) / 256F;
+        Mob mob = (Mob) EntityDispatcher.createEntity(addMobPacket.type, mc.theWorld);
+        mob.serverPosX = addMobPacket.x;
+        mob.serverPosY = addMobPacket.y;
+        mob.serverPosZ = addMobPacket.z;
+        mob.id = addMobPacket.id;
         mob.absMoveTo(d, d1, d2, f, f1);
         mob.isMultiplayerEntity = true;
-        worldClient.addEntityToWorld(addMobspawn.id, mob);
-        List<SynchedEntityData.DataItem<?>> list = addMobspawn.getUnpackedData();
+        worldClient.addEntityToWorld(addMobPacket.id, mob);
+        List<SynchedEntityData.DataItem<?>> list = addMobPacket.getUnpackedData();
         if (list != null)
         {
             mob.getEntityData().assignValues(list);
         }
-        mob.nickname = StringUtils.substring(addMobspawn.nickname, 0, 32);
-        mob.chatColor = addMobspawn.chatColor;
+        mob.nickname = StringUtils.substring(addMobPacket.nickname, 0, 32);
+        mob.chatColor = addMobPacket.chatColor;
     }
 
     @Override
-    public void handleUpdateTime(SetTimePacket timePacket)
+    public void handleUpdateTime(SetTimePacket setTimePacket)
     {
-        mc.theWorld.setWorldTime(timePacket.time);
+        mc.theWorld.setWorldTime(setTimePacket.time);
     }
 
     @Override
-    public void handleSpawnPosition(SetSpawnPositionPacket setSpawnpositionPacket)
+    public void handleSpawnPosition(SetSpawnPositionPacket setSpawnPositionPacket)
     {
-        mc.thePlayer.setPlayerSpawnCoordinate(new ChunkCoordinates(setSpawnpositionPacket.x, setSpawnpositionPacket.y, setSpawnpositionPacket.z));
-        mc.theWorld.getLevelData().setSpawn(setSpawnpositionPacket.x, setSpawnpositionPacket.y, setSpawnpositionPacket.z);
+        mc.thePlayer.setPlayerSpawnCoordinate(new ChunkCoordinates(setSpawnPositionPacket.x, setSpawnPositionPacket.y, setSpawnPositionPacket.z));
+        mc.theWorld.getLevelData().setSpawn(setSpawnPositionPacket.x, setSpawnPositionPacket.y, setSpawnPositionPacket.z);
     }
 
     @Override
-    public void handleAttachEntity(SetRidingPacket packet)
+    public void handleAttachEntity(SetRidingPacket setRidingPacket)
     {
-        Entity passenger = getEntityByID(packet.passengerId);
+        Entity passenger = getEntityByID(setRidingPacket.passengerId);
         IVehicle vehicle;
-        if (packet.passengerId == mc.thePlayer.id)
+        if (setRidingPacket.passengerId == mc.thePlayer.id)
         {
             passenger = mc.thePlayer;
         }
-        if (packet.isTileEntity) {
-            vehicle = (IVehicle) worldClient.getBlockEntity(packet.x, packet.y, packet.z);
+        if (setRidingPacket.isTileEntity) {
+            vehicle = (IVehicle) worldClient.getBlockEntity(setRidingPacket.x, setRidingPacket.y, setRidingPacket.z);
         } else {
-            vehicle = getEntityByID(packet.vehicleId);
+            vehicle = getEntityByID(setRidingPacket.vehicleId);
         }
         if (passenger != null && vehicle != null) {
             passenger.startRiding(vehicle);
@@ -763,12 +762,12 @@ public class ClientPacketHandler extends PacketHandler
     }
 
     @Override
-    public void handleEntityStatus(EnitityEventPacket enitityEventPacket38Entitystatus)
+    public void handleEntityStatus(EnitityEventPacket enitityEventPacket)
     {
-        Entity entity = getEntityByID(enitityEventPacket38Entitystatus.entityId);
+        Entity entity = getEntityByID(enitityEventPacket.entityId);
         if (entity != null)
         {
-            entity.handleEntityEvent(enitityEventPacket38Entitystatus.entityStatus, enitityEventPacket38Entitystatus.attackedAtYaw);
+            entity.handleEntityEvent(enitityEventPacket.entityStatus, enitityEventPacket.attackedAtYaw);
         }
     }
 
@@ -785,9 +784,9 @@ public class ClientPacketHandler extends PacketHandler
     }
 
     @Override
-    public void handleUpdateHealth(SetHealthPacket healthPacket)
+    public void handleUpdateHealth(SetHealthPacket setHealthPacket)
     {
-        mc.thePlayer.setHealth(healthPacket.healthMP);
+        mc.thePlayer.setHealth(setHealthPacket.healthMP);
     }
 
     @Override
@@ -917,9 +916,9 @@ public class ClientPacketHandler extends PacketHandler
     }
 
     @Override
-    public void handlePhotoMode(PhotoModePacket packet)
+    public void handlePhotoMode(PhotoModePacket photoModePacket)
     {
-        PauseScreen.photoModeDisabled = packet.disabled;
+        PauseScreen.photoModeDisabled = photoModePacket.disabled;
     }
 
     @Override
@@ -971,35 +970,35 @@ public class ClientPacketHandler extends PacketHandler
     }
 
     @Override
-    public void handleWindowItems(ContainerSetContentPacket setContentPacket)
+    public void handleWindowItems(ContainerSetContentPacket containerSetContentPacket)
     {
-        if (setContentPacket.windowId == 0)
+        if (containerSetContentPacket.windowId == 0)
         {
-            mc.thePlayer.inventorySlots.setAll(setContentPacket.stackList);
+            mc.thePlayer.inventorySlots.setAll(containerSetContentPacket.stackList);
         }
-        else if (setContentPacket.windowId == mc.thePlayer.craftingInventory.containerId)
+        else if (containerSetContentPacket.windowId == mc.thePlayer.craftingInventory.containerId)
         {
-            mc.thePlayer.craftingInventory.setAll(setContentPacket.stackList);
+            mc.thePlayer.craftingInventory.setAll(containerSetContentPacket.stackList);
         }
     }
 
     @Override
-    public void handleUpdateProgressbar(ContainerSetDataPacket setDataPacket)
+    public void handleUpdateProgressbar(ContainerSetDataPacket containerSetDataPacket)
     {
-        handleInvalidPacket(setDataPacket);
-        if (mc.thePlayer.craftingInventory != null && mc.thePlayer.craftingInventory.containerId == setDataPacket.windowId)
+        handleInvalidPacket(containerSetDataPacket);
+        if (mc.thePlayer.craftingInventory != null && mc.thePlayer.craftingInventory.containerId == containerSetDataPacket.windowId)
         {
-            mc.thePlayer.craftingInventory.setData(setDataPacket.progressBar, setDataPacket.progressBarValue);
+            mc.thePlayer.craftingInventory.setData(containerSetDataPacket.progressBar, containerSetDataPacket.progressBarValue);
         }
     }
 
     @Override
-    public void handlePlayerInventory(SetEquippedItemPacket equippedItemPacket)
+    public void handlePlayerInventory(SetEquippedItemPacket setEquippedItemPacket)
     {
-        Entity entity = getEntityByID(equippedItemPacket.entityID);
+        Entity entity = getEntityByID(setEquippedItemPacket.entityID);
         if (entity != null)
         {
-            entity.setEquippedSlot(equippedItemPacket.slot, equippedItemPacket.itemID, equippedItemPacket.itemMeta, equippedItemPacket.itemData);
+            entity.setEquippedSlot(setEquippedItemPacket.slot, setEquippedItemPacket.itemID, setEquippedItemPacket.itemMeta, setEquippedItemPacket.itemData);
         }
     }
 
@@ -1018,9 +1017,9 @@ public class ClientPacketHandler extends PacketHandler
     }
 
     @Override
-    public void handlePlayNoteBlock(BlockEventPacket packet54PlaynoteblockEventPacket)
+    public void handleBlockEvent(BlockEventPacket blockEventPacket)
     {
-        mc.theWorld.triggerEvent(packet54PlaynoteblockEventPacket.xLocation, packet54PlaynoteblockEventPacket.yLocation, packet54PlaynoteblockEventPacket.zLocation, packet54PlaynoteblockEventPacket.instrumentType, packet54PlaynoteblockEventPacket.pitch);
+        mc.theWorld.triggerEvent(blockEventPacket.xLocation, blockEventPacket.yLocation, blockEventPacket.zLocation, blockEventPacket.index, blockEventPacket.data);
     }
 
     @Override
@@ -1047,9 +1046,9 @@ public class ClientPacketHandler extends PacketHandler
     }
 
     @Override
-    public void handlePlaySoundEffect(PlaySoundEffectPacket playsoundeffectPacket)
+    public void handlePlaySoundEffect(PlaySoundEffectPacket playSoundEffectPacket)
     {
-        mc.theWorld.playBlockEvent(playsoundeffectPacket.soundID, playsoundeffectPacket.x, playsoundeffectPacket.y, playsoundeffectPacket.z, playsoundeffectPacket.data);
+        mc.theWorld.playBlockEvent(playSoundEffectPacket.soundID, playSoundEffectPacket.x, playSoundEffectPacket.y, playSoundEffectPacket.z, playSoundEffectPacket.data);
     }
 
 	@Override
@@ -1128,14 +1127,14 @@ public class ClientPacketHandler extends PacketHandler
     }
 
     @Override
-    public void handleTileEntityData(BlockEntityDataPacket packet)
+    public void handleTileEntityData(BlockEntityDataPacket blockEntityDataPacket)
     {
-        Class<?> clazz = BlockEntityDispatcher.getClassFromID(packet.tag.getString("id"));
+        Class<?> clazz = BlockEntityDispatcher.getClassFromID(blockEntityDataPacket.tag.getString("id"));
         if (clazz == null) return;
-        BlockEntity existingBlockEntity = worldClient.getBlockEntity(packet.tag.getInteger("x"), packet.tag.getInteger("y"), packet.tag.getInteger("z"));
+        BlockEntity existingBlockEntity = worldClient.getBlockEntity(blockEntityDataPacket.tag.getInteger("x"), blockEntityDataPacket.tag.getInteger("y"), blockEntityDataPacket.tag.getInteger("z"));
         if (existingBlockEntity == null || existingBlockEntity.getClass() != clazz)
         {
-            BlockEntity blockEntity = BlockEntityDispatcher.createAndLoadEntity(packet.tag);
+            BlockEntity blockEntity = BlockEntityDispatcher.createAndLoadEntity(blockEntityDataPacket.tag);
             if (blockEntity != null)
             {
                 mc.theWorld.setBlockTileEntity(blockEntity.x, blockEntity.y, blockEntity.z, blockEntity);
@@ -1143,9 +1142,9 @@ public class ClientPacketHandler extends PacketHandler
         }
         else
         {
-            existingBlockEntity.readFromNBT(packet.tag);
+            existingBlockEntity.readFromNBT(blockEntityDataPacket.tag);
         }
-        worldClient.markBlockDirty(packet.tag.getInteger("x"), packet.tag.getInteger("y"), packet.tag.getInteger("z"));
+        worldClient.markBlockDirty(blockEntityDataPacket.tag.getInteger("x"), blockEntityDataPacket.tag.getInteger("y"), blockEntityDataPacket.tag.getInteger("z"));
     }
 
     @Override
@@ -1175,22 +1174,22 @@ public class ClientPacketHandler extends PacketHandler
     }
     
     @Override
-    public void handleIds(SyncIDsPacket packet) {
-    	SoundTypes.setSoundIds(packet.soundIds);
+    public void handleIds(SyncIDsPacket syncIDsPacket) {
+    	SoundTypes.setSoundIds(syncIDsPacket.soundIds);
     }
     
     @Override
-    public void handleCustomPayload(CustomPayloadPacket packet) {
-        if("BTA|RainbowStart".equals(packet.channel)) {
+    public void handleCustomPayload(CustomPayloadPacket customPayloadPacket) {
+        if("BTA|RainbowStart".equals(customPayloadPacket.channel)) {
 //            System.out.printf("b0:%s b1:%s b2:%s b3:%s\n", packet.data[0], packet.data[1], packet.data[2], packet.data[3]);
-            int rainbowTicks = Byte.toUnsignedInt(packet.data[0]) << 24 | Byte.toUnsignedInt(packet.data[1]) << 16 | Byte.toUnsignedInt(packet.data[2]) << 8 | Byte.toUnsignedInt(packet.data[3]);
+            int rainbowTicks = Byte.toUnsignedInt(customPayloadPacket.data[0]) << 24 | Byte.toUnsignedInt(customPayloadPacket.data[1]) << 16 | Byte.toUnsignedInt(customPayloadPacket.data[2]) << 8 | Byte.toUnsignedInt(customPayloadPacket.data[3]);
 //            System.out.println("Added rainbow with " + rainbowTicks + " ticks");
             worldClient.addRainbow(rainbowTicks);
         }
     }
 
     @Override
-    public void handleCommandManagerPacket(CommandManagerPacket packet) {
-        ChatSuggestionsElement.serverSuggestions = packet.suggestions;
+    public void handleCommandManagerPacket(CommandManagerPacket commandManagerPacket) {
+        ChatSuggestionsElement.serverSuggestions = commandManagerPacket.suggestions;
     }
 }
diff --git a/src/main/java/net/minecraft/client/net/handler/PingPacketHandler.java b/src/main/java/net/minecraft/client/net/handler/PingPacketHandler.java
index 1ba52c28e..30702b888 100644
--- a/src/main/java/net/minecraft/client/net/handler/PingPacketHandler.java
+++ b/src/main/java/net/minecraft/client/net/handler/PingPacketHandler.java
@@ -81,7 +81,7 @@ public class PingPacketHandler
 
 
     @Override
-    public void handleErrorMessage(String s, Object[] aobj) {
+    public void handleErrorMessage(String message, Object[] objects) {
         if (!disconnected) {
             disconnected = true;
         }
diff --git a/src/main/java/net/minecraft/client/player/controller/PlayerControllerMP.java b/src/main/java/net/minecraft/client/player/controller/PlayerControllerMP.java
index 3a00c9c1d..bc8500f4c 100644
--- a/src/main/java/net/minecraft/client/player/controller/PlayerControllerMP.java
+++ b/src/main/java/net/minecraft/client/player/controller/PlayerControllerMP.java
@@ -41,17 +41,17 @@ public class PlayerControllerMP extends PlayerController {
 	@Override
 	protected void hitBlock(int x, int y, int z, Side side, double xHit, double yHit) {
 		super.hitBlock(x, y, z, side, xHit, yHit);
-		netHandler.addToSendQueue(new PlayerActionPacket(1, x, y, z, side, xHit, yHit));
+		netHandler.addToSendQueue(new PlayerActionPacket(PlayerActionPacket.ACTION_DIG_CONTINUED, x, y, z, side, xHit, yHit));
 	}
 	
 	@Override
 	public void sendStartDigPacket(int x, int y, int z, Side side, double xHit, double yHit) {
-		netHandler.addToSendQueue(new PlayerActionPacket(0, x, y, z, side, xHit, yHit));
+		netHandler.addToSendQueue(new PlayerActionPacket(PlayerActionPacket.ACTION_DIG_START, x, y, z, side, xHit, yHit));
 	}
 	
 	@Override
 	public void sendDestroyBlockPacket(int x, int y, int z, Side side, double xHit, double yHit) {
-		netHandler.addToSendQueue(new PlayerActionPacket(2, x, y, z, side, xHit, yHit));
+		netHandler.addToSendQueue(new PlayerActionPacket(PlayerActionPacket.ACTION_DIG_COMPLETE, x, y, z, side, xHit, yHit));
 	}
 	
 	@Override
diff --git a/src/main/java/net/minecraft/client/render/RenderGlobal.java b/src/main/java/net/minecraft/client/render/RenderGlobal.java
index 44cc472e5..c17ab72bd 100644
--- a/src/main/java/net/minecraft/client/render/RenderGlobal.java
+++ b/src/main/java/net/minecraft/client/render/RenderGlobal.java
@@ -486,23 +486,23 @@ public class RenderGlobal
         return "E: " + countEntitiesRendered + "/" + countEntitiesTotal + ". B: " + countEntitiesHidden + ", I: " + (countEntitiesTotal - countEntitiesHidden - countEntitiesRendered);
     }
 
-    public void markRenderersForNewPosition(int i, int j, int k)
+    public void markRenderersForNewPosition(int x, int y, int z)
     {
-        i -= 8;
-        j -= 8;
-        k -= 8;
-        minBlockX = 0x7fffffff;
-        minBlockY = 0x7fffffff;
-        minBlockZ = 0x7fffffff;
-        maxBlockX = 0x80000000;
-        maxBlockY = 0x80000000;
-        maxBlockZ = 0x80000000;
+        x -= 8;
+        y -= 8;
+        z -= 8;
+        minBlockX = Integer.MAX_VALUE;
+        minBlockY = Integer.MAX_VALUE;
+        minBlockZ = Integer.MAX_VALUE;
+        maxBlockX = Integer.MIN_VALUE;
+        maxBlockY = Integer.MIN_VALUE;
+        maxBlockZ = Integer.MIN_VALUE;
         int l = renderChunksWide * RENDER_CHUNK_SIZE;
         int i1 = l / 2;
         for(int j1 = 0; j1 < renderChunksWide; j1++)
         {
             int k1 = j1 * RENDER_CHUNK_SIZE;
-            int l1 = (k1 + i1) - i;
+            int l1 = (k1 + i1) - x;
             if(l1 < 0)
             {
                 l1 -= l - 1;
@@ -520,7 +520,7 @@ public class RenderGlobal
             for(int i2 = 0; i2 < renderChunksDeep; i2++)
             {
                 int j2 = i2 * RENDER_CHUNK_SIZE;
-                int k2 = (j2 + i1) - k;
+                int k2 = (j2 + i1) - z;
                 if(k2 < 0)
                 {
                     k2 -= l - 1;
diff --git a/src/main/java/net/minecraft/client/render/WorldRenderer.java b/src/main/java/net/minecraft/client/render/WorldRenderer.java
index db4b333fb..ee3a6b8ba 100644
--- a/src/main/java/net/minecraft/client/render/WorldRenderer.java
+++ b/src/main/java/net/minecraft/client/render/WorldRenderer.java
@@ -439,8 +439,8 @@ public class WorldRenderer
 					l = -1;
 				}
 				if(mc.gameSettings.smoothCamera.value) {
-					deltaX = mouseFilterXAxis.func_22386_a(deltaX, 0.05F * sensitivity);
-					deltaY = mouseFilterYAxis.func_22386_a(deltaY, 0.05F * sensitivity);
+					deltaX = mouseFilterXAxis.getSmoothedDelta(deltaX, 0.05F * sensitivity);
+					deltaY = mouseFilterYAxis.getSmoothedDelta(deltaY, 0.05F * sensitivity);
 				} else {
                     mouseFilterXAxis.reset();
                     mouseFilterYAxis.reset();
diff --git a/src/main/java/net/minecraft/client/render/block/model/ActivatorBlockModel.java b/src/main/java/net/minecraft/client/render/block/model/ActivatorBlockModel.java
index d9161bf31..b12ff14a2 100644
--- a/src/main/java/net/minecraft/client/render/block/model/ActivatorBlockModel.java
+++ b/src/main/java/net/minecraft/client/render/block/model/ActivatorBlockModel.java
@@ -3,17 +3,26 @@ package net.minecraft.client.render.block.model;
 import net.minecraft.client.render.texture.stitcher.IconCoordinate;
 import net.minecraft.client.render.texture.stitcher.TextureRegistry;
 import net.minecraft.core.block.ActivatorBlock;
-import net.minecraft.core.block.FullRotatableBlock;
 import net.minecraft.core.block.Block;
-import net.minecraft.core.block.VeryRotatableEntityBlock;
-import net.minecraft.core.block.RotatableBlock;
-import net.minecraft.core.util.helper.Direction;
 import net.minecraft.core.util.helper.Side;
-import net.minecraft.core.util.helper.Sides;
 
 public class ActivatorBlockModel extends VeryRotatableBlockModel<ActivatorBlock> {
-    public final IconCoordinate frontPowered = TextureRegistry.getTexture("minecraft:block/activator_front_active");
-    public final IconCoordinate frontOverbright = TextureRegistry.getTexture("minecraft:block/activator_front_active_overlay");
+    public final IconCoordinate[] poweredTextures = {
+        null,
+        TextureRegistry.getTexture("minecraft:block/activator_top_active"),
+        TextureRegistry.getTexture("minecraft:block/activator_side_active"),
+        TextureRegistry.getTexture("minecraft:block/activator_front_active"),
+        TextureRegistry.getTexture("minecraft:block/activator_side_active"),
+        TextureRegistry.getTexture("minecraft:block/activator_side_active")
+    };
+    public final IconCoordinate[] overbrightTextures = {
+        null,
+        TextureRegistry.getTexture("minecraft:block/activator_top_active_overlay"),
+        TextureRegistry.getTexture("minecraft:block/activator_side_active_overlay"),
+        TextureRegistry.getTexture("minecraft:block/activator_front_active_overlay"),
+        TextureRegistry.getTexture("minecraft:block/activator_side_active_overlay"),
+        TextureRegistry.getTexture("minecraft:block/activator_side_active_overlay")
+    };
     public ActivatorBlockModel(Block block) {
         super(block);
     }
@@ -26,24 +35,18 @@ public class ActivatorBlockModel extends VeryRotatableBlockModel<ActivatorBlock>
     @Override
     public IconCoordinate getBlockTextureFromSideAndMetadata(Side side, int data)
     {
-        boolean isPowered = (data & ActivatorBlock.MASK_POWERED) != 0;
-        final Direction dir = VeryRotatableEntityBlock.metaToDirection(data);
-        if (side == dir.getSide()) {
-            return isPowered ? frontPowered : atlasIndices[Side.TOP.getId()];
+        if ((data & ActivatorBlock.MASK_POWERED) != 0) {
+            return poweredTextures[getTextureIndex(side, data)];
+        } else {
+            return super.getBlockTextureFromSideAndMetadata(side, data);
         }
-        if (side == Side.BOTTOM || side == Side.TOP) return atlasIndices[Side.BOTTOM.getId()];
-        if ((dir.getSide() == Side.BOTTOM || dir.getSide() == Side.TOP) && (side == Side.NORTH || side == Side.SOUTH)) return atlasIndices[Side.BOTTOM.getId()];
-        return side.getDirection() != dir.getOpposite() ? atlasIndices[Side.NORTH.getId()] : atlasIndices[Side.BOTTOM.getId()];
     }
 
     @Override
     public IconCoordinate getBlockOverbrightTextureFromSideAndMeta(Side side, int data)
     {
         boolean isPowered = (data & ActivatorBlock.MASK_POWERED) != 0;
-        if(isPowered && side.getId() == FullRotatableBlock.metaToDirection(data).getSide().getId())
-        {
-            return frontOverbright;
-        }
-        return null;
+        if (!isPowered) return null;
+        return overbrightTextures[getTextureIndex(side, data)];
     }
 }
diff --git a/src/main/java/net/minecraft/client/render/block/model/BlockModelDispatcher.java b/src/main/java/net/minecraft/client/render/block/model/BlockModelDispatcher.java
index 21bccd4cd..58ebdff08 100644
--- a/src/main/java/net/minecraft/client/render/block/model/BlockModelDispatcher.java
+++ b/src/main/java/net/minecraft/client/render/block/model/BlockModelDispatcher.java
@@ -333,8 +333,8 @@ public class BlockModelDispatcher
 
         addDispatch(new SpikesBlockModel<>(Blocks.SPIKES).withTextures("minecraft:block/spikes_top", "minecraft:block/spikes_bottom", "minecraft:block/spikes_side"));
 
-        addDispatch(new VeryRotatableBlockModel<>(Blocks.DISPENSER_COBBLE_STONE).withTextures("minecraft:block/dispenser_front", "minecraft:block/dispenser_top", "minecraft:block/dispenser_side"));
-        addDispatch(new ActivatorBlockModel(Blocks.ACTIVATOR_COBBLE_NETHERRACK).withTextures("minecraft:block/activator_front", "minecraft:block/activator_top", "minecraft:block/activator_side"));
+        addDispatch(new VeryRotatableBlockModel<>(Blocks.DISPENSER_COBBLE_STONE).withTextures("minecraft:block/dispenser_top", "minecraft:block/dispenser_bottom", "minecraft:block/dispenser_side", "minecraft:block/dispenser_side", "minecraft:block/dispenser_front", "minecraft:block/dispenser_side"));
+        addDispatch(new ActivatorBlockModel(Blocks.ACTIVATOR_COBBLE_NETHERRACK).withTextures("minecraft:block/activator_top", "minecraft:block/activator_bottom", "minecraft:block/activator_side", "minecraft:block/activator_side", "minecraft:block/activator_front", "minecraft:block/activator_side"));
 
         addDispatch(new TrapDoorBlockModel<>(Blocks.TRAPDOOR_PLANKS_OAK).withTextures("minecraft:block/trapdoor_planks_oak_top", "minecraft:block/trapdoor_planks_oak_side"));
         addDispatch(new TrapDoorBlockModel<>(Blocks.TRAPDOOR_IRON).withTextures("minecraft:block/trapdoor_iron_top", "minecraft:block/trapdoor_iron_side"));
@@ -352,8 +352,8 @@ public class BlockModelDispatcher
         addDispatch(new PaintedDoorBlockModel<>(Blocks.DOOR_PLANKS_PAINTED_TOP, true).withTextures("minecraft:block/trapdoor_planks_oak_top", "minecraft:block/door_planks_oak_top"));
         addDispatch(new GlassDoorBlockModel<>(Blocks.DOOR_GLASS_BOTTOM).withTextures("minecraft:block/glass", "minecraft:block/door_glass_bottom"));
         addDispatch(new GlassDoorBlockModel<>(Blocks.DOOR_GLASS_TOP).withTextures("minecraft:block/glass", "minecraft:block/door_glass_top"));
-        addDispatch(new DoorBlockModel<>(Blocks.DOOR_STEEL_BOTTOM).withTextures("minecraft:block/trapdoor_steel_top", "minecraft:block/door_steel_bottom"));
-        addDispatch(new DoorBlockModel<>(Blocks.DOOR_STEEL_TOP).withTextures("minecraft:block/trapdoor_steel_top", "minecraft:block/door_steel_top"));
+        addDispatch(new DoorBlockModel<>(Blocks.DOOR_STEEL_BOTTOM).withTextures("minecraft:block/door_steel_frame_top", "minecraft:block/door_steel_bottom"));
+        addDispatch(new DoorBlockModel<>(Blocks.DOOR_STEEL_TOP).withTextures("minecraft:block/door_steel_frame_top", "minecraft:block/door_steel_top"));
 
         addDispatch(new TransparentBlockModel<>(Blocks.MESH, true).withTextures("minecraft:block/mesh"));
         addDispatch(new TransparentBlockModel<>(Blocks.MESH_GOLD, true).withTextures("minecraft:block/mesh_gold"));
@@ -371,8 +371,8 @@ public class BlockModelDispatcher
 
         addDispatch(new StandardBlockModel<>(Blocks.WORKBENCH).withTextures("minecraft:block/workbench_top", "minecraft:block/planks_oak", "minecraft:block/workbench_front", "minecraft:block/workbench_side", "minecraft:block/workbench_front", "minecraft:block/workbench_side"));
 
-        addDispatch(new FurnaceBlockModel<>(Blocks.FURNACE_STONE_IDLE).withTextures("minecraft:block/furnace_stone_top", "minecraft:block/furnace_stone_top", "minecraft:block/furnace_stone_idle_front", "minecraft:block/furnace_stone_side", "minecraft:block/furnace_stone_side", "minecraft:block/furnace_stone_side"));
-        addDispatch(new FurnaceBlockModel<>(Blocks.FURNACE_STONE_ACTIVE).withTextures("minecraft:block/furnace_stone_top", "minecraft:block/furnace_stone_top", "minecraft:block/furnace_stone_active_front", "minecraft:block/furnace_stone_side", "minecraft:block/furnace_stone_side", "minecraft:block/furnace_stone_side"));
+        addDispatch(new FurnaceBlockModel<>(Blocks.FURNACE_STONE_IDLE).withTextures("minecraft:block/furnace_stone_top", "minecraft:block/furnace_stone_bottom", "minecraft:block/furnace_stone_idle_front", "minecraft:block/furnace_stone_side", "minecraft:block/furnace_stone_side", "minecraft:block/furnace_stone_side"));
+        addDispatch(new FurnaceBlockModel<>(Blocks.FURNACE_STONE_ACTIVE).withTextures("minecraft:block/furnace_stone_top", "minecraft:block/furnace_stone_bottom", "minecraft:block/furnace_stone_active_front", "minecraft:block/furnace_stone_side", "minecraft:block/furnace_stone_side", "minecraft:block/furnace_stone_side"));
         addDispatch(new FurnaceBlockModel<>(Blocks.FURNACE_BLAST_IDLE).withTextures("minecraft:block/furnace_blast_top", "minecraft:block/furnace_blast_bottom", "minecraft:block/furnace_blast_idle_front", "minecraft:block/furnace_blast_side", "minecraft:block/furnace_blast_side", "minecraft:block/furnace_blast_side"));
         addDispatch(new FurnaceBlockModel<>(Blocks.FURNACE_BLAST_ACTIVE).withTextures("minecraft:block/furnace_blast_top", "minecraft:block/furnace_blast_bottom", "minecraft:block/furnace_blast_active_front", "minecraft:block/furnace_blast_side", "minecraft:block/furnace_blast_side", "minecraft:block/furnace_blast_side"));
 
diff --git a/src/main/java/net/minecraft/client/render/block/model/CacaoLeavesBlockModel.java b/src/main/java/net/minecraft/client/render/block/model/CacaoLeavesBlockModel.java
index 8ab16cc30..32f2dda26 100644
--- a/src/main/java/net/minecraft/client/render/block/model/CacaoLeavesBlockModel.java
+++ b/src/main/java/net/minecraft/client/render/block/model/CacaoLeavesBlockModel.java
@@ -5,6 +5,7 @@ import net.minecraft.client.render.texture.stitcher.IconCoordinate;
 import net.minecraft.client.render.texture.stitcher.TextureRegistry;
 import net.minecraft.client.render.tessellator.Tessellator;
 import net.minecraft.core.block.Block;
+import net.minecraft.core.block.CacaoLeavesBlock;
 import org.jetbrains.annotations.Nullable;
 import org.lwjgl.opengl.GL11;
 
@@ -16,13 +17,14 @@ public class CacaoLeavesBlockModel<T extends Block> extends LeavesBlockModel<T>
             TextureRegistry.getTexture("minecraft:block/leaves_cacao_bean_stage3")};
     public CacaoLeavesBlockModel(Block block) {
         super(block, "minecraft:block/leaves_cacao");
+        assert growthStages.length == CacaoLeavesBlock.MAX_GROWTH_STATE : "There must be a texture associated with every cacao bean stage!";
     }
 
     @Override
     public boolean render(Tessellator tessellator, int x, int y, int z) {
         super.render(tessellator, x, y, z);
 
-        final int growthRate = (renderBlocks.blockAccess.getBlockMetadata(x, y, z) & 0XF0) >> 4;
+        final int growthRate = CacaoLeavesBlock.getGrowthRate(renderBlocks.blockAccess.getBlockMetadata(x, y, z));
         float brightness = 1.0f;
         if(LightmapHelper.isLightmapEnabled()) {
             int lmc = block.getLightmapCoord(renderBlocks.blockAccess, x, y, z);
@@ -40,7 +42,7 @@ public class CacaoLeavesBlockModel<T extends Block> extends LeavesBlockModel<T>
         final float cNorthSouth = 0.8F;
         final float cEastWest = 0.6F;
         if (growthRate > 0) {
-            renderBlocks.overrideBlockTexture = growthStages[Math.min(growthRate - 1, 3)];
+            renderBlocks.overrideBlockTexture = growthStages[Math.min(growthRate - 1, CacaoLeavesBlock.MAX_GROWTH_STATE - 1)];
             tessellator.setColorOpaque_F(cNorthSouth * brightness, cNorthSouth * brightness, cNorthSouth * brightness);
             renderNorthFace(tessellator, block, x, y, z, renderBlocks.overrideBlockTexture);
             renderSouthFace(tessellator, block, x, y, z, renderBlocks.overrideBlockTexture);
@@ -57,7 +59,7 @@ public class CacaoLeavesBlockModel<T extends Block> extends LeavesBlockModel<T>
         super.renderBlockOnInventory(tessellator, metadata, brightness, alpha, lightmapCoordinate);
         GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
 
-        final IconCoordinate cacaoCoord = growthStages[3];
+        final IconCoordinate cacaoCoord = growthStages[CacaoLeavesBlock.MAX_GROWTH_STATE - 1];
         GL11.glColor4f(brightness, brightness, brightness, alpha);
 
         tessellator.startDrawingQuads();
diff --git a/src/main/java/net/minecraft/client/render/block/model/CropsWheatBlockModel.java b/src/main/java/net/minecraft/client/render/block/model/CropsWheatBlockModel.java
index 516b1c711..e41c614f2 100644
--- a/src/main/java/net/minecraft/client/render/block/model/CropsWheatBlockModel.java
+++ b/src/main/java/net/minecraft/client/render/block/model/CropsWheatBlockModel.java
@@ -5,6 +5,7 @@ import net.minecraft.client.render.texture.stitcher.IconCoordinate;
 import net.minecraft.client.render.texture.stitcher.TextureRegistry;
 import net.minecraft.client.render.tessellator.Tessellator;
 import net.minecraft.core.block.Block;
+import net.minecraft.core.block.CropsWheatBlock;
 import net.minecraft.core.util.helper.MathHelper;
 import net.minecraft.core.util.helper.Side;
 
@@ -22,6 +23,7 @@ public class CropsWheatBlockModel<T extends Block> extends StandardBlockModel<T>
 
     public CropsWheatBlockModel(Block block) {
         super(block);
+        assert growthStageTextures.length == CropsWheatBlock.MAX_GROWTH_STATE + 1 : "There must be a texture for each wheat growth stage!";
     }
 
     @Override
diff --git a/src/main/java/net/minecraft/client/render/block/model/DoorBlockModel.java b/src/main/java/net/minecraft/client/render/block/model/DoorBlockModel.java
index 391d4e5bf..7af28c992 100644
--- a/src/main/java/net/minecraft/client/render/block/model/DoorBlockModel.java
+++ b/src/main/java/net/minecraft/client/render/block/model/DoorBlockModel.java
@@ -119,7 +119,7 @@ public class DoorBlockModel<T extends DoorBlock> extends StandardBlockModel<T> {
     }
     protected boolean shouldFlipTexture(Side side, int meta){
         if(side == Side.TOP || side == Side.BOTTOM) return false;
-        int state = block.getState(meta);
+        int state = block.getRotation(meta);
         int l = state / 2 + (side.getId() & 1 ^ state);
         if((state == 0 || state == 2) ^ (side.getId() <= 3))
         {
diff --git a/src/main/java/net/minecraft/client/render/block/model/FenceGateBlockModel.java b/src/main/java/net/minecraft/client/render/block/model/FenceGateBlockModel.java
index 76fcf3ee0..ebfcf58ea 100644
--- a/src/main/java/net/minecraft/client/render/block/model/FenceGateBlockModel.java
+++ b/src/main/java/net/minecraft/client/render/block/model/FenceGateBlockModel.java
@@ -18,8 +18,8 @@ public class FenceGateBlockModel<T extends FenceGateBlock> extends StandardBlock
         block.setBlockBoundsBasedOnState(renderBlocks.blockAccess, x, y, z);
         boolean flag = true;
         int l = renderBlocks.blockAccess.getBlockMetadata(x, y, z);
-        boolean flag1 = FenceGateBlock.func_35291_d(l);
-        int i1 = FenceGateBlock.func_35290_f(l);
+        boolean flag1 = FenceGateBlock.isOpen(l);
+        int i1 = FenceGateBlock.getDirection(l);
         if(i1 == 3 || i1 == 1)
         {
             float f = 0.4375F;
diff --git a/src/main/java/net/minecraft/client/render/block/model/LanternBlockModel.java b/src/main/java/net/minecraft/client/render/block/model/LanternBlockModel.java
index a0197810e..970eb9922 100644
--- a/src/main/java/net/minecraft/client/render/block/model/LanternBlockModel.java
+++ b/src/main/java/net/minecraft/client/render/block/model/LanternBlockModel.java
@@ -4,6 +4,7 @@ import net.minecraft.client.render.LightmapHelper;
 import net.minecraft.client.render.texture.stitcher.IconCoordinate;
 import net.minecraft.client.render.tessellator.Tessellator;
 import net.minecraft.core.block.Block;
+import net.minecraft.core.block.FireflyLanternBlock;
 import net.minecraft.core.util.helper.Side;
 
 public class LanternBlockModel<T extends Block> extends StandardBlockModel<T> {
@@ -15,8 +16,8 @@ public class LanternBlockModel<T extends Block> extends StandardBlockModel<T> {
     public boolean render(Tessellator tessellator, int x, int y, int z) {
         block.setBlockBoundsBasedOnState(renderBlocks.blockAccess, x, y, z);
         int meta = renderBlocks.blockAccess.getBlockMetadata(x, y, z);
-        boolean isHanging = (meta & 0b00000001) == 0;
-        boolean isAngled = (meta & 0b00000010) != 0;
+        boolean isHanging = (meta & FireflyLanternBlock.MASK_HANGING) == 0;
+        boolean isAngled = (meta & FireflyLanternBlock.MASK_ANGLED) != 0;
 
         float brightness = 1.0f;
         if(LightmapHelper.isLightmapEnabled()) {
diff --git a/src/main/java/net/minecraft/client/render/block/model/TorchBlockModel.java b/src/main/java/net/minecraft/client/render/block/model/TorchBlockModel.java
index 9d980568d..8bf27d21a 100644
--- a/src/main/java/net/minecraft/client/render/block/model/TorchBlockModel.java
+++ b/src/main/java/net/minecraft/client/render/block/model/TorchBlockModel.java
@@ -4,6 +4,7 @@ import net.minecraft.client.render.LightmapHelper;
 import net.minecraft.client.render.texture.stitcher.IconCoordinate;
 import net.minecraft.client.render.tessellator.Tessellator;
 import net.minecraft.core.block.Block;
+import net.minecraft.core.block.TorchBlock;
 import net.minecraft.core.util.helper.Side;
 
 public class TorchBlockModel<T extends Block> extends StandardBlockModel<T> {
@@ -14,38 +15,36 @@ public class TorchBlockModel<T extends Block> extends StandardBlockModel<T> {
     @Override
     public boolean render(Tessellator tessellator, int x, int y, int z) {
         block.setBlockBoundsBasedOnState(renderBlocks.blockAccess, x, y, z);
-        int l = renderBlocks.blockAccess.getBlockMetadata(x, y, z);
         float brightness = 1.0f;
         if(LightmapHelper.isLightmapEnabled()) {
-        	tessellator.setLightmapCoord(block.getLightmapCoord(renderBlocks.blockAccess, x, y, z));
+            tessellator.setLightmapCoord(block.getLightmapCoord(renderBlocks.blockAccess, x, y, z));
         }else {
-        	brightness = getBlockBrightness(renderBlocks.blockAccess, x, y, z);
-        	if(Block.lightEmission[block.id] > 0) {
-        		brightness = 1.0F;
-        	}
+            brightness = getBlockBrightness(renderBlocks.blockAccess, x, y, z);
+            if(Block.lightEmission[block.id] > 0) {
+                brightness = 1.0F;
+            }
         }
         tessellator.setColorOpaque_F(brightness, brightness, brightness);
         double d = 0.4;
         double d1 = 0.5D - d;
         double d2 = 0.2;
-        if(l == 1)
-        {
-            renderTorchAtAngle(tessellator, (double)x - d1, (double)y + d2, z, -d, 0.0D);
-        } else
-        if(l == 2)
-        {
-            renderTorchAtAngle(tessellator, (double)x + d1, (double)y + d2, z, d, 0.0D);
-        } else
-        if(l == 3)
-        {
-            renderTorchAtAngle(tessellator, x, (double)y + d2, (double)z - d1, 0.0D, -d);
-        } else
-        if(l == 4)
-        {
-            renderTorchAtAngle(tessellator, x, (double)y + d2, (double)z + d1, 0.0D, d);
-        } else
-        {
-            renderTorchAtAngle(tessellator, x, y, z, 0.0D, 0.0D);
+        int direction = renderBlocks.blockAccess.getBlockMetadata(x, y, z) & TorchBlock.MASK_DIRECTION;
+        switch (direction) {
+            case TorchBlock.SIDE_WEST:
+                renderTorchAtAngle(tessellator, (double) x - d1, (double) y + d2, z, -d, 0.0D);
+                break;
+            case TorchBlock.SIDE_EAST:
+                renderTorchAtAngle(tessellator, (double) x + d1, (double) y + d2, z, d, 0.0D);
+                break;
+            case TorchBlock.SIDE_NORTH:
+                renderTorchAtAngle(tessellator, x, (double) y + d2, (double) z - d1, 0.0D, -d);
+                break;
+            case TorchBlock.SIDE_SOUTH:
+                renderTorchAtAngle(tessellator, x, (double) y + d2, (double) z + d1, 0.0D, d);
+                break;
+            default:
+                renderTorchAtAngle(tessellator, x, y, z, 0.0D, 0.0D);
+                break;
         }
         return true;
     }
diff --git a/src/main/java/net/minecraft/client/render/block/model/VeryRotatableBlockModel.java b/src/main/java/net/minecraft/client/render/block/model/VeryRotatableBlockModel.java
index 57c6fcf51..be0447f4e 100644
--- a/src/main/java/net/minecraft/client/render/block/model/VeryRotatableBlockModel.java
+++ b/src/main/java/net/minecraft/client/render/block/model/VeryRotatableBlockModel.java
@@ -38,12 +38,47 @@ public class VeryRotatableBlockModel<T extends Block> extends StandardBlockModel
     @Override
     public IconCoordinate getBlockTextureFromSideAndMetadata(Side side, int data)
     {
+        return atlasIndices[getTextureIndex(side, data)];
+    }
+
+    public int getTextureIndex(Side side, int data) {
         final Direction dir = VeryRotatableEntityBlock.metaToDirection(data);
-        if (side == dir.getSide()) {
-            return atlasIndices[Side.TOP.getId()];
+        switch (dir) { // I love brute forcing fixes so much :3
+            case SOUTH:
+                return side.getId();
+            case EAST:
+                return side.getDirection().rotate(1).getId();
+            case NORTH:
+                return side.getDirection().rotate(2).getId();
+            case WEST:
+                return side.getDirection().rotate(3).getId();
+            case UP:
+                switch (side) {
+                    case NORTH:
+                        return Side.TOP.getId();
+                    case SOUTH:
+                        return Side.BOTTOM.getId();
+                    case TOP:
+                        return Side.SOUTH.getId();
+                    case BOTTOM:
+                        return Side.NORTH.getId();
+                    default:
+                        return side.getId();
+                }
+            case DOWN:
+                switch (side) {
+                    case NORTH:
+                        return Side.BOTTOM.getId();
+                    case SOUTH:
+                        return Side.TOP.getId();
+                    case TOP:
+                        return Side.NORTH.getId();
+                    case BOTTOM:
+                        return Side.SOUTH.getId();
+                    default:
+                        return side.getId();
+                }
         }
-        if (side == Side.BOTTOM || side == Side.TOP) return atlasIndices[Side.BOTTOM.getId()];
-        if ((dir.getSide() == Side.BOTTOM || dir.getSide() == Side.TOP) && (side == Side.NORTH || side == Side.SOUTH)) return atlasIndices[Side.BOTTOM.getId()];
-        return side.getDirection() != dir.getOpposite() ? atlasIndices[Side.NORTH.getId()] : atlasIndices[Side.BOTTOM.getId()];
+        return 0;
     }
 }
diff --git a/src/main/java/net/minecraft/client/render/blockentity/SignBlockEntityRenderer.java b/src/main/java/net/minecraft/client/render/blockentity/SignBlockEntityRenderer.java
index 134f0f8f7..2a7cd1496 100644
--- a/src/main/java/net/minecraft/client/render/blockentity/SignBlockEntityRenderer.java
+++ b/src/main/java/net/minecraft/client/render/blockentity/SignBlockEntityRenderer.java
@@ -69,7 +69,7 @@ public class SignBlockEntityRenderer extends BlockEntityRenderer<SignBlockEntity
         loadTexture("/assets/minecraft/textures/entity/sign.png");
         GL11.glPushMatrix();
         GL11.glScalef(scale, -scale, -scale);
-        signModel.func_887_a();
+        signModel.render();
         GL11.glPopMatrix();
         Font font = getFont();
 
diff --git a/src/main/java/net/minecraft/client/render/entity/LightningBoltRenderer.java b/src/main/java/net/minecraft/client/render/entity/LightningBoltRenderer.java
index a90031aa6..c5e7a88dc 100644
--- a/src/main/java/net/minecraft/client/render/entity/LightningBoltRenderer.java
+++ b/src/main/java/net/minecraft/client/render/entity/LightningBoltRenderer.java
@@ -16,19 +16,19 @@ public class LightningBoltRenderer extends EntityRenderer<LightningEntity>
     {
     }
 
-    public void func_27002_a(LightningEntity lightningBolt, double d, double d1, double d2,
-                             float f, float f1)
+    @Override
+    public void render(Tessellator tessellator, LightningEntity lightning, double x, double y, double z,
+                       float yaw, float partialTick)
     {
-        Tessellator tessellator = Tessellator.instance;
         GL11.glDisable(GL11.GL_TEXTURE_2D);
         GL11.glDisable(GL11.GL_LIGHTING);
         GL11.glEnable(GL11.GL_BLEND);
-        GL11.glBlendFunc(770, 1);
+        GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
         double ad[] = new double[8];
         double ad1[] = new double[8];
         double d3 = 0.0D;
         double d4 = 0.0D;
-        Random random = new Random(lightningBolt.seed);
+        Random random = new Random(lightning.seed);
         for(int j = 7; j >= 0; j--)
         {
             ad[j] = d3;
@@ -39,7 +39,7 @@ public class LightningBoltRenderer extends EntityRenderer<LightningEntity>
 
         for(int i = 0; i < 4; i++)
         {
-            Random random1 = new Random(lightningBolt.seed);
+            random.setSeed(lightning.seed);
             for(int k = 0; k < 3; k++)
             {
                 int l = 7;
@@ -60,30 +60,30 @@ public class LightningBoltRenderer extends EntityRenderer<LightningEntity>
                     double d8 = d6;
                     if(k == 0)
                     {
-                        d5 += random1.nextInt(11) - 5;
-                        d6 += random1.nextInt(11) - 5;
+                        d5 += random.nextInt(11) - 5;
+                        d6 += random.nextInt(11) - 5;
                     } else
                     {
-                        d5 += random1.nextInt(31) - 15;
-                        d6 += random1.nextInt(31) - 15;
+                        d5 += random.nextInt(31) - 15;
+                        d6 += random.nextInt(31) - 15;
                     }
                     tessellator.startDrawing(5);
                     float f2 = 0.5F;
                     tessellator.setColorRGBA_F(0.9F * f2, 0.9F * f2, 1.0F * f2, 0.3F);
-                    double d9 = 0.10000000000000001D + (double)i * 0.20000000000000001D;
+                    double d9 = 0.1D + (double)i * 0.2D;
                     if(k == 0)
                     {
-                        d9 *= (double)j1 * 0.10000000000000001D + 1.0D;
+                        d9 *= (double)j1 * 0.1D + 1.0D;
                     }
-                    double d10 = 0.10000000000000001D + (double)i * 0.20000000000000001D;
+                    double d10 = 0.1D + (double)i * 0.2D;
                     if(k == 0)
                     {
-                        d10 *= (double)(j1 - 1) * 0.10000000000000001D + 1.0D;
+                        d10 *= (double)(j1 - 1) * 0.1D + 1.0D;
                     }
                     for(int k1 = 0; k1 < 5; k1++)
                     {
-                        double d11 = (d + 0.5D) - d9;
-                        double d12 = (d2 + 0.5D) - d9;
+                        double d11 = (x + 0.5D) - d9;
+                        double d12 = (z + 0.5D) - d9;
                         if(k1 == 1 || k1 == 2)
                         {
                             d11 += d9 * 2D;
@@ -92,8 +92,8 @@ public class LightningBoltRenderer extends EntityRenderer<LightningEntity>
                         {
                             d12 += d9 * 2D;
                         }
-                        double d13 = (d + 0.5D) - d10;
-                        double d14 = (d2 + 0.5D) - d10;
+                        double d13 = (x + 0.5D) - d10;
+                        double d14 = (z + 0.5D) - d10;
                         if(k1 == 1 || k1 == 2)
                         {
                             d13 += d10 * 2D;
@@ -102,8 +102,8 @@ public class LightningBoltRenderer extends EntityRenderer<LightningEntity>
                         {
                             d14 += d10 * 2D;
                         }
-                        tessellator.addVertex(d13 + d5, d1 + (double)(j1 * 16), d14 + d6);
-                        tessellator.addVertex(d11 + d7, d1 + (double)((j1 + 1) * 16), d12 + d8);
+                        tessellator.addVertex(d13 + d5, y + (double)(j1 * 16), d14 + d6);
+                        tessellator.addVertex(d11 + d7, y + (double)((j1 + 1) * 16), d12 + d8);
                     }
 
                     tessellator.draw();
@@ -117,11 +117,4 @@ public class LightningBoltRenderer extends EntityRenderer<LightningEntity>
         GL11.glEnable(GL11.GL_LIGHTING);
         GL11.glEnable(GL11.GL_TEXTURE_2D);
     }
-
-    @Override
-    public void render(Tessellator tessellator, LightningEntity entity, double x, double y, double z,
-                       float yaw, float partialTick)
-    {
-        func_27002_a(entity, x, y, z, yaw, partialTick);
-    }
 }
diff --git a/src/main/java/net/minecraft/client/render/entity/PlayerRenderer.java b/src/main/java/net/minecraft/client/render/entity/PlayerRenderer.java
index 4b184a97a..f4293f672 100644
--- a/src/main/java/net/minecraft/client/render/entity/PlayerRenderer.java
+++ b/src/main/java/net/minecraft/client/render/entity/PlayerRenderer.java
@@ -55,7 +55,7 @@ public class PlayerRenderer extends MobRenderer<Player>
         } else if (player.getGamemode() == Gamemode.spectator) {
             GL11.glColor4f(1f, 1f, 1f, 0.0f);
         }
-        ItemStack itemstack = player.inventory.armorItemInSlot(3);
+        ItemStack itemstack = player.inventory.armorItemInSlot(IArmorItem.PIECE_HEAD);
         if(itemstack != null && itemstack.getItem().id < Block.blocksList.length)
         {
             GL11.glPushMatrix();
@@ -278,7 +278,7 @@ public class PlayerRenderer extends MobRenderer<Player>
 
     @Override
     protected boolean prepareArmor(Player entity, int layer, float partialTick) {
-        ItemStack itemstack = entity.inventory.armorItemInSlot(3 - layer);
+        ItemStack itemstack = entity.inventory.armorItemInSlot(IArmorItem.PIECE_HEAD - layer);
         if(itemstack != null)
         {
             Item item = itemstack.getItem();
diff --git a/src/main/java/net/minecraft/client/render/model/SignModel.java b/src/main/java/net/minecraft/client/render/model/SignModel.java
index bacc3e4d8..7d3dfddaf 100644
--- a/src/main/java/net/minecraft/client/render/model/SignModel.java
+++ b/src/main/java/net/minecraft/client/render/model/SignModel.java
@@ -15,7 +15,7 @@ public class SignModel
         signStick.addBox(-1F, -2F, -1F, 2, 14, 2, 0.0F);
     }
 
-    public void func_887_a()
+    public void render()
     {
         signBoard.render(0.0625F);
         signStick.render(0.0625F);
diff --git a/src/main/java/net/minecraft/client/render/texture/meta/gui/GuiTextureProperties.java b/src/main/java/net/minecraft/client/render/texture/meta/gui/GuiTextureProperties.java
index 9cf491e4d..28ae55403 100644
--- a/src/main/java/net/minecraft/client/render/texture/meta/gui/GuiTextureProperties.java
+++ b/src/main/java/net/minecraft/client/render/texture/meta/gui/GuiTextureProperties.java
@@ -9,12 +9,14 @@ public class GuiTextureProperties {
     public final int width;
     public final int height;
     public final Border border;
+    public final boolean stretchInner;
 
-    public GuiTextureProperties(String type, int width, int height, Border border) {
+    public GuiTextureProperties(String type, int width, int height, Border border, boolean stretchInner) {
         this.type = type;
         this.width = width;
         this.height = height;
         this.border = border;
+        this.stretchInner = stretchInner;
     }
 
     public static class Border {
diff --git a/src/main/java/net/minecraft/client/render/texture/meta/gui/GuiTexturePropertiesAdapter.java b/src/main/java/net/minecraft/client/render/texture/meta/gui/GuiTexturePropertiesAdapter.java
index 08c7e3292..aca0a8e51 100644
--- a/src/main/java/net/minecraft/client/render/texture/meta/gui/GuiTexturePropertiesAdapter.java
+++ b/src/main/java/net/minecraft/client/render/texture/meta/gui/GuiTexturePropertiesAdapter.java
@@ -14,17 +14,32 @@ public class GuiTexturePropertiesAdapter implements JsonDeserializer<GuiTextureP
     @Override
     public GuiTextureProperties deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
         JsonObject jo = json.getAsJsonObject();
+        JsonObject scalingObj = jo.getAsJsonObject("scaling");
         String type = GuiTextureProperties.TYPE_STRETCH;
-        int width = jo.get("width").getAsInt();
-        int height = jo.get("height").getAsInt();
-        GuiTextureProperties.Border border = new GuiTextureProperties.Border(0);
+        boolean stretchInner = false;
+        int width = -1; // Required with TYPE_TILE or TYPE_NINE_SLICE
+        int height = -1; // Required with TYPE_TILE or TYPE_NINE_SLICE
+        GuiTextureProperties.Border border = null; // Required with TYPE_NINE_SLICE
 
-        if (jo.has("type")) {
-            type = jo.get("type").getAsString();
+        if (scalingObj.has("type")) {
+            type = scalingObj.get("type").getAsString();
         }
 
-        if (jo.has("border")) {
-            JsonElement be = jo.get("border");
+        if (type.equals(GuiTextureProperties.TYPE_TILE) || type.equals(GuiTextureProperties.TYPE_NINE_SLICE)) {
+            if (!scalingObj.has("width")) throw new JsonParseException("Gui scaling type 'tile' and 'nine_slice' requires a width property!");
+            if (!scalingObj.has("height")) throw new JsonParseException("Gui scaling type 'tile' and 'nine_slice' requires a height property!");
+
+            width = scalingObj.get("width").getAsInt();
+            height = scalingObj.get("height").getAsInt();
+        }
+
+        if (scalingObj.has("stretch_inner")) {
+            stretchInner = scalingObj.get("stretch_inner").getAsBoolean();
+        }
+
+        if (type.equals(GuiTextureProperties.TYPE_NINE_SLICE)) {
+            if (!scalingObj.has("border")) throw new JsonParseException("Gui scaling type 'nine_slice' requires a border property!");
+            JsonElement be = scalingObj.get("border");
             if (be.isJsonPrimitive()) {
                 border = new GuiTextureProperties.Border(be.getAsInt());
             } else if (be.isJsonObject()) {
@@ -37,7 +52,7 @@ public class GuiTexturePropertiesAdapter implements JsonDeserializer<GuiTextureP
             }
         }
 
-        return new GuiTextureProperties(type, width, height, border);
+        return new GuiTextureProperties(type, width, height, border, stretchInner);
     }
 
     @Override
diff --git a/src/main/java/net/minecraft/client/world/WorldClient.java b/src/main/java/net/minecraft/client/world/WorldClient.java
index a3d361827..f48ca5388 100644
--- a/src/main/java/net/minecraft/client/world/WorldClient.java
+++ b/src/main/java/net/minecraft/client/world/WorldClient.java
@@ -79,14 +79,14 @@ public class WorldClient extends World {
         sendQueue.tick();
     }
 
-    public void func_711_c(int i, int j, int k, int l, int i1, int j1)
+    public void removePositionTypesInBounds(int minX, int minY, int minZ, int maxX, int maxY, int maxZ)
     {
-        for(int k1 = 0; k1 < positionTypesList.size(); k1++)
+        for(int i = 0; i < positionTypesList.size(); i++)
         {
-            WorldBlockPositionType worldblockpositiontype = positionTypesList.get(k1);
-            if(worldblockpositiontype.x >= i && worldblockpositiontype.y >= j && worldblockpositiontype.z >= k && worldblockpositiontype.x <= l && worldblockpositiontype.y <= i1 && worldblockpositiontype.z <= j1)
+            WorldBlockPositionType worldblockpositiontype = positionTypesList.get(i);
+            if(worldblockpositiontype.x >= minX && worldblockpositiontype.y >= minY && worldblockpositiontype.z >= minZ && worldblockpositiontype.x <= maxX && worldblockpositiontype.y <= maxY && worldblockpositiontype.z <= maxZ)
             {
-                positionTypesList.remove(k1--);
+                positionTypesList.remove(i--);
             }
         }
 
@@ -111,28 +111,28 @@ public class WorldClient extends World {
     }
 
     @Override
-	public void scheduleBlockUpdate(int i, int j, int k, int l, int i1)
+	public void scheduleBlockUpdate(int x, int y, int z, int id, int delay)
     {
     }
 
     @Override
-	public boolean tickUpdates(boolean flag)
+	public boolean tickUpdates(boolean all)
     {
         return false;
     }
 
-    public void doPreChunk(int i, int j, boolean flag)
+    public void doPreChunk(int chunkX, int chunkZ, boolean playerAdded)
     {
-        if(flag)
+        if(playerAdded)
         {
-            chunkCache.prepareChunk(i, j);
+            chunkCache.prepareChunk(chunkX, chunkZ);
         } else
         {
-            chunkCache.func_539_c(i, j);
+            chunkCache.dropChunk(chunkX, chunkZ);
         }
-        if(!flag)
+        if(!playerAdded)
         {
-            markBlocksDirty(i * 16, 0, j * 16, i * 16 + 15, getHeightBlocks(), j * 16 + 15);
+            markBlocksDirty(chunkX * 16, 0, chunkZ * 16, chunkX * 16 + 15, getHeightBlocks(), chunkZ * 16 + 15);
         }
     }
 
@@ -251,7 +251,7 @@ public class WorldClient extends World {
 
     public boolean blockChange(int x, int y, int z, int id, int meta)
     {
-        func_711_c(x, y, z, x, y, z);
+        removePositionTypesInBounds(x, y, z, x, y, z);
         if(super.setBlockAndMetadata(x, y, z, id, meta))
         {
             notifyBlockChange(x, y, z, id);
@@ -265,7 +265,7 @@ public class WorldClient extends World {
     @Override
 	public void sendQuittingDisconnectingPacket()
     {
-        sendQueue.func_28117_a(new DisconnectPacket("Quitting"));
+        sendQueue.sendFinalPacket(new DisconnectPacket("Quitting"));
     }
 
     @Override
diff --git a/src/main/java/net/minecraft/client/world/chunk/provider/ChunkProviderClient.java b/src/main/java/net/minecraft/client/world/chunk/provider/ChunkProviderClient.java
index 86eaa9f7a..38dc54980 100644
--- a/src/main/java/net/minecraft/client/world/chunk/provider/ChunkProviderClient.java
+++ b/src/main/java/net/minecraft/client/world/chunk/provider/ChunkProviderClient.java
@@ -46,14 +46,14 @@ public class ChunkProviderClient
     {
     }
 
-    public void func_539_c(int i, int j)
+    public void dropChunk(int chunkX, int chunkZ)
     {
-        Chunk chunk = provideChunk(i, j);
+        Chunk chunk = provideChunk(chunkX, chunkZ);
         if(!chunk.isChunkEmpty())
         {
             chunk.onUnload();
         }
-        chunkMapping.remove(new ChunkCoordinate(i, j));
+        chunkMapping.remove(new ChunkCoordinate(chunkX, chunkZ));
         chunks.remove(chunk);
     }
 
diff --git a/src/main/java/net/minecraft/core/NextTickListEntry.java b/src/main/java/net/minecraft/core/NextTickListEntry.java
index 997d58af5..58a8b6c2b 100644
--- a/src/main/java/net/minecraft/core/NextTickListEntry.java
+++ b/src/main/java/net/minecraft/core/NextTickListEntry.java
@@ -10,11 +10,11 @@ public class NextTickListEntry
     public int z;
     public int blockId;
     public long delay;
-    private long c;
+    private final long entryId;
 
     public NextTickListEntry(int x, int y, int z, int blockId)
     {
-        c = counter++;
+        entryId = counter++;
         this.x = x;
         this.y = y;
         this.z = z;
@@ -57,10 +57,10 @@ public class NextTickListEntry
         {
             return 1;
         }
-        if(c < other.c)
+        if(entryId < other.entryId)
         {
             return -1;
         }
-        return c <= other.c ? 0 : 1;
+        return entryId <= other.entryId ? 0 : 1;
     }
 }
diff --git a/src/main/java/net/minecraft/core/achievement/Achievement.java b/src/main/java/net/minecraft/core/achievement/Achievement.java
index 9f4b14e44..c91467efe 100644
--- a/src/main/java/net/minecraft/core/achievement/Achievement.java
+++ b/src/main/java/net/minecraft/core/achievement/Achievement.java
@@ -9,9 +9,9 @@ import net.minecraft.core.util.collection.NamespaceID;
 
 public class Achievement extends Stat
 {
-    public static final Type TYPE_NORMAL = new Type("minecraft:gui/achievement/achievement", 0xffffffff, 0xff808080, false);
-    public static final Type TYPE_SPECIAL = new Type("minecraft:gui/achievement/achievement_special", 0xffffff80, 0xff808040, false);
-    public static final Type TYPE_SECRET = new Type("minecraft:gui/achievement/achievement_secret", 0xff8080ff, 0xff404080, true);
+    public static final Type TYPE_NORMAL = new Type("minecraft:gui/screen/achievement/achievement", 0xffffffff, 0xff808080, false);
+    public static final Type TYPE_SPECIAL = new Type("minecraft:gui/screen/achievement/achievement_special", 0xffffff80, 0xff808040, false);
+    public static final Type TYPE_SECRET = new Type("minecraft:gui/screen/achievement/achievement_secret", 0xff8080ff, 0xff404080, true);
 
     public final int x;
     public final int y;
diff --git a/src/main/java/net/minecraft/core/block/AlgaeBlock.java b/src/main/java/net/minecraft/core/block/AlgaeBlock.java
index 733f29bd5..f068bce4b 100644
--- a/src/main/java/net/minecraft/core/block/AlgaeBlock.java
+++ b/src/main/java/net/minecraft/core/block/AlgaeBlock.java
@@ -6,6 +6,7 @@ import net.minecraft.core.entity.Entity;
 import net.minecraft.core.entity.vehicle.BoatEntity;
 import net.minecraft.core.enums.EnumDropCause;
 import net.minecraft.core.item.ItemStack;
+import net.minecraft.core.world.LevelListener;
 import net.minecraft.core.world.WorldSource;
 import net.minecraft.core.world.World;
 import net.minecraft.core.block.material.Material;
@@ -30,7 +31,7 @@ public class AlgaeBlock extends Block
     {
         if(entity instanceof BoatEntity) {
             int data = world.getBlockMetadata(x, y, z);
-            world.playBlockEvent(null, 2001, x, y, z, id);
+            world.playBlockEvent(null, LevelListener.EVENT_BLOCK_BREAK, x, y, z, id);
             world.setBlockWithNotify(x, y, z, 0);
             this.onBlockRemoved(world, x, y, z, data);
         }
diff --git a/src/main/java/net/minecraft/core/block/AxisAlignedBlock.java b/src/main/java/net/minecraft/core/block/AxisAlignedBlock.java
index fde1697f2..2452f1a51 100644
--- a/src/main/java/net/minecraft/core/block/AxisAlignedBlock.java
+++ b/src/main/java/net/minecraft/core/block/AxisAlignedBlock.java
@@ -15,12 +15,19 @@ public class AxisAlignedBlock extends Block {
 	}
 
 	@Override
-	public void onBlockPlacedByMob(World world, int x, int y, int z, @NotNull Side side, Mob mob, double sideHeight) {
+	public void onBlockPlacedByMob(World world, int x, int y, int z, @NotNull Side side, Mob mob, double xPlaced, double yPlaced) {
 		Axis axis = mob.getPlacementDirection(side, PlacementMode.SIDE).getAxis();
 		
 		world.setBlockMetadataWithNotify(x, y, z, axisToMeta(axis));
 	}
 
+	@Override
+	public void onBlockPlacedOnSide(World world, int x, int y, int z, @NotNull Side side, double xPlaced, double yPlaced) {
+		Axis axis = side.getAxis();
+
+		world.setBlockMetadataWithNotify(x, y, z, axisToMeta(axis));
+	}
+
 	public static int axisToMeta(Axis axis) {
 		if(axis == Axis.X) return 2;
 		if(axis == Axis.Z) return 1;
diff --git a/src/main/java/net/minecraft/core/block/BaseLeavesBlock.java b/src/main/java/net/minecraft/core/block/BaseLeavesBlock.java
index 2da2ab76f..8314568e9 100644
--- a/src/main/java/net/minecraft/core/block/BaseLeavesBlock.java
+++ b/src/main/java/net/minecraft/core/block/BaseLeavesBlock.java
@@ -186,10 +186,10 @@ public abstract class BaseLeavesBlock extends Block
         }
     }
     
-    private void removeLeaves(World world, int i, int j, int k)
+    private void removeLeaves(World world, int x, int y, int z)
     {
-        dropBlockWithCause(world, EnumDropCause.WORLD, i, j, k, world.getBlockMetadata(i, j, k), null, null);
-        world.setBlockWithNotify(i, j, k, 0);
+        dropBlockWithCause(world, EnumDropCause.WORLD, x, y, z, world.getBlockMetadata(x, y, z), null, null);
+        world.setBlockWithNotify(x, y, z, 0);
     }
 
     public static boolean isPermanent(int meta) {
diff --git a/src/main/java/net/minecraft/core/block/BedBlock.java b/src/main/java/net/minecraft/core/block/BedBlock.java
index 0eb62603d..ef326abf5 100644
--- a/src/main/java/net/minecraft/core/block/BedBlock.java
+++ b/src/main/java/net/minecraft/core/block/BedBlock.java
@@ -120,7 +120,7 @@ public class BedBlock extends Block {
 
 	@Override
 	public int getPistonPushReaction(World world, int x, int y, int z) {
-		return 1;
+		return Material.PISTON_DESTROY_ON_PUSH;
 	}
 
 	public static final int MASK_IS_FOOT = 0b0000_1000;
@@ -138,14 +138,14 @@ public class BedBlock extends Block {
 		return meta & MASK_DIRECTION;
 	}
 
-	public static void setBedOccupied(World world, int i, int j, int k, boolean flag) {
-		int l = world.getBlockMetadata(i, j, k);
+	public static void setBedOccupied(World world, int x, int y, int z, boolean flag) {
+		int l = world.getBlockMetadata(x, y, z);
 		if(flag) {
 			l |= MASK_IS_OCCUPIED;
 		} else {
 			l &= ~MASK_IS_OCCUPIED;
 		}
-		world.setBlockMetadataWithNotify(i, j, k, l);
+		world.setBlockMetadataWithNotify(x, y, z, l);
 	}
 
 	public static ChunkCoordinates getNearestEmptyChunkCoordinates(World world, int x, int y, int z, int l) {
diff --git a/src/main/java/net/minecraft/core/block/Block.java b/src/main/java/net/minecraft/core/block/Block.java
index e362db9e7..1a2816ff9 100644
--- a/src/main/java/net/minecraft/core/block/Block.java
+++ b/src/main/java/net/minecraft/core/block/Block.java
@@ -555,7 +555,8 @@ public class Block
     }
 
     public void onActivatorInteract(World world, int x, int y, int z, ActivatorBlockEntity activator, Direction direction) {
-
+    }
+    public void onBlockPlacedByActivator(World world, int x, int y, int z, ActivatorBlockEntity activator, Direction direction) {
     }
 
     public void onEntityWalking(World world, int x, int y, int z, Entity entity)
@@ -681,7 +682,11 @@ public class Block
         return true;
     }
 
-    public void onBlockPlacedByMob(World world, int x, int y, int z, @NotNull Side side, Mob mob, double sideHeight) {
+    public void onBlockPlacedByMob(World world, int x, int y, int z, @NotNull Side side, Mob mob, double xPlaced, double yPlaced) {
+        onBlockPlacedOnSide(world, x, y, z, side, xPlaced, yPlaced);
+    }
+
+    public void onBlockPlacedOnSide(World world, int x, int y, int z, @NotNull Side side, double xPlaced, double yPlaced) {
 
     }
 
diff --git a/src/main/java/net/minecraft/core/block/Blocks.java b/src/main/java/net/minecraft/core/block/Blocks.java
index 353dacc8c..1b9dd2b76 100644
--- a/src/main/java/net/minecraft/core/block/Blocks.java
+++ b/src/main/java/net/minecraft/core/block/Blocks.java
@@ -1208,7 +1208,7 @@ public final class Blocks {
             .withTags(BlockTags.MINEABLE_BY_PICKAXE, BlockTags.CHAINLINK_FENCES_CONNECT, BlockTags.CAN_HANG_OFF);
         FENCE_PAPER_WALL = new PaperWallFenceBlock("fence.paper_wall", "minecraft:block/fence_paper_wall", 891, Material.cloth).withSound(BlockSounds.CLOTH).withHardness(0.5F)
             .withTags(BlockTags.MINEABLE_BY_SHEARS, BlockTags.FENCES_CONNECT, BlockTags.CAN_HANG_OFF, BlockTags.MINEABLE_BY_AXE);
-        FENCE_STEEL = new SteelFenceBlock("fence.steel", "minecraft:block/fence_steel", 892, Material.metal).withSound(BlockSounds.METAL).withHardness(8F)
+        FENCE_STEEL = new SteelFenceBlock("fence.steel", "minecraft:block/fence_steel", 892, Material.metal).withSound(BlockSounds.METAL).withHardness(8F).withBlastResistance(2000F)
             .withTags(BlockTags.MINEABLE_BY_PICKAXE, BlockTags.CHAINLINK_FENCES_CONNECT, BlockTags.CAN_HANG_OFF);
 
         BASKET = new BasketBlock("basket", "minecraft:block/basket", 900, Material.cloth).withSound(BlockSounds.CLOTH).withHardness(0.5F).withOverrideColor(MaterialColor.wood).setStatParent(() -> Items.BASKET)
diff --git a/src/main/java/net/minecraft/core/block/ButtonBlock.java b/src/main/java/net/minecraft/core/block/ButtonBlock.java
index c6d345cb4..6d0d00b53 100644
--- a/src/main/java/net/minecraft/core/block/ButtonBlock.java
+++ b/src/main/java/net/minecraft/core/block/ButtonBlock.java
@@ -2,7 +2,6 @@ package net.minecraft.core.block;
 
 import net.minecraft.core.block.entity.ActivatorBlockEntity;
 import net.minecraft.core.block.material.Material;
-import net.minecraft.core.entity.Mob;
 import net.minecraft.core.entity.player.Player;
 import net.minecraft.core.enums.EnumDropCause;
 import net.minecraft.core.item.Item;
@@ -24,6 +23,14 @@ import java.util.Random;
 
 public class ButtonBlock extends Block
 {
+    public static final int MASK_POWERED = 0b0000_1000;
+    public static final int MASK_DIRECTION = 0b0000_0111;
+    public static final int SIDE_WEST = 1;
+    public static final int SIDE_EAST = 2;
+    public static final int SIDE_NORTH = 3;
+    public static final int SIDE_SOUTH = 4;
+    public static final int SIDE_TOP = 5;
+    public static final int SIDE_BOTTOM = 6;
 
 	public ButtonBlock(String key, String namespaceId, int id)
     {
@@ -86,115 +93,115 @@ public class ButtonBlock extends Block
         }
         return world.isBlockNormalCube(x, y, z + 1);
     }
-    
+
     @Override
-    public void onBlockPlacedByMob(World world, int x, int y, int z, @NotNull Side side, Mob mob, double sideHeight) {
-        int i1 = world.getBlockMetadata(x, y, z);
-        int j1 = i1 & 8;
-        i1 &= 7;
-        if(side == Side.BOTTOM && world.isBlockNormalCube(x, y + 1, z)) {
-            i1 = 5;
-        } else if(side == Side.TOP && world.isBlockNormalCube(x, y - 1, z)) {
-            i1 = 6;
-        } else if(side == Side.NORTH && world.isBlockNormalCube(x, y, z + 1)) {
-            i1 = 4;
-        } else if(side == Side.SOUTH && world.isBlockNormalCube(x, y, z - 1)) {
-            i1 = 3;
-        } else if(side == Side.WEST && world.isBlockNormalCube(x + 1, y, z)) {
-            i1 = 2;
-        } else if(side == Side.EAST && world.isBlockNormalCube(x - 1, y, z)) {
-            i1 = 1;
-        } else {
-            i1 = getOrientation(world, x, y, z);
+    public void onBlockPlacedOnSide(World world, int x, int y, int z, @NotNull Side side, double xPlaced, double yPlaced) {
+        int orientation = -1;
+        switch (side) {
+            case BOTTOM:
+                if (world.isBlockNormalCube(x, y + 1, z)) {
+                    orientation = SIDE_TOP;
+                }
+                break;
+            case TOP:
+                if (world.isBlockNormalCube(x, y - 1, z)) {
+                    orientation = SIDE_BOTTOM;
+                }
+                break;
+            case NORTH:
+                if (world.isBlockNormalCube(x, y, z + 1)) {
+                    orientation = SIDE_SOUTH;
+                }
+                break;
+            case SOUTH:
+                if (world.isBlockNormalCube(x, y, z - 1)) {
+                    orientation = SIDE_NORTH;
+                }
+                break;
+            case WEST:
+                if (world.isBlockNormalCube(x + 1, y, z)) {
+                    orientation = SIDE_EAST;
+                }
+                break;
+            case EAST:
+                if (world.isBlockNormalCube(x - 1, y, z)) {
+                    orientation = SIDE_EAST;
+                }
+                break;
+        }
+        if (orientation == -1) {
+            orientation = getOrientation(world, x, y, z);
         }
-        world.setBlockMetadataWithNotify(x, y, z, i1 + j1);
+        int meta = world.getBlockMetadata(x, y, z);
+        world.setBlockMetadataWithNotify(x, y, z, (meta & ~MASK_DIRECTION) | orientation);
     }
-    
+
     private int getOrientation(World world, int x, int y, int z)
     {
         if(world.isBlockNormalCube(x - 1, y, z))
         {
-            return 1;
+            return SIDE_WEST;
         }
         if(world.isBlockNormalCube(x + 1, y, z))
         {
-            return 2;
+            return SIDE_EAST;
         }
         if(world.isBlockNormalCube(x, y, z - 1))
         {
-            return 3;
+            return SIDE_NORTH;
         }
         if (world.isBlockNormalCube(x, y, z + 1)){
-            return 4;
+            return SIDE_SOUTH;
         }
         if (world.isBlockNormalCube(x, y + 1, z)){
-            return 5;
+            return SIDE_TOP;
         }
         if (world.isBlockNormalCube(x, y - 1, z)){
-            return 6;
+            return SIDE_BOTTOM;
         }
-        return 1;
+        return SIDE_WEST;
     }
 
     @Override
 	public void onNeighborBlockChange(World world, int x, int y, int z, int blockId)
     {
-        if(canButtonStay(world, x, y, z))
-        {
-            int i1 = world.getBlockMetadata(x, y, z) & 7;
-            boolean flag = false;
-            if(!world.isBlockNormalCube(x - 1, y, z) && i1 == 1)
-            {
-                flag = true;
-            }
-            if(!world.isBlockNormalCube(x + 1, y, z) && i1 == 2)
-            {
-                flag = true;
-            }
-            if(!world.isBlockNormalCube(x, y, z - 1) && i1 == 3)
-            {
-                flag = true;
-            }
-            if(!world.isBlockNormalCube(x, y, z + 1) && i1 == 4)
-            {
-                flag = true;
-            }
-            if(!world.isBlockNormalCube(x, y + 1, z) && i1 == 5)
-            {
-                flag = true;
-            }
-            if(!world.isBlockNormalCube(x, y - 1, z) && i1 == 6)
-            {
-                flag = true;
-            }
-            if(flag)
-            {
-                dropBlockWithCause(world, EnumDropCause.WORLD, x, y, z, i1, null, null);
-                world.setBlockWithNotify(x, y, z, 0);
-            }
+        boolean invalid;
+        int side = world.getBlockMetadata(x, y, z) & MASK_DIRECTION;
+        switch (side) {
+            case SIDE_WEST:
+                invalid = !world.isBlockNormalCube(x - 1, y, z);
+                break;
+            case SIDE_EAST:
+                invalid = !world.isBlockNormalCube(x + 1, y, z);
+                break;
+            case SIDE_NORTH:
+                invalid = !world.isBlockNormalCube(x, y, z - 1);
+                break;
+            case SIDE_SOUTH:
+                invalid = !world.isBlockNormalCube(x, y, z + 1);
+                break;
+            case SIDE_TOP:
+                invalid = !world.isBlockNormalCube(x, y + 1, z);
+                break;
+            case SIDE_BOTTOM:
+                invalid = !world.isBlockNormalCube(x, y - 1, z);
+                break;
+            default:
+                invalid = true;
         }
-    }
-
-    private boolean canButtonStay(World world, int x, int y, int z)
-    {
-        if(!canPlaceBlockAt(world, x, y, z))
+        if(invalid)
         {
-            dropBlockWithCause(world, EnumDropCause.WORLD, x, y, z, world.getBlockMetadata(x, y, z), null, null);
+            dropBlockWithCause(world, EnumDropCause.WORLD, x, y, z, side, null, null);
             world.setBlockWithNotify(x, y, z, 0);
-            return false;
-        }
-        else
-        {
-            return true;
         }
     }
 
     @Override
     public void setBlockBoundsBasedOnState(WorldSource world, int x, int y, int z)
     {
-        int l = world.getBlockMetadata(x, y, z);
-        int i1 = l & 7;
-        boolean flag = (l & 8) > 0;
+        int meta = world.getBlockMetadata(x, y, z);
+        int direction = meta & MASK_DIRECTION;
+        boolean flag = (meta & MASK_POWERED) != 0;
         float f = 0.375F;
         float f1 = 0.625F;
         float f2 = 0.1875F;
@@ -203,18 +210,25 @@ public class ButtonBlock extends Block
         {
             f3 = 0.0625F;
         }
-        if(i1 == 1) {
-            setBlockBounds(0.0F, f, 0.5F - f2, f3, f1, 0.5F + f2);
-        } else if(i1 == 2) {
-            setBlockBounds(1.0F - f3, f, 0.5F - f2, 1.0F, f1, 0.5F + f2);
-        } else if(i1 == 3) {
-            setBlockBounds(0.5F - f2, f, 0.0F, 0.5F + f2, f1, f3);
-        } else if(i1 == 4) {
-            setBlockBounds(0.5F - f2, f, 1.0F - f3, 0.5F + f2, f1, 1.0F);
-        } else if(i1 == 5) { // Top
-            setBlockBounds(0.5f - f2, 1 - f3, f, 0.5f + f2, 1.0, f1);
-        } else if(i1 == 6) { // Bottom
-            setBlockBounds(0.5f - f2, 0, f, 0.5f + f2, f3, f1);
+        switch (direction) {
+            case SIDE_WEST:
+                setBlockBounds(0.0F, f, 0.5F - f2, f3, f1, 0.5F + f2);
+                break;
+            case SIDE_EAST:
+                setBlockBounds(1.0F - f3, f, 0.5F - f2, 1.0F, f1, 0.5F + f2);
+                break;
+            case SIDE_NORTH:
+                setBlockBounds(0.5F - f2, f, 0.0F, 0.5F + f2, f1, f3);
+                break;
+            case SIDE_SOUTH:
+                setBlockBounds(0.5F - f2, f, 1.0F - f3, 0.5F + f2, f1, 1.0F);
+                break;
+            case SIDE_TOP:
+                setBlockBounds(0.5f - f2, 1 - f3, f, 0.5f + f2, 1.0, f1);
+                break;
+            case SIDE_BOTTOM:
+                setBlockBounds(0.5f - f2, 0, f, 0.5f + f2, f3, f1);
+                break;
         }
     }
 
@@ -233,29 +247,36 @@ public class ButtonBlock extends Block
     }
 
     public boolean press(World world, int x, int y, int z, @Nullable Player player) {
-        int l = world.getBlockMetadata(x, y, z);
-        int i1 = l & 7;
-        int j1 = 8 - (l & 8);
-        if(j1 == 0)
+        int meta = world.getBlockMetadata(x, y, z);
+        int direction = meta & MASK_DIRECTION;
+        boolean isPowered = (meta & MASK_POWERED) != 0;
+        if(isPowered)
         {
             return true;
         }
-        world.setBlockMetadataWithNotify(x, y, z, i1 + j1);
+        world.setBlockMetadataWithNotify(x, y, z, direction | MASK_POWERED);
         world.markBlocksDirty(x, y, z, x, y, z);
         world.playSoundEffect(player, SoundCategory.WORLD_SOUNDS, (double) x + 0.5D, (double) y + 0.5D, (double) z + 0.5D, "random.click", 0.3F, 0.6F);
         world.notifyBlocksOfNeighborChange(x, y, z, id);
-        if(i1 == 1) {
-            world.notifyBlocksOfNeighborChange(x - 1, y, z, id);
-        } else if(i1 == 2) {
-            world.notifyBlocksOfNeighborChange(x + 1, y, z, id);
-        } else if(i1 == 3) {
-            world.notifyBlocksOfNeighborChange(x, y, z - 1, id);
-        } else if(i1 == 4) {
-            world.notifyBlocksOfNeighborChange(x, y, z + 1, id);
-        } else if(i1 == 5) {
-            world.notifyBlocksOfNeighborChange(x, y + 1, z, id);
-        } else {
-            world.notifyBlocksOfNeighborChange(x, y - 1, z, id);
+        switch (direction) {
+            case SIDE_WEST:
+                world.notifyBlocksOfNeighborChange(x - 1, y, z, id);
+                break;
+            case SIDE_EAST:
+                world.notifyBlocksOfNeighborChange(x + 1, y, z, id);
+                break;
+            case SIDE_NORTH:
+                world.notifyBlocksOfNeighborChange(x, y, z - 1, id);
+                break;
+            case SIDE_SOUTH:
+                world.notifyBlocksOfNeighborChange(x, y, z + 1, id);
+                break;
+            case SIDE_TOP:
+                world.notifyBlocksOfNeighborChange(x, y + 1, z, id);
+                break;
+            case SIDE_BOTTOM:
+                world.notifyBlocksOfNeighborChange(x, y - 1, z, id);
+                break;
         }
         world.scheduleBlockUpdate(x, y, z, id, tickDelay());
         return true;
@@ -269,22 +290,29 @@ public class ButtonBlock extends Block
     @Override
     public void onBlockRemoved(World world, int x, int y, int z, int data)
     {
-        if((data & 8) > 0)
+        if((data & MASK_POWERED) != 0)
         {
             world.notifyBlocksOfNeighborChange(x, y, z, id);
-            int i1 = data & 7;
-            if(i1 == 1) {
-                world.notifyBlocksOfNeighborChange(x - 1, y, z, id);
-            } else if(i1 == 2) {
-                world.notifyBlocksOfNeighborChange(x + 1, y, z, id);
-            } else if(i1 == 3) {
-                world.notifyBlocksOfNeighborChange(x, y, z - 1, id);
-            } else if(i1 == 4) {
-                world.notifyBlocksOfNeighborChange(x, y, z + 1, id);
-            } else if(i1 == 5) {
-                world.notifyBlocksOfNeighborChange(x, y + 1, z, id);
-            } else {
-                world.notifyBlocksOfNeighborChange(x, y - 1, z, id);
+            int direction = data & MASK_DIRECTION;
+            switch (direction) {
+                case SIDE_WEST:
+                    world.notifyBlocksOfNeighborChange(x - 1, y, z, id);
+                    break;
+                case SIDE_EAST:
+                    world.notifyBlocksOfNeighborChange(x + 1, y, z, id);
+                    break;
+                case SIDE_NORTH:
+                    world.notifyBlocksOfNeighborChange(x, y, z - 1, id);
+                    break;
+                case SIDE_SOUTH:
+                    world.notifyBlocksOfNeighborChange(x, y, z + 1, id);
+                    break;
+                case SIDE_TOP:
+                    world.notifyBlocksOfNeighborChange(x, y + 1, z, id);
+                    break;
+                case SIDE_BOTTOM:
+                    world.notifyBlocksOfNeighborChange(x, y - 1, z, id);
+                    break;
             }
         }
         super.onBlockRemoved(world, x, y, z, data);
@@ -293,33 +321,32 @@ public class ButtonBlock extends Block
     @Override
     public boolean getSignal(WorldSource worldSource, int x, int y, int z, Side side)
     {
-        return (worldSource.getBlockMetadata(x, y, z) & 8) > 0;
+        return (worldSource.getBlockMetadata(x, y, z) & MASK_POWERED) != 0;
     }
 
     @Override
     public boolean getDirectSignal(World world, int x, int y, int z, Side side)
     {
         int meta = world.getBlockMetadata(x, y, z);
-        if((meta & 8) == 0) {
+        if((meta & MASK_POWERED) == 0) {
             return false;
         }
-        int direction = meta & 7;
-        if(direction == 6 && side == Side.TOP) {
-            return true;
-        }
-        if(direction == 5 && side == Side.BOTTOM) {
-            return true;
-        }
-        if(direction == 4 && side == Side.NORTH) {
-            return true;
+        int direction = meta & MASK_DIRECTION;
+        switch (direction) {
+            case SIDE_WEST:
+                return side == Side.EAST;
+            case SIDE_EAST:
+                return side == Side.WEST;
+            case SIDE_NORTH:
+                return side == Side.SOUTH;
+            case SIDE_SOUTH:
+                return side == Side.NORTH;
+            case SIDE_TOP:
+                return side == Side.BOTTOM;
+            case SIDE_BOTTOM:
+                return side == Side.TOP;
         }
-        if(direction == 3 && side == Side.SOUTH) {
-            return true;
-        }
-        if(direction == 2 && side == Side.WEST) {
-            return true;
-        }
-        return direction == 1 && side == Side.EAST;
+        return false;
     }
 
     @Override
@@ -335,26 +362,33 @@ public class ButtonBlock extends Block
         {
             return;
         }
-        int l = world.getBlockMetadata(x, y, z);
-        if((l & 8) == 0)
+        int meta = world.getBlockMetadata(x, y, z);
+        if((meta & MASK_POWERED) == 0)
         {
             return;
         }
-        world.setBlockMetadataWithNotify(x, y, z, l & 7);
+        world.setBlockMetadataWithNotify(x, y, z, meta & ~MASK_POWERED);
         world.notifyBlocksOfNeighborChange(x, y, z, id);
-        int i1 = l & 7;
-        if(i1 == 1) {
-            world.notifyBlocksOfNeighborChange(x - 1, y, z, id);
-        } else if(i1 == 2) {
-            world.notifyBlocksOfNeighborChange(x + 1, y, z, id);
-        } else if(i1 == 3) {
-            world.notifyBlocksOfNeighborChange(x, y, z - 1, id);
-        } else if(i1 == 4) {
-            world.notifyBlocksOfNeighborChange(x, y, z + 1, id);
-        } else if(i1 == 5) {
-            world.notifyBlocksOfNeighborChange(x, y + 1, z, id);
-        } else {
-            world.notifyBlocksOfNeighborChange(x, y - 1, z, id);
+        int direction = meta & MASK_DIRECTION;
+        switch (direction) {
+            case SIDE_WEST:
+                world.notifyBlocksOfNeighborChange(x - 1, y, z, id);
+                break;
+            case SIDE_EAST:
+                world.notifyBlocksOfNeighborChange(x + 1, y, z, id);
+                break;
+            case SIDE_NORTH:
+                world.notifyBlocksOfNeighborChange(x, y, z - 1, id);
+                break;
+            case SIDE_SOUTH:
+                world.notifyBlocksOfNeighborChange(x, y, z + 1, id);
+                break;
+            case SIDE_TOP:
+                world.notifyBlocksOfNeighborChange(x, y + 1, z, id);
+                break;
+            case SIDE_BOTTOM:
+                world.notifyBlocksOfNeighborChange(x, y - 1, z, id);
+                break;
         }
 
         world.playSoundEffect(null, SoundCategory.WORLD_SOUNDS, (double) x + 0.5D, (double) y + 0.5D, (double) z + 0.5D, "random.click", 0.3F, 0.5F);
diff --git a/src/main/java/net/minecraft/core/block/CacaoLeavesBlock.java b/src/main/java/net/minecraft/core/block/CacaoLeavesBlock.java
index 0f231c41a..6917f4f25 100644
--- a/src/main/java/net/minecraft/core/block/CacaoLeavesBlock.java
+++ b/src/main/java/net/minecraft/core/block/CacaoLeavesBlock.java
@@ -9,6 +9,7 @@ import net.minecraft.core.item.IBonemealable;
 import net.minecraft.core.item.Items;
 import net.minecraft.core.item.ItemStack;
 import net.minecraft.core.util.helper.Direction;
+import net.minecraft.core.util.helper.DyeColor;
 import net.minecraft.core.util.helper.MathHelper;
 import net.minecraft.core.util.helper.Side;
 import net.minecraft.core.world.World;
@@ -19,6 +20,8 @@ import java.util.Random;
 
 public class CacaoLeavesBlock extends BaseLeavesBlock implements IBonemealable {
 
+    public static final int MASK_GROWTH_DATA = 0b1111_0000;
+    public static final int MAX_GROWTH_STATE = 4;
     static final int BEAN_GROWTH_RATE = 50;
     public CacaoLeavesBlock(String key, String namespaceId, int id) {
         super(key, namespaceId, id, Material.leaves);
@@ -39,12 +42,12 @@ public class CacaoLeavesBlock extends BaseLeavesBlock implements IBonemealable {
     @Override
     public ItemStack[] getBreakResult(World world, EnumDropCause dropCause, int meta, BlockEntity blockEntity)
     {
-        int growthRate = (meta & 0xF0) >> 4;
         if (dropCause == EnumDropCause.PICK_BLOCK || dropCause == EnumDropCause.SILK_TOUCH) return new ItemStack[] { new ItemStack(this) };
 
+        int growthRate = getGrowthRate(meta);
         if (growthRate > 1)
         {
-            return new ItemStack[] { new ItemStack(Items.DYE, MathHelper.floor((double) growthRate / 2), 3)};
+            return new ItemStack[] { new ItemStack(Items.DYE, MathHelper.ceil((double) growthRate / 2), DyeColor.BROWN.itemMeta)};
         }
 
         return super.getBreakResult(world, dropCause, meta, blockEntity);
@@ -63,16 +66,17 @@ public class CacaoLeavesBlock extends BaseLeavesBlock implements IBonemealable {
 
     public boolean harvest(World world, int x, int y, int z, @Nullable Player player) {
         int meta = world.getBlockMetadata(x, y, z);
-        int decayData = meta & 0x0F;
-        int growthRate = (meta & 0xF0) >> 4;
-        if((growthRate) > 0)
+        int growthRate = getGrowthRate(meta);
+        if(growthRate > 0)
         {
-            world.playSoundAtEntity(player, player, "random.pop", 0.2F, 0.5f);
+            if (player != null) {
+                world.playSoundAtEntity(player, player, "random.pop", 0.2F, 0.5f);
+            }
             if(!world.isClientSide)
             {
                 dropBlockWithCause(world, EnumDropCause.WORLD, x, y, z, meta, null, null);
             }
-            world.setBlockMetadataWithNotify(x, y, z, decayData);
+            world.setBlockMetadataWithNotify(x, y, z, setGrowthRate(meta, 0));
             world.scheduleBlockUpdate(x, y, z, Blocks.LEAVES_CACAO.id, tickDelay());
             return true;
         }
@@ -88,18 +92,18 @@ public class CacaoLeavesBlock extends BaseLeavesBlock implements IBonemealable {
     public void updateTick(World world, int x, int y, int z, Random rand) {
         super.updateTick(world, x, y, z, rand);
         int meta = world.getBlockMetadata(x, y, z);
-        int growthRate = (meta & 0XF0) >> 4;
+        int growthRate = getGrowthRate(meta);
         if (rand.nextInt(BEAN_GROWTH_RATE) == 0) {
             if (world.getSeasonManager().getCurrentSeason() == Seasons.OVERWORLD_SUMMER) {
                 if (canBeansGrow(world, x, y, z)) {
-                    if ((growthRate) < 4) {
-                        world.setBlockMetadataWithNotify(x, y, z, (++growthRate) << 4 | meta);
+                    if (growthRate < MAX_GROWTH_STATE) {
+                        world.setBlockMetadataWithNotify(x, y, z, setGrowthRate(meta, ++growthRate));
                         world.scheduleBlockUpdate(x, y, z, Blocks.LEAVES_CACAO.id, tickDelay());
                     }
                 }
             }
             else if(growthRate > 0){
-                world.setBlockMetadataWithNotify(x, y, z, meta & 0X0F);
+                world.setBlockMetadataWithNotify(x, y, z, setGrowthRate(meta, 0));
                 world.scheduleBlockUpdate(x, y, z, Blocks.LEAVES_CACAO.id, tickDelay());
             }
         }
@@ -113,13 +117,13 @@ public class CacaoLeavesBlock extends BaseLeavesBlock implements IBonemealable {
     @Override
     public boolean onBonemealUsed(ItemStack itemstack, @Nullable Player player, World world, int blockX, int blockY, int blockZ, Side side, double xPlaced, double yPlaced) {
         int meta = world.getBlockMetadata(blockX, blockY, blockZ);
-        if(((meta & 0xF0) >> 4) < 4)
+        if(getGrowthRate(meta) < MAX_GROWTH_STATE)
         {
             if(!world.isClientSide)
             {
                 if(world.getSeasonManager().getCurrentSeason() != Seasons.OVERWORLD_SUMMER)
                     return true;
-                world.setBlockMetadataWithNotify(blockX, blockY, blockZ, (4 << 4) | meta);
+                world.setBlockMetadataWithNotify(blockX, blockY, blockZ, setGrowthRate(meta, MAX_GROWTH_STATE));
                 if (player == null || player.getGamemode().consumeBlocks())
                 {
                     itemstack.stackSize--;
@@ -129,4 +133,12 @@ public class CacaoLeavesBlock extends BaseLeavesBlock implements IBonemealable {
         }
         return false;
     }
+
+    public static int getGrowthRate(int meta) {
+        return (meta & MASK_GROWTH_DATA) >> 4;
+    }
+
+    public static int setGrowthRate(int meta, int growthRate) {
+        return (meta & ~MASK_GROWTH_DATA) | (growthRate << 4) & MASK_GROWTH_DATA;
+    }
 }
diff --git a/src/main/java/net/minecraft/core/block/ChestBlock.java b/src/main/java/net/minecraft/core/block/ChestBlock.java
index 9c866fa9e..62dcfcfe2 100644
--- a/src/main/java/net/minecraft/core/block/ChestBlock.java
+++ b/src/main/java/net/minecraft/core/block/ChestBlock.java
@@ -22,10 +22,10 @@ public class ChestBlock extends EntityBlock implements IPaintable {
 	}
 	
 	@Override
-	public void onBlockPlacedByMob(World world, int x, int y, int z, @NotNull Side placeSide, Mob mob, double sideHeight) {
+	public void onBlockPlacedByMob(World world, int x, int y, int z, @NotNull Side placeSide, Mob mob, double xPlaced, double yPlaced) {
 		Direction direction = mob.getHorizontalPlacementDirection(placeSide).getOpposite();
 		Type type = Type.SINGLE;
-		
+
 		if(mob.isSneaking() && placeSide.isHorizontal() && (mob.rotationLockHorizontal == null || mob.rotationLockHorizontal == Direction.NONE)) {
 			int placedOnX = x;
 			int placedOnZ = z;
@@ -33,7 +33,7 @@ public class ChestBlock extends EntityBlock implements IPaintable {
 			if(placeSide == Side.SOUTH) placedOnZ--;
 			if(placeSide == Side.EAST) placedOnX--;
 			if(placeSide == Side.WEST) placedOnX++;
-			
+
 			if(isSingleChest(world, placedOnX, y, placedOnZ)) {
 				Direction direction2 = getDirectionFromMeta(world.getBlockMetadata(placedOnX, y, placedOnZ));
 				if(direction2 == Direction.NORTH) {
@@ -127,14 +127,67 @@ public class ChestBlock extends EntityBlock implements IPaintable {
 				}
 			}
 		}
-		
+
 		int meta = world.getBlockMetadata(x, y, z);
 		meta = getMetaWithDirection(meta, direction);
 		meta = getMetaWithType(meta, type);
-		
+
 		world.setBlockMetadata(x, y, z, meta);
 	}
-	
+
+	@Override
+	public void onBlockPlacedOnSide(World world, int x, int y, int z, @NotNull Side side, double xPlaced, double yPlaced) {
+		Direction direction = side.getOpposite().getDirection();
+		Type type = Type.SINGLE;
+
+        if (direction == Direction.NORTH) {
+            if (isSingleChestWithDirection(world, x - 1, y, z, direction) && !isSingleChestWithDirection(world, x + 1, y, z, direction)) {
+                type = Type.LEFT;
+                setType(world, x - 1, y, z, Type.RIGHT);
+            }
+            if (isSingleChestWithDirection(world, x + 1, y, z, direction) && !isSingleChestWithDirection(world, x - 1, y, z, direction)) {
+                type = Type.RIGHT;
+                setType(world, x + 1, y, z, Type.LEFT);
+            }
+        }
+        if(direction == Direction.EAST) {
+            if(isSingleChestWithDirection(world, x, y, z - 1, direction) && !isSingleChestWithDirection(world, x, y, z + 1, direction)) {
+                type = Type.LEFT;
+                setType(world, x, y, z - 1, Type.RIGHT);
+            }
+            if(isSingleChestWithDirection(world, x, y, z + 1, direction) && !isSingleChestWithDirection(world, x, y, z - 1, direction)) {
+                type = Type.RIGHT;
+                setType(world, x, y, z + 1, Type.LEFT);
+            }
+        }
+        if(direction == Direction.SOUTH) {
+            if(isSingleChestWithDirection(world, x - 1, y, z, direction) && !isSingleChestWithDirection(world, x + 1, y, z, direction)) {
+                type = Type.RIGHT;
+                setType(world, x - 1, y, z, Type.LEFT);
+            }
+            if(isSingleChestWithDirection(world, x + 1, y, z, direction) && !isSingleChestWithDirection(world, x - 1, y, z, direction)) {
+                type = Type.LEFT;
+                setType(world, x + 1, y, z, Type.RIGHT);
+            }
+        }
+        if(direction == Direction.WEST) {
+            if(isSingleChestWithDirection(world, x, y, z - 1, direction) && !isSingleChestWithDirection(world, x, y, z + 1, direction)) {
+                type = Type.RIGHT;
+                setType(world, x, y, z - 1, Type.LEFT);
+            }
+            if(isSingleChestWithDirection(world, x, y, z + 1, direction) && !isSingleChestWithDirection(world, x, y, z - 1, direction)) {
+                type = Type.LEFT;
+                setType(world, x, y, z + 1, Type.RIGHT);
+            }
+        }
+
+        int meta = world.getBlockMetadata(x, y, z);
+		meta = getMetaWithDirection(meta, direction);
+		meta = getMetaWithType(meta, type);
+
+		world.setBlockMetadata(x, y, z, meta);
+	}
+
 	public void checkIfOtherHalfExists(World world, int x, int y, int z) {
 		int meta = world.getBlockMetadata(x, y, z);
 		Type type = getTypeFromMeta(meta);
diff --git a/src/main/java/net/minecraft/core/block/CropsWheatBlock.java b/src/main/java/net/minecraft/core/block/CropsWheatBlock.java
index 2edf0870f..ee1167de8 100644
--- a/src/main/java/net/minecraft/core/block/CropsWheatBlock.java
+++ b/src/main/java/net/minecraft/core/block/CropsWheatBlock.java
@@ -13,12 +13,10 @@ import net.minecraft.core.util.helper.Side;
 import net.minecraft.core.world.World;
 import org.jetbrains.annotations.Nullable;
 
-// Referenced classes of package net.minecraft.src:
-//            FlowerBlock, Block, World, ItemEntity,
-//            ItemStack, Item
-
 public class CropsWheatBlock extends FlowerBlock implements IBonemealable
 {
+    public static final int MASK_GROWTH = 0b0000_0111;
+    public static final int MAX_GROWTH_STATE = 7;
 	public CropsWheatBlock(String key, String namespaceId, int id)
     {
         super(key, namespaceId, id);
@@ -40,7 +38,7 @@ public class CropsWheatBlock extends FlowerBlock implements IBonemealable
         if(world.getBlockLightValue(x, y + 1, z) >= 9)
         {
             int l = world.getBlockMetadata(x, y, z);
-            if(l < 7)
+            if(l < MAX_GROWTH_STATE)
             {
                 float f = getGrowthRate(world, x, y, z);
                 if(rand.nextInt((int)(100F / f)) == 0)
@@ -52,9 +50,9 @@ public class CropsWheatBlock extends FlowerBlock implements IBonemealable
         }
     }
 
-    public void fertilize(World world, int i, int j, int k)
+    public void fertilize(World world, int x, int y, int z)
     {
-        world.setBlockMetadataWithNotify(i, j, k, 7);
+        world.setBlockMetadataWithNotify(x, y, z, MAX_GROWTH_STATE);
     }
 
     private float getGrowthRate(World world, int x, int y, int z)
@@ -124,7 +122,7 @@ public class CropsWheatBlock extends FlowerBlock implements IBonemealable
     @Override
     public ItemStack[] getBreakResult(World world, EnumDropCause dropCause, int meta, BlockEntity blockEntity)
     {
-        if (meta != 7)
+        if (meta != MAX_GROWTH_STATE)
         {
             return new ItemStack[] { new ItemStack(Items.SEEDS_WHEAT) };
         }
@@ -136,7 +134,7 @@ public class CropsWheatBlock extends FlowerBlock implements IBonemealable
 
     @Override
     public boolean onBonemealUsed(ItemStack itemstack, @Nullable Player player, World world, int blockX, int blockY, int blockZ, Side side, double xPlaced, double yPlaced) {
-        if(world.getBlockMetadata(blockX, blockY, blockZ) < 7)
+        if(world.getBlockMetadata(blockX, blockY, blockZ) < MAX_GROWTH_STATE)
         {
             if(!world.isClientSide)
             {
diff --git a/src/main/java/net/minecraft/core/block/DetectorRailBlock.java b/src/main/java/net/minecraft/core/block/DetectorRailBlock.java
index 37efefec6..4ca99be28 100644
--- a/src/main/java/net/minecraft/core/block/DetectorRailBlock.java
+++ b/src/main/java/net/minecraft/core/block/DetectorRailBlock.java
@@ -45,26 +45,26 @@ public class DetectorRailBlock extends RailBlock {
             return;
         }
         int meta = world.getBlockMetadata(x, y, z);
-        if ((meta & 8) != 0) { // If powered
+        if ((meta & MASK_POWERED) != 0) { // If powered
             checkForMinecart(world, x, y, z, meta);
         }
     }
 
     @Override
     public boolean getSignal(WorldSource worldSource, int x, int y, int z, Side side) {
-        return (worldSource.getBlockMetadata(x, y, z) & 0b1000) != 0;
+        return (worldSource.getBlockMetadata(x, y, z) & MASK_POWERED) != 0;
     }
 
     @Override
     public boolean getDirectSignal(World world, int x, int y, int z, Side side) {
-        if((world.getBlockMetadata(x, y, z) & 0b1000) == 0) {
+        if((world.getBlockMetadata(x, y, z) & MASK_POWERED) == 0) {
             return false;
         } else {
             return side == Side.TOP;
         }
     }
     private void checkForMinecart(World world, int x, int y, int z, int meta) {
-        boolean isPowered = (meta & 0b1000) != 0;
+        boolean isPowered = (meta & MASK_POWERED) != 0;
         boolean minecartPresent = false;
         float offset = 0.125f;
         List<Entity> list = world.getEntitiesWithinAABB(MinecartEntity.class, AABB.getTemporaryBB(x + offset, y + offset, z + offset, x + 1 - offset, y + 1 - offset, z + 1 - offset));
@@ -73,14 +73,14 @@ public class DetectorRailBlock extends RailBlock {
         }
         if(minecartPresent && !isPowered) {
             // Set rail to powered
-            world.setBlockMetadataWithNotify(x, y, z, meta | 0b1000);
+            world.setBlockMetadataWithNotify(x, y, z, meta | MASK_POWERED);
             world.notifyBlocksOfNeighborChange(x, y, z, id);
             world.notifyBlocksOfNeighborChange(x, y - 1, z, id);
             world.markBlockDirty(x, y, z);
         }
         if(!minecartPresent && isPowered) {
             // Set rail to unpowered
-            world.setBlockMetadataWithNotify(x, y, z, meta & 0b111);
+            world.setBlockMetadataWithNotify(x, y, z, meta & ~MASK_POWERED);
             world.notifyBlocksOfNeighborChange(x, y, z, id);
             world.notifyBlocksOfNeighborChange(x, y - 1, z, id);
             world.markBlockDirty(x, y, z);
diff --git a/src/main/java/net/minecraft/core/block/DoorBlock.java b/src/main/java/net/minecraft/core/block/DoorBlock.java
index a01317bed..2e635f4c8 100644
--- a/src/main/java/net/minecraft/core/block/DoorBlock.java
+++ b/src/main/java/net/minecraft/core/block/DoorBlock.java
@@ -4,7 +4,6 @@ import java.util.Random;
 import java.util.function.Supplier;
 
 import net.minecraft.core.block.entity.ActivatorBlockEntity;
-import net.minecraft.core.entity.Mob;
 import net.minecraft.core.entity.player.Player;
 import net.minecraft.core.util.helper.Direction;
 import net.minecraft.core.util.helper.DyeColor;
@@ -31,6 +30,9 @@ import org.jetbrains.annotations.Nullable;
 
 public class DoorBlock extends Block implements IPaintable
 {
+    public static final int MASK_ROTATION = 0b0000_0011;
+    public static final int MASK_OPENED = 0b0000_0100;
+    public static final int MASK_HINGE = 0b0000_1000; // 0 == left hinge; 1 == right hinge
 
 	public final boolean isTop;
 	public final boolean requireTool;
@@ -55,16 +57,16 @@ public class DoorBlock extends Block implements IPaintable
     }
 
     @Override
-    public void onBlockPlacedByMob(World world, int x, int y, int z, @NotNull Side side, Mob mob, double sideHeight) {
-        super.onBlockPlacedByMob(world, x, y, z, side, mob, sideHeight);
+    public void onBlockPlacedOnSide(World world, int x, int y, int z, @NotNull Side side, double xPlaced, double yPlaced) {
+        super.onBlockPlacedOnSide(world, x, y, z, side, xPlaced, yPlaced);
 
         int meta = world.getBlockMetadata(x, y, z);
         if(world.hasNeighborSignal(x, y, z)) {
-            world.setBlockMetadataWithNotify(x, y, z, meta | 4);
+            world.setBlockMetadataWithNotify(x, y, z, meta | MASK_OPENED);
             if (isTop) {
-                world.setBlockMetadataWithNotify(x, y - 1, z, meta | 4);
+                world.setBlockMetadataWithNotify(x, y - 1, z, meta | MASK_OPENED);
             } else {
-                world.setBlockMetadataWithNotify(x, y + 1, z, meta | 4);
+                world.setBlockMetadataWithNotify(x, y + 1, z, meta | MASK_OPENED);
             }
         }
     }
@@ -84,7 +86,7 @@ public class DoorBlock extends Block implements IPaintable
     @Override
     public AABB getSelectedBoundingBoxFromPool(WorldSource world, int x, int y, int z)
     {
-        setDoorRotation(getState(world.getBlockMetadata(x, y, z)), true);
+        setBoundsForRotation(getRotation(world.getBlockMetadata(x, y, z)), true);
         return super.getSelectedBoundingBoxFromPool(world, x, y, z);
     }
 
@@ -98,10 +100,10 @@ public class DoorBlock extends Block implements IPaintable
     @Override
     public void setBlockBoundsBasedOnState(WorldSource world, int x, int y, int z)
     {
-        setDoorRotation(getState(world.getBlockMetadata(x, y, z)), false);
+        setBoundsForRotation(getRotation(world.getBlockMetadata(x, y, z)), false);
     }
 
-    public void setDoorRotation(int i, boolean drawingSelection)
+    public void setBoundsForRotation(int rotation, boolean drawingSelection)
     {
         float top = 1.0f, bottom = 0.0f;
         if (isTop && drawingSelection)
@@ -116,19 +118,19 @@ public class DoorBlock extends Block implements IPaintable
         }
         float f = 0.1875F;
         setBlockBounds(0.0F, bottom, 0.0F, 1.0F, top, 1.0F);
-        if(i == 0)
+        if(rotation == 0)
         {
             setBlockBounds(0.0F, bottom, 0.0F, 1.0F, top, f);
         }
-        if(i == 1)
+        if(rotation == 1)
         {
             setBlockBounds(1.0F - f, bottom, 0.0F, 1.0F, top, 1.0F);
         }
-        if(i == 2)
+        if(rotation == 2)
         {
             setBlockBounds(0.0F, bottom, 1.0F - f, 1.0F, top, 1.0F);
         }
-        if(i == 3)
+        if(rotation == 3)
         {
             setBlockBounds(0.0F, bottom, 0.0F, f, top, 1.0F);
         }
@@ -142,7 +144,7 @@ public class DoorBlock extends Block implements IPaintable
     }
 
     @Override
-    public boolean onBlockRightClicked(World world, int x, int y, int z, Player player, Side side, double xPlaced, double yPlaced)
+    public boolean onBlockRightClicked(World world, int x, int y, int z, @Nullable Player player, Side side, double xPlaced, double yPlaced)
     {
         if(blockMaterial == Material.metal)
         {
@@ -159,9 +161,9 @@ public class DoorBlock extends Block implements IPaintable
         }
         if(Block.blocksList[world.getBlockId(x, y + 1, z)] instanceof DoorBlock)
         {
-            world.setBlockMetadataWithNotify(x, y + 1, z, l ^ 4);
+            world.setBlockMetadataWithNotify(x, y + 1, z, l ^ MASK_OPENED);
         }
-        world.setBlockMetadataWithNotify(x, y, z, l ^ 4);
+        world.setBlockMetadataWithNotify(x, y, z, l ^ MASK_OPENED);
         world.markBlocksDirty(x, y - 1, z, x, y, z);
         world.playBlockEvent(player, LevelListener.EVENT_DOOR_SOUND, x, y, z, 0);
         return true;
@@ -174,9 +176,9 @@ public class DoorBlock extends Block implements IPaintable
 
     public void onPoweredBlockChange(World world, int x, int y, int z, boolean isPowered)
     {
-        int l = world.getBlockMetadata(x, y, z);
+        int meta = world.getBlockMetadata(x, y, z);
         
-        if ((l & 0x8) > 0) isPowered = !isPowered;
+        if ((meta & MASK_HINGE) > 0) isPowered = !isPowered;
         
         if(isTop)
         {
@@ -193,11 +195,11 @@ public class DoorBlock extends Block implements IPaintable
         }
         if(Block.blocksList[world.getBlockId(x, y + 1, z)] instanceof DoorBlock)
         {
-            world.setBlockMetadataWithNotify(x, y + 1, z, l ^ 4);
+            world.setBlockMetadataWithNotify(x, y + 1, z, meta ^ MASK_OPENED);
         }
-        world.setBlockMetadataWithNotify(x, y, z, l ^ 4);
+        world.setBlockMetadataWithNotify(x, y, z, meta ^ MASK_OPENED);
         world.markBlocksDirty(x, y - 1, z, x, y, z);
-        world.playBlockEvent(null, 1003, x, y, z, 0);
+        world.playBlockEvent(null, LevelListener.EVENT_DOOR_SOUND, x, y, z, 0);
     }
 
     @Override
@@ -290,21 +292,19 @@ public class DoorBlock extends Block implements IPaintable
         return super.collisionRayTrace(world, x, y, z, start, end);
     }
 
-    public int getState(int i)
+    public int getRotation(int i)
     {
-        if((i & 4) == 0)
-        {
-            return i - 1 & 3;
-        } else
-        {
-            return i & 3;
+        if ((i & MASK_OPENED) != 0) {
+            return i & MASK_ROTATION;
+        } else {
+            return (i - 1) & MASK_ROTATION;
         }
     }
 
     public static boolean isOpen(int i)
     {
-    	boolean hasRightHinge = (i & 8) != 0;
-    	boolean opened = (i & 4) != 0; 
+    	boolean hasRightHinge = (i & MASK_HINGE) != 0;
+    	boolean opened = (i & MASK_OPENED) != 0;
     	
         return !hasRightHinge && opened || hasRightHinge && !opened;
     }
@@ -324,7 +324,7 @@ public class DoorBlock extends Block implements IPaintable
     @Override
     public int getPistonPushReaction(World world, int x, int y, int z)
     {
-        return 1;
+        return Material.PISTON_DESTROY_ON_PUSH;
     }
 
     @Override
diff --git a/src/main/java/net/minecraft/core/block/FarmlandBlock.java b/src/main/java/net/minecraft/core/block/FarmlandBlock.java
index 29085bf58..ba3fb8f88 100644
--- a/src/main/java/net/minecraft/core/block/FarmlandBlock.java
+++ b/src/main/java/net/minecraft/core/block/FarmlandBlock.java
@@ -6,6 +6,7 @@ import net.minecraft.core.block.tag.BlockTags;
 import net.minecraft.core.entity.Entity;
 import net.minecraft.core.entity.player.Player;
 import net.minecraft.core.enums.EnumDropCause;
+import net.minecraft.core.item.IArmorItem;
 import net.minecraft.core.item.IBonemealable;
 import net.minecraft.core.item.Items;
 import net.minecraft.core.item.ItemStack;
@@ -19,6 +20,8 @@ import java.util.Random;
 
 public class FarmlandBlock extends Block implements IBonemealable
 {
+	public static final int MASK_FERTILIZED = 0b0001_0000;
+	public static final int MASK_WET = 0b0000_1111;
 	public FarmlandBlock(String key, String namespaceId, int id)
 	{
 		super(key, namespaceId, id, Material.dirt);
@@ -28,26 +31,33 @@ public class FarmlandBlock extends Block implements IBonemealable
 	}
 
 	public static boolean isWet(int data) {
-		return (data & 0x0F) > 0;
+		return getWet(data) > 0;
+	}
+
+	public static int getWet(int data) {
+		return (data & MASK_WET);
 	}
 
 	public static int setWet(int data, int amount) {
-		return (amount & 0x0F) | (data & 0xF0);
+		return (amount & MASK_WET) | (data & ~MASK_WET);
 	}
 
 	public static boolean isFertilized(int data) {
-		return (data & 0x10) > 0;
+		return (data & MASK_FERTILIZED) != 0;
 	}
 
 	public static int setFertilized(int data, boolean fertilized) {
-		int f = fertilized ? 0x10 : 0x00;
-		return (data & 0x0F) | f;
+		if (fertilized) {
+			return data | MASK_FERTILIZED;
+		} else {
+			return data & ~MASK_FERTILIZED;
+		}
 	}
 
 	@Override
 	public AABB getCollisionBoundingBoxFromPool(final WorldSource world, final int x, final int y, final int z)
 	{
-		return AABB.getTemporaryBB(x + 0, y + 0, z + 0, x + 1, y + 1, z + 1);
+		return AABB.getTemporaryBB(x, y, z, x + 1, y + 1, z + 1);
 	}
 
 	@Override
@@ -130,7 +140,7 @@ public class FarmlandBlock extends Block implements IBonemealable
 		{
 			if (entity instanceof Player)
 			{
-				if (((Player) entity).inventory.armorInventory[0] != null && ((Player) entity).inventory.armorInventory[0].getItem() == Items.ARMOR_BOOTS_LEATHER) {
+				if (((Player) entity).inventory.armorInventory[IArmorItem.PIECE_BOOTS] != null && ((Player) entity).inventory.armorInventory[IArmorItem.PIECE_BOOTS].getItem() == Items.ARMOR_BOOTS_LEATHER) {
 					return;
 				}
 				if(isWet(world.getBlockMetadata(x, y, z)))
@@ -168,11 +178,10 @@ public class FarmlandBlock extends Block implements IBonemealable
 		if (rand.nextInt(5) == 0) {
 			int data = world.getBlockMetadata(x, y, z);
 			if (isWaterNearby(world, x, y, z) || world.canBlockBeRainedOn(x, y + 1, z)) {
-				world.setBlockMetadataWithNotify(x, y, z, data | 7);
+				world.setBlockMetadataWithNotify(x, y, z, setWet(data, getWet(data) - 1));
 			} else {
 				if (isWet(data)) {
-					int newData = ((data & 0x0F) - 1) | (data & 0xF0);
-					world.setBlockMetadataWithNotify(x, y, z, newData);
+					world.setBlockMetadataWithNotify(x, y, z, setWet(data, 0));
 				} else if (!isCropsNearby(world, x, y, z)) {
 					world.setBlockWithNotify(x, y, z, Blocks.DIRT.id);
 				}
diff --git a/src/main/java/net/minecraft/core/block/FenceGateBlock.java b/src/main/java/net/minecraft/core/block/FenceGateBlock.java
index 8630ba6e4..6c0f4e947 100644
--- a/src/main/java/net/minecraft/core/block/FenceGateBlock.java
+++ b/src/main/java/net/minecraft/core/block/FenceGateBlock.java
@@ -19,6 +19,8 @@ import org.jetbrains.annotations.Nullable;
 
 public class FenceGateBlock extends Block implements IPaintable
 {
+    public static final int MASK_DIRECTION = 0b0000_0011;
+    public static final int MASK_OPEN = 0b0000_0100;
 
     public FenceGateBlock(String key, String namespaceId, int id)
     {
@@ -29,7 +31,7 @@ public class FenceGateBlock extends Block implements IPaintable
 	public AABB getCollisionBoundingBoxFromPool(WorldSource world, int x, int y, int z)
     {
         int l = world.getBlockMetadata(x, y, z);
-        if(func_35291_d(l))
+        if(isOpen(l))
         {
             return null;
         } else
@@ -40,7 +42,7 @@ public class FenceGateBlock extends Block implements IPaintable
     
     private AABB getAABBFromMeta(int meta)
     {
-    	if (func_35290_f(meta) == 3 || func_35290_f(meta) == 1)
+    	if (getDirection(meta) == 3 || getDirection(meta) == 1)
     	{
     		return AABB.getTemporaryBB(0.375f, 0, 0, 1 - 0.375f, 1.0F, 1f);
     	}
@@ -83,10 +85,18 @@ public class FenceGateBlock extends Block implements IPaintable
     }
 
     @Override
-    public void onBlockPlacedByMob(World world, int x, int y, int z, @NotNull Side side, Mob mob, double sideHeight) {
-    	int directionmeta = mob.getHorizontalPlacementDirection(side).getHorizontalIndex();
-        int colormeta = world.getBlockMetadata(x, y, z);
-        world.setBlockMetadataWithNotify(x, y, z, directionmeta | (colormeta & 0xF0));
+    public void onBlockPlacedByMob(World world, int x, int y, int z, @NotNull Side side, Mob mob, double xPlaced, double yPlaced) {
+    	int direction = mob.getHorizontalPlacementDirection(side).getHorizontalIndex();
+        int meta = world.getBlockMetadata(x, y, z);
+        world.setBlockMetadataWithNotify(x, y, z, direction | (meta & ~MASK_DIRECTION));
+    }
+
+    @Override
+    public void onBlockPlacedOnSide(World world, int x, int y, int z, @NotNull Side side, double xPlaced, double yPlaced) {
+        if (!side.isHorizontal()) side = Side.NORTH;
+        int direction = side.getDirection().getHorizontalIndex();
+        int meta = world.getBlockMetadata(x, y, z);
+        world.setBlockMetadataWithNotify(x, y, z, direction | (meta & ~MASK_DIRECTION));
     }
     
     @Override
@@ -100,23 +110,23 @@ public class FenceGateBlock extends Block implements IPaintable
     public boolean onBlockRightClicked(World world, int x, int y, int z, @Nullable Player player, Side side, double xPlaced, double yPlaced)
     {
         int l = world.getBlockMetadata(x, y, z);
-        if(func_35291_d(l))
+        if(isOpen(l))
         {
-            world.setBlockMetadataWithNotify(x, y, z, l & -5);
+            world.setBlockMetadataWithNotify(x, y, z, l & ~MASK_OPEN);
         } else
         {
             int i1 = 0;
             if (player != null) {
                 i1 = (MathHelper.floor((double)((player.yRot * 4F) / 360F) + 0.5D) & 3) % 4;
             }
-            int j1 = func_35290_f(l);
+            int j1 = getDirection(l);
             if(j1 == (i1 + 2) % 4)
             {
                 l = (l & 0xF0) | i1;
             }
-            world.setBlockMetadataWithNotify(x, y, z, l | 4);
+            world.setBlockMetadataWithNotify(x, y, z, l | MASK_OPEN);
         }
-        if(java.lang.Math.random() < 0.5D)
+        if(Math.random() < 0.5D)
         {
             world.playSoundEffect(player, SoundCategory.WORLD_SOUNDS, x, y, z, "random.door_open", 1.0F, 1.0F);
         } else
@@ -131,14 +141,14 @@ public class FenceGateBlock extends Block implements IPaintable
         onBlockRightClicked(world, x, y, z, null, direction.getSide(), 0.5, 0.5);
     }
 
-    public static boolean func_35291_d(int i)
+    public static boolean isOpen(int meta)
     {
-        return (i & 4) != 0;
+        return (meta & MASK_OPEN) != 0;
     }
 
-    public static int func_35290_f(int i)
+    public static int getDirection(int meta)
     {
-        return i & 3;
+        return meta & MASK_DIRECTION;
     }
 
     @Override
diff --git a/src/main/java/net/minecraft/core/block/FireflyLanternBlock.java b/src/main/java/net/minecraft/core/block/FireflyLanternBlock.java
index 5e3ed709d..5a51483d1 100644
--- a/src/main/java/net/minecraft/core/block/FireflyLanternBlock.java
+++ b/src/main/java/net/minecraft/core/block/FireflyLanternBlock.java
@@ -19,7 +19,8 @@ import java.util.Random;
 import java.util.function.Supplier;
 
 public class FireflyLanternBlock extends Block{
-
+    public static final int MASK_HANGING = 0b0000_0001;
+    public static final int MASK_ANGLED = 0b0000_0010;
     private final Supplier<Item> itemSupplier;
     private final FireflyClusterMob.FireflyColor color;
 
@@ -35,7 +36,7 @@ public class FireflyLanternBlock extends Block{
     {
         int metadata = world.getBlockMetadata(x, y, z);
         float offset = 0.0F;
-        if (metadata == 1)
+        if ((metadata & MASK_HANGING) != 0)
             offset = 0.3875F;
         return AABB.getTemporaryBB(x + 0.3125f, y + offset, z + 0.3125f, x + 1 - 0.3125f, (float) y + 0.5F + offset, z + 1 - 0.3125f);
     }
@@ -92,18 +93,18 @@ public class FireflyLanternBlock extends Block{
         return true;
     }
     @Override
-    public void onBlockPlacedByMob(World world, int x, int y, int z, @NotNull Side side, Mob mob, double sideHeight) {
-        if ((side == Side.BOTTOM || (side != Side.TOP && sideHeight >= 0.5d)) && (world.isBlockNormalCube(x, y+1, z) || Block.hasTag(world.getBlockId(x, y + 1, z), BlockTags.CAN_HANG_OFF))){
-            world.setBlockMetadataWithNotify(x, y, z, 1);
+    public void onBlockPlacedOnSide(World world, int x, int y, int z, @NotNull Side side, double xPlaced, double yPlaced) {
+        if ((side == Side.BOTTOM || (side != Side.TOP && yPlaced >= 0.5d)) && (world.isBlockNormalCube(x, y+1, z) || Block.hasTag(world.getBlockId(x, y + 1, z), BlockTags.CAN_HANG_OFF))){
+            world.setBlockMetadataWithNotify(x, y, z, MASK_HANGING);
             return;
         }
-        if ((side == Side.TOP || (side != Side.BOTTOM && sideHeight < 0.5d)) && (world.canPlaceOnSurfaceOfBlock(x, y-1, z))){
+        if ((side == Side.TOP || (side != Side.BOTTOM && yPlaced < 0.5d)) && (world.canPlaceOnSurfaceOfBlock(x, y-1, z))){
             world.setBlockMetadataWithNotify(x, y, z, 0);
             return;
         }
         if(world.isBlockNormalCube(x, y+1, z) || Block.hasTag(world.getBlockId(x, y + 1, z), BlockTags.CAN_HANG_OFF))
         {
-            world.setBlockMetadataWithNotify(x, y, z, 1);
+            world.setBlockMetadataWithNotify(x, y, z, MASK_HANGING);
         } else world.setBlockMetadataWithNotify(x, y, z, 0);
     }
 
@@ -145,7 +146,7 @@ public class FireflyLanternBlock extends Block{
     public boolean canBlockStay(World world, int x, int y, int z)
     {
         int meta = world.getBlockMetadata(x, y, z);
-        if(meta == 1) {
+        if((meta & MASK_HANGING) != 0) {
             return world.isBlockNormalCube(x, y + 1, z) || Block.hasTag(world.getBlockId(x, y + 1, z), BlockTags.CAN_HANG_OFF);
         }
 
diff --git a/src/main/java/net/minecraft/core/block/FloweringCherryLeavesBlock.java b/src/main/java/net/minecraft/core/block/FloweringCherryLeavesBlock.java
index 1f0d820a3..7ab65c9c3 100644
--- a/src/main/java/net/minecraft/core/block/FloweringCherryLeavesBlock.java
+++ b/src/main/java/net/minecraft/core/block/FloweringCherryLeavesBlock.java
@@ -18,6 +18,7 @@ import java.util.Random;
 public class FloweringCherryLeavesBlock extends CherryLeavesBlock implements IBonemealable
 {
     public static final int MASK_GROWTH_DATA = 0b1111_0000;
+    public static final int MAX_GROWTH_STATE = 1;
 	public FloweringCherryLeavesBlock(String key, String namespaceId, int id) {
         super(key, namespaceId, id);
     }
@@ -49,16 +50,17 @@ public class FloweringCherryLeavesBlock extends CherryLeavesBlock implements IBo
 
     public boolean harvest(World world, int x, int y, int z, @Nullable Player player) {
         int meta = world.getBlockMetadata(x, y, z);
-        int decayData = meta & MASK_DECAY_DATA;
         int growthRate = getGrowthRate(meta);
         if(growthRate > 0)
         {
-            world.playSoundAtEntity(player, player, "random.pop", 0.2F, 0.5f);
+            if (player != null) {
+                world.playSoundAtEntity(player, player, "random.pop", 0.2F, 0.5f);
+            }
             if(!world.isClientSide)
             {
                 dropBlockWithCause(world, EnumDropCause.WORLD, x, y, z, meta, null, null);
             }
-            world.setBlockMetadataWithNotify(x, y, z, decayData);
+            world.setBlockMetadataWithNotify(x, y, z, setGrowthRate(meta, 0));
             world.scheduleBlockUpdate(x, y, z, Blocks.LEAVES_CHERRY_FLOWERING.id, tickDelay());
             return true;
         }
@@ -79,7 +81,7 @@ public class FloweringCherryLeavesBlock extends CherryLeavesBlock implements IBo
         if (world.getSeasonManager().getCurrentSeason() == Seasons.OVERWORLD_SPRING) {
             if (rand.nextInt(20) == 0) {
                 if ((growthRate) == 0) {
-                    world.setBlockMetadataWithNotify(x, y, z, 1 << 4 | meta);
+                    world.setBlockMetadataWithNotify(x, y, z, setGrowthRate(meta, MAX_GROWTH_STATE));
                     world.scheduleBlockUpdate(x, y, z, Blocks.LEAVES_CHERRY_FLOWERING.id, tickDelay());
                 }
             }
@@ -93,13 +95,13 @@ public class FloweringCherryLeavesBlock extends CherryLeavesBlock implements IBo
     @Override
     public boolean onBonemealUsed(ItemStack itemstack, @Nullable Player player, World world, int blockX, int blockY, int blockZ, Side side, double xPlaced, double yPlaced) {
         int meta = world.getBlockMetadata(blockX, blockY, blockZ);
-        if(((meta & 0xF0) >> 4) == 0)
+        if(getGrowthRate(meta) == 0)
         {
             if(!world.isClientSide)
             {
                 if(world.getSeasonManager().getCurrentSeason() != Seasons.OVERWORLD_SPRING)
                     return true;
-                world.setBlockMetadataWithNotify(blockX, blockY, blockZ, (1 << 4) | meta);
+                world.setBlockMetadataWithNotify(blockX, blockY, blockZ, setGrowthRate(meta, MAX_GROWTH_STATE));
                 if (player == null || player.getGamemode().consumeBlocks())
                 {
                     itemstack.stackSize--;
@@ -110,6 +112,10 @@ public class FloweringCherryLeavesBlock extends CherryLeavesBlock implements IBo
         return false;
     }
     public static int getGrowthRate(int meta){
-        return (meta & MASK_GROWTH_DATA) >> NUM_DECAY_BITS;
+        return (meta & MASK_GROWTH_DATA) >> 4;
+    }
+
+    public static int setGrowthRate(int meta, int growthRate) {
+        return (meta & ~MASK_GROWTH_DATA) | (growthRate << 4) & MASK_GROWTH_DATA;
     }
 }
diff --git a/src/main/java/net/minecraft/core/block/FlowingFluidBlock.java b/src/main/java/net/minecraft/core/block/FlowingFluidBlock.java
index 4a64f6b57..0a720d358 100644
--- a/src/main/java/net/minecraft/core/block/FlowingFluidBlock.java
+++ b/src/main/java/net/minecraft/core/block/FlowingFluidBlock.java
@@ -147,22 +147,22 @@ public class FlowingFluidBlock extends FluidBlock
         }
     }
 
-    private void flowIntoBlock(World world, int i, int j, int k, int l)
+    private void flowIntoBlock(World world, int x, int y, int z, int meta)
     {
-        if(canSpreadTo(world, i, j, k))
+        if(canSpreadTo(world, x, y, z))
         {
-            int i1 = world.getBlockId(i, j, k);
+            int i1 = world.getBlockId(x, y, z);
             if(i1 > 0)
             {
                 if(blockMaterial == Material.lava)
                 {
-                    fizz(world, i, j, k);
+                    fizz(world, x, y, z);
                 } else
                 {
-                    Block.blocksList[i1].dropBlockWithCause(world, EnumDropCause.WORLD, i, j, k, world.getBlockMetadata(i, j, k), null, null);
+                    Block.blocksList[i1].dropBlockWithCause(world, EnumDropCause.WORLD, x, y, z, world.getBlockMetadata(x, y, z), null, null);
                 }
             }
-            world.setBlockAndMetadataWithNotify(i, j, k, id, l);
+            world.setBlockAndMetadataWithNotify(x, y, z, id, meta);
         }
     }
 
@@ -295,9 +295,9 @@ public class FlowingFluidBlock extends FluidBlock
         return currentFlowDecay >= 0 && flowDecay >= currentFlowDecay ? currentFlowDecay : flowDecay;
     }
 
-    private boolean canSpreadTo(World world, int i, int j, int k)
+    private boolean canSpreadTo(World world, int x, int y, int z)
     {
-        Material material = world.getBlockMaterial(i, j, k);
+        Material material = world.getBlockMaterial(x, y, z);
         if(material == blockMaterial)
         {
             return false;
@@ -308,7 +308,7 @@ public class FlowingFluidBlock extends FluidBlock
         }
         else
         {
-            return !isFluidBlocking(world, i, j, k);
+            return !isFluidBlocking(world, x, y, z);
         }
     }
 
diff --git a/src/main/java/net/minecraft/core/block/FullRotatableBlock.java b/src/main/java/net/minecraft/core/block/FullRotatableBlock.java
index c4cb103b9..5d3947869 100644
--- a/src/main/java/net/minecraft/core/block/FullRotatableBlock.java
+++ b/src/main/java/net/minecraft/core/block/FullRotatableBlock.java
@@ -5,6 +5,7 @@ import net.minecraft.core.entity.Mob;
 import net.minecraft.core.util.helper.Direction;
 import net.minecraft.core.util.helper.Side;
 import net.minecraft.core.world.World;
+import net.minecraft.core.block.entity.ActivatorBlockEntity;
 import org.jetbrains.annotations.NotNull;
 
 public abstract class FullRotatableBlock extends Block {
@@ -14,12 +15,19 @@ public abstract class FullRotatableBlock extends Block {
     }
 
     @Override
-    public void onBlockPlacedByMob(World world, int x, int y, int z, @NotNull Side side, Mob mob, double sideHeight) {
+    public void onBlockPlacedByMob(World world, int x, int y, int z, @NotNull Side side, Mob mob, double xPlaced, double yPlaced) {
         final Direction direction = mob.getPlacementDirection(side).getOpposite();
 
         world.setBlockMetadataWithNotify(x, y, z, directionToMeta(direction));
     }
 
+    @Override
+    public void onBlockPlacedOnSide(World world, int x, int y, int z, @NotNull Side side, double xPlaced, double yPlaced) {
+        final Direction direction = side.getOpposite().getDirection();
+
+        world.setBlockMetadataWithNotify(x, y, z, directionToMeta(direction));
+    }
+
     public static int directionToMeta(Direction direction) {
         return direction.getId() & MASK_DIRECTION;
     }
@@ -27,4 +35,11 @@ public abstract class FullRotatableBlock extends Block {
     public static Direction metaToDirection(int meta) {
         return Direction.getDirectionById(meta & MASK_DIRECTION);
     }
+
+    @Override
+    public void onBlockPlacedByActivator(World world, int x, int y, int z, ActivatorBlockEntity activator, Direction direction)
+    {
+        super.onBlockPlacedByActivator(world, x, y, z, activator, direction);
+        world.setBlockMetadataWithNotify(x, y, z, RotatableBlock.setDirection(0, direction));
+    }
 }
diff --git a/src/main/java/net/minecraft/core/block/FurnaceBlock.java b/src/main/java/net/minecraft/core/block/FurnaceBlock.java
index a08e5aeeb..3a4f3b836 100644
--- a/src/main/java/net/minecraft/core/block/FurnaceBlock.java
+++ b/src/main/java/net/minecraft/core/block/FurnaceBlock.java
@@ -31,13 +31,6 @@ public class FurnaceBlock extends RotatableEntityBlock
         isActive = flag;
     }
 
-    @Override
-	public void onBlockPlacedByWorld(World world, int x, int y, int z)
-    {
-        super.onBlockPlacedByWorld(world, x, y, z);
-        setDefaultDirection(world, x, y, z);
-    }
-
     @Override
     public ItemStack[] getBreakResult(World world, EnumDropCause dropCause, int meta, BlockEntity blockEntity)
     {
diff --git a/src/main/java/net/minecraft/core/block/IceBlock.java b/src/main/java/net/minecraft/core/block/IceBlock.java
index fb8e4de98..0feddf8a8 100644
--- a/src/main/java/net/minecraft/core/block/IceBlock.java
+++ b/src/main/java/net/minecraft/core/block/IceBlock.java
@@ -44,13 +44,13 @@ public class IceBlock extends TransparentBlock
     }
 
     @Override
-    public void harvestBlock(World world, Player entityplayer, int i, int j, int k, int meta, BlockEntity blockEntity)
+    public void harvestBlock(World world, Player entityplayer, int x, int y, int z, int meta, BlockEntity blockEntity)
     {
-        super.harvestBlock(world, entityplayer, i, j, k, meta, blockEntity);
-        Material material = world.getBlockMaterial(i, j - 1, k);
+        super.harvestBlock(world, entityplayer, x, y, z, meta, blockEntity);
+        Material material = world.getBlockMaterial(x, y - 1, z);
         if(material.blocksMotion() || material.isLiquid())
         {
-            world.setBlockWithNotify(i, j, k, Blocks.FLUID_WATER_FLOWING.id);
+            world.setBlockWithNotify(x, y, z, Blocks.FLUID_WATER_FLOWING.id);
         }
     }
 
@@ -66,6 +66,6 @@ public class IceBlock extends TransparentBlock
     @Override
     public int getPistonPushReaction(World world, int x, int y, int z)
     {
-        return 0;
+        return Material.PISTON_PUSHABLE;
     }
 }
diff --git a/src/main/java/net/minecraft/core/block/JukeboxBlock.java b/src/main/java/net/minecraft/core/block/JukeboxBlock.java
index 7dac2e605..48e354516 100644
--- a/src/main/java/net/minecraft/core/block/JukeboxBlock.java
+++ b/src/main/java/net/minecraft/core/block/JukeboxBlock.java
@@ -53,14 +53,14 @@ public class JukeboxBlock extends EntityBlock
         }
     }
 
-    public void ejectRecord(World world, int i, int j, int k)
+    public void ejectRecord(World world, int x, int y, int z)
     {
         if(world.isClientSide)
         {
             return;
         }
-        BlockEntity blockEntity = world.getBlockEntity(i, j, k);
-        blockEntity.dropContents(world, i, j, k);
+        BlockEntity blockEntity = world.getBlockEntity(x, y, z);
+        blockEntity.dropContents(world, x, y, z);
     }
 
     @Override
diff --git a/src/main/java/net/minecraft/core/block/LampBlock.java b/src/main/java/net/minecraft/core/block/LampBlock.java
index f185e66fc..be09345f7 100644
--- a/src/main/java/net/minecraft/core/block/LampBlock.java
+++ b/src/main/java/net/minecraft/core/block/LampBlock.java
@@ -19,7 +19,7 @@ public class LampBlock extends Block implements IPainted {
     }
 
     @Override
-    public void onBlockPlacedByMob(World world, int x, int y, int z, @NotNull Side side, Mob mob, double sideHeight) {
+    public void onBlockPlacedOnSide(World world, int x, int y, int z, @NotNull Side side, double xPlaced, double yPlaced) {
         if (world.isClientSide) {
             return;
         }
diff --git a/src/main/java/net/minecraft/core/block/LeavesLayerBlock.java b/src/main/java/net/minecraft/core/block/LeavesLayerBlock.java
index 0c171535d..1f18fead4 100644
--- a/src/main/java/net/minecraft/core/block/LeavesLayerBlock.java
+++ b/src/main/java/net/minecraft/core/block/LeavesLayerBlock.java
@@ -69,22 +69,14 @@ public class LeavesLayerBlock extends BaseLayerBlock
     @Override
 	public void onNeighborBlockChange(World world, int x, int y, int z, int blockId)
     {
-        func_314_h(world, x, y, z);
-    }
-
-    private boolean func_314_h(World world, int i, int j, int k)
-    {
-        if(!canPlaceBlockAt(world, i, j, k))
-        {
-            dropBlockWithCause(world, EnumDropCause.WORLD, i, j, k, world.getBlockMetadata(i, j, k), null, null);
-            world.setBlockWithNotify(i, j, k, 0);
-            return false;
-        } else
-        {
-            return true;
+        // Remove if no longer valid
+        if (!canPlaceBlockAt(world, x, y, z)) {
+            dropBlockWithCause(world, EnumDropCause.WORLD, x, y, z, world.getBlockMetadata(x, y, z), null, null);
+            world.setBlockWithNotify(x, y, z, 0);
         }
     }
 
+
     @Override
     public ItemStack[] getBreakResult(World world, EnumDropCause dropCause, int meta, BlockEntity blockEntity)
     {
diff --git a/src/main/java/net/minecraft/core/block/LeverBlock.java b/src/main/java/net/minecraft/core/block/LeverBlock.java
index 81440557e..5f1b849cf 100644
--- a/src/main/java/net/minecraft/core/block/LeverBlock.java
+++ b/src/main/java/net/minecraft/core/block/LeverBlock.java
@@ -72,7 +72,7 @@ public class LeverBlock extends Block
     }
     
     @Override
-    public void onBlockPlacedByMob(World world, int x, int y, int z, @NotNull Side side, Mob mob, double sideHeight) {
+    public void onBlockPlacedByMob(World world, int x, int y, int z, @NotNull Side side, Mob mob, double xPlaced, double yPlaced) {
         int meta = world.getBlockMetadata(x, y, z);
         boolean isPowered = isPowered(meta);
         int rotation = -1;
@@ -117,7 +117,54 @@ public class LeverBlock extends Block
             world.setBlockMetadataWithNotify(x, y, z, rotation | (isPowered ? MASK_POWERED : 0));
         }
     }
-    
+
+    @Override
+    public void onBlockPlacedOnSide(World world, int x, int y, int z, @NotNull Side side, double xPlaced, double yPlaced) {
+        int meta = world.getBlockMetadata(x, y, z);
+        boolean isPowered = isPowered(meta);
+        int rotation = -1;
+        switch (side){
+            case BOTTOM:
+                if (world.canPlaceOnSurfaceOfBlock(x, y + 1, z)){
+                    rotation = ROTATION_BOTTOM_NS;
+                }
+                break;
+            case TOP:
+                if (world.canPlaceOnSurfaceOfBlock(x, y - 1, z))
+                {
+                    rotation = ROTATION_TOP_NS;
+                }
+                break;
+            case NORTH:
+                if (world.isBlockNormalCube(x, y, z + 1)){
+                    rotation = ROTATION_NORTH;
+                }
+                break;
+            case SOUTH:
+                if (world.isBlockNormalCube(x, y, z - 1)){
+                    rotation = ROTATION_SOUTH;
+                }
+                break;
+            case WEST:
+                if (world.isBlockNormalCube(x + 1, y, z)){
+                    rotation = ROTATION_WEST;
+                }
+                break;
+            case EAST:
+                if (world.isBlockNormalCube(x - 1, y, z)){
+                    rotation = ROTATION_EAST;
+                }
+                break;
+        }
+
+        if(rotation == -1) {
+            dropBlockWithCause(world, EnumDropCause.WORLD, x, y, z, world.getBlockMetadata(x, y, z), null, null);
+            world.setBlockWithNotify(x, y, z, 0);
+        } else {
+            world.setBlockMetadataWithNotify(x, y, z, rotation | (isPowered ? MASK_POWERED : 0));
+        }
+    }
+
     @Override
 	public void onNeighborBlockChange(World world, int x, int y, int z, int blockId)
     {
diff --git a/src/main/java/net/minecraft/core/block/MobSpawnerBlock.java b/src/main/java/net/minecraft/core/block/MobSpawnerBlock.java
index ede40f130..851902b96 100644
--- a/src/main/java/net/minecraft/core/block/MobSpawnerBlock.java
+++ b/src/main/java/net/minecraft/core/block/MobSpawnerBlock.java
@@ -40,7 +40,7 @@ public class MobSpawnerBlock extends EntityBlock
     }
 
     @Override
-	public void onBlockPlacedByMob(World world, int x, int y, int z, @NotNull Side side, Mob mob, double sideHeight) {
+	public void onBlockPlacedOnSide(World world, int x, int y, int z, @NotNull Side side, double xPlaced, double yPlaced) {
     	MobSpawnerBlockEntity tileEntity = (MobSpawnerBlockEntity) world.getBlockEntity(x, y, z);
     	tileEntity.setMobId("none");
     }
diff --git a/src/main/java/net/minecraft/core/block/PaintedFenceGateBlock.java b/src/main/java/net/minecraft/core/block/PaintedFenceGateBlock.java
index 2734b05ff..1dd83c3d5 100644
--- a/src/main/java/net/minecraft/core/block/PaintedFenceGateBlock.java
+++ b/src/main/java/net/minecraft/core/block/PaintedFenceGateBlock.java
@@ -11,6 +11,7 @@ import org.jetbrains.annotations.Nullable;
 
 public class PaintedFenceGateBlock extends FenceGateBlock implements IPainted
 {
+	public static final int MASK_COLOR = 0b1111_0000;
 	public PaintedFenceGateBlock(String key, String namespaceId, int id)
 	{
 		super(key, namespaceId, id);
@@ -24,12 +25,12 @@ public class PaintedFenceGateBlock extends FenceGateBlock implements IPainted
 	@Override
 	public ItemStack[] getBreakResult(World world, EnumDropCause dropCause, int meta, BlockEntity blockEntity)
 	{
-		return new ItemStack[] { new ItemStack(this, 1, meta & 0xF0) };
+		return new ItemStack[] { new ItemStack(this, 1, meta & MASK_COLOR) };
 	}
 
 	@Override
 	public DyeColor fromMetadata(int meta) {
-		return DyeColor.colorFromBlockMeta((meta & 0xF0) >> 4);
+		return DyeColor.colorFromBlockMeta((meta & MASK_COLOR) >> 4);
 	}
 
 	@Override
@@ -39,13 +40,13 @@ public class PaintedFenceGateBlock extends FenceGateBlock implements IPainted
 
 	@Override
 	public int stripColorFromMetadata(int meta) {
-		return meta & 0xF;
+		return meta & ~MASK_COLOR;
 	}
 
 	@Override
 	public void removeDye(World world, int x, int y, int z) {
 		final int meta = world.getBlockMetadata(x, y, z);
-		world.setBlockAndMetadataWithNotify(x, y, z, Blocks.FENCE_GATE_PLANKS_OAK.id, meta & 0xF);
+		world.setBlockAndMetadataWithNotify(x, y, z, Blocks.FENCE_GATE_PLANKS_OAK.id, meta & ~MASK_COLOR);
 	}
 
 	@Override
diff --git a/src/main/java/net/minecraft/core/block/PaintedSlabBlock.java b/src/main/java/net/minecraft/core/block/PaintedSlabBlock.java
index a9508082c..3eb3e0365 100644
--- a/src/main/java/net/minecraft/core/block/PaintedSlabBlock.java
+++ b/src/main/java/net/minecraft/core/block/PaintedSlabBlock.java
@@ -23,8 +23,14 @@ public class PaintedSlabBlock extends SlabBlock implements IPainted
 	}
 
 	@Override
-	public void onBlockPlacedByMob(World world, int x, int y, int z, @NotNull Side side, Mob mob, double sideHeight) {
-		int meta = mob.getVerticalPlacementDirection(side, sideHeight) == Direction.UP ? 2 : 0;
+	public void onBlockPlacedByMob(World world, int x, int y, int z, @NotNull Side side, Mob mob, double xPlaced, double yPlaced) {
+		int meta = mob.getVerticalPlacementDirection(side, yPlaced) == Direction.UP ? 2 : 0;
+		world.setBlockMetadataWithNotify(x, y, z, meta | (world.getBlockMetadata(x, y, z) & 0xF0));
+	}
+
+	@Override
+	public void onBlockPlacedOnSide(World world, int x, int y, int z, @NotNull Side side, double xPlaced, double yPlaced) {
+		int meta = side == Side.TOP ? 2 : 0;
 		world.setBlockMetadataWithNotify(x, y, z, meta | (world.getBlockMetadata(x, y, z) & 0xF0));
 	}
 
diff --git a/src/main/java/net/minecraft/core/block/PressurePlateBlock.java b/src/main/java/net/minecraft/core/block/PressurePlateBlock.java
index 0c02f172d..5c6145b66 100644
--- a/src/main/java/net/minecraft/core/block/PressurePlateBlock.java
+++ b/src/main/java/net/minecraft/core/block/PressurePlateBlock.java
@@ -16,6 +16,8 @@ import java.util.Random;
 
 public class PressurePlateBlock extends Block
 {
+    public static final int MASK_POWERED = 0b0000_0001;
+    public static final int MASK_CEILING = 0b0000_0010;
     private final Class<? extends Entity> triggerMobClass;
 
 	public PressurePlateBlock(String key, String namespaceId, int id, Class<? extends Entity> mobType, Material material)
@@ -96,7 +98,7 @@ public class PressurePlateBlock extends Block
     {
         int meta = world.getBlockMetadata(x, y, z);
         boolean isPressed = isPressed(meta);
-        boolean isCeiling = (meta & 0b10) != 0;
+        boolean isCeiling = onCeiling(meta);
         boolean isSteppedOn = false;
         float f = 0.125F;
         List<Entity> list = world.getEntitiesWithinAABB(triggerMobClass, AABB.getTemporaryBB((float)x + f, y + (isCeiling ? .85f : 0f), (float)z + f, (float)(x + 1) - f, (double)y + (isCeiling ? 1 : 0.25D), (float)(z + 1) - f));;
@@ -106,7 +108,7 @@ public class PressurePlateBlock extends Block
         }
         if(isSteppedOn && !isPressed)
         {
-            world.setBlockMetadataWithNotify(x, y, z, meta | 0b01);
+            world.setBlockMetadataWithNotify(x, y, z, meta | MASK_POWERED);
             world.notifyBlocksOfNeighborChange(x, y, z, id);
             world.notifyBlocksOfNeighborChange(x, y + (isCeiling ? 1 : -1), z, id);
             world.markBlocksDirty(x, y, z, x, y, z);
@@ -114,7 +116,7 @@ public class PressurePlateBlock extends Block
         }
         if(!isSteppedOn && isPressed)
         {
-            world.setBlockMetadataWithNotify(x, y, z, meta & 0b10);
+            world.setBlockMetadataWithNotify(x, y, z, meta & ~MASK_POWERED);
             world.notifyBlocksOfNeighborChange(x, y, z, id);
             world.notifyBlocksOfNeighborChange(x, y + (isCeiling ? 1 : -1), z, id);
             world.markBlocksDirty(x, y, z, x, y, z);
@@ -129,7 +131,7 @@ public class PressurePlateBlock extends Block
     @Override
     public void onBlockRemoved(World world, int x, int y, int z, int data)
     {
-        boolean isCeiling = (world.getBlockMetadata(x, y, z) & 0b10) != 0;
+        boolean isCeiling = onCeiling(world.getBlockMetadata(x, y, z));
         if(isPressed(data))
         {
             world.notifyBlocksOfNeighborChange(x, y, z, id);
@@ -143,7 +145,7 @@ public class PressurePlateBlock extends Block
     {
         int meta = world.getBlockMetadata(x, y, z);
         boolean isPressed = isPressed(meta);
-        boolean isCeiling = (meta & 0b10) != 0;
+        boolean isCeiling = onCeiling(meta);
         float pixel = 0.0625F;
         if(isPressed)
         {
@@ -173,15 +175,19 @@ public class PressurePlateBlock extends Block
     public boolean getDirectSignal(World world, int x, int y, int z, Side side)
     {
         int meta = world.getBlockMetadata(x, y, z);
-        boolean isCeiling = (meta & 0b10) != 0;
+        boolean isCeiling = onCeiling(meta);
         if(isPressed(world.getBlockMetadata(x, y, z))) {
             return side == (isCeiling ? Side.BOTTOM : Side.TOP);
         } else {
             return false;
         }
     }
-    public boolean isPressed(int meta){
-        return (meta & 0b1) != 0;
+    public static boolean isPressed(int meta){
+        return (meta & MASK_POWERED) != 0;
+    }
+
+    public static boolean onCeiling(int meta) {
+        return (meta & MASK_CEILING) != 0;
     }
 
     @Override
@@ -193,12 +199,12 @@ public class PressurePlateBlock extends Block
     @Override
     public int getPistonPushReaction(World world, int x, int y, int z)
     {
-        return 1;
+        return Material.PISTON_DESTROY_ON_PUSH;
     }
     @Override
-    public void onBlockPlacedByMob(World world, int x, int y, int z, @NotNull Side side, Mob mob, double sideHeight) {
-        if (!world.canPlaceOnSurfaceOfBlock(x, y - 1 , z) || (side.isHorizontal() && sideHeight > 0.5 && world.isBlockNormalCube(x, y + 1, z))){
-            world.setBlockMetadata(x, y, z, world.getBlockMetadata(x, y, z) | 0b10);
+    public void onBlockPlacedOnSide(World world, int x, int y, int z, @NotNull Side side, double xPlaced, double yPlaced) {
+        if (!world.canPlaceOnSurfaceOfBlock(x, y - 1 , z) || (side.isHorizontal() && yPlaced > 0.5 && world.isBlockNormalCube(x, y + 1, z))){
+            world.setBlockMetadata(x, y, z, world.getBlockMetadata(x, y, z) | MASK_CEILING);
         }
     }
 }
diff --git a/src/main/java/net/minecraft/core/block/RailBlock.java b/src/main/java/net/minecraft/core/block/RailBlock.java
index 5e5e56937..2ae5815a8 100644
--- a/src/main/java/net/minecraft/core/block/RailBlock.java
+++ b/src/main/java/net/minecraft/core/block/RailBlock.java
@@ -15,6 +15,8 @@ import java.util.ArrayList;
 import java.util.List;
 
 public class RailBlock extends Block {
+    public static final int MASK_DIRECTION = 0b0000_0111;
+    public static final int MASK_POWERED = 0b0000_1000;
     public final boolean isPowered;
 
     public static boolean isRailBlockAt(World world, int x, int y, int z) {
@@ -23,7 +25,7 @@ public class RailBlock extends Block {
     public RailDirection getRailDirection(WorldSource world, int x, int y, int z){
         int meta = world.getBlockMetadata(x, y, z);
         if (isPowered){
-            meta &= 0b111;
+            meta &= MASK_DIRECTION;
         }
         return RailDirection.getFromMeta(meta);
     }
@@ -90,7 +92,7 @@ public class RailBlock extends Block {
             return;
         }
         int meta = world.getBlockMetadata(x, y, z);
-        boolean isPoweredFlagSet = (meta & 0b1000) != 0;
+        boolean isPoweredFlagSet = (meta & MASK_POWERED) != 0;
         RailDirection railDirection = getRailDirection(world, x, y, z);
 
         if(!isValidState(world, x, y, z)) {
@@ -111,7 +113,7 @@ public class RailBlock extends Block {
             boolean changedMeta = false;
             if(gettingPower && !isPoweredFlagSet) {
                 // Set powered bit
-                world.setBlockMetadataWithNotify(x, y, z, railDirection.meta | 0b1000);
+                world.setBlockMetadataWithNotify(x, y, z, railDirection.meta | MASK_POWERED);
                 changedMeta = true;
             } else if(!gettingPower && isPoweredFlagSet) {
                 // Remove powered bit
@@ -198,7 +200,7 @@ public class RailBlock extends Block {
         int blockId = world.getBlockId(x, y, z);
         if(blockId == Blocks.RAIL_POWERED.id) {
             int meta = world.getBlockMetadata(x, y, z);
-            boolean isPoweredFlagSet = (meta & 0b1000) != 0;
+            boolean isPoweredFlagSet = (meta & MASK_POWERED) != 0;
             RailDirection direction = getRailDirection(world, x, y, z);
 
             // Return false for perpendicular powered rails
@@ -230,7 +232,7 @@ public class RailBlock extends Block {
     @Override
     public int getPistonPushReaction(World world, int x, int y, int z)
     {
-        return 0;
+        return Material.PISTON_PUSHABLE;
     }
     public static class Rail {
         private final World world;
@@ -431,7 +433,7 @@ public class RailBlock extends Block {
 
             int newMeta = railType.meta;
             if(isPoweredRail) {
-                newMeta |= world.getBlockMetadata(x, y, z) & 0b1000;
+                newMeta |= world.getBlockMetadata(x, y, z) & MASK_POWERED;
             }
 
             if(forceUpdate || world.getBlockMetadata(x, y, z) != newMeta) {
@@ -497,7 +499,7 @@ public class RailBlock extends Block {
             }
             int newMeta = railDirection.meta;
             if(isPoweredRail) {
-                newMeta |= world.getBlockMetadata(x, y, z) & 0b1000;
+                newMeta |= world.getBlockMetadata(x, y, z) & MASK_POWERED;
             }
             world.setBlockMetadataWithNotify(x, y, z, newMeta);
         }
diff --git a/src/main/java/net/minecraft/core/block/RedstoneOreBlock.java b/src/main/java/net/minecraft/core/block/RedstoneOreBlock.java
index 4bbcadfb4..73f2ae871 100644
--- a/src/main/java/net/minecraft/core/block/RedstoneOreBlock.java
+++ b/src/main/java/net/minecraft/core/block/RedstoneOreBlock.java
@@ -63,12 +63,12 @@ public class RedstoneOreBlock extends Block
     }
 
 
-    private void lightRedstone(World world, int i, int j, int k)
+    private void lightRedstone(World world, int x, int y, int z)
     {
-        spawnParticles(world, i, j, k);
+        spawnParticles(world, x, y, z);
         if (!illuminated)
         {
-        	world.setBlockWithNotify(i, j, k, illuminatedBlock.get().id);
+        	world.setBlockWithNotify(x, y, z, illuminatedBlock.get().id);
         }
     }
 
diff --git a/src/main/java/net/minecraft/core/block/RedstoneTorchBlock.java b/src/main/java/net/minecraft/core/block/RedstoneTorchBlock.java
index f94f02372..e7e93cabd 100644
--- a/src/main/java/net/minecraft/core/block/RedstoneTorchBlock.java
+++ b/src/main/java/net/minecraft/core/block/RedstoneTorchBlock.java
@@ -27,7 +27,7 @@ public class RedstoneTorchBlock extends TorchBlock {
 
     @Override
     public void onBlockPlacedByWorld(World world, int x, int y, int z) {
-        if (world.getBlockMetadata(x, y, z) == 0) {
+        if (world.getBlockMetadata(x, y, z) == SIDE_NONE) {
             super.onBlockPlacedByWorld(world, x, y, z);
         }
         if (torchActive) {
@@ -57,37 +57,38 @@ public class RedstoneTorchBlock extends TorchBlock {
         if (!torchActive) {
             return false;
         }
-        int meta = worldSource.getBlockMetadata(x, y, z);
-        if (meta == 5 && side == Side.TOP) {
-            return false;
-        }
-        if (meta == 3 && side == Side.SOUTH) {
-            return false;
-        }
-        if (meta == 4 && side == Side.NORTH) {
-            return false;
-        }
-        if (meta == 1 && side == Side.EAST) {
-            return false;
-        }
-        return meta != 2 || side != Side.WEST;
+        int direction = worldSource.getBlockMetadata(x, y, z) & MASK_DIRECTION;
+        switch (direction) {
+            case SIDE_BOTTOM:
+                return side != Side.TOP;
+            case SIDE_SOUTH:
+                return side != Side.NORTH;
+            case SIDE_NORTH:
+                return side != Side.SOUTH;
+            case SIDE_EAST:
+                return side != Side.WEST;
+            case SIDE_WEST:
+                return side != Side.EAST;
+        }
+        return false;
     }
 
     private boolean hasNeighborSignal(World world, int x, int y, int z) {
-        int meta = world.getBlockMetadata(x, y, z);
-        if (meta == 5 && world.getSignal(x, y - 1, z, Side.BOTTOM)) {
-            return true;
-        }
-        if (meta == 3 && world.getSignal(x, y, z - 1, Side.NORTH)) {
-            return true;
+        int direction = world.getBlockMetadata(x, y, z) & MASK_DIRECTION;
+        switch (direction) {
+            case SIDE_BOTTOM:
+                return world.getSignal(x, y - 1, z, Side.BOTTOM);
+            case SIDE_SOUTH:
+                return world.getSignal(x, y, z + 1, Side.SOUTH);
+            case SIDE_NORTH:
+                return world.getSignal(x, y, z - 1, Side.NORTH);
+            case SIDE_EAST:
+                return world.getSignal(x + 1, y, z, Side.EAST);
+            case SIDE_WEST:
+                return world.getSignal(x - 1, y, z, Side.WEST);
+            default:
+                return false;
         }
-        if (meta == 4 && world.getSignal(x, y, z + 1, Side.SOUTH)) {
-            return true;
-        }
-        if (meta == 1 && world.getSignal(x - 1, y, z, Side.WEST)) {
-            return true;
-        }
-        return meta == 2 && world.getSignal(x + 1, y, z, Side.EAST);
     }
 
     @Override
@@ -133,7 +134,7 @@ public class RedstoneTorchBlock extends TorchBlock {
             return;
         }
 
-        int meta = world.getBlockMetadata(x, y, z);
+        int direction = world.getBlockMetadata(x, y, z) & MASK_DIRECTION;
         double px = (x + 0.5D) + (rand.nextFloat() - 0.5D) * 0.2D;
         double py = (y + 0.7D) + (rand.nextFloat() - 0.5D) * 0.2D;
         double pz = (z + 0.5D) + (rand.nextFloat() - 0.5D) * 0.2D;
@@ -150,16 +151,22 @@ public class RedstoneTorchBlock extends TorchBlock {
         float green = color.getGreen() / 255.0f;
         float blue = color.getBlue() / 255.0f;
 
-        if (meta == 1) {
-            world.spawnParticle("reddust", px - horizontalOffset, py + verticalOffset, pz, red, green, blue, redstoneBrightness);
-        } else if (meta == 2) {
-            world.spawnParticle("reddust", px + horizontalOffset, py + verticalOffset, pz, red, green, blue, redstoneBrightness);
-        } else if (meta == 3) {
-            world.spawnParticle("reddust", px, py + verticalOffset, pz - horizontalOffset, red, green, blue, redstoneBrightness);
-        } else if (meta == 4) {
-            world.spawnParticle("reddust", px, py + verticalOffset, pz + horizontalOffset, red, green, blue, redstoneBrightness);
-        } else {
-            world.spawnParticle("reddust", px, py, pz, red, green, blue, redstoneBrightness);
+        switch (direction) {
+            case SIDE_WEST:
+                world.spawnParticle("reddust", px - horizontalOffset, py + verticalOffset, pz, red, green, blue, redstoneBrightness);
+                break;
+            case SIDE_EAST:
+                world.spawnParticle("reddust", px + horizontalOffset, py + verticalOffset, pz, red, green, blue, redstoneBrightness);
+                break;
+            case SIDE_NORTH:
+                world.spawnParticle("reddust", px, py + verticalOffset, pz - horizontalOffset, red, green, blue, redstoneBrightness);
+                break;
+            case SIDE_SOUTH:
+                world.spawnParticle("reddust", px, py + verticalOffset, pz + horizontalOffset, red, green, blue, redstoneBrightness);
+                break;
+            case SIDE_BOTTOM:
+                world.spawnParticle("reddust", px, py, pz, red, green, blue, redstoneBrightness);
+                break;
         }
     }
 }
diff --git a/src/main/java/net/minecraft/core/block/RepeaterBlock.java b/src/main/java/net/minecraft/core/block/RepeaterBlock.java
index cd036866e..da3bc9e00 100644
--- a/src/main/java/net/minecraft/core/block/RepeaterBlock.java
+++ b/src/main/java/net/minecraft/core/block/RepeaterBlock.java
@@ -9,6 +9,7 @@ import net.minecraft.core.entity.player.Player;
 import net.minecraft.core.enums.EnumDropCause;
 import net.minecraft.core.item.ItemStack;
 import net.minecraft.core.item.Items;
+import net.minecraft.core.util.helper.Axis;
 import net.minecraft.core.util.helper.Color;
 import net.minecraft.core.util.helper.Direction;
 import net.minecraft.core.util.helper.Side;
@@ -165,7 +166,7 @@ public class RepeaterBlock extends Block
     }
 
     @Override
-    public void onBlockPlacedByMob(World world, int x, int y, int z, @NotNull Side side, Mob mob, double sideHeight) {
+    public void onBlockPlacedByMob(World world, int x, int y, int z, @NotNull Side side, Mob mob, double xPlaced, double yPlaced) {
 		int l = mob.getHorizontalPlacementDirection(side).index;
 		world.setBlockMetadataWithNotify(x, y, z, l);
 		boolean flag = isGettingPower(world, x, y, z, l);
@@ -175,6 +176,18 @@ public class RepeaterBlock extends Block
 		}
     }
 
+    @Override
+    public void onBlockPlacedOnSide(World world, int x, int y, int z, @NotNull Side side, double xPlaced, double yPlaced) {
+        if (!side.isHorizontal()) side = Side.NORTH;
+        int l = side.getDirection().index;
+        world.setBlockMetadataWithNotify(x, y, z, l);
+        boolean flag = isGettingPower(world, x, y, z, l);
+        if(flag)
+        {
+            world.scheduleBlockUpdate(x, y, z, id, 1);
+        }
+    }
+
     @Override
 	public void onBlockPlacedByWorld(World world, int x, int y, int z)
     {
diff --git a/src/main/java/net/minecraft/core/block/RopeBlock.java b/src/main/java/net/minecraft/core/block/RopeBlock.java
index 967e5ed96..c204db867 100644
--- a/src/main/java/net/minecraft/core/block/RopeBlock.java
+++ b/src/main/java/net/minecraft/core/block/RopeBlock.java
@@ -15,6 +15,7 @@ import net.minecraft.core.world.WorldSource;
 
 public class RopeBlock
     extends Block {
+    public static final int MASK_ROPE_CONNECT = 0b1000_0000;
     public RopeBlock(String key, String namespaceId, int id) {
         super(key, namespaceId,id, Material.cloth);
     }
@@ -72,8 +73,8 @@ public class RopeBlock
         ItemStack heldItem = player.getHeldItem();
         if (heldItem != null && heldItem.getItem() instanceof ToolShearsItem) {
             int meta = world.getBlockMetadata(x, y, z);
-            int forceRope = (~meta) & 0b1000_0000;
-            world.setBlockMetadataWithNotify(x, y, z, forceRope | (meta & 0b0111_1111));
+            int forceRope = (~meta) & MASK_ROPE_CONNECT;
+            world.setBlockMetadataWithNotify(x, y, z, forceRope | (meta & ~MASK_ROPE_CONNECT));
             heldItem.damageItem(1, player);
             if (heldItem.stackSize <= 0){
                 player.destroyCurrentEquippedItem();
diff --git a/src/main/java/net/minecraft/core/block/RotatableBlock.java b/src/main/java/net/minecraft/core/block/RotatableBlock.java
index 6c6972c9e..679dc3e81 100644
--- a/src/main/java/net/minecraft/core/block/RotatableBlock.java
+++ b/src/main/java/net/minecraft/core/block/RotatableBlock.java
@@ -5,6 +5,7 @@ import net.minecraft.core.entity.Mob;
 import net.minecraft.core.util.helper.Direction;
 import net.minecraft.core.util.helper.Side;
 import net.minecraft.core.world.World;
+import net.minecraft.core.block.entity.ActivatorBlockEntity;
 import org.jetbrains.annotations.NotNull;
 
 public abstract class RotatableBlock extends Block{
@@ -13,36 +14,6 @@ public abstract class RotatableBlock extends Block{
         super(key, namespaceId, id, material);
     }
 
-    public void setDefaultDirection(World world, int x, int y, int z)
-    {
-        if(world.isClientSide)
-        {
-            return;
-        }
-        int idNegZ = world.getBlockId(x, y, z - 1);
-        int idPosZ = world.getBlockId(x, y, z + 1);
-        int idNegX = world.getBlockId(x - 1, y, z);
-        int idPosX = world.getBlockId(x + 1, y, z);
-        Direction direction = Direction.SOUTH;
-        if(Block.solid[idNegZ] && !Block.solid[idPosZ])
-        {
-            direction = Direction.SOUTH;
-        }
-        if(Block.solid[idPosZ] && !Block.solid[idNegZ])
-        {
-            direction = Direction.NORTH;
-        }
-        if(Block.solid[idNegX] && !Block.solid[idPosX])
-        {
-            direction = Direction.EAST;
-        }
-        if(Block.solid[idPosX] && !Block.solid[idNegX])
-        {
-            direction = Direction.WEST;
-        }
-        world.setBlockMetadataWithNotify(x, y, z, setDirection(0, direction));
-    }
-
     public static Direction getDirectionFromMeta(int meta)
     {
         return Direction.getDirectionById(meta & MASK_DIRECTION);
@@ -53,14 +24,20 @@ public abstract class RotatableBlock extends Block{
     }
 
     @Override
-    public void onBlockPlacedByMob(World world, int x, int y, int z, @NotNull Side side, Mob mob, double sideHeight) {
+    public void onBlockPlacedByMob(World world, int x, int y, int z, @NotNull Side side, Mob mob, double xPlaced, double yPlaced) {
         world.setBlockMetadataWithNotify(x, y, z, mob.getHorizontalPlacementDirection(side).getOpposite().getId());
     }
 
     @Override
-	public void onBlockPlacedByWorld(World world, int x, int y, int z)
+    public void onBlockPlacedOnSide(World world, int x, int y, int z, @NotNull Side side, double xPlaced, double yPlaced) {
+        if (!side.isHorizontal()) side = Side.NORTH;
+        world.setBlockMetadataWithNotify(x, y, z, side.getOpposite().getId());
+    }
+
+    public void onBlockPlacedByActivator(World world, int x, int y, int z, ActivatorBlockEntity activator, Direction direction)
     {
-        super.onBlockPlacedByWorld(world, x, y, z);
-        setDefaultDirection(world, x, y, z);
+        super.onBlockPlacedByActivator(world, x, y, z, activator, direction);
+        if (direction.getOffsetY() != 0) direction = Direction.NORTH.getOpposite();
+        world.setBlockMetadataWithNotify(x, y, z, RotatableBlock.setDirection(0, direction));
     }
 }
diff --git a/src/main/java/net/minecraft/core/block/RotatableEntityBlock.java b/src/main/java/net/minecraft/core/block/RotatableEntityBlock.java
index 21a7614f1..30c75acb6 100644
--- a/src/main/java/net/minecraft/core/block/RotatableEntityBlock.java
+++ b/src/main/java/net/minecraft/core/block/RotatableEntityBlock.java
@@ -5,6 +5,7 @@ import net.minecraft.core.entity.Mob;
 import net.minecraft.core.util.helper.Direction;
 import net.minecraft.core.util.helper.Side;
 import net.minecraft.core.world.World;
+import net.minecraft.core.block.entity.ActivatorBlockEntity;
 import org.jetbrains.annotations.NotNull;
 
 public abstract class RotatableEntityBlock extends EntityBlock {
@@ -12,45 +13,23 @@ public abstract class RotatableEntityBlock extends EntityBlock {
 	public RotatableEntityBlock(String key, String namespaceId, int id, Material material) {
         super(key, namespaceId, id, material);
     }
-	public void setDefaultDirection(World world, int x, int y, int z)
-    {
-        if(world.isClientSide)
-        {
-            return;
-        }
-        int idNegZ = world.getBlockId(x, y, z - 1);
-        int idPosZ = world.getBlockId(x, y, z + 1);
-        int idNegX = world.getBlockId(x - 1, y, z);
-        int idPosX = world.getBlockId(x + 1, y, z);
-        Direction direction = Direction.SOUTH;
-        if(Block.solid[idNegZ] && !Block.solid[idPosZ])
-        {
-            direction = Direction.SOUTH;
-        }
-        if(Block.solid[idPosZ] && !Block.solid[idNegZ])
-        {
-            direction = Direction.NORTH;
-        }
-        if(Block.solid[idNegX] && !Block.solid[idPosX])
-        {
-            direction = Direction.EAST;
-        }
-        if(Block.solid[idPosX] && !Block.solid[idNegX])
-        {
-            direction = Direction.WEST;
-        }
-        world.setBlockMetadataWithNotify(x, y, z, RotatableBlock.setDirection(0, direction));
-    }
 
     @Override
-    public void onBlockPlacedByMob(World world, int x, int y, int z, @NotNull Side side, Mob mob, double sideHeight) {
+    public void onBlockPlacedByMob(World world, int x, int y, int z, @NotNull Side side, Mob mob, double xPlaced, double yPlaced) {
     	world.setBlockMetadataWithNotify(x, y, z, mob.getHorizontalPlacementDirection(side).getOpposite().getId());
     }
 
     @Override
-	public void onBlockPlacedByWorld(World world, int x, int y, int z)
+    public void onBlockPlacedOnSide(World world, int x, int y, int z, @NotNull Side side, double xPlaced, double yPlaced) {
+        if (!side.isHorizontal()) side = Side.NORTH;
+        world.setBlockMetadataWithNotify(x, y, z, side.getOpposite().getId());
+    }
+
+    @Override
+    public void onBlockPlacedByActivator(World world, int x, int y, int z, ActivatorBlockEntity activator, Direction direction)
     {
-        super.onBlockPlacedByWorld(world, x, y, z);
-        setDefaultDirection(world, x, y, z);
+        super.onBlockPlacedByActivator(world, x, y, z, activator, direction);
+        if (direction.getOffsetY() != 0) direction = Direction.NORTH.getOpposite();
+        world.setBlockMetadataWithNotify(x, y, z, RotatableBlock.setDirection(0, direction));
     }
 }
diff --git a/src/main/java/net/minecraft/core/block/SaplingBaseBlock.java b/src/main/java/net/minecraft/core/block/SaplingBaseBlock.java
index b03aa8d7a..66e14b858 100644
--- a/src/main/java/net/minecraft/core/block/SaplingBaseBlock.java
+++ b/src/main/java/net/minecraft/core/block/SaplingBaseBlock.java
@@ -76,5 +76,5 @@ public abstract class SaplingBaseBlock extends FlowerBlock implements IBonemeala
         return true;
     }
 
-    public abstract void growTree(World world, int i, int j, int k, Random random);
+    public abstract void growTree(World world, int x, int y, int z, Random random);
 }
diff --git a/src/main/java/net/minecraft/core/block/SaplingBirchBlock.java b/src/main/java/net/minecraft/core/block/SaplingBirchBlock.java
index 8818e28b7..2d3a87c91 100644
--- a/src/main/java/net/minecraft/core/block/SaplingBirchBlock.java
+++ b/src/main/java/net/minecraft/core/block/SaplingBirchBlock.java
@@ -20,17 +20,17 @@ public class SaplingBirchBlock extends SaplingBaseBlock
 
 
     @Override
-	public void growTree(World world, int i, int j, int k, Random random)
+	public void growTree(World world, int x, int y, int z, Random random)
     {
     	Object obj = null;
 
-    	world.setBlock(i, j, k, 0);
+    	world.setBlock(x, y, z, 0);
 
     	obj = new WorldFeatureTree(Blocks.LEAVES_BIRCH.id, Blocks.LOG_BIRCH.id, 5);
 
-        if(!((WorldFeature) (obj)).place(world, random, i, j, k))
+        if(!((WorldFeature) (obj)).place(world, random, x, y, z))
         {
-            world.setBlock(i, j, k, id);
+            world.setBlock(x, y, z, id);
         }
     }
 }
diff --git a/src/main/java/net/minecraft/core/block/SaplingCacaoBlock.java b/src/main/java/net/minecraft/core/block/SaplingCacaoBlock.java
index 1db56e5d2..e7be41576 100644
--- a/src/main/java/net/minecraft/core/block/SaplingCacaoBlock.java
+++ b/src/main/java/net/minecraft/core/block/SaplingCacaoBlock.java
@@ -15,14 +15,14 @@ public class SaplingCacaoBlock extends SaplingBaseBlock
     }
 
     @Override
-    public void growTree(World world, int i, int j, int k, Random random)
+    public void growTree(World world, int x, int y, int z, Random random)
     {
         Object treeSmall = new WorldFeatureTree(Blocks.LEAVES_CACAO.id, Blocks.LOG_OAK_MOSSY.id, 4);
-        world.setBlock(i, j, k, 0);
+        world.setBlock(x, y, z, 0);
 
-        if(!((WorldFeature) (treeSmall)).place(world, random, i, j, k))
+        if(!((WorldFeature) (treeSmall)).place(world, random, x, y, z))
         {
-                world.setBlock(i, j, k, id);
+                world.setBlock(x, y, z, id);
         }
     }
 }
diff --git a/src/main/java/net/minecraft/core/block/SaplingCherryBlock.java b/src/main/java/net/minecraft/core/block/SaplingCherryBlock.java
index 9a8e99d6b..47b143630 100644
--- a/src/main/java/net/minecraft/core/block/SaplingCherryBlock.java
+++ b/src/main/java/net/minecraft/core/block/SaplingCherryBlock.java
@@ -20,16 +20,16 @@ public class SaplingCherryBlock extends SaplingBaseBlock
     }
 
     @Override
-	public void growTree(World world, int i, int j, int k, Random random)
+	public void growTree(World world, int x, int y, int z, Random random)
     {
         Object treeBig  = new WorldFeatureTreeFancy(Blocks.LEAVES_CHERRY.id, Blocks.LOG_CHERRY.id);
         Object treeSmall = new WorldFeatureTreeCherry(Blocks.LEAVES_CHERRY.id, Blocks.LOG_CHERRY.id, 4);
-        world.setBlock(i, j, k, 0);
+        world.setBlock(x, y, z, 0);
 
-        if(!((WorldFeature) (treeSmall)).place(world, random, i, j, k))
+        if(!((WorldFeature) (treeSmall)).place(world, random, x, y, z))
         {
-            if(!((WorldFeature) (treeBig)).place(world, random, i, j, k)) {
-                world.setBlock(i, j, k, id);
+            if(!((WorldFeature) (treeBig)).place(world, random, x, y, z)) {
+                world.setBlock(x, y, z, id);
             }
         }
     }
diff --git a/src/main/java/net/minecraft/core/block/SaplingEucalyptusBlock.java b/src/main/java/net/minecraft/core/block/SaplingEucalyptusBlock.java
index 58c267aa6..64fa1f8e9 100644
--- a/src/main/java/net/minecraft/core/block/SaplingEucalyptusBlock.java
+++ b/src/main/java/net/minecraft/core/block/SaplingEucalyptusBlock.java
@@ -19,17 +19,17 @@ public class SaplingEucalyptusBlock extends SaplingBaseBlock
     }
     
     @Override
-	public void growTree(World world, int i, int j, int k, Random random)
+	public void growTree(World world, int x, int y, int z, Random random)
     {
     	WorldFeature obj = null;
         
-    	world.setBlock(i, j, k, 0);
+    	world.setBlock(x, y, z, 0);
         
         obj = new WorldFeatureTreeEucalyptus(Blocks.LEAVES_EUCALYPTUS.id, Blocks.LOG_EUCALYPTUS.id);
         obj.init(1.0D, 1.0D, 1.0D);
-        if(!obj.place(world, random, i, j, k))
+        if(!obj.place(world, random, x, y, z))
         {
-            world.setBlock(i, j, k, id);
+            world.setBlock(x, y, z, id);
         }
     }
 }
diff --git a/src/main/java/net/minecraft/core/block/SaplingOakBlock.java b/src/main/java/net/minecraft/core/block/SaplingOakBlock.java
index a4b0410c2..4a1365258 100644
--- a/src/main/java/net/minecraft/core/block/SaplingOakBlock.java
+++ b/src/main/java/net/minecraft/core/block/SaplingOakBlock.java
@@ -20,16 +20,16 @@ public class SaplingOakBlock extends SaplingBaseBlock
     }
     
     @Override
-	public void growTree(World world, int i, int j, int k, Random random)
+	public void growTree(World world, int x, int y, int z, Random random)
     {
     	Object treeBig = new WorldFeatureTreeFancy(Blocks.LEAVES_OAK.id, Blocks.LOG_OAK.id);
         Object treeSmall = new WorldFeatureTree(Blocks.LEAVES_OAK.id, Blocks.LOG_OAK.id, 4);
-    	world.setBlock(i, j, k, 0);
+    	world.setBlock(x, y, z, 0);
 
-        if(!((WorldFeature) (treeSmall)).place(world, random, i, j, k))
+        if(!((WorldFeature) (treeSmall)).place(world, random, x, y, z))
         {
-            if(!((WorldFeature) (treeBig)).place(world, random, i, j, k)) {
-                world.setBlock(i, j, k, id);
+            if(!((WorldFeature) (treeBig)).place(world, random, x, y, z)) {
+                world.setBlock(x, y, z, id);
             }
         }
     }
diff --git a/src/main/java/net/minecraft/core/block/SaplingPineBlock.java b/src/main/java/net/minecraft/core/block/SaplingPineBlock.java
index dec0a43db..901b049c6 100644
--- a/src/main/java/net/minecraft/core/block/SaplingPineBlock.java
+++ b/src/main/java/net/minecraft/core/block/SaplingPineBlock.java
@@ -42,17 +42,17 @@ public class SaplingPineBlock extends SaplingBaseBlock
     }
     
     @Override
-	public void growTree(World world, int i, int j, int k, Random random)
+	public void growTree(World world, int x, int y, int z, Random random)
     {
         Object treeBig  = new WorldFeatureTreeTaigaTall(Blocks.LEAVES_PINE.id, Blocks.LOG_PINE.id);
         Object treeSmall = new WorldFeatureTreeTaigaBushy(Blocks.LEAVES_PINE.id, Blocks.LOG_PINE.id);
         
-    	world.setBlock(i, j, k, 0);
+    	world.setBlock(x, y, z, 0);
 
-        if(!((WorldFeature) (treeSmall)).place(world, random, i, j, k))
+        if(!((WorldFeature) (treeSmall)).place(world, random, x, y, z))
         {
-            if(!((WorldFeature) (treeBig)).place(world, random, i, j, k)) {
-                world.setBlock(i, j, k, id);
+            if(!((WorldFeature) (treeBig)).place(world, random, x, y, z)) {
+                world.setBlock(x, y, z, id);
             }
         }
     }
diff --git a/src/main/java/net/minecraft/core/block/SaplingRetroBlock.java b/src/main/java/net/minecraft/core/block/SaplingRetroBlock.java
index c4ac5780e..f378b2f96 100644
--- a/src/main/java/net/minecraft/core/block/SaplingRetroBlock.java
+++ b/src/main/java/net/minecraft/core/block/SaplingRetroBlock.java
@@ -21,16 +21,16 @@ public class SaplingRetroBlock extends SaplingBaseBlock
 
 
     @Override
-	public void growTree(World world, int i, int j, int k, Random random)
+	public void growTree(World world, int x, int y, int z, Random random)
     {
         Object treeBig  = new WorldFeatureTreeFancy(Blocks.LEAVES_OAK_RETRO.id, Blocks.LOG_OAK.id);
         Object treeSmall = new WorldFeatureTree(Blocks.LEAVES_OAK_RETRO.id, Blocks.LOG_OAK.id, 4);
-        world.setBlock(i, j, k, 0);
+        world.setBlock(x, y, z, 0);
 
-        if(!((WorldFeature) (treeSmall)).place(world, random, i, j, k))
+        if(!((WorldFeature) (treeSmall)).place(world, random, x, y, z))
         {
-            if(!((WorldFeature) (treeBig)).place(world, random, i, j, k)) {
-                world.setBlock(i, j, k, id);
+            if(!((WorldFeature) (treeBig)).place(world, random, x, y, z)) {
+                world.setBlock(x, y, z, id);
             }
         }
     }
diff --git a/src/main/java/net/minecraft/core/block/SaplingShrubBlock.java b/src/main/java/net/minecraft/core/block/SaplingShrubBlock.java
index ff81de64a..b77d4a015 100644
--- a/src/main/java/net/minecraft/core/block/SaplingShrubBlock.java
+++ b/src/main/java/net/minecraft/core/block/SaplingShrubBlock.java
@@ -19,17 +19,17 @@ public class SaplingShrubBlock extends SaplingBaseBlock
     }
     
     @Override
-	public void growTree(World world, int i, int j, int k, Random random)
+	public void growTree(World world, int x, int y, int z, Random random)
     {
     	Object obj = null;
         
-    	world.setBlock(i, j, k, 0);
+    	world.setBlock(x, y, z, 0);
         
     	obj = new WorldFeatureTreeShrub(Blocks.LEAVES_SHRUB.id, Blocks.LOG_OAK.id);
         
-        if(!((WorldFeature) (obj)).place(world, random, i, j, k))
+        if(!((WorldFeature) (obj)).place(world, random, x, y, z))
         {
-            world.setBlock(i, j, k, id);
+            world.setBlock(x, y, z, id);
         }
     }
 }
diff --git a/src/main/java/net/minecraft/core/block/SlabBlock.java b/src/main/java/net/minecraft/core/block/SlabBlock.java
index d640de755..86513126a 100644
--- a/src/main/java/net/minecraft/core/block/SlabBlock.java
+++ b/src/main/java/net/minecraft/core/block/SlabBlock.java
@@ -188,8 +188,8 @@ public class SlabBlock extends Block
     }
 
     @Override
-    public void onBlockPlacedByMob(World world, int x, int y, int z, @NotNull Side side, Mob mob, double sideHeight) {
-    	Direction dir = mob.getVerticalPlacementDirection(side, sideHeight);
+    public void onBlockPlacedByMob(World world, int x, int y, int z, @NotNull Side side, Mob mob, double xPlaced, double yPlaced) {
+    	Direction dir = mob.getVerticalPlacementDirection(side, yPlaced);
     	if(dir == Direction.DOWN) {
             world.setBlockMetadataWithNotify(x, y, z, 0);
     	}
@@ -197,6 +197,15 @@ public class SlabBlock extends Block
             world.setBlockMetadataWithNotify(x, y, z, 2);
     	}
     }
+
+    @Override
+    public void onBlockPlacedOnSide(World world, int x, int y, int z, @NotNull Side side, double xPlaced, double yPlaced) {
+        if(side == Side.TOP) {
+            world.setBlockMetadataWithNotify(x, y, z, 2);
+        } else {
+            world.setBlockMetadataWithNotify(x, y, z, 0);
+        }
+    }
     
     @Override
 	public void onBlockPlacedByWorld(World world, int x, int y, int z)
diff --git a/src/main/java/net/minecraft/core/block/SnowLayerBlock.java b/src/main/java/net/minecraft/core/block/SnowLayerBlock.java
index 60271389c..d8f08df6a 100644
--- a/src/main/java/net/minecraft/core/block/SnowLayerBlock.java
+++ b/src/main/java/net/minecraft/core/block/SnowLayerBlock.java
@@ -71,22 +71,12 @@ public class SnowLayerBlock extends BaseLayerBlock
     @Override
 	public void onNeighborBlockChange(World world, int x, int y, int z, int blockId)
     {
-        func_314_h(world, x, y, z);
-    }
-
-    private boolean func_314_h(World world, int i, int j, int k)
-    {
-        if(!canPlaceBlockAt(world, i, j, k))
-        {
-            dropBlockWithCause(world, EnumDropCause.WORLD, i, j, k, world.getBlockMetadata(i, j, k), null, null);
-            world.setBlockWithNotify(i, j, k, 0);
-            return false;
-        } else
-        {
-            return true;
+        // Remove if no longer valid
+        if (!canPlaceBlockAt(world, x, y, z)) {
+            dropBlockWithCause(world, EnumDropCause.WORLD, x, y, z, world.getBlockMetadata(x, y, z), null, null);
+            world.setBlockWithNotify(x, y, z, 0);
         }
     }
-
     @Override
     public ItemStack[] getBreakResult(World world, EnumDropCause dropCause, int meta, BlockEntity blockEntity)
     {
diff --git a/src/main/java/net/minecraft/core/block/SpikesBlock.java b/src/main/java/net/minecraft/core/block/SpikesBlock.java
index 7eb59e2d6..e703356fa 100644
--- a/src/main/java/net/minecraft/core/block/SpikesBlock.java
+++ b/src/main/java/net/minecraft/core/block/SpikesBlock.java
@@ -8,6 +8,7 @@ import net.minecraft.core.enums.EnumDropCause;
 import net.minecraft.core.item.ItemStack;
 import net.minecraft.core.util.helper.MathHelper;
 import net.minecraft.core.util.helper.Side;
+import net.minecraft.core.world.LevelListener;
 import net.minecraft.core.world.World;
 import net.minecraft.core.block.material.Material;
 import net.minecraft.core.util.phys.AABB;
@@ -17,6 +18,7 @@ import org.jetbrains.annotations.NotNull;
 
 public class SpikesBlock extends Block
 {
+    public static final int MASK_POWERED = 0b0000_0001;
 
     public SpikesBlock(String key, String namespaceId, int id, Material mat)
     {
@@ -24,14 +26,14 @@ public class SpikesBlock extends Block
     }
 
     @Override
-    public void onBlockPlacedByMob(World world, int x, int y, int z, @NotNull Side side, Mob mob, double sideHeight) {
+    public void onBlockPlacedOnSide(World world, int x, int y, int z, @NotNull Side side, double xPlaced, double yPlaced) {
         if (world.isClientSide) {
             return;
         }
 
         int meta = world.getBlockMetadata(x, y, z);
         if(world.hasNeighborSignal(x, y, z)) {
-            world.setBlockMetadataWithNotify(x, y, z, meta | 1);
+            world.setBlockMetadataWithNotify(x, y, z, meta | MASK_POWERED);
         }
     }
 
@@ -61,15 +63,15 @@ public class SpikesBlock extends Block
 		}
 
 		int meta = world.getBlockMetadata(x, y, z);
-		boolean wasPowered = (meta & 1) > 0;
+		boolean wasPowered = (meta & MASK_POWERED) != 0;
 		boolean isPowered = world.hasNeighborSignal(x, y, z);
 		
 		if(isPowered != wasPowered) {
 			if(isPowered) {
-				world.playBlockEvent(null, 1007, x, y, z, 0);
-				world.setBlockMetadataWithNotify(x, y, z, 1);
+				world.playBlockEvent(null, LevelListener.EVENT_PISTON_RETRACT, x, y, z, 0);
+				world.setBlockMetadataWithNotify(x, y, z, MASK_POWERED);
 			}else {
-				world.playBlockEvent(null, 1006, x, y, z, 0);
+				world.playBlockEvent(null, LevelListener.EVENT_PISTON_EXTEND, x, y, z, 0);
 				world.setBlockMetadataWithNotify(x, y, z, 0);
 			}
 		}
@@ -105,7 +107,7 @@ public class SpikesBlock extends Block
     
     public static boolean isSpikesUp(int i)
     {
-        return (i & 1) != 1;
+        return (i & MASK_POWERED) == 0;
     }
 
     @Override
diff --git a/src/main/java/net/minecraft/core/block/StairsBlock.java b/src/main/java/net/minecraft/core/block/StairsBlock.java
index 39336b3c0..da7d7c494 100644
--- a/src/main/java/net/minecraft/core/block/StairsBlock.java
+++ b/src/main/java/net/minecraft/core/block/StairsBlock.java
@@ -307,7 +307,7 @@ public class StairsBlock extends Block
     }
     
     @Override
-    public void onBlockPlacedByMob(World world, int x, int y, int z, @NotNull Side side, Mob mob, double sideHeight) {
+    public void onBlockPlacedByMob(World world, int x, int y, int z, @NotNull Side side, Mob mob, double xPlaced, double yPlaced) {
 //    	System.out.println("Placed Side: "+side+" Height: "+sideHeight);
     	
         int meta = world.getBlockMetadata(x, y, z) & 0xF0;
@@ -318,13 +318,32 @@ public class StairsBlock extends Block
         if(hRotation == Direction.SOUTH) meta |= 0b0011;
         if(hRotation == Direction.WEST) meta |= 0b0000;
 
-        Direction vRotation = mob.getVerticalPlacementDirection(side, sideHeight);
+        Direction vRotation = mob.getVerticalPlacementDirection(side, yPlaced);
         if (vRotation == Direction.DOWN) meta |= 0b0000;
         if (vRotation == Direction.UP) meta |= 0b1000;
 
         world.setBlockMetadataWithNotify(x, y, z, meta);
     }
-    
+
+    @Override
+    public void onBlockPlacedOnSide(World world, int x, int y, int z, @NotNull Side side, double xPlaced, double yPlaced) {
+        int meta = world.getBlockMetadata(x, y, z) & 0xF0;
+
+        Side hSide = !side.isHorizontal() ? Side.NORTH : side;
+        Direction hRotation = side.getOpposite().getDirection();
+        if(hRotation == Direction.NORTH) meta |= 0b0010;
+        if(hRotation == Direction.EAST) meta |= 0b0001;
+        if(hRotation == Direction.SOUTH) meta |= 0b0011;
+        if(hRotation == Direction.WEST) meta |= 0b0000;
+
+        Side vSide = !side.isVertical() ? Side.BOTTOM : side;
+        Direction vRotation = vSide.getDirection();
+        if (vRotation == Direction.DOWN) meta |= 0b0000;
+        if (vRotation == Direction.UP) meta |= 0b1000;
+
+        world.setBlockMetadataWithNotify(x, y, z, meta);
+    }
+
     @Override
     public float getAmbientOcclusionStrength(WorldSource blockAccess, int x, int y, int z) {
     	return 0.0f;
diff --git a/src/main/java/net/minecraft/core/block/StillFluidBlock.java b/src/main/java/net/minecraft/core/block/StillFluidBlock.java
index 309865dcf..5e9e11587 100644
--- a/src/main/java/net/minecraft/core/block/StillFluidBlock.java
+++ b/src/main/java/net/minecraft/core/block/StillFluidBlock.java
@@ -29,13 +29,13 @@ public class StillFluidBlock extends FluidBlock
         }
     }
 
-    private void setFlowing(World world, int i, int j, int k)
+    private void setFlowing(World world, int x, int y, int z)
     {
-        int l = world.getBlockMetadata(i, j, k);
+        int meta = world.getBlockMetadata(x, y, z);
         world.noNeighborUpdate = true;
-        world.setBlockAndMetadata(i, j, k, id - 1, l);
-        world.markBlocksDirty(i, j, k, i, j, k);
-        world.scheduleBlockUpdate(i, j, k, id - 1, tickDelay());
+        world.setBlockAndMetadata(x, y, z, id - 1, meta);
+        world.markBlocksDirty(x, y, z, x, y, z);
+        world.scheduleBlockUpdate(x, y, z, id - 1, tickDelay());
         world.noNeighborUpdate = false;
     }
 
diff --git a/src/main/java/net/minecraft/core/block/SugarcaneBlock.java b/src/main/java/net/minecraft/core/block/SugarcaneBlock.java
index 261a510c6..3337905eb 100644
--- a/src/main/java/net/minecraft/core/block/SugarcaneBlock.java
+++ b/src/main/java/net/minecraft/core/block/SugarcaneBlock.java
@@ -98,12 +98,12 @@ public class SugarcaneBlock extends Block implements IBonemealable
         checkBlockCoordValid(world, x, y, z);
     }
 
-    protected final void checkBlockCoordValid(World world, int i, int j, int k)
+    protected final void checkBlockCoordValid(World world, int x, int y, int z)
     {
-        if(!canBlockStay(world, i, j, k))
+        if(!canBlockStay(world, x, y, z))
         {
-            dropBlockWithCause(world, EnumDropCause.WORLD, i, j, k, world.getBlockMetadata(i, j, k), null, null);
-            world.setBlockWithNotify(i, j, k, 0);
+            dropBlockWithCause(world, EnumDropCause.WORLD, x, y, z, world.getBlockMetadata(x, y, z), null, null);
+            world.setBlockWithNotify(x, y, z, 0);
         }
     }
 
diff --git a/src/main/java/net/minecraft/core/block/TorchBlock.java b/src/main/java/net/minecraft/core/block/TorchBlock.java
index 2481adc2c..7d2734603 100644
--- a/src/main/java/net/minecraft/core/block/TorchBlock.java
+++ b/src/main/java/net/minecraft/core/block/TorchBlock.java
@@ -19,6 +19,14 @@ import java.util.Random;
 
 public class TorchBlock extends Block
 {
+    public static final int MASK_DIRECTION = 0b0000_0111;
+    public static final int SIDE_NONE = 0;
+    public static final int SIDE_WEST = 1;
+    public static final int SIDE_EAST = 2;
+    public static final int SIDE_NORTH = 3;
+    public static final int SIDE_SOUTH = 4;
+    public static final int SIDE_BOTTOM = 5;
+    public static final int SIDE_TOP = 6;
 
 	public TorchBlock(String key, String namespaceId, int id)
     {
@@ -73,37 +81,48 @@ public class TorchBlock extends Block
     }
 
     @Override
-    public void onBlockPlacedByMob(World world, int x, int y, int z, @NotNull Side side, Mob mob, double sideHeight) {
-    	int l = side.getId();
-        int i1 = world.getBlockMetadata(x, y, z);
-        if(l == 1 && canPlaceOnTop(world, x, y - 1, z))
-        {
-            i1 = 5;
-        }
-        if(l == 2 && world.isBlockNormalCube(x, y, z + 1))
-        {
-            i1 = 4;
-        }
-        if(l == 3 && world.isBlockNormalCube(x, y, z - 1))
-        {
-            i1 = 3;
-        }
-        if(l == 4 && world.isBlockNormalCube(x + 1, y, z))
-        {
-            i1 = 2;
+    public void onBlockPlacedOnSide(World world, int x, int y, int z, @NotNull Side side, double xPlaced, double yPlaced) {
+        int orientation = SIDE_NONE;
+        switch (side) {
+            case TOP:
+                if(canPlaceOnTop(world, x, y - 1, z))
+                {
+                    orientation = SIDE_BOTTOM;
+                }
+                break;
+            case NORTH:
+                if(world.isBlockNormalCube(x, y, z + 1))
+                {
+                    orientation = SIDE_SOUTH;
+                }
+                break;
+            case SOUTH:
+                if(world.isBlockNormalCube(x, y, z - 1))
+                {
+                    orientation = SIDE_NORTH;
+                }
+                break;
+            case WEST:
+                if(world.isBlockNormalCube(x + 1, y, z))
+                {
+                    orientation = SIDE_EAST;
+                }
+                break;
+            case EAST:
+                if(world.isBlockNormalCube(x - 1, y, z))
+                {
+                    orientation = SIDE_WEST;
+                }
+                break;
         }
-        if(l == 5 && world.isBlockNormalCube(x - 1, y, z))
-        {
-            i1 = 1;
-        }
-        world.setBlockMetadataWithNotify(x, y, z, i1);
+        world.setBlockMetadataWithNotify(x, y, z, orientation);
     }
     
     @Override
 	public void updateTick(World world, int x, int y, int z, Random rand)
     {
         super.updateTick(world, x, y, z, rand);
-        if(world.getBlockMetadata(x, y, z) == 0)
+        if(world.getBlockMetadata(x, y, z) == SIDE_NONE)
         {
             onBlockPlacedByWorld(world, x, y, z);
         }
@@ -114,23 +133,23 @@ public class TorchBlock extends Block
     {
         if(world.isBlockNormalCube(x - 1, y, z))
         {
-            world.setBlockMetadataWithNotify(x, y, z, 1);
+            world.setBlockMetadataWithNotify(x, y, z, SIDE_WEST);
         } else
         if(world.isBlockNormalCube(x + 1, y, z))
         {
-            world.setBlockMetadataWithNotify(x, y, z, 2);
+            world.setBlockMetadataWithNotify(x, y, z, SIDE_EAST);
         } else
         if(world.isBlockNormalCube(x, y, z - 1))
         {
-            world.setBlockMetadataWithNotify(x, y, z, 3);
+            world.setBlockMetadataWithNotify(x, y, z, SIDE_NORTH);
         } else
         if(world.isBlockNormalCube(x, y, z + 1))
         {
-            world.setBlockMetadataWithNotify(x, y, z, 4);
+            world.setBlockMetadataWithNotify(x, y, z, SIDE_SOUTH);
         } else
         if(canPlaceOnTop(world, x, y - 1, z))
         {
-            world.setBlockMetadataWithNotify(x, y, z, 5);
+            world.setBlockMetadataWithNotify(x, y, z, SIDE_BOTTOM);
         }
         dropTorchIfCantStay(world, x, y, z);
     }
@@ -138,44 +157,40 @@ public class TorchBlock extends Block
     @Override
 	public void onNeighborBlockChange(World world, int x, int y, int z, int blockId)
     {
-        if(dropTorchIfCantStay(world, x, y, z))
+        boolean invalid;
+        int side = world.getBlockMetadata(x, y, z) & MASK_DIRECTION;
+        switch (side) {
+            case SIDE_WEST:
+                invalid = !world.isBlockNormalCube(x - 1, y, z);
+                break;
+            case SIDE_EAST:
+                invalid = !world.isBlockNormalCube(x + 1, y, z);
+                break;
+            case SIDE_NORTH:
+                invalid = !world.isBlockNormalCube(x, y, z - 1);
+                break;
+            case SIDE_SOUTH:
+                invalid = !world.isBlockNormalCube(x, y, z + 1);
+                break;
+            case SIDE_BOTTOM:
+                invalid = !world.isBlockNormalCube(x, y - 1, z);
+                break;
+            default:
+                invalid = true;
+        }
+        if(invalid)
         {
-            int i1 = world.getBlockMetadata(x, y, z);
-            boolean flag = false;
-            if(!world.isBlockNormalCube(x - 1, y, z) && i1 == 1)
-            {
-                flag = true;
-            }
-            if(!world.isBlockNormalCube(x + 1, y, z) && i1 == 2)
-            {
-                flag = true;
-            }
-            if(!world.isBlockNormalCube(x, y, z - 1) && i1 == 3)
-            {
-                flag = true;
-            }
-            if(!world.isBlockNormalCube(x, y, z + 1) && i1 == 4)
-            {
-                flag = true;
-            }
-            if(!canPlaceOnTop(world, x, y - 1, z) && i1 == 5)
-            {
-                flag = true;
-            }
-            if(flag)
-            {
-                dropBlockWithCause(world, EnumDropCause.WORLD, x, y, z, i1, null, null);
-                world.setBlockWithNotify(x, y, z, 0);
-            }
+            dropBlockWithCause(world, EnumDropCause.WORLD, x, y, z, side, null, null);
+            world.setBlockWithNotify(x, y, z, 0);
         }
     }
 
-    private boolean dropTorchIfCantStay(World world, int i, int j, int k)
+    private boolean dropTorchIfCantStay(World world, int x, int y, int z)
     {
-        if(!canPlaceBlockAt(world, i, j, k))
+        if(!canPlaceBlockAt(world, x, y, z))
         {
-            dropBlockWithCause(world, EnumDropCause.WORLD, i, j, k, world.getBlockMetadata(i, j, k), null, null);
-            world.setBlockWithNotify(i, j, k, 0);
+            dropBlockWithCause(world, EnumDropCause.WORLD, x, y, z, world.getBlockMetadata(x, y, z), null, null);
+            world.setBlockWithNotify(x, y, z, 0);
             return false;
         } else
         {
@@ -186,27 +201,25 @@ public class TorchBlock extends Block
     @Override
     public HitResult collisionRayTrace(World world, int x, int y, int z, Vec3 start, Vec3 end)
     {
-        int l = world.getBlockMetadata(x, y, z) & 7;
         float f = 0.15F;
-        if(l == 1)
-        {
-            setBlockBounds(0.0F, 0.2F, 0.5F - f, f * 2.0F, 0.8F, 0.5F + f);
-        } else
-        if(l == 2)
-        {
-            setBlockBounds(1.0F - f * 2.0F, 0.2F, 0.5F - f, 1.0F, 0.8F, 0.5F + f);
-        } else
-        if(l == 3)
-        {
-            setBlockBounds(0.5F - f, 0.2F, 0.0F, 0.5F + f, 0.8F, f * 2.0F);
-        } else
-        if(l == 4)
-        {
-            setBlockBounds(0.5F - f, 0.2F, 1.0F - f * 2.0F, 0.5F + f, 0.8F, 1.0F);
-        } else
-        {
-            float f1 = 0.1F;
-            setBlockBounds(0.5F - f1, 0.0F, 0.5F - f1, 0.5F + f1, 0.6F, 0.5F + f1);
+        int side = world.getBlockMetadata(x, y, z) & MASK_DIRECTION;
+        switch (side) {
+            case SIDE_WEST:
+                setBlockBounds(0.0F, 0.2F, 0.5F - f, f * 2.0F, 0.8F, 0.5F + f);
+                break;
+            case SIDE_EAST:
+                setBlockBounds(1.0F - f * 2.0F, 0.2F, 0.5F - f, 1.0F, 0.8F, 0.5F + f);
+                break;
+            case SIDE_NORTH:
+                setBlockBounds(0.5F - f, 0.2F, 0.0F, 0.5F + f, 0.8F, f * 2.0F);
+                break;
+            case SIDE_SOUTH:
+                setBlockBounds(0.5F - f, 0.2F, 1.0F - f * 2.0F, 0.5F + f, 0.8F, 1.0F);
+                break;
+            case SIDE_BOTTOM:
+                final float f1 = 0.1F;
+                setBlockBounds(0.5F - f1, 0.0F, 0.5F - f1, 0.5F + f1, 0.6F, 0.5F + f1);
+                break;
         }
         return super.collisionRayTrace(world, x, y, z, start, end);
     }
@@ -214,35 +227,33 @@ public class TorchBlock extends Block
     @Override
 	public void animationTick(World world, int x, int y, int z, Random rand)
     {
-        int l = world.getBlockMetadata(x, y, z);
         double xPos = (double) x + 0.5D;
         double yPos = (double) y + 0.7D;
         double zPos = (double) z + 0.5D;
         double d3 = 0.22D;
         double d4 = 0.27D;
-        if(l == 1)
-        {
-            world.spawnParticle("smoke", xPos - d4, yPos + d3, zPos, 0.0D, 0.0D, 0.0D, 0);
-            world.spawnParticle("flame", xPos - d4, yPos + d3, zPos, 0.0D, 0.0D, 0.0D, 0);
-        } else
-        if(l == 2)
-        {
-            world.spawnParticle("smoke", xPos + d4, yPos + d3, zPos, 0.0D, 0.0D, 0.0D, 0);
-            world.spawnParticle("flame", xPos + d4, yPos + d3, zPos, 0.0D, 0.0D, 0.0D, 0);
-        } else
-        if(l == 3)
-        {
-            world.spawnParticle("smoke", xPos, yPos + d3, zPos - d4, 0.0D, 0.0D, 0.0D, 0);
-            world.spawnParticle("flame", xPos, yPos + d3, zPos - d4, 0.0D, 0.0D, 0.0D, 0);
-        } else
-        if(l == 4)
-        {
-            world.spawnParticle("smoke", xPos, yPos + d3, zPos + d4, 0.0D, 0.0D, 0.0D, 0);
-            world.spawnParticle("flame", xPos, yPos + d3, zPos + d4, 0.0D, 0.0D, 0.0D, 0);
-        } else
-        {
-            world.spawnParticle("smoke", xPos, yPos, zPos, 0.0D, 0.0D, 0.0D, 0);
-            world.spawnParticle("flame", xPos, yPos, zPos, 0.0D, 0.0D, 0.0D, 0);
+        int side = world.getBlockMetadata(x, y, z) & MASK_DIRECTION;
+        switch (side) {
+            case SIDE_WEST:
+                world.spawnParticle("smoke", xPos - d4, yPos + d3, zPos, 0.0D, 0.0D, 0.0D, 0);
+                world.spawnParticle("flame", xPos - d4, yPos + d3, zPos, 0.0D, 0.0D, 0.0D, 0);
+                break;
+            case SIDE_EAST:
+                world.spawnParticle("smoke", xPos + d4, yPos + d3, zPos, 0.0D, 0.0D, 0.0D, 0);
+                world.spawnParticle("flame", xPos + d4, yPos + d3, zPos, 0.0D, 0.0D, 0.0D, 0);
+                break;
+            case SIDE_NORTH:
+                world.spawnParticle("smoke", xPos, yPos + d3, zPos - d4, 0.0D, 0.0D, 0.0D, 0);
+                world.spawnParticle("flame", xPos, yPos + d3, zPos - d4, 0.0D, 0.0D, 0.0D, 0);
+                break;
+            case SIDE_SOUTH:
+                world.spawnParticle("smoke", xPos, yPos + d3, zPos + d4, 0.0D, 0.0D, 0.0D, 0);
+                world.spawnParticle("flame", xPos, yPos + d3, zPos + d4, 0.0D, 0.0D, 0.0D, 0);
+                break;
+            case SIDE_BOTTOM:
+                world.spawnParticle("smoke", xPos, yPos, zPos, 0.0D, 0.0D, 0.0D, 0);
+                world.spawnParticle("flame", xPos, yPos, zPos, 0.0D, 0.0D, 0.0D, 0);
+                break;
         }
     }
     
diff --git a/src/main/java/net/minecraft/core/block/TrapDoorBlock.java b/src/main/java/net/minecraft/core/block/TrapDoorBlock.java
index ea399580d..1207293a9 100644
--- a/src/main/java/net/minecraft/core/block/TrapDoorBlock.java
+++ b/src/main/java/net/minecraft/core/block/TrapDoorBlock.java
@@ -2,7 +2,6 @@ package net.minecraft.core.block;
 
 import net.minecraft.core.block.entity.ActivatorBlockEntity;
 import net.minecraft.core.block.material.Material;
-import net.minecraft.core.entity.Mob;
 import net.minecraft.core.entity.player.Player;
 import net.minecraft.core.enums.PlacementMode;
 import net.minecraft.core.item.Item;
@@ -19,11 +18,12 @@ import net.minecraft.core.world.WorldSource;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
 
-// Referenced classes of package net.minecraft.src:
-//            Block, Material, IBlockAccess, World, 
-//            AxisAlignedBB, Player, Vec3D, MovingObjectPosition
-
 public class TrapDoorBlock extends Block {
+    public static final int DIRECTION_SOUTH = 0;
+    public static final int DIRECTION_NORTH = 1;
+    public static final int DIRECTION_EAST = 2;
+    public static final int DIRECTION_WEST = 3;
+
     public static final int MASK_DIRECTION = 0b0000_0011;
     public static final int MASK_OPEN = 0b0000_0100;
     public static final int MASK_UPPER_HALF = 0b0000_1000;
@@ -36,9 +36,7 @@ public class TrapDoorBlock extends Block {
     }
 
     @Override
-    public void onBlockPlacedByMob(World world, int x, int y, int z, @NotNull Side side, Mob mob, double sideHeight) {
-        super.onBlockPlacedByMob(world, x, y, z, side, mob, sideHeight);
-
+    public void onBlockPlacedOnSide(World world, int x, int y, int z, @NotNull Side side, double xPlaced, double yPlaced) {
         int meta = world.getBlockMetadata(x, y, z);
         boolean isOpened = isTrapdoorOpen(meta);
         boolean isPowered = world.hasNeighborSignal(x, y, z);
@@ -72,30 +70,27 @@ public class TrapDoorBlock extends Block {
 
     @Override
     public void setBlockBoundsBasedOnState(WorldSource world, int x, int y, int z) {
-        setBlockBoundsForBlockRender(world.getBlockMetadata(x, y, z));
-    }
-
-    public void setBlockBoundsForBlockRender(int i) {
-        float f = 0.1875F;
+        int meta = world.getBlockMetadata(x, y, z);
+        float thickness = 3/16f;
 
-        if (isTrapdoorOpen(i)) {
-            if ((i & 3) == 0) {
-                setBlockBounds(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F);
+        if (isTrapdoorOpen(meta)) {
+            if ((meta & MASK_DIRECTION) == DIRECTION_SOUTH) { // South
+                setBlockBounds(0.0F, 0.0F, 1.0F - thickness, 1.0F, 1.0F, 1.0F);
             }
-            if ((i & 3) == 1) {
-                setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f);
+            if ((meta & MASK_DIRECTION) == DIRECTION_NORTH) { // North
+                setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, thickness);
             }
-            if ((i & 3) == 2) {
-                setBlockBounds(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
+            if ((meta & MASK_DIRECTION) == DIRECTION_EAST) { // East
+                setBlockBounds(1.0F - thickness, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
             }
-            if ((i & 3) == 3) {
-                setBlockBounds(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F);
+            if ((meta & MASK_DIRECTION) == DIRECTION_WEST) { // West
+                setBlockBounds(0.0F, 0.0F, 0.0F, thickness, 1.0F, 1.0F);
             }
         } else {
-            if (isUpperHalf(i)) {
-                setBlockBounds(0.0F, 1.0f - f, 0.0F, 1.0F, 1.0f, 1.0F);
+            if (isUpperHalf(meta)) {
+                setBlockBounds(0.0F, 1.0f - thickness, 0.0F, 1.0F, 1.0f, 1.0F);
             } else {
-                setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, f, 1.0F);
+                setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, thickness, 1.0F);
             }
         }
     }
@@ -111,7 +106,7 @@ public class TrapDoorBlock extends Block {
     public boolean onBlockRightClicked(World world, int x, int y, int z, Player player, Side side, double xPlaced, double yPlaced) {
         if (blockMaterial != Material.metal) {
             int l = world.getBlockMetadata(x, y, z);
-            world.setBlockMetadataWithNotify(x, y, z, l ^ 4);
+            world.setBlockMetadataWithNotify(x, y, z, l ^ MASK_OPEN);
             world.playBlockEvent(player, LevelListener.EVENT_DOOR_SOUND, x, y, z, 0);
             return true;
         }
@@ -122,7 +117,7 @@ public class TrapDoorBlock extends Block {
     public void onActivatorInteract(World world, int x, int y, int z, ActivatorBlockEntity activator, Direction direction) {
         if (blockMaterial != Material.metal) {
             int l = world.getBlockMetadata(x, y, z);
-            world.setBlockMetadataWithNotify(x, y, z, l ^ 4);
+            world.setBlockMetadataWithNotify(x, y, z, l ^ MASK_OPEN);
             world.playBlockEvent(null, LevelListener.EVENT_DOOR_SOUND, x, y, z, 0);
         }
     }
@@ -153,7 +148,7 @@ public class TrapDoorBlock extends Block {
     public int getPlacedBlockMetadata(@Nullable Player player, ItemStack stack, World world, int x, int y, int z, Side side, double xPlaced, double yPlaced) {
         int meta = getMetaForDirection(player == null ? side.getDirection().getOpposite() : player.getHorizontalPlacementDirection(side, PlacementMode.SIDE));
         if (player != null && player.getVerticalPlacementDirection(side, yPlaced) == Direction.UP) {
-            meta |= 8;
+            meta = setUpperHalf(meta, true);
         }
         return meta;
     }
@@ -198,11 +193,20 @@ public class TrapDoorBlock extends Block {
     }
 
     public int getMetaForDirection(Direction dir) {
-        return dir.getId();
+        switch (dir) {
+            case SOUTH:
+                return DIRECTION_SOUTH;
+            case NORTH:
+                return DIRECTION_NORTH;
+            case EAST:
+                return DIRECTION_EAST;
+            case WEST:
+                return DIRECTION_WEST;
+        }
+        return 0;
     }
 
     public Direction getDirectionForMeta(int meta) {
-        meta = meta & MASK_DIRECTION;
-        return Direction.getDirectionById(meta);
+        return Direction.getDirectionById(meta & MASK_DIRECTION);
     }
 }
diff --git a/src/main/java/net/minecraft/core/block/TrommelBlock.java b/src/main/java/net/minecraft/core/block/TrommelBlock.java
index 2a33d21da..af600fa24 100644
--- a/src/main/java/net/minecraft/core/block/TrommelBlock.java
+++ b/src/main/java/net/minecraft/core/block/TrommelBlock.java
@@ -24,13 +24,6 @@ public class TrommelBlock extends RotatableEntityBlock
         this.isActive = isActive;
     }
 
-    @Override
-	public void onBlockPlacedByWorld(World world, int x, int y, int z)
-    {
-        super.onBlockPlacedByWorld(world, x, y, z);
-        setDefaultDirection(world, x, y, z);
-    }
-
     @Override
     public ItemStack[] getBreakResult(World world, EnumDropCause dropCause, int meta, BlockEntity blockEntity)
     {
diff --git a/src/main/java/net/minecraft/core/block/VeryRotatableEntityBlock.java b/src/main/java/net/minecraft/core/block/VeryRotatableEntityBlock.java
index 8b2403694..8039803b6 100644
--- a/src/main/java/net/minecraft/core/block/VeryRotatableEntityBlock.java
+++ b/src/main/java/net/minecraft/core/block/VeryRotatableEntityBlock.java
@@ -2,28 +2,44 @@ package net.minecraft.core.block;
 
 import net.minecraft.core.block.material.Material;
 import net.minecraft.core.entity.Mob;
-import net.minecraft.core.enums.PlacementMode;
 import net.minecraft.core.util.helper.Direction;
 import net.minecraft.core.util.helper.Side;
 import net.minecraft.core.world.World;
+import net.minecraft.core.block.entity.ActivatorBlockEntity;
+import org.jetbrains.annotations.NotNull;
 
 public abstract class VeryRotatableEntityBlock extends RotatableEntityBlock {
+    public static final int MASK_DIRECTION = 0b0000_0111;
 	public VeryRotatableEntityBlock(String key, String namespaceId, int id, Material material) {
         super(key, namespaceId, id, material);
     }
 
     @Override
-    public void onBlockPlacedByMob(World world, int x, int y, int z, Side side, Mob mob, double sideHeight) {
+    public void onBlockPlacedByMob(World world, int x, int y, int z, @NotNull Side side, Mob mob, double xPlaced, double yPlaced) {
         final Direction direction = mob.getPlacementDirection(side).getOpposite();
 
         world.setBlockMetadataWithNotify(x, y, z, directionToMeta(direction));
     }
 
+    @Override
+    public void onBlockPlacedOnSide(World world, int x, int y, int z, @NotNull Side side, double xPlaced, double yPlaced) {
+        final Direction direction = side.getOpposite().getDirection();
+
+        world.setBlockMetadataWithNotify(x, y, z, directionToMeta(direction));
+    }
+
     public static int directionToMeta(Direction direction) {
-        return direction.getId() & 7;
+        return direction.getId() & MASK_DIRECTION;
     }
 
     public static Direction metaToDirection(int meta) {
-        return Direction.getDirectionById(meta & 7);
+        return Direction.getDirectionById(meta & MASK_DIRECTION);
+    }
+
+    @Override
+    public void onBlockPlacedByActivator(World world, int x, int y, int z, ActivatorBlockEntity activator, Direction direction)
+    {
+        super.onBlockPlacedByActivator(world, x, y, z, activator, direction);
+        world.setBlockMetadataWithNotify(x, y, z, RotatableBlock.setDirection(0, direction));
     }
 }
diff --git a/src/main/java/net/minecraft/core/block/entity/BlockEntity.java b/src/main/java/net/minecraft/core/block/entity/BlockEntity.java
index 8328f58f0..c98efbf41 100644
--- a/src/main/java/net/minecraft/core/block/entity/BlockEntity.java
+++ b/src/main/java/net/minecraft/core/block/entity/BlockEntity.java
@@ -142,7 +142,7 @@ public class BlockEntity implements ICarriable
         world.setBlockTileEntity(x, y, z, this);
         Block b = world.getBlock(x, y, z);
         if (b != null && holder instanceof Mob) {
-            b.onBlockPlacedByMob(world, x, y, z, side, (Mob) holder, yPlaced);
+            b.onBlockPlacedByMob(world, x, y, z, side, (Mob) holder, xPlaced, yPlaced);
         }
         world.notifyBlockChange(x, y, z, carriedBlock.blockId);
         return true;
@@ -178,9 +178,7 @@ public class BlockEntity implements ICarriable
         Block currentBlock = world.getBlock(x, y, z);
         int currentMeta = world.getBlockMetadata(x, y, z);
         world.removeBlockTileEntity(x, y, z);
-        Chunk c = world.getChunkFromBlockCoords(x, z);
-        c.setBlockIDRaw(x & 0b1111, y, z & 0b1111, 0);
-        c.recalcHeightmap();
+        world.setBlockRaw(x & 0b1111, y, z & 0b1111, 0);
         world.notifyBlockChange(x, y, z, 0);
         this.worldObj = null;
         this.carriedBlock = getCarriedEntry(world, holder, currentBlock, currentMeta);
diff --git a/src/main/java/net/minecraft/core/block/motion/CarriedBlock.java b/src/main/java/net/minecraft/core/block/motion/CarriedBlock.java
index dd643a210..4825e7d17 100644
--- a/src/main/java/net/minecraft/core/block/motion/CarriedBlock.java
+++ b/src/main/java/net/minecraft/core/block/motion/CarriedBlock.java
@@ -15,8 +15,6 @@ import net.minecraft.core.world.World;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
 
-import java.util.Objects;
-
 public class CarriedBlock implements ICarriable {
     public int blockId;
     public int metadata;
@@ -66,7 +64,7 @@ public class CarriedBlock implements ICarriable {
 
             Block b = world.getBlock(x, y, z);
             if (b != null && holder instanceof Mob) {
-                b.onBlockPlacedByMob(world, x, y, z, side, (Mob) holder, yPlaced);
+                b.onBlockPlacedByMob(world, x, y, z, side, (Mob) holder, xPlaced, yPlaced);
             }
             return true;
         }
diff --git a/src/main/java/net/minecraft/core/block/piston/MovingPistonBlockEntity.java b/src/main/java/net/minecraft/core/block/piston/MovingPistonBlockEntity.java
index 375b508c8..30de4c93f 100644
--- a/src/main/java/net/minecraft/core/block/piston/MovingPistonBlockEntity.java
+++ b/src/main/java/net/minecraft/core/block/piston/MovingPistonBlockEntity.java
@@ -3,6 +3,7 @@ package net.minecraft.core.block.piston;
 import net.minecraft.core.block.entity.BlockEntity;
 import net.minecraft.core.block.entity.BlockEntityDispatcher;
 import net.minecraft.core.entity.Entity;
+import net.minecraft.core.block.Block;
 import net.minecraft.core.block.Blocks;
 import net.minecraft.core.util.helper.Direction;
 import net.minecraft.core.util.phys.AABB;
@@ -143,9 +144,7 @@ public class MovingPistonBlockEntity extends BlockEntity
         worldObj.removeBlockTileEntity(x, y, z);
         invalidate();
         if(worldObj.getBlockId(x, y, z) == Blocks.PISTON_MOVING.id) {
-            // Don't combine these into setBlockAndMetadata, then onBlockPlacedByWorld can override the metadata
-            worldObj.setBlock(x, y, z, movedId);
-            worldObj.setBlockMetadata(x, y, z, movedData);
+            worldObj.setBlockAndMetadataRaw(x, y, z, movedId, movedData);
             if (movedEntity != null) {
                 BlockEntity oldEnt = worldObj.getBlockEntity(x, y, z);
                 if (oldEnt != null) {
@@ -157,6 +156,9 @@ public class MovingPistonBlockEntity extends BlockEntity
                 movedEntity.z = z;
                 worldObj.replaceBlockTileEntity(x, y, z, movedEntity);
             }
+            if (movedId != 0) {
+                Block.blocksList[movedId].onBlockPlacedByWorld(worldObj, x, y, z);
+            }
             worldObj.notifyBlockChange(x, y, z, movedId);
         }
     }
diff --git a/src/main/java/net/minecraft/core/block/piston/PistonBaseBlock.java b/src/main/java/net/minecraft/core/block/piston/PistonBaseBlock.java
index f1adc8914..de25b0b39 100644
--- a/src/main/java/net/minecraft/core/block/piston/PistonBaseBlock.java
+++ b/src/main/java/net/minecraft/core/block/piston/PistonBaseBlock.java
@@ -45,7 +45,7 @@ public class PistonBaseBlock extends Block
     }
 
     @Override
-    public void onBlockPlacedByMob(World world, int x, int y, int z, @NotNull Side side, Mob mob, double sideHeight) {
+    public void onBlockPlacedByMob(World world, int x, int y, int z, @NotNull Side side, Mob mob, double xPlaced, double yPlaced) {
     	Direction placementDirection = mob.getPlacementDirection(side).getOpposite();
         world.setBlockMetadataWithNotify(x, y, z, placementDirection.getId());
         if(!world.isClientSide)
@@ -54,6 +54,16 @@ public class PistonBaseBlock extends Block
         }
     }
 
+    @Override
+    public void onBlockPlacedOnSide(World world, int x, int y, int z, @NotNull Side side, double xPlaced, double yPlaced) {
+        Direction placementDirection = side.getOpposite().getDirection();
+        world.setBlockMetadataWithNotify(x, y, z, placementDirection.getId());
+        if(!world.isClientSide)
+        {
+            checkIfExtend(world, x, y, z);
+        }
+    }
+
     @Override
 	public void onNeighborBlockChange(World world, int x, int y, int z, int blockId)
     {
@@ -135,7 +145,7 @@ public class PistonBaseBlock extends Block
     public void triggerEvent(World world, int x, int y, int z, int index, int data)
     {
         Direction direction = getDirection(data);
-        if (direction == Direction.NONE) direction = Direction.DOWN; // Probably going to end with a downwards facing bedrock breaker
+        if (direction == Direction.NONE) return;
         if(index == EVENT_EXTEND)
         {
             extendEvent(world, x, y, z, data, direction);
@@ -339,7 +349,7 @@ public class PistonBaseBlock extends Block
             int pushId = world.getBlockId(px, py, pz);
             int pushMeta = world.getBlockMetadata(px, py, pz);
             BlockEntity pushEntity = world.getBlockEntity(px, py, pz);
-            if (pushEntity instanceof MovingPistonBlockEntity) {
+            if (pushEntity instanceof MovingPistonBlockEntity && px == x && py == y && pz == z) {
                 break;
             }
             if(pushId == id && px == x && py == y && pz == z)
@@ -365,6 +375,8 @@ public class PistonBaseBlock extends Block
                 world.setBlockAndMetadata(xo, yo, zo, Blocks.PISTON_MOVING.id, pushMeta);
                 world.replaceBlockTileEntity(xo, yo, zo, MovingPistonBlock.createTileEntity(pushId, pushMeta, pushEntity, direction, true, false));
             }
+            if (!(px == x && py == y && pz == z))
+                world.setBlockAndMetadataRaw(px, py, pz, 0, 0);
             xo = px;
             yo = py;
             zo = pz;
diff --git a/src/main/java/net/minecraft/core/data/gamerule/GameRules.java b/src/main/java/net/minecraft/core/data/gamerule/GameRules.java
index 2c19c2f27..ef514cbfc 100644
--- a/src/main/java/net/minecraft/core/data/gamerule/GameRules.java
+++ b/src/main/java/net/minecraft/core/data/gamerule/GameRules.java
@@ -13,6 +13,7 @@ public abstract class GameRules
     public static GameRuleBoolean DWARF_MODE = register(new GameRuleBoolean("dwarfMode", false));
     public static GameRuleBoolean MOB_GRIEFING = register(new GameRuleBoolean("mobGriefing", true));
     public static GameRuleBoolean DO_DAY_CYCLE = register(new GameRuleBoolean("doDaylightCycle", true));
+    public static GameRuleBoolean DO_WEATHER_CYCLE = register(new GameRuleBoolean("doWeatherCycle", true));
     public static GameRuleBoolean INSTANT_HEALING = register(new GameRuleBoolean("instantHealing", false));
 
     public static <T extends GameRule<?>> T register(T gameRule)
diff --git a/src/main/java/net/minecraft/core/data/gamerule/TreecapitatorHelper.java b/src/main/java/net/minecraft/core/data/gamerule/TreecapitatorHelper.java
index 45c6d8828..1c9d670d9 100644
--- a/src/main/java/net/minecraft/core/data/gamerule/TreecapitatorHelper.java
+++ b/src/main/java/net/minecraft/core/data/gamerule/TreecapitatorHelper.java
@@ -12,6 +12,7 @@ import net.minecraft.core.entity.ItemEntity;
 import net.minecraft.core.entity.player.Player;
 import net.minecraft.core.enums.EnumDropCause;
 import net.minecraft.core.item.ItemStack;
+import net.minecraft.core.world.LevelListener;
 import net.minecraft.core.world.World;
 import net.minecraft.core.world.chunk.ChunkPosition;
 
@@ -206,7 +207,7 @@ public class TreecapitatorHelper {
 				}	
 			}
 			if(particle) {
-				world.playBlockEvent(player, 2001, pos.x, pos.y, pos.z, block.id);
+				world.playBlockEvent(player, LevelListener.EVENT_BLOCK_BREAK, pos.x, pos.y, pos.z, block.id);
 			}
 			return true;
 		}
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 98f563649..165da3f22 100644
--- a/src/main/java/net/minecraft/core/data/registry/Registries.java
+++ b/src/main/java/net/minecraft/core/data/registry/Registries.java
@@ -68,7 +68,6 @@ public class Registries extends Registry<Registry<?>>
 
         ITEM_GROUPS.register("minecraft:stones",stackListOf(Blocks.STONE, Blocks.BASALT, Blocks.LIMESTONE, Blocks.GRANITE, Blocks.PERMAFROST, Blocks.NETHERRACK));
         ITEM_GROUPS.register("minecraft:cobblestones",stackListOf(Blocks.COBBLE_STONE, Blocks.COBBLE_BASALT, Blocks.COBBLE_LIMESTONE, Blocks.COBBLE_GRANITE, Blocks.COBBLE_PERMAFROST, Blocks.COBBLE_NETHERRACK));
-        ITEM_GROUPS.register("minecraft:planks",stackListOf(Blocks.PLANKS_OAK, new ItemStack(Blocks.PLANKS_OAK_PAINTED, 1, 0), new ItemStack(Blocks.PLANKS_OAK_PAINTED, 1, 1), new ItemStack(Blocks.PLANKS_OAK_PAINTED, 1, 2), new ItemStack(Blocks.PLANKS_OAK_PAINTED, 1, 3), new ItemStack(Blocks.PLANKS_OAK_PAINTED, 1, 4), new ItemStack(Blocks.PLANKS_OAK_PAINTED, 1, 5), new ItemStack(Blocks.PLANKS_OAK_PAINTED, 1, 6), new ItemStack(Blocks.PLANKS_OAK_PAINTED, 1, 7), new ItemStack(Blocks.PLANKS_OAK_PAINTED, 1, 8), new ItemStack(Blocks.PLANKS_OAK_PAINTED, 1, 9), new ItemStack(Blocks.PLANKS_OAK_PAINTED, 1, 10), new ItemStack(Blocks.PLANKS_OAK_PAINTED, 1, 11), new ItemStack(Blocks.PLANKS_OAK_PAINTED, 1, 12), new ItemStack(Blocks.PLANKS_OAK_PAINTED, 1, 13), new ItemStack(Blocks.PLANKS_OAK_PAINTED, 1, 14), new ItemStack(Blocks.PLANKS_OAK_PAINTED, 1, 15)));
         ITEM_GROUPS.register("minecraft:grasses",stackListOf(Blocks.GRASS, Blocks.GRASS_RETRO));
         ITEM_GROUPS.register("minecraft:dirt",stackListOf(Blocks.DIRT, Blocks.DIRT_SCORCHED));
         ITEM_GROUPS.register("minecraft:trommel_dirt",stackListOf(Blocks.DIRT, Blocks.DIRT_SCORCHED, Blocks.GRASS, Blocks.GRASS_RETRO, Blocks.GRASS_SCORCHED, Blocks.PATH_DIRT, Blocks.FARMLAND_DIRT, Blocks.MUD));
@@ -82,9 +81,46 @@ public class Registries extends Registry<Registry<?>>
         ITEM_GROUPS.register("minecraft:redstone_ores",stackListOf(Blocks.ORE_REDSTONE_STONE, Blocks.ORE_REDSTONE_BASALT, Blocks.ORE_REDSTONE_LIMESTONE, Blocks.ORE_REDSTONE_GRANITE, Blocks.ORE_REDSTONE_GLOWING_STONE, Blocks.ORE_REDSTONE_GLOWING_BASALT, Blocks.ORE_REDSTONE_GLOWING_LIMESTONE, Blocks.ORE_REDSTONE_GLOWING_GRANITE));
         ITEM_GROUPS.register("minecraft:diamond_ores",stackListOf(Blocks.ORE_DIAMOND_STONE, Blocks.ORE_DIAMOND_BASALT, Blocks.ORE_DIAMOND_LIMESTONE, Blocks.ORE_DIAMOND_GRANITE));
         ITEM_GROUPS.register("minecraft:nethercoal_ores", stackListOf(Blocks.ORE_NETHERCOAL_NETHERRACK));
-        ITEM_GROUPS.register("minecraft:chests",stackListOf(Blocks.CHEST_PLANKS_OAK, new ItemStack(Blocks.CHEST_PLANKS_OAK_PAINTED, 1, 0x00), new ItemStack(Blocks.CHEST_PLANKS_OAK_PAINTED, 1, 0x10), new ItemStack(Blocks.CHEST_PLANKS_OAK_PAINTED, 1, 0x20), new ItemStack(Blocks.CHEST_PLANKS_OAK_PAINTED, 1, 0x30), new ItemStack(Blocks.CHEST_PLANKS_OAK_PAINTED, 1, 0x40), new ItemStack(Blocks.CHEST_PLANKS_OAK_PAINTED, 1, 0x50), new ItemStack(Blocks.CHEST_PLANKS_OAK_PAINTED, 1, 0x60), new ItemStack(Blocks.CHEST_PLANKS_OAK_PAINTED, 1, 0x70), new ItemStack(Blocks.CHEST_PLANKS_OAK_PAINTED, 1, 0x80), new ItemStack(Blocks.CHEST_PLANKS_OAK_PAINTED, 1, 0x90), new ItemStack(Blocks.CHEST_PLANKS_OAK_PAINTED, 1, 0xA0), new ItemStack(Blocks.CHEST_PLANKS_OAK_PAINTED, 1, 0xB0), new ItemStack(Blocks.CHEST_PLANKS_OAK_PAINTED, 1, 0xC0), new ItemStack(Blocks.CHEST_PLANKS_OAK_PAINTED, 1, 0xD0), new ItemStack(Blocks.CHEST_PLANKS_OAK_PAINTED, 1, 0xE0), new ItemStack(Blocks.CHEST_PLANKS_OAK_PAINTED, 1, 0xF0)));
-        ITEM_GROUPS.register("minecraft:wools", stackListOf(new ItemStack(Blocks.WOOL, 1, 0), new ItemStack(Blocks.WOOL, 1, 1), new ItemStack(Blocks.WOOL, 1, 2), new ItemStack(Blocks.WOOL, 1, 3), new ItemStack(Blocks.WOOL, 1, 4), new ItemStack(Blocks.WOOL, 1, 5), new ItemStack(Blocks.WOOL, 1, 6), new ItemStack(Blocks.WOOL, 1, 7), new ItemStack(Blocks.WOOL, 1, 8), new ItemStack(Blocks.WOOL, 1, 9), new ItemStack(Blocks.WOOL, 1, 10), new ItemStack(Blocks.WOOL, 1, 11), new ItemStack(Blocks.WOOL, 1, 12), new ItemStack(Blocks.WOOL, 1, 13), new ItemStack(Blocks.WOOL, 1, 14), new ItemStack(Blocks.WOOL, 1, 15)));
-        ITEM_GROUPS.register("minecraft:lamps", stackListOf(new ItemStack(Blocks.LAMP_IDLE, 1, 0), new ItemStack(Blocks.LAMP_IDLE, 1, 1), new ItemStack(Blocks.LAMP_IDLE, 1, 2), new ItemStack(Blocks.LAMP_IDLE, 1, 3), new ItemStack(Blocks.LAMP_IDLE, 1, 4), new ItemStack(Blocks.LAMP_IDLE, 1, 5), new ItemStack(Blocks.LAMP_IDLE, 1, 6), new ItemStack(Blocks.LAMP_IDLE, 1, 7), new ItemStack(Blocks.LAMP_IDLE, 1, 8), new ItemStack(Blocks.LAMP_IDLE, 1, 9), new ItemStack(Blocks.LAMP_IDLE, 1, 10), new ItemStack(Blocks.LAMP_IDLE, 1, 11), new ItemStack(Blocks.LAMP_IDLE, 1, 12), new ItemStack(Blocks.LAMP_IDLE, 1, 13), new ItemStack(Blocks.LAMP_IDLE, 1, 14), new ItemStack(Blocks.LAMP_IDLE, 1, 15)));
+        {
+            List<ItemStack> plankStackList = new ArrayList<>();
+            List<ItemStack> chestStackList = new ArrayList<>();
+            List<ItemStack> stairsStackList = new ArrayList<>();
+            List<ItemStack> slabsStackList = new ArrayList<>();
+            List<ItemStack> fencesStackList = new ArrayList<>();
+            List<ItemStack> fenceGatesStackList = new ArrayList<>();
+            List<ItemStack> trapdoorStackList = new ArrayList<>();
+            List<ItemStack> woolStackList = new ArrayList<>();
+            List<ItemStack> lampStackList = new ArrayList<>();
+
+            plankStackList.add(Blocks.PLANKS_OAK.getDefaultStack());
+            chestStackList.add(Blocks.CHEST_PLANKS_OAK.getDefaultStack());
+            stairsStackList.add(Blocks.STAIRS_PLANKS_OAK.getDefaultStack());
+            slabsStackList.add(Blocks.SLAB_PLANKS_OAK.getDefaultStack());
+            fencesStackList.add(Blocks.FENCE_PLANKS_OAK.getDefaultStack());
+            fenceGatesStackList.add(Blocks.FENCE_GATE_PLANKS_OAK.getDefaultStack());
+            trapdoorStackList.add(Blocks.TRAPDOOR_PLANKS_OAK.getDefaultStack());
+
+            for (DyeColor color : DyeColor.values()) {
+                plankStackList.add(new ItemStack(Blocks.PLANKS_OAK_PAINTED, 1, color.blockMeta));
+                chestStackList.add(new ItemStack(Blocks.CHEST_PLANKS_OAK_PAINTED, 1, color.blockMeta << 4));
+                stairsStackList.add(new ItemStack(Blocks.STAIRS_PLANKS_PAINTED, 1, color.blockMeta << 4));
+                slabsStackList.add(new ItemStack(Blocks.SLAB_PLANKS_PAINTED, 1, color.blockMeta << 4));
+                fencesStackList.add(new ItemStack(Blocks.FENCE_PLANKS_OAK_PAINTED, 1, color.blockMeta));
+                fenceGatesStackList.add(new ItemStack(Blocks.FENCE_GATE_PLANKS_OAK_PAINTED, 1, color.blockMeta << 4));
+                trapdoorStackList.add(new ItemStack(Blocks.TRAPDOOR_PLANKS_PAINTED, 1, color.blockMeta << 4));
+                woolStackList.add(new ItemStack(Blocks.WOOL, 1, color.blockMeta));
+                lampStackList.add(new ItemStack(Blocks.LAMP_IDLE, 1, color.blockMeta));
+            }
+            ITEM_GROUPS.register("minecraft:planks",plankStackList);
+            ITEM_GROUPS.register("minecraft:chests", chestStackList);
+            ITEM_GROUPS.register("minecraft:wools", woolStackList);
+            ITEM_GROUPS.register("minecraft:lamps", lampStackList);
+            ITEM_GROUPS.register("minecraft:stairs_planks", stairsStackList);
+            ITEM_GROUPS.register("minecraft:slabs_planks", slabsStackList);
+            ITEM_GROUPS.register("minecraft:fences_planks", fencesStackList);
+            ITEM_GROUPS.register("minecraft:fence_gates_planks", fenceGatesStackList);
+            ITEM_GROUPS.register("minecraft:trapdoor_planks", trapdoorStackList);
+        }
 
         ITEM_GROUPS.register("minecraft:tool_swords",
             stackListOf( // metadata of -1 to indicate that the metadata check should be skipped
@@ -95,41 +131,6 @@ public class Registries extends Registry<Registry<?>>
                 new ItemStack(Items.TOOL_SWORD_DIAMOND, 1, -1),
                 new ItemStack(Items.TOOL_SWORD_STEEL, 1, -1)));
 
-        List<ItemStack> stackList = new ArrayList<>();
-        stackList.add(Blocks.STAIRS_PLANKS_OAK.getDefaultStack());
-        for (DyeColor color : DyeColor.values()) {
-            stackList.add(new ItemStack(Blocks.STAIRS_PLANKS_PAINTED, 1, color.blockMeta << 4));
-        }
-        ITEM_GROUPS.register("minecraft:stairs_planks", stackList);
-
-        stackList = new ArrayList<>();
-        stackList.add(Blocks.SLAB_PLANKS_OAK.getDefaultStack());
-        for (DyeColor color : DyeColor.values()) {
-            stackList.add(new ItemStack(Blocks.SLAB_PLANKS_PAINTED, 1, color.blockMeta << 4));
-        }
-        ITEM_GROUPS.register("minecraft:slabs_planks", stackList);
-
-        stackList = new ArrayList<>();
-        stackList.add(Blocks.FENCE_PLANKS_OAK.getDefaultStack());
-        for (DyeColor color : DyeColor.values()) {
-            stackList.add(new ItemStack(Blocks.FENCE_PLANKS_OAK_PAINTED, 1, color.blockMeta));
-        }
-        ITEM_GROUPS.register("minecraft:fences_planks", stackList);
-
-        stackList = new ArrayList<>();
-        stackList.add(Blocks.FENCE_GATE_PLANKS_OAK.getDefaultStack());
-        for (DyeColor color : DyeColor.values()) {
-            stackList.add(new ItemStack(Blocks.FENCE_GATE_PLANKS_OAK_PAINTED, 1, color.blockMeta << 4));
-        }
-        ITEM_GROUPS.register("minecraft:fence_gates_planks", stackList);
-
-        stackList = new ArrayList<>();
-        stackList.add(Blocks.TRAPDOOR_PLANKS_OAK.getDefaultStack());
-        for (DyeColor color : DyeColor.values()) {
-            stackList.add(new ItemStack(Blocks.TRAPDOOR_PLANKS_PAINTED, 1, color.blockMeta << 4));
-        }
-        ITEM_GROUPS.register("minecraft:trapdoor_planks", stackList);
-
         if(RECIPES == null) new RecipeRegistry();
     }
 
diff --git a/src/main/java/net/minecraft/core/entity/Mob.java b/src/main/java/net/minecraft/core/entity/Mob.java
index bac30820c..e8a613df7 100644
--- a/src/main/java/net/minecraft/core/entity/Mob.java
+++ b/src/main/java/net/minecraft/core/entity/Mob.java
@@ -1103,7 +1103,7 @@ public abstract class Mob extends Entity
         }
         if(currentTarget != null)
         {
-            lookAt(currentTarget, 10F, func_25026_x());
+            lookAt(currentTarget, 10F, getLookingTilt());
             if(numTicksToChaseTarget-- <= 0 || currentTarget.removed || currentTarget.distanceToSqr(this) > (double)(f * f))
             {
                 currentTarget = null;
@@ -1125,20 +1125,20 @@ public abstract class Mob extends Entity
         }
     }
 
-    protected int func_25026_x()
+    protected int getLookingTilt()
     {
         return 40;
     }
 
-    public void lookAt(Entity entity, float f, float f1)
+    public void lookAt(Entity entity, float yRot, float xRot)
     {
         double x = entity.x - this.x;
         double y = entity.z - z;
         double y2;
         if(entity instanceof Mob)
         {
-            Mob entityliving = (Mob)entity;
-            y2 = entityliving.y + entityliving.getHeadHeight() - (this.y + this.getHeadHeight());
+            Mob mob = (Mob)entity;
+            y2 = mob.y + mob.getHeadHeight() - (this.y + this.getHeadHeight());
         } else
         {
             y2 = (entity.bb.minY + entity.bb.maxY) / 2D - (this.y + (double) getHeadHeight());
@@ -1146,8 +1146,8 @@ public abstract class Mob extends Entity
         double d3 = MathHelper.sqrt(x * x + y * y);
         float f2 = (float)((Math.atan2(y, x) * 180D) / Math.PI) - 90F;
         float f3 = (float)(-((Math.atan2(-y2, d3) * 180D) / Math.PI));
-        xRot = -rotationLerp(xRot, f3, f1);
-        yRot = rotationLerp(yRot, f2, f);
+        this.xRot = -rotationLerp(this.xRot, f3, xRot);
+        this.yRot = rotationLerp(this.yRot, f2, yRot);
     }
 
     public boolean hasCurrentTarget()
diff --git a/src/main/java/net/minecraft/core/entity/animal/SheepMob.java b/src/main/java/net/minecraft/core/entity/animal/SheepMob.java
index c1b5a0639..ffbbafb9b 100644
--- a/src/main/java/net/minecraft/core/entity/animal/SheepMob.java
+++ b/src/main/java/net/minecraft/core/entity/animal/SheepMob.java
@@ -12,6 +12,7 @@ import net.minecraft.core.item.ToolShearsItem;
 import net.minecraft.core.util.collection.NamespaceID;
 import net.minecraft.core.util.helper.DyeColor;
 import net.minecraft.core.util.helper.MathHelper;
+import net.minecraft.core.world.LevelListener;
 import net.minecraft.core.world.World;
 
 import java.util.Random;
@@ -171,7 +172,7 @@ public class SheepMob extends Animal
 			if (prevTimeSheepEating == 35) {
 				if(blockBelow == Blocks.GRASS || blockBelow == Blocks.GRASS_RETRO) {
 					if(!world.isClientSide) {
-						world.playBlockEvent(null, 2001, (int) x, (int) y - 1, (int) z, world.getBlockId((int) x, (int) y - 1, (int) z));
+						world.playBlockEvent(null, LevelListener.EVENT_BLOCK_BREAK, (int) x, (int) y - 1, (int) z, world.getBlockId((int) x, (int) y - 1, (int) z));
 						world.setBlockWithNotify(blockX, blockY - 1, blockZ, Blocks.DIRT.id);
 						setSheared(false);
 					}
diff --git a/src/main/java/net/minecraft/core/entity/animal/WolfMob.java b/src/main/java/net/minecraft/core/entity/animal/WolfMob.java
index d59564663..dceeb8b99 100644
--- a/src/main/java/net/minecraft/core/entity/animal/WolfMob.java
+++ b/src/main/java/net/minecraft/core/entity/animal/WolfMob.java
@@ -65,12 +65,6 @@ public class WolfMob extends Animal
         setSize(0.8F, 0.8F);
         moveSpeed = 1.1F;
         scoreValue = 500;
-
-        if(!isWolfTamed()){
-            if(random.nextInt(100) == 0){
-                setWolfHeldItem(new ItemStack(Items.RECORD_DOG, 1));
-            }
-        }
     }
 
     @Override
@@ -87,6 +81,13 @@ public class WolfMob extends Animal
         return super.sendDeathMessage(entityKilledBy) || isWolfTamed();
     }
 
+    @Override
+    public void spawnInit() {
+        if(random.nextInt(25 /*Used to be 100, but I think having it that high would make it excessively rare*/) == 0){
+            setWolfHeldItem(new ItemStack(Items.RECORD_DOG, 1));
+        }
+    }
+
     public ArmorMaterial getArmorMaterial() {
         ArmorMaterial material = null;
         String name = entityData.getString(DATA_ARMOR_MATERIAL);
@@ -516,14 +517,14 @@ public class WolfMob extends Animal
     }
 
     @Override
-	protected int func_25026_x()
+	protected int getLookingTilt()
     {
         if(isWolfSitting())
         {
             return 20;
         } else
         {
-            return super.func_25026_x();
+            return super.getLookingTilt();
         }
     }
 
diff --git a/src/main/java/net/minecraft/core/entity/monster/GhastMob.java b/src/main/java/net/minecraft/core/entity/monster/GhastMob.java
index 1a3f1c49f..f7725159b 100644
--- a/src/main/java/net/minecraft/core/entity/monster/GhastMob.java
+++ b/src/main/java/net/minecraft/core/entity/monster/GhastMob.java
@@ -132,9 +132,9 @@ public class GhastMob extends FlyingMob
             courseChangeCooldown += random.nextInt(5) + 2;
             if(isCourseTraversable(waypointX, waypointY, waypointZ, d3))
             {
-                xd += (d / d3) * 0.10000000000000001D;
-                yd += (d1 / d3) * 0.10000000000000001D;
-                zd += (d2 / d3) * 0.10000000000000001D;
+                xd += (d / d3) * 0.1D;
+                yd += (d1 / d3) * 0.1D;
+                zd += (d2 / d3) * 0.1D;
             } else
             {
                 waypointX = x;
diff --git a/src/main/java/net/minecraft/core/entity/monster/Monster.java b/src/main/java/net/minecraft/core/entity/monster/Monster.java
index 2c3de6be6..4c7860151 100644
--- a/src/main/java/net/minecraft/core/entity/monster/Monster.java
+++ b/src/main/java/net/minecraft/core/entity/monster/Monster.java
@@ -127,9 +127,9 @@ public abstract class Monster extends PathfinderMob
     }
 
     @Override
-	protected float getBlockPathWeight(int i, int j, int k)
+	protected float getBlockPathWeight(int x, int y, int z)
     {
-        return 0.5F - world.getLightBrightness(i, j, k);
+        return 0.5F - world.getLightBrightness(x, y, z);
     }
 
     @Override
@@ -147,14 +147,14 @@ public abstract class Monster extends PathfinderMob
     @Override
 	public boolean canSpawnHere()
     {
-        int i = MathHelper.floor(x);
-        int j = MathHelper.floor(bb.minY);
-        int k = MathHelper.floor(z);
-        if(world.getSavedLightValue(LightLayer.Block, i, j, k) > 0) return false;
-        if(world.getSavedLightValue(LightLayer.Sky, i, j, k) > random.nextInt(32))
+        int blockX = MathHelper.floor(x);
+        int blockY = MathHelper.floor(bb.minY);
+        int blockZ = MathHelper.floor(z);
+        if(world.getSavedLightValue(LightLayer.Block, blockX, blockY, blockZ) > 0) return false;
+        if(world.getSavedLightValue(LightLayer.Sky, blockX, blockY, blockZ) > random.nextInt(32))
             return false;
 
-        int blockLight = world.getBlockLightValue(i, j, k);
+        int blockLight = world.getBlockLightValue(blockX, blockY, blockZ);
         if(world.getCurrentWeather() != null && world.getCurrentWeather().doMobsSpawnInDaylight)
             blockLight = blockLight/2;
 
diff --git a/src/main/java/net/minecraft/core/entity/player/Player.java b/src/main/java/net/minecraft/core/entity/player/Player.java
index 2bdfb5881..f2ac316d3 100644
--- a/src/main/java/net/minecraft/core/entity/player/Player.java
+++ b/src/main/java/net/minecraft/core/entity/player/Player.java
@@ -46,6 +46,7 @@ import net.minecraft.core.entity.vehicle.MinecartEntity;
 import net.minecraft.core.enums.ArtType;
 import net.minecraft.core.enums.EnumDropCause;
 import net.minecraft.core.enums.EnumSleepStatus;
+import net.minecraft.core.item.IArmorItem;
 import net.minecraft.core.item.Item;
 import net.minecraft.core.item.ItemStack;
 import net.minecraft.core.item.Items;
@@ -194,7 +195,7 @@ public abstract class Player extends Mob
     @Override
     public boolean canSkate() 
     {
-        return inventory.armorInventory[0] != null && inventory.armorInventory[0].itemID == Items.ARMOR_BOOTS_ICESKATES.id;
+        return inventory.armorInventory[IArmorItem.PIECE_BOOTS] != null && inventory.armorInventory[IArmorItem.PIECE_BOOTS].itemID == Items.ARMOR_BOOTS_ICESKATES.id;
     }
 
     @Override
@@ -1606,7 +1607,7 @@ public abstract class Player extends Mob
     }
     public Item getNextArrow(){
         Item nextArrow = null;
-        ItemStack quiverSlot = inventory.armorItemInSlot(2);
+        ItemStack quiverSlot = inventory.armorItemInSlot(IArmorItem.PIECE_CHEST);
         if(quiverSlot != null && quiverSlot.itemID == Items.ARMOR_QUIVER.id && quiverSlot.getMetadata() < quiverSlot.getMaxDamage()){
             nextArrow = Items.AMMO_ARROW;
         }
diff --git a/src/main/java/net/minecraft/core/entity/projectile/FireballProjectile.java b/src/main/java/net/minecraft/core/entity/projectile/FireballProjectile.java
index 01b04f7db..6a0baca1c 100644
--- a/src/main/java/net/minecraft/core/entity/projectile/FireballProjectile.java
+++ b/src/main/java/net/minecraft/core/entity/projectile/FireballProjectile.java
@@ -40,6 +40,7 @@ public class FireballProjectile extends Projectile
         setSize(1.0F, 1.0F);
         moveTo(owner.x, owner.y, owner.z, owner.yRot, owner.xRot);
         setPos(x, y, z);
+        this.owner = owner;
         heightOffset = 0.0F;
         vX += (random.nextGaussian() - random.nextGaussian()) * 0.8D;
         vY += (random.nextGaussian()) * 0.4D;
diff --git a/src/main/java/net/minecraft/core/item/BowItem.java b/src/main/java/net/minecraft/core/item/BowItem.java
index 54af1774f..317f63c33 100644
--- a/src/main/java/net/minecraft/core/item/BowItem.java
+++ b/src/main/java/net/minecraft/core/item/BowItem.java
@@ -24,9 +24,9 @@ public class BowItem extends Item
     @Override
     public ItemStack onUseItem(ItemStack itemstack, World world, Player entityplayer)
     {
-        ItemStack quiverSlot = entityplayer.inventory.armorItemInSlot(2);
+        ItemStack quiverSlot = entityplayer.inventory.armorItemInSlot(IArmorItem.PIECE_CHEST);
         if(quiverSlot != null && quiverSlot.itemID == Items.ARMOR_QUIVER.id && quiverSlot.getMetadata() < quiverSlot.getMaxDamage()){
-            entityplayer.inventory.armorItemInSlot(2).damageItem(1, entityplayer);
+            entityplayer.inventory.armorItemInSlot(IArmorItem.PIECE_CHEST).damageItem(1, entityplayer);
             itemstack.damageItem(1, entityplayer);
             world.playSoundAtEntity(entityplayer, entityplayer, "random.bow", 0.3f, 1.0F / (itemRand.nextFloat() * 0.4F + 0.8F));
             if (!world.isClientSide) {
diff --git a/src/main/java/net/minecraft/core/item/DoorItem.java b/src/main/java/net/minecraft/core/item/DoorItem.java
index 24df706cd..0bddb3b68 100644
--- a/src/main/java/net/minecraft/core/item/DoorItem.java
+++ b/src/main/java/net/minecraft/core/item/DoorItem.java
@@ -1,6 +1,7 @@
 package net.minecraft.core.item;
 
 import net.minecraft.core.block.Block;
+import net.minecraft.core.block.entity.ActivatorBlockEntity;
 import net.minecraft.core.block.material.Material;
 
 // Referenced classes of package net.minecraft.src:
@@ -13,6 +14,8 @@ import net.minecraft.core.util.helper.Direction;
 import net.minecraft.core.util.helper.Side;
 import net.minecraft.core.world.World;
 
+import java.util.Random;
+
 public class DoorItem extends Item {
 	protected final Block doorBlockBottom;
 	protected final Block doorBlockTop;
@@ -25,7 +28,7 @@ public class DoorItem extends Item {
     }
 
 	@Override
-	public boolean onUseItemOnBlock(ItemStack itemstack, Player entityplayer, World world, int blockX, int blockY, int blockZ, Side side, double xPlaced, double yPlaced) {
+	public boolean onUseItemOnBlock(ItemStack itemstack, Player player, World world, int blockX, int blockY, int blockZ, Side side, double xPlaced, double yPlaced) {
 		if(!world.canPlaceInsideBlock(blockX, blockY, blockZ)) {
 			blockX += side.getOffsetX();
 			blockY += side.getOffsetY();
@@ -35,7 +38,7 @@ public class DoorItem extends Item {
 			return false;
 		}
 
-		Direction dir = entityplayer.getHorizontalPlacementDirection(side).rotate(3);
+		Direction dir = player.getHorizontalPlacementDirection(side).rotate(3);
 		int meta = dir.getHorizontalIndex();
 		
 		int xOffset = -dir.getOffsetX();
@@ -64,12 +67,57 @@ public class DoorItem extends Item {
 		world.noNeighborUpdate = false;
 		world.notifyBlocksOfNeighborChange(blockX, blockY, blockZ, doorBlockBottom.id);
 		world.notifyBlocksOfNeighborChange(blockX, blockY + 1, blockZ, doorBlockTop.id);
-		world.playBlockSoundEffect(entityplayer, blockX + 0.5F, blockY + 0.5F, blockZ + 0.5F, doorBlockBottom, EnumBlockSoundEffectType.PLACE);
-		doorBlockBottom.onBlockPlacedByMob(world, blockX, blockY, blockZ, side, entityplayer, yPlaced);
-		doorBlockTop.onBlockPlacedByMob(world, blockX, blockY + 1, blockZ, side, entityplayer, yPlaced);
-		itemstack.consumeItem(entityplayer);
+		world.playBlockSoundEffect(player, blockX + 0.5F, blockY + 0.5F, blockZ + 0.5F, doorBlockBottom, EnumBlockSoundEffectType.PLACE);
+		doorBlockBottom.onBlockPlacedByMob(world, blockX, blockY, blockZ, side, player, xPlaced, yPlaced);
+		doorBlockTop.onBlockPlacedByMob(world, blockX, blockY + 1, blockZ, side, player, xPlaced, yPlaced);
+		itemstack.consumeItem(player);
 		return true;
 	}
 
-	private Material doorMaterial;
+	@Override
+	public void onUseByActivator(ItemStack itemStack, ActivatorBlockEntity activatorBlock, World world, Random random, int blockX, int blockY, int blockZ, double offX, double offY, double offZ, Direction direction) {
+		if(!world.canPlaceInsideBlock(blockX, blockY, blockZ)) {
+			blockX += direction.getOffsetX();
+			blockY += direction.getOffsetY();
+			blockZ += direction.getOffsetZ();
+		}
+		if(!doorBlockBottom.canPlaceBlockAt(world, blockX, blockY, blockZ)) {
+			return;
+		}
+
+		if (!direction.isHorizontal()) direction = Direction.NORTH;
+		Direction dir = direction.rotate(3);
+		int meta = dir.getHorizontalIndex();
+
+		int xOffset = -dir.getOffsetX();
+		int zOffset = -dir.getOffsetZ();
+
+		int isSolidBlockLeft = (world.isBlockNormalCube(blockX - xOffset, blockY, blockZ - zOffset) ? 1 : 0) + (world.isBlockNormalCube(blockX - xOffset, blockY + 1, blockZ - zOffset) ? 1 : 0);
+		int isSolidBlockRight = (world.isBlockNormalCube(blockX + xOffset, blockY, blockZ + zOffset) ? 1 : 0) + (world.isBlockNormalCube(blockX + xOffset, blockY + 1, blockZ + zOffset) ? 1 : 0);
+		boolean isDoorLeft = world.getBlockId(blockX - xOffset, blockY, blockZ - zOffset) == doorBlockBottom.id || world.getBlockId(blockX - xOffset, blockY + 1, blockZ - zOffset) == doorBlockTop.id;
+		boolean isDoorRight = world.getBlockId(blockX + xOffset, blockY, blockZ + zOffset) == doorBlockBottom.id || world.getBlockId(blockX + xOffset, blockY + 1, blockZ + zOffset) == doorBlockTop.id;
+		boolean isMirrored = false;
+
+		if(isDoorLeft && !isDoorRight) {
+			isMirrored = true;
+		} else if(isSolidBlockRight > isSolidBlockLeft) {
+			isMirrored = true;
+		}
+		if(isMirrored) {
+			meta = meta - 1 & 3;
+			meta += 4;
+			meta |= 0x8;
+		}
+
+		world.noNeighborUpdate = true;
+		world.setBlockAndMetadataWithNotify(blockX, blockY, blockZ, doorBlockBottom.id, meta);
+		world.setBlockAndMetadataWithNotify(blockX, blockY + 1, blockZ, doorBlockTop.id, meta);
+		world.noNeighborUpdate = false;
+		world.notifyBlocksOfNeighborChange(blockX, blockY, blockZ, doorBlockBottom.id);
+		world.notifyBlocksOfNeighborChange(blockX, blockY + 1, blockZ, doorBlockTop.id);
+		world.playBlockSoundEffect(null, blockX + 0.5F, blockY + 0.5F, blockZ + 0.5F, doorBlockBottom, EnumBlockSoundEffectType.PLACE);
+		doorBlockBottom.onBlockPlacedOnSide(world, blockX, blockY, blockZ, direction.getSide(), 0.5, 0.5);
+		doorBlockTop.onBlockPlacedOnSide(world, blockX, blockY + 1, blockZ, direction.getSide(), 0.5, 0.5);
+		itemStack.consumeItem(null);
+	}
 }
diff --git a/src/main/java/net/minecraft/core/item/IArmorItem.java b/src/main/java/net/minecraft/core/item/IArmorItem.java
index fd4f9e21a..f5e5cf4fd 100644
--- a/src/main/java/net/minecraft/core/item/IArmorItem.java
+++ b/src/main/java/net/minecraft/core/item/IArmorItem.java
@@ -4,13 +4,13 @@ import net.minecraft.core.item.material.ArmorMaterial;
 import org.jetbrains.annotations.Nullable;
 
 public interface IArmorItem {
-    int PIECE_HEAD = 0;
-    int PIECE_CHEST = 1;
-    int PIECE_LEGS = 2;
-    int PIECE_BOOTS = 3;
-    int[] ARMOR_PIECE_PROTECTION_VALUES = new int[] {3, 8, 6, 3};
+    int PIECE_HEAD = 3;
+    int PIECE_CHEST = 2;
+    int PIECE_LEGS = 1;
+    int PIECE_BOOTS = 0;
+    int[] ARMOR_PIECE_PROTECTION_VALUES = new int[] {3, 6, 8, 3};
 
-    float[] ARMOR_PIECE_DURABILITY_MODIFIERS = new float[] {0.91f, 1.0f, 0.97f, 0.94f};
+    float[] ARMOR_PIECE_DURABILITY_MODIFIERS = new float[] {0.94f, 0.97f, 1.0f, 0.91f};
     Item asItem(); // Ensure this has the same signature as Item's Item.asItem
     @Nullable
     ArmorMaterial getArmorMaterial();
diff --git a/src/main/java/net/minecraft/core/item/PaintedDoorItem.java b/src/main/java/net/minecraft/core/item/PaintedDoorItem.java
index 2d451cb76..ae0a7e395 100644
--- a/src/main/java/net/minecraft/core/item/PaintedDoorItem.java
+++ b/src/main/java/net/minecraft/core/item/PaintedDoorItem.java
@@ -13,7 +13,7 @@ public class PaintedDoorItem extends DoorItem {
         super(name, namespaceId, id, doorBottom, doorTopId);
     }
     @Override
-    public boolean onUseItemOnBlock(ItemStack itemstack, Player entityplayer, World world, int blockX, int blockY, int blockZ, Side side, double xPlaced, double yPlaced) {
+    public boolean onUseItemOnBlock(ItemStack itemstack, Player player, World world, int blockX, int blockY, int blockZ, Side side, double xPlaced, double yPlaced) {
         if(!world.canPlaceInsideBlock(blockX, blockY, blockZ)) {
             blockX += side.getOffsetX();
             blockY += side.getOffsetY();
@@ -23,7 +23,7 @@ public class PaintedDoorItem extends DoorItem {
             return false;
         }
 
-        Direction dir = entityplayer.getHorizontalPlacementDirection(side).rotate(3);
+        Direction dir = player.getHorizontalPlacementDirection(side).rotate(3);
         int meta = dir.getHorizontalIndex();
 
         int xOffset = -dir.getOffsetX();
@@ -53,8 +53,8 @@ public class PaintedDoorItem extends DoorItem {
         world.noNeighborUpdate = false;
         world.notifyBlocksOfNeighborChange(blockX, blockY, blockZ, doorBlockBottom.id);
         world.notifyBlocksOfNeighborChange(blockX, blockY + 1, blockZ, doorBlockTop.id);
-        world.playBlockSoundEffect(entityplayer,blockX + 0.5F, blockY + 0.5F, blockZ + 0.5F, doorBlockBottom, EnumBlockSoundEffectType.PLACE);
-        itemstack.consumeItem(entityplayer);
+        world.playBlockSoundEffect(player,blockX + 0.5F, blockY + 0.5F, blockZ + 0.5F, doorBlockBottom, EnumBlockSoundEffectType.PLACE);
+        itemstack.consumeItem(player);
         return true;
     }
     @Override
diff --git a/src/main/java/net/minecraft/core/item/PebbleItem.java b/src/main/java/net/minecraft/core/item/PebbleItem.java
index 18758812e..d9b388706 100644
--- a/src/main/java/net/minecraft/core/item/PebbleItem.java
+++ b/src/main/java/net/minecraft/core/item/PebbleItem.java
@@ -11,7 +11,6 @@ import net.minecraft.core.util.helper.Direction;
 import net.minecraft.core.util.helper.Side;
 import net.minecraft.core.util.phys.AABB;
 import net.minecraft.core.world.World;
-import org.jetbrains.annotations.Nullable;
 
 import java.util.Random;
 
@@ -114,7 +113,7 @@ public class PebbleItem extends Item implements IDispensable
         {
             if (world.setBlockAndMetadataWithNotify(blockX, blockY, blockZ, Blocks.OVERLAY_PEBBLES.id, 0))
             {
-                Blocks.OVERLAY_PEBBLES.onBlockPlacedByMob(world, blockX, blockY, blockZ, side, player, yPlaced);
+                Blocks.OVERLAY_PEBBLES.onBlockPlacedByMob(world, blockX, blockY, blockZ, side, player, xPlaced, yPlaced);
                 world.playBlockSoundEffect(player, blockX + 0.5F, blockY + 0.5F, blockZ + 0.5F, Blocks.OVERLAY_PEBBLES, EnumBlockSoundEffectType.PLACE);
                 itemstack.consumeItem(player);
 				return true;
diff --git a/src/main/java/net/minecraft/core/item/PlaceableItem.java b/src/main/java/net/minecraft/core/item/PlaceableItem.java
index 76f265a6c..3ee386dbe 100644
--- a/src/main/java/net/minecraft/core/item/PlaceableItem.java
+++ b/src/main/java/net/minecraft/core/item/PlaceableItem.java
@@ -39,9 +39,9 @@ public class PlaceableItem extends Item {
 		if(world.canBlockBePlacedAt(blockToPlace.id, blockX, blockY, blockZ, false, side) && stack.consumeItem(player)) {
 			if(world.setBlockWithNotify(blockX, blockY, blockZ, blockToPlace.id)) {
 				if (player == null) {
-					blockToPlace.onBlockPlacedByWorld(world, blockX, blockY, blockZ);
+					blockToPlace.onBlockPlacedOnSide(world, blockX, blockY, blockZ, side, xPlaced, yPlaced);
 				} else {
-					blockToPlace.onBlockPlacedByMob(world, blockX, blockY, blockZ, side, player, yPlaced);
+					blockToPlace.onBlockPlacedByMob(world, blockX, blockY, blockZ, side, player, xPlaced, yPlaced);
 				}
 				world.playBlockSoundEffect(player, blockX + 0.5F, blockY + 0.5F, blockZ + 0.5F, blockToPlace, EnumBlockSoundEffectType.PLACE);
 				return true;
diff --git a/src/main/java/net/minecraft/core/item/RopeItem.java b/src/main/java/net/minecraft/core/item/RopeItem.java
index 52366e44b..24047207b 100644
--- a/src/main/java/net/minecraft/core/item/RopeItem.java
+++ b/src/main/java/net/minecraft/core/item/RopeItem.java
@@ -1,16 +1,13 @@
 package net.minecraft.core.item;
 
 import net.minecraft.core.block.Block;
-import net.minecraft.core.block.entity.ActivatorBlockEntity;
+import net.minecraft.core.block.RopeBlock;
 import net.minecraft.core.entity.player.Player;
 import net.minecraft.core.enums.EnumBlockSoundEffectType;
-import net.minecraft.core.util.helper.Direction;
 import net.minecraft.core.util.helper.Side;
 import net.minecraft.core.world.World;
 import org.jetbrains.annotations.Nullable;
 
-import java.util.Random;
-
 public class RopeItem extends PlaceableItem {
     public RopeItem(String name, String namespaceId, int id, Block blockToPlace) {
         super(name, namespaceId, id, blockToPlace);
@@ -47,11 +44,11 @@ public class RopeItem extends PlaceableItem {
             return false;
         }
         if(world.canBlockBePlacedAt(blockToPlace.id, blockX, blockY, blockZ, false, side) && stack.consumeItem(player)) {
-            if(world.setBlockAndMetadataWithNotify(blockX, blockY, blockZ, blockToPlace.id, placeOnSide ? 0b1000_0000 : 0)) {
+            if(world.setBlockAndMetadataWithNotify(blockX, blockY, blockZ, blockToPlace.id, placeOnSide ? RopeBlock.MASK_ROPE_CONNECT : 0)) {
                 if (player == null) {
-                    blockToPlace.onBlockPlacedByWorld(world, blockX, blockY, blockZ);
+                    blockToPlace.onBlockPlacedOnSide(world, blockX, blockY, blockZ, side, xPlaced, yPlaced);
                 } else {
-                    blockToPlace.onBlockPlacedByMob(world, blockX, blockY, blockZ, side, player, yPlaced);
+                    blockToPlace.onBlockPlacedByMob(world, blockX, blockY, blockZ, side, player, xPlaced, yPlaced);
                 }
                 world.playBlockSoundEffect(player, blockX + 0.5F, blockY + 0.5F, blockZ + 0.5F, blockToPlace, EnumBlockSoundEffectType.PLACE);
 				return true;
diff --git a/src/main/java/net/minecraft/core/item/block/AlgaeBlockItem.java b/src/main/java/net/minecraft/core/item/block/AlgaeBlockItem.java
index bf4333752..8291ede68 100644
--- a/src/main/java/net/minecraft/core/item/block/AlgaeBlockItem.java
+++ b/src/main/java/net/minecraft/core/item/block/AlgaeBlockItem.java
@@ -4,7 +4,10 @@ package net.minecraft.core.item.block;
 //            World, MovingObjectPosition, EnumMovingObjectType, Block, 
 //            BoatEntity, ItemStack
 
+import net.minecraft.core.block.entity.ActivatorBlockEntity;
+import net.minecraft.core.block.tag.BlockTags;
 import net.minecraft.core.entity.player.Player;
+import net.minecraft.core.util.helper.Direction;
 import net.minecraft.core.util.phys.HitResult;
 import net.minecraft.core.block.Block;
 import net.minecraft.core.block.Blocks;
@@ -16,6 +19,8 @@ import net.minecraft.core.util.phys.Vec3;
 import net.minecraft.core.world.World;
 import org.jetbrains.annotations.Nullable;
 
+import java.util.Random;
+
 public class AlgaeBlockItem extends BlockItem
 {
 
@@ -75,7 +80,7 @@ public class AlgaeBlockItem extends BlockItem
             Block block = Block.blocksList[Blocks.ALGAE.id];
             if(itemstack.consumeItem(player) && world.setBlockAndMetadataWithNotify(blockX, blockY, blockZ, Blocks.ALGAE.id, 0))
             {
-                Block.blocksList[blockID].onBlockPlacedByMob(world, blockX, blockY, blockZ, Side.NONE, player, 0.0);
+                Block.blocksList[blockID].onBlockPlacedByMob(world, blockX, blockY, blockZ, Side.NONE, player, 0.5, 0.5);
                 world.playBlockSoundEffect(player, blockX + 0.5F, blockY + 0.5F, blockZ + 0.5F, block, EnumBlockSoundEffectType.PLACE);
                 player.swingItem();
             }
@@ -83,4 +88,17 @@ public class AlgaeBlockItem extends BlockItem
         }
         return itemstack;
     }
+
+    @Override
+    public void onUseByActivator(ItemStack itemStack, ActivatorBlockEntity activatorBlock, World world, Random random, int blockX, int blockY, int blockZ, double offX, double offY, double offZ, Direction direction) {
+        int x = blockX + direction.getOffsetX();
+        int y = blockY + direction.getOffsetY();
+        int z = blockZ + direction.getOffsetZ();
+        Block b = world.getBlock(x, y, z);
+        Block bAbove = world.getBlock(x, y + 1, z);
+        if (b == Blocks.FLUID_WATER_STILL && (bAbove == null || bAbove.hasTag(BlockTags.PLACE_OVERWRITES))) {
+            world.setBlockWithNotify(x, y + 1, z, Blocks.ALGAE.id);
+            Blocks.ALGAE.onBlockPlacedOnSide(world, x, y + 1, z, Side.NONE, 0.5, 0.5);
+        }
+    }
 }
diff --git a/src/main/java/net/minecraft/core/item/block/BlockItem.java b/src/main/java/net/minecraft/core/item/block/BlockItem.java
index 73e3fa9a3..7cfa18ea0 100644
--- a/src/main/java/net/minecraft/core/item/block/BlockItem.java
+++ b/src/main/java/net/minecraft/core/item/block/BlockItem.java
@@ -54,9 +54,9 @@ public class BlockItem extends Item
 			if(world.setBlockAndMetadataWithNotify(x, y, z, blockID, meta)) {
 				stack.consumeItem(player);
 				if (player == null) {
-                    block.onBlockPlacedByWorld(world, x, y, z);
+                    block.onBlockPlacedOnSide(world, x, y, z, side, xPlaced, yPlaced);
                 } else {
-                    block.onBlockPlacedByMob(world, x, y, z, side, player, yPlaced);
+                    block.onBlockPlacedByMob(world, x, y, z, side, player, xPlaced, yPlaced);
                 }
 				world.playBlockSoundEffect(player, x + 0.5F, y + 0.5F, z + 0.5F, block, EnumBlockSoundEffectType.PLACE);
 				return true;
@@ -72,7 +72,9 @@ public class BlockItem extends Item
         int z = blockZ + direction.getOffsetZ();
         Block b = world.getBlock(x, y, z);
         if (b == null || BlockTags.PLACE_OVERWRITES.appliesTo(b)) {
-            onUseItemOnBlock(itemStack, null, world, x, y, z, direction.getSide(), 0.5, 0.5);
+            if (onUseItemOnBlock(itemStack, null, world, x, y, z, direction.getSide(), 0.5, 0.5)) {
+                getBlock().onBlockPlacedByActivator(world, x, y, z, activatorBlock, direction);
+            }
         }
     }
 
diff --git a/src/main/java/net/minecraft/core/item/block/LadderBlockItem.java b/src/main/java/net/minecraft/core/item/block/LadderBlockItem.java
index 8ab95f928..e869e8d75 100644
--- a/src/main/java/net/minecraft/core/item/block/LadderBlockItem.java
+++ b/src/main/java/net/minecraft/core/item/block/LadderBlockItem.java
@@ -28,7 +28,7 @@ public class LadderBlockItem extends BlockItem {
 			while(world.getBlock(x, y, z) == ladderBlock && ladderBlock.getSideFromMeta(world.getBlockMetadata(x, y, z)) == clickedLadderSide) y--;
 			int meta = ladderBlock.getMetaForSide(clickedLadderSide);
 			if(ladderBlock.canExistAt(world, x, y, z, meta)) {
-				return placeBlock(world, x, y, z, meta, player, stack, clickedLadderSide, 0.5);
+				return placeBlock(world, x, y, z, meta, player, stack, clickedLadderSide, 0.5, 0.5);
 			}
 			
 			return false;
@@ -47,16 +47,16 @@ public class LadderBlockItem extends BlockItem {
 		
 		int meta = ladderBlock.getMetaForSide(sideForPlacement);
 		if(ladderBlock.canExistAt(world, x, y, z, meta)) {
-			return placeBlock(world, x, y, z, meta, player, stack, sideForPlacement, yPlaced);
+			return placeBlock(world, x, y, z, meta, player, stack, sideForPlacement, xPlaced, yPlaced);
 		}
 		
 		return false;
 	}
 	
-	public boolean placeBlock(World world, int x, int y, int z, int meta, @Nullable Player player, ItemStack stack, Side side, double sideHeight) {
+	public boolean placeBlock(World world, int x, int y, int z, int meta, @Nullable Player player, ItemStack stack, Side side, double xPlaced, double yPlaced) {
 		if(world.canPlaceInsideBlock(x, y, z) && world.canBlockBePlacedAt(blockID, x, y, z, false, side) && stack.consumeItem(player)) {
 			if(world.setBlockAndMetadataWithNotify(x, y, z, blockID, meta)) {
-				Block.getBlock(blockID).onBlockPlacedByMob(world, x, y, z, side, player, sideHeight);
+				Block.getBlock(blockID).onBlockPlacedByMob(world, x, y, z, side, player, xPlaced, yPlaced);
 				world.playBlockSoundEffect(player, x + 0.5f, y + 0.5f, z + 0.5f, ladderBlock, EnumBlockSoundEffectType.PLACE);
 				return true;
 			}
diff --git a/src/main/java/net/minecraft/core/item/block/LayerBlockItem.java b/src/main/java/net/minecraft/core/item/block/LayerBlockItem.java
index 49fa05fed..07c63d6c2 100644
--- a/src/main/java/net/minecraft/core/item/block/LayerBlockItem.java
+++ b/src/main/java/net/minecraft/core/item/block/LayerBlockItem.java
@@ -130,9 +130,9 @@ public class LayerBlockItem extends BlockItem
 			if (world.setBlockAndMetadataWithNotify(blockX, blockY, blockZ, blockID, placeMeta))
 			{
 				if (player == null) {
-					Block.blocksList[blockID].onBlockPlacedByWorld(world, blockX, blockY, blockZ);
+					Block.blocksList[blockID].onBlockPlacedOnSide(world, blockX, blockY, blockZ, side, xPlaced, yPlaced);
 				} else {
-					Block.blocksList[blockID].onBlockPlacedByMob(world, blockX, blockY, blockZ, Side.NONE, player, yPlaced);
+					Block.blocksList[blockID].onBlockPlacedByMob(world, blockX, blockY, blockZ, Side.NONE, player, xPlaced, yPlaced);
 				}
 				world.playBlockSoundEffect(player, blockX + 0.5F, blockY + 0.5F, blockZ + 0.5F, block, EnumBlockSoundEffectType.PLACE);
 				itemstack.consumeItem(player);
diff --git a/src/main/java/net/minecraft/core/item/block/LeavesLayerBlockItem.java b/src/main/java/net/minecraft/core/item/block/LeavesLayerBlockItem.java
index 86303dcf7..0a6e9342a 100644
--- a/src/main/java/net/minecraft/core/item/block/LeavesLayerBlockItem.java
+++ b/src/main/java/net/minecraft/core/item/block/LeavesLayerBlockItem.java
@@ -126,9 +126,9 @@ public class LeavesLayerBlockItem extends BlockItem
 			if (world.setBlockAndMetadataWithNotify(blockX, blockY, blockZ, blockID, placeMeta))
 			{
 				if (player == null) {
-					Block.blocksList[blockID].onBlockPlacedByWorld(world, blockX, blockY, blockZ);
+					Block.blocksList[blockID].onBlockPlacedOnSide(world, blockX, blockY, blockZ, side, xPlaced, yPlaced);
 				} else {
-					Block.blocksList[blockID].onBlockPlacedByMob(world, blockX, blockY, blockZ, side, player, yPlaced);
+					Block.blocksList[blockID].onBlockPlacedByMob(world, blockX, blockY, blockZ, side, player, xPlaced, yPlaced);
 				}
 				world.playBlockSoundEffect(player, blockX + 0.5F, blockY + 0.5F, blockZ + 0.5F, block, EnumBlockSoundEffectType.PLACE);
 				itemstack.consumeItem(player);
diff --git a/src/main/java/net/minecraft/core/item/block/SlabBlockItem.java b/src/main/java/net/minecraft/core/item/block/SlabBlockItem.java
index 27291fc9b..057849ee2 100644
--- a/src/main/java/net/minecraft/core/item/block/SlabBlockItem.java
+++ b/src/main/java/net/minecraft/core/item/block/SlabBlockItem.java
@@ -91,9 +91,9 @@ public class SlabBlockItem extends BlockItem
             if(world.setBlockAndMetadataWithNotify(blockX, blockY, blockZ, blockID, placeMeta))
             {
                 if (player == null) {
-                    Block.blocksList[blockID].onBlockPlacedByWorld(world, blockX, blockY, blockZ);
+                    Block.blocksList[blockID].onBlockPlacedOnSide(world, blockX, blockY, blockZ, side, xPlaced, yPlaced);
                 } else {
-                    Block.blocksList[blockID].onBlockPlacedByMob(world, blockX, blockY, blockZ, side, player, yPlaced);
+                    Block.blocksList[blockID].onBlockPlacedByMob(world, blockX, blockY, blockZ, side, player, xPlaced, yPlaced);
                 }
                 world.playBlockSoundEffect(player, blockX + 0.5F, blockY + 0.5F, blockZ + 0.5F, block, EnumBlockSoundEffectType.PLACE);
                 itemstack.consumeItem(player);
diff --git a/src/main/java/net/minecraft/core/net/IUpdatePlayerListBox.java b/src/main/java/net/minecraft/core/net/IUpdatePlayerListBox.java
index a60921f36..1afcbd866 100644
--- a/src/main/java/net/minecraft/core/net/IUpdatePlayerListBox.java
+++ b/src/main/java/net/minecraft/core/net/IUpdatePlayerListBox.java
@@ -4,5 +4,5 @@ package net.minecraft.core.net;
 public interface IUpdatePlayerListBox
 {
 
-    public abstract void update();
+    void update();
 }
diff --git a/src/main/java/net/minecraft/core/net/NetworkManager.java b/src/main/java/net/minecraft/core/net/NetworkManager.java
index 684d1fa97..56421ff3d 100644
--- a/src/main/java/net/minecraft/core/net/NetworkManager.java
+++ b/src/main/java/net/minecraft/core/net/NetworkManager.java
@@ -314,7 +314,8 @@ public class NetworkManager
         for(int i = 100; !incoming.isEmpty() && i >= 0; i--)
         {
             Packet packet = incoming.remove(0);
-            packet.handlePacket(packetListener);
+            if (!disconnected)
+                packet.handlePacket(packetListener);
         }
 
         wakeThreads();
diff --git a/src/main/java/net/minecraft/core/net/command/arguments/BlockArgumentType.java b/src/main/java/net/minecraft/core/net/command/arguments/BlockArgumentType.java
index 6d2518474..0c8aadfab 100644
--- a/src/main/java/net/minecraft/core/net/command/arguments/BlockArgumentType.java
+++ b/src/main/java/net/minecraft/core/net/command/arguments/BlockArgumentType.java
@@ -18,7 +18,7 @@ import java.util.Locale;
 import java.util.concurrent.CompletableFuture;
 
 public class BlockArgumentType implements ArgumentType<BlockInput> {
-    private static final List<String> EXAMPLES = Arrays.asList("tile.stone", "stone", "tile.log[1]");
+    private static final List<String> EXAMPLES = Arrays.asList("minecraft:block/stone", "block/stone", "minecraft:block/log_oak[1]");
 
     public static ArgumentType<BlockInput> block() {
         return new BlockArgumentType();
@@ -42,9 +42,9 @@ public class BlockArgumentType implements ArgumentType<BlockInput> {
             String remaining = suggestionsBuilder.getRemaining().toLowerCase(Locale.ROOT);
             for (Block block : Block.blocksList) {
                 if (block == null) continue;
-                CommandHelper.getStringToSuggest(block.getKey(), remaining).ifPresent(suggestionsBuilder::suggest);
-                CommandHelper.getStringToSuggest("tile.air", remaining).ifPresent(suggestionsBuilder::suggest);
+                CommandHelper.getStringToSuggest(block.namespaceID.toString(), remaining).ifPresent(suggestionsBuilder::suggest);
             }
+            CommandHelper.getStringToSuggest(BlockArgumentParser.AIR_BLOCK.toString(), remaining).ifPresent(suggestionsBuilder::suggest);
             suggestionsBuilder.buildFuture();
         });
     }
diff --git a/src/main/java/net/minecraft/core/net/command/arguments/SeasonArgumentType.java b/src/main/java/net/minecraft/core/net/command/arguments/SeasonArgumentType.java
new file mode 100644
index 000000000..8d9867b18
--- /dev/null
+++ b/src/main/java/net/minecraft/core/net/command/arguments/SeasonArgumentType.java
@@ -0,0 +1,62 @@
+package net.minecraft.core.net.command.arguments;
+
+import com.mojang.brigadier.StringReader;
+import com.mojang.brigadier.arguments.ArgumentType;
+import com.mojang.brigadier.context.CommandContext;
+import com.mojang.brigadier.exceptions.CommandSyntaxException;
+import com.mojang.brigadier.suggestion.Suggestions;
+import com.mojang.brigadier.suggestion.SuggestionsBuilder;
+import net.minecraft.core.lang.I18n;
+import net.minecraft.core.net.command.CommandSource;
+import net.minecraft.core.world.season.Season;
+import net.minecraft.core.world.season.SeasonManager;
+import net.minecraft.core.world.season.SeasonManagerCycle;
+import net.minecraft.core.world.season.Seasons;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+import java.util.concurrent.CompletableFuture;
+
+public class SeasonArgumentType implements ArgumentType<String> {
+    private static final List<String> EXAMPLES = Arrays.asList("overworld.winter", "overworld.summer", "paradise.gold");
+
+    public static ArgumentType<String> season() {
+        return new SeasonArgumentType();
+    }
+
+    @Override
+    public String parse(StringReader reader) throws CommandSyntaxException {
+        final String string = reader.readString();
+
+        for (Season s : Seasons.getAllSeasons()) {
+            if (s.getId().equalsIgnoreCase(string)) {
+                return s.getId();
+            }
+        }
+        throw new CommandSyntaxException(CommandSyntaxException.BUILT_IN_EXCEPTIONS.dispatcherUnknownArgument(), () -> I18n.getInstance().translateKeyAndFormat("command.argument_types.season.invalid_id", string));
+    }
+
+    @Override
+    public <S> CompletableFuture<Suggestions> listSuggestions(CommandContext<S> context, SuggestionsBuilder builder) {
+        if (context.getSource() instanceof CommandSource) {
+            CommandSource commandSource = (CommandSource) context.getSource();
+            SeasonManager seasonManager = commandSource.getWorld().getSeasonManager();
+            if (seasonManager instanceof SeasonManagerCycle) {
+                for (Season s : seasonManager.getSeasons()) {
+                    builder.suggest(s.getId());
+                }
+            }
+        } else {
+            for (Season s : Seasons.getAllSeasons()) {
+                builder.suggest(s.getId());
+            }
+        }
+        return builder.buildFuture();
+    }
+
+    @Override
+    public Collection<String> getExamples() {
+        return EXAMPLES;
+    }
+}
diff --git a/src/main/java/net/minecraft/core/net/command/commands/FillCommand.java b/src/main/java/net/minecraft/core/net/command/commands/FillCommand.java
index 30490476a..20805ea11 100644
--- a/src/main/java/net/minecraft/core/net/command/commands/FillCommand.java
+++ b/src/main/java/net/minecraft/core/net/command/commands/FillCommand.java
@@ -31,7 +31,7 @@ public class FillCommand {
                             if (CommandHelper.getVolume(c.getSource(), first, second) > 32768)
                                 throw CommandExceptions.volumeTooLarge().create();
                             int blocksFilled = fillReplace(c.getSource(), c.getSource().getWorld(), first, second, block);
-                            c.getSource().sendTranslatableMessage(blocksFilled == 1 ? "command.commands.fill.success_single" : "commands.fill.success_multiple", blocksFilled);
+                            c.getSource().sendTranslatableMessage(blocksFilled == 1 ? "command.commands.fill.success_single" : "command.commands.fill.success_multiple", blocksFilled);
                             return blocksFilled;
                         })
                         .then(LiteralArgumentBuilder.<CommandSource>literal("replace")
@@ -42,7 +42,7 @@ public class FillCommand {
                                 if (CommandHelper.getVolume(c.getSource(), first, second) > 32768)
                                     throw CommandExceptions.volumeTooLarge().create();
                                 int blocksFilled = fillReplace(c.getSource(), c.getSource().getWorld(), first, second, block);
-                                c.getSource().sendTranslatableMessage(blocksFilled == 1 ? "command.commands.fill.success_single" : "commands.fill.success_multiple", blocksFilled);
+                                c.getSource().sendTranslatableMessage(blocksFilled == 1 ? "command.commands.fill.success_single" : "command.commands.fill.success_multiple", blocksFilled);
                                 return blocksFilled;
                             })
                             .then(RequiredArgumentBuilder.<CommandSource, BlockInput>argument("filter", BlockArgumentType.block())
@@ -54,7 +54,7 @@ public class FillCommand {
                                     if (CommandHelper.getVolume(c.getSource(), first, second) > 32768)
                                         throw CommandExceptions.volumeTooLarge().create();
                                     int blocksFilled = fillReplace(c.getSource(), c.getSource().getWorld(), first, second, block, filter);
-                                    c.getSource().sendTranslatableMessage(blocksFilled == 1 ? "command.commands.fill.success_single" : "commands.fill.success_multiple", blocksFilled);
+                                    c.getSource().sendTranslatableMessage(blocksFilled == 1 ? "command.commands.fill.success_single" : "command.commands.fill.success_multiple", blocksFilled);
                                     return blocksFilled;
                                 })))
                         .then(LiteralArgumentBuilder.<CommandSource>literal("hollow")
@@ -65,7 +65,7 @@ public class FillCommand {
                                 if (CommandHelper.getVolume(c.getSource(), first, second) > 32768)
                                     throw CommandExceptions.volumeTooLarge().create();
                                 int blocksFilled = fillHollow(c.getSource(), c.getSource().getWorld(), first, second, block);
-                                c.getSource().sendTranslatableMessage(blocksFilled == 1 ? "command.commands.fill.success_single" : "commands.fill.success_multiple", blocksFilled);
+                                c.getSource().sendTranslatableMessage(blocksFilled == 1 ? "command.commands.fill.success_single" : "command.commands.fill.success_multiple", blocksFilled);
                                 return blocksFilled;
                             }))
                         .then(LiteralArgumentBuilder.<CommandSource>literal("outline")
@@ -76,7 +76,7 @@ public class FillCommand {
                                 if (CommandHelper.getVolume(c.getSource(), first, second) > 32768)
                                     throw CommandExceptions.volumeTooLarge().create();
                                 int blocksFilled = fillOutline(c.getSource(), c.getSource().getWorld(), first, second, block);
-                                c.getSource().sendTranslatableMessage(blocksFilled == 1 ? "command.commands.fill.success_single" : "commands.fill.success_multiple", blocksFilled);
+                                c.getSource().sendTranslatableMessage(blocksFilled == 1 ? "command.commands.fill.success_single" : "command.commands.fill.success_multiple", blocksFilled);
                                 return blocksFilled;
                             }))
                         .then(LiteralArgumentBuilder.<CommandSource>literal("keep")
@@ -87,7 +87,7 @@ public class FillCommand {
                                 if (CommandHelper.getVolume(c.getSource(), first, second) > 32768)
                                     throw CommandExceptions.volumeTooLarge().create();
                                 int blocksFilled = fillKeep(c.getSource(), c.getSource().getWorld(), first, second, block);
-                                c.getSource().sendTranslatableMessage(blocksFilled == 1 ? "command.commands.fill.success_single" : "commands.fill.success_multiple", blocksFilled);
+                                c.getSource().sendTranslatableMessage(blocksFilled == 1 ? "command.commands.fill.success_single" : "command.commands.fill.success_multiple", blocksFilled);
                                 return blocksFilled;
                             }))
                         .then(LiteralArgumentBuilder.<CommandSource>literal("destroy")
@@ -98,7 +98,7 @@ public class FillCommand {
                                 if (CommandHelper.getVolume(c.getSource(), first, second) > 32768)
                                     throw CommandExceptions.volumeTooLarge().create();
                                 int blocksFilled = fillDestroy(c.getSource(), c.getSource().getWorld(), first, second, block);
-                                c.getSource().sendTranslatableMessage(blocksFilled == 1 ? "command.commands.fill.success_single" : "commands.fill.success_multiple", blocksFilled);
+                                c.getSource().sendTranslatableMessage(blocksFilled == 1 ? "command.commands.fill.success_single" : "command.commands.fill.success_multiple", blocksFilled);
                                 return blocksFilled;
                             }))))));
     }
diff --git a/src/main/java/net/minecraft/core/net/command/commands/MobSpawningCommand.java b/src/main/java/net/minecraft/core/net/command/commands/MobSpawningCommand.java
index 462d35345..9734b8079 100644
--- a/src/main/java/net/minecraft/core/net/command/commands/MobSpawningCommand.java
+++ b/src/main/java/net/minecraft/core/net/command/commands/MobSpawningCommand.java
@@ -13,6 +13,7 @@ import net.minecraft.core.net.command.CommandSource;
 import net.minecraft.core.net.command.arguments.EntitySummonArgumentType;
 import net.minecraft.core.world.SpawnerMobs;
 import net.minecraft.core.world.World;
+import net.minecraft.core.world.config.spawning.SpawnerConfig;
 
 import java.util.Collection;
 
@@ -28,7 +29,7 @@ public class MobSpawningCommand {
                     .then(LiteralArgumentBuilder.<CommandSource>literal("list").executes(c -> {
                         Collection<String> ids = EntityDispatcher.classToKeyMap.values();
                         World world = c.getSource().getWorld();
-                        SpawnerMobs.SpawnerConfig config = world.spawningConfig;
+                        SpawnerConfig config = world.getSpawnerConfig();
                         for (String s : ids) {
                             c.getSource().sendMessage(String.format("%s : %s", s, config.canMobSpawn(s)));
                         }
@@ -42,7 +43,7 @@ public class MobSpawningCommand {
                             .then(RequiredArgumentBuilder.<CommandSource, Boolean>argument("value", BoolArgumentType.bool())
                                 .executes(c -> {
                                     World world = c.getSource().getWorld();
-                                    SpawnerMobs.SpawnerConfig config = world.spawningConfig;
+                                    SpawnerConfig config = world.getSpawnerConfig();
 
                                     String mobId = EntityDispatcher.getEncodeId(c.getArgument("entity", Class.class));
                                     boolean value = c.getArgument("value", Boolean.class);
@@ -54,7 +55,7 @@ public class MobSpawningCommand {
                         .then(RequiredArgumentBuilder.<CommandSource, Boolean>argument("value", BoolArgumentType.bool())
                             .executes(c -> {
                                 World world = c.getSource().getWorld();
-                                SpawnerMobs.SpawnerConfig config = world.spawningConfig;
+                                SpawnerConfig config = world.getSpawnerConfig();
 
                                 boolean value = c.getArgument("value", Boolean.class);
                                 config.setPassiveSpawning(value);
@@ -65,7 +66,7 @@ public class MobSpawningCommand {
                         .then(RequiredArgumentBuilder.<CommandSource, Boolean>argument("value", BoolArgumentType.bool())
                             .executes(c -> {
                                 World world = c.getSource().getWorld();
-                                SpawnerMobs.SpawnerConfig config = world.spawningConfig;
+                                SpawnerConfig config = world.getSpawnerConfig();
 
                                 boolean value = c.getArgument("value", Boolean.class);
                                 config.setHostileSpawning(value);
diff --git a/src/main/java/net/minecraft/core/net/command/commands/TimeCommand.java b/src/main/java/net/minecraft/core/net/command/commands/TimeCommand.java
index 4a02e4725..eb1613ce8 100644
--- a/src/main/java/net/minecraft/core/net/command/commands/TimeCommand.java
+++ b/src/main/java/net/minecraft/core/net/command/commands/TimeCommand.java
@@ -2,83 +2,134 @@ package net.minecraft.core.net.command.commands;
 
 import com.mojang.brigadier.Command;
 import com.mojang.brigadier.CommandDispatcher;
+import com.mojang.brigadier.arguments.IntegerArgumentType;
 import com.mojang.brigadier.builder.LiteralArgumentBuilder;
 import com.mojang.brigadier.builder.RequiredArgumentBuilder;
+import net.minecraft.core.Global;
+import net.minecraft.core.net.command.arguments.SeasonArgumentType;
 import net.minecraft.core.world.LevelListener;
 import net.minecraft.core.world.World;
 import net.minecraft.core.net.command.CommandSource;
 import net.minecraft.core.net.command.arguments.TimeArgumentType;
+import net.minecraft.core.world.season.Season;
+import net.minecraft.core.world.season.SeasonManager;
+import net.minecraft.core.world.season.SeasonManagerCycle;
+import net.minecraft.core.world.season.Seasons;
 
 public class TimeCommand {
     public static void register(CommandDispatcher<CommandSource> dispatcher) {
         dispatcher.register(LiteralArgumentBuilder.<CommandSource>literal("time")
-                .requires(CommandSource::hasAdmin)
-                .then(LiteralArgumentBuilder.<CommandSource>literal("query")
-                        .then(LiteralArgumentBuilder.<CommandSource>literal("daytime")
-                                .executes(c -> {
-                                    CommandSource source = c.getSource();
-                                    source.sendTranslatableMessage("command.commands.time.query", c.getSource().getWorld().getWorldTime() % 24000L);
-
-                                    return Command.SINGLE_SUCCESS;
-                                }))
-                        .then(LiteralArgumentBuilder.<CommandSource>literal("gametime")
-                                .executes(c -> {
-                                    CommandSource source = c.getSource();
-                                    source.sendTranslatableMessage("command.commands.time.query", source.getWorld().getWorldTime() % Integer.MAX_VALUE);
-
-                                    return Command.SINGLE_SUCCESS;
-                                }))
-                        .then(LiteralArgumentBuilder.<CommandSource>literal("day")
-                                .executes(c -> {
-                                    CommandSource source = c.getSource();
-                                    source.sendTranslatableMessage("command.commands.time.query", source.getWorld().getWorldTime() / 24000L % Integer.MAX_VALUE);
-
-                                    return Command.SINGLE_SUCCESS;
-                                })))
-                .then(LiteralArgumentBuilder.<CommandSource>literal("set")
-                        .then(RequiredArgumentBuilder.<CommandSource, Integer>argument("time", TimeArgumentType.time())
-                                .executes(c -> {
-                                    CommandSource source = c.getSource();
-                                    int time = c.getArgument("time", Integer.class);
-                                    setWorldTime(source, source.getWorld(), time);
-                                    return Command.SINGLE_SUCCESS;
-                                }))
-                        .then(LiteralArgumentBuilder.<CommandSource>literal("day")
-                                .executes(c -> {
-                                    CommandSource source = c.getSource();
-                                    setDayTime(source, source.getWorld(), 1000);
-                                    return Command.SINGLE_SUCCESS;
-                                }))
-                        .then(LiteralArgumentBuilder.<CommandSource>literal("noon")
-                                .executes(c -> {
-                                    CommandSource source = c.getSource();
-                                    setDayTime(source, source.getWorld(), 6000);
-                                    return Command.SINGLE_SUCCESS;
-                                }))
-                        .then(LiteralArgumentBuilder.<CommandSource>literal("night")
-                                .executes(c -> {
-                                    CommandSource source = c.getSource();
-                                    setDayTime(source, source.getWorld(), 13000);
-                                    return Command.SINGLE_SUCCESS;
-                                }))
-                        .then(LiteralArgumentBuilder.<CommandSource>literal("midnight")
-                                .executes(c -> {
-                                    CommandSource source = c.getSource();
-                                    setDayTime(source, source.getWorld(), 18000);
-                                    return Command.SINGLE_SUCCESS;
-                                })))
-                .then(LiteralArgumentBuilder.<CommandSource>literal("add")
-                        .then(RequiredArgumentBuilder.<CommandSource, Integer>argument("time", TimeArgumentType.time())
-                                .executes(c -> {
-                                    CommandSource source = c.getSource();
-                                    int time = c.getArgument("time", Integer.class);
-                                    addWorldTime(source, source.getWorld(), time);
-                                    return Command.SINGLE_SUCCESS;
-                                }))));
+            .requires(CommandSource::hasAdmin)
+            .then(LiteralArgumentBuilder.<CommandSource>literal("query")
+                .then(LiteralArgumentBuilder.<CommandSource>literal("daytime")
+                    .executes(c -> {
+                        CommandSource source = c.getSource();
+                        source.sendTranslatableMessage("command.commands.time.query", c.getSource().getWorld().getWorldTime() % 24000L);
+
+                        return Command.SINGLE_SUCCESS;
+                    }))
+                .then(LiteralArgumentBuilder.<CommandSource>literal("gametime")
+                    .executes(c -> {
+                        CommandSource source = c.getSource();
+                        source.sendTranslatableMessage("command.commands.time.query", source.getWorld().getWorldTime() % Integer.MAX_VALUE);
+
+                        return Command.SINGLE_SUCCESS;
+                    }))
+                .then(LiteralArgumentBuilder.<CommandSource>literal("day")
+                    .executes(c -> {
+                        CommandSource source = c.getSource();
+                        source.sendTranslatableMessage("command.commands.time.query", source.getWorld().getWorldTime() / 24000L % Integer.MAX_VALUE);
+
+                        return Command.SINGLE_SUCCESS;
+                        })))
+            .then(LiteralArgumentBuilder.<CommandSource>literal("set")
+                .then(RequiredArgumentBuilder.<CommandSource, Integer>argument("time", TimeArgumentType.time())
+                    .executes(c -> {
+                        CommandSource source = c.getSource();
+                        int time = c.getArgument("time", Integer.class);
+                        setWorldTime(source, source.getWorld(), time);
+                        return Command.SINGLE_SUCCESS;
+                    }))
+                .then(LiteralArgumentBuilder.<CommandSource>literal("day")
+                    .executes(c -> {
+                        CommandSource source = c.getSource();
+                        setDayTime(source, source.getWorld(), 1000);
+                        return Command.SINGLE_SUCCESS;
+                    }))
+                .then(LiteralArgumentBuilder.<CommandSource>literal("noon")
+                    .executes(c -> {
+                        CommandSource source = c.getSource();
+                        setDayTime(source, source.getWorld(), 6000);
+                        return Command.SINGLE_SUCCESS;
+                    }))
+                .then(LiteralArgumentBuilder.<CommandSource>literal("night")
+                    .executes(c -> {
+                        CommandSource source = c.getSource();
+                        setDayTime(source, source.getWorld(), 13000);
+                        return Command.SINGLE_SUCCESS;
+                    }))
+                .then(LiteralArgumentBuilder.<CommandSource>literal("midnight")
+                    .executes(c -> {
+                        CommandSource source = c.getSource();
+                        setDayTime(source, source.getWorld(), 18000);
+                        return Command.SINGLE_SUCCESS;
+                    }))
+                .then(RequiredArgumentBuilder.<CommandSource, String>argument("season", SeasonArgumentType.season())
+                    .requires(c -> c.getWorld().getSeasonManager() instanceof SeasonManagerCycle)
+                    .executes(c -> {
+                        CommandSource source = c.getSource();
+
+                        String seasonId = c.getArgument("season", String.class);
+                        Season targetSeason = Seasons.getSeason(seasonId);
+
+                        SeasonManagerCycle seasonManager = (SeasonManagerCycle) source.getWorld().getSeasonManager();
+
+                        int time = 0;
+                        for (Season season : seasonManager.getSeasons()) {
+                            if (season == targetSeason) break;
+                            time += seasonManager.getSeasonLengthTicks(season);
+                        }
+
+                        setWorldTime(source, source.getWorld(), source.getWorld().getWorldTime() - (source.getWorld().getWorldTime() % seasonManager.getYearLengthTicks()) + time);
+                        return Command.SINGLE_SUCCESS;
+                    })
+                    .then(RequiredArgumentBuilder.<CommandSource, Integer>argument("day", IntegerArgumentType.integer())
+                        .executes(c -> {
+                            CommandSource source = c.getSource();
+
+                            String seasonId = c.getArgument("season", String.class);
+                            Season targetSeason = Seasons.getSeason(seasonId);
+
+                            int day = c.getArgument("day", Integer.class);
+
+                            SeasonManagerCycle seasonManager = (SeasonManagerCycle) source.getWorld().getSeasonManager();
+
+                            int time = 0;
+                            for (Season season : seasonManager.getSeasons()) {
+                                if (season == targetSeason) break;
+                                time += seasonManager.getSeasonLengthTicks(season);
+                            }
+
+                            time += day * Global.DAY_LENGTH_TICKS;
+
+                            setWorldTime(source, source.getWorld(), source.getWorld().getWorldTime() - (source.getWorld().getWorldTime() % seasonManager.getYearLengthTicks()) + time);
+                            return Command.SINGLE_SUCCESS;
+                        })
+                    )
+                )
+            )
+            .then(LiteralArgumentBuilder.<CommandSource>literal("add")
+                .then(RequiredArgumentBuilder.<CommandSource, Integer>argument("time", TimeArgumentType.time())
+                    .executes(c -> {
+                        CommandSource source = c.getSource();
+                        int time = c.getArgument("time", Integer.class);
+                        addWorldTime(source, source.getWorld(), time);
+                        return Command.SINGLE_SUCCESS;
+                    }))));
     }
 
     private static void setDayTime(CommandSource source, World world, long time) {
-        setWorldTime(source, world, world.getWorldTime() - (world.getWorldTime() % 24000L) + time);
+        setWorldTime(source, world, world.getWorldTime() - (world.getWorldTime() % Global.DAY_LENGTH_TICKS) + time);
     }
 
     private static void setWorldTime(CommandSource source, World world, long time) {
diff --git a/src/main/java/net/minecraft/core/net/command/helpers/BlockArgumentParser.java b/src/main/java/net/minecraft/core/net/command/helpers/BlockArgumentParser.java
index abba3832b..0109ada15 100644
--- a/src/main/java/net/minecraft/core/net/command/helpers/BlockArgumentParser.java
+++ b/src/main/java/net/minecraft/core/net/command/helpers/BlockArgumentParser.java
@@ -9,13 +9,14 @@ import com.mojang.nbt.CompoundTag;
 import net.minecraft.core.block.Block;
 import net.minecraft.core.lang.I18n;
 import net.minecraft.core.net.command.util.CommandHelper;
+import net.minecraft.core.util.collection.NamespaceID;
 
 import java.util.concurrent.CompletableFuture;
 import java.util.function.Consumer;
 
 public class BlockArgumentParser extends ArgumentParser {
     private static final SimpleCommandExceptionType INVALID_BLOCK = new SimpleCommandExceptionType(() -> I18n.getInstance().translateKey("command.argument_types.block.invalid_block"));
-
+    public static final NamespaceID AIR_BLOCK = new NamespaceID("minecraft", "block/air");
     private Block block;
     private int metadata = 0;
     private CompoundTag tag = new CompoundTag();
@@ -51,15 +52,26 @@ public class BlockArgumentParser extends ArgumentParser {
     }
 
     private void parseBlock() throws CommandSyntaxException {
-        String string = this.reader.readString();
+        StringBuilder builder = new StringBuilder();
+        while (reader.canRead()) {
+            char peak = reader.peek();
+            if (peak == '[' || peak == '{' || peak == ' ') {
+                break;
+            }
+            builder.append(reader.read());
+        }
+        String string = builder.toString();
         boolean isAir = false;
-        for (Block blockInList : Block.blocksList) {
-            if (blockInList == null) continue;
-            if (CommandHelper.matchesKeyString(blockInList.getKey(), string)) {
-                this.block = blockInList;
-            } else if (CommandHelper.matchesKeyString("tile.air", string)) {
-                this.block = null;
-                isAir = true;
+        if (CommandHelper.matchesNamespaceId(AIR_BLOCK, string)) {
+            this.block = null;
+            isAir = true;
+        } else {
+            for (Block blockInList : Block.blocksList) {
+                if (blockInList == null) continue;
+                if (CommandHelper.matchesNamespaceId(blockInList.namespaceID, string)) {
+                    this.block = blockInList;
+                    break;
+                }
             }
         }
         if (this.block == null && !isAir) throw INVALID_BLOCK.createWithContext(this.reader);
diff --git a/src/main/java/net/minecraft/core/net/handler/PacketHandler.java b/src/main/java/net/minecraft/core/net/handler/PacketHandler.java
index 0d5d9d04c..b7b47d0a1 100644
--- a/src/main/java/net/minecraft/core/net/handler/PacketHandler.java
+++ b/src/main/java/net/minecraft/core/net/handler/PacketHandler.java
@@ -11,7 +11,7 @@ public abstract class PacketHandler
 
     public abstract boolean isServerHandler();
 
-    public void handleMapChunk(BlockRegionUpdatePacket blockRegionUpdatePacket51Mapchunk)
+    public void handleMapChunk(BlockRegionUpdatePacket blockRegionUpdatePacket)
     {
     }
 
@@ -19,7 +19,7 @@ public abstract class PacketHandler
     {
     }
 
-    public void handleErrorMessage(String s, Object[] aobj)
+    public void handleErrorMessage(String message, Object[] objects)
     {
     }
 
@@ -38,29 +38,29 @@ public abstract class PacketHandler
         handleInvalidPacket(movePlayerPacket);
     }
 
-    public void handleMultiBlockChange(ChunkBlocksUpdatePacket packet)
+    public void handleMultiBlockChange(ChunkBlocksUpdatePacket chunkBlocksUpdatePacket)
     {
-        handleInvalidPacket(packet);
+        handleInvalidPacket(chunkBlocksUpdatePacket);
     }
 
-    public void handleBlockDig(PlayerActionPacket playerActionPacket14Blockdig)
+    public void handleBlockDig(PlayerActionPacket playerActionPacket)
     {
-        handleInvalidPacket(playerActionPacket14Blockdig);
+        handleInvalidPacket(playerActionPacket);
     }
 
-    public void handleBlockChange(BlockUpdatePacket blockchange)
+    public void handleBlockUpdate(BlockUpdatePacket blockUpdatePacket)
     {
-        handleInvalidPacket(blockchange);
+        handleInvalidPacket(blockUpdatePacket);
     }
 
-    public void handlePreChunk(ChunkVisibilityPacket packet50PrechunkVisibilityPacket)
+    public void handlePreChunk(ChunkVisibilityPacket chunkVisibilityPacket)
     {
-        handleInvalidPacket(packet50PrechunkVisibilityPacket);
+        handleInvalidPacket(chunkVisibilityPacket);
     }
 
-    public void handleNamedEntitySpawn(AddPlayerPacket addPlayerPacket20Namedentityspawn)
+    public void handleNamedEntitySpawn(AddPlayerPacket addPlayerPacket)
     {
-        handleInvalidPacket(addPlayerPacket20Namedentityspawn);
+        handleInvalidPacket(addPlayerPacket);
     }
 
     public void handleEntity(MoveEntityPacket moveEntityPacket)
@@ -68,9 +68,9 @@ public abstract class PacketHandler
         handleInvalidPacket(moveEntityPacket);
     }
 
-    public void handleEntityTeleport(TeleportEntityPacket packet34EntityteleportEntityPacket)
+    public void handleEntityTeleport(TeleportEntityPacket teleportEntityPacket)
     {
-        handleInvalidPacket(packet34EntityteleportEntityPacket);
+        handleInvalidPacket(teleportEntityPacket);
     }
 
     public void handlePlace(UseItemPacket useItemPacket)
@@ -78,24 +78,24 @@ public abstract class PacketHandler
         handleInvalidPacket(useItemPacket);
     }
 
-    public void handleBlockItemSwitch(SetCarriedItemPacket packet16blockitemswitch)
+    public void handleBlockItemSwitch(SetCarriedItemPacket setCarriedItemPacket)
     {
-        handleInvalidPacket(packet16blockitemswitch);
+        handleInvalidPacket(setCarriedItemPacket);
     }
 
-    public void handleDestroyEntity(RemoveEntityPacket packet29DestroyentityPacket)
+    public void handleDestroyEntity(RemoveEntityPacket removeEntityPacket)
     {
-        handleInvalidPacket(packet29DestroyentityPacket);
+        handleInvalidPacket(removeEntityPacket);
     }
 
-    public void handleSetPaintingMotive(SetPaintingArtPacket packet)
+    public void handleSetPaintingMotive(SetPaintingArtPacket setPaintingArtPacket)
     {
-        handleInvalidPacket(packet);
+        handleInvalidPacket(setPaintingArtPacket);
     }
 
-    public void handlePickupSpawn(AddItemEntityPacket addItemEntityPacket21Pickupspawn)
+    public void handlePickupSpawn(AddItemEntityPacket addItemEntityPacket)
     {
-        handleInvalidPacket(addItemEntityPacket21Pickupspawn);
+        handleInvalidPacket(addItemEntityPacket);
     }
 
     public void handleCollect(TakeItemEntityPacket takeItemEntityPacket)
@@ -108,9 +108,9 @@ public abstract class PacketHandler
         handleInvalidPacket(chatPacket);
     }
 
-    public void handleVehicleSpawn(AddEntityPacket addEntityPacket23Vehiclespawn)
+    public void handleVehicleSpawn(AddEntityPacket addEntityPacket)
     {
-        handleInvalidPacket(addEntityPacket23Vehiclespawn);
+        handleInvalidPacket(addEntityPacket);
     }
 
     public void handleAnimation(AnimatePacket animatePacket)
@@ -118,9 +118,9 @@ public abstract class PacketHandler
         handleInvalidPacket(animatePacket);
     }
 
-    public void handleEntityAction(PlayerCommandPacket packet19entityaction)
+    public void handlePlayerState(UpdatePlayerStatePacket updatePlayerStatePacket)
     {
-        handleInvalidPacket(packet19entityaction);
+        handleInvalidPacket(updatePlayerStatePacket);
     }
 
     public void handleHandshake(PreLoginPacket preLoginPacket)
@@ -128,54 +128,54 @@ public abstract class PacketHandler
         handleInvalidPacket(preLoginPacket);
     }
 
-    public void handleMobSpawn(AddMobPacket addMobspawn)
+    public void handleMobSpawn(AddMobPacket addMobPacket)
     {
-        handleInvalidPacket(addMobspawn);
+        handleInvalidPacket(addMobPacket);
     }
 
-    public void handleUpdateTime(SetTimePacket packet4UpdatetimePacket)
+    public void handleUpdateTime(SetTimePacket setTimePacket)
     {
-        handleInvalidPacket(packet4UpdatetimePacket);
+        handleInvalidPacket(setTimePacket);
     }
 
-    public void handleSpawnPosition(SetSpawnPositionPacket setSpawnpositionPacket)
+    public void handleSpawnPosition(SetSpawnPositionPacket setSpawnPositionPacket)
     {
-        handleInvalidPacket(setSpawnpositionPacket);
+        handleInvalidPacket(setSpawnPositionPacket);
     }
 
-    public void handleEntityVelocity(SetEntityMotionPacket setEntityvelocity)
+    public void handleEntityVelocity(SetEntityMotionPacket setEntityMotionPacket)
     {
-        handleInvalidPacket(setEntityvelocity);
+        handleInvalidPacket(setEntityMotionPacket);
     }
 
-    public void handleEntityMetadata(SetEntityDataPacket entitymetadata)
+    public void handleEntityMetadata(SetEntityDataPacket setEntityDataPacket)
     {
-        handleInvalidPacket(entitymetadata);
+        handleInvalidPacket(setEntityDataPacket);
     }
 
-    public void handleAttachEntity(SetRidingPacket setRidingPacket39Attachentity)
+    public void handleAttachEntity(SetRidingPacket setRidingPacket)
     {
-        handleInvalidPacket(setRidingPacket39Attachentity);
+        handleInvalidPacket(setRidingPacket);
     }
 
-    public void handleUseEntity(InteractPacket interactPacket7Useentity)
+    public void handleUseEntity(InteractPacket interactPacket)
     {
-        handleInvalidPacket(interactPacket7Useentity);
+        handleInvalidPacket(interactPacket);
     }
 
-    public void handleEntityStatus(EnitityEventPacket enitityEventPacket38Entitystatus)
+    public void handleEntityStatus(EnitityEventPacket enitityEventPacket)
     {
-        handleInvalidPacket(enitityEventPacket38Entitystatus);
+        handleInvalidPacket(enitityEventPacket);
     }
 
-    public void handleEntityTagData(EntityTagDataPacket packet)
+    public void handleEntityTagData(EntityTagDataPacket entityTagDataPacket)
     {
-        handleInvalidPacket(packet);
+        handleInvalidPacket(entityTagDataPacket);
     }
 
-    public void handleUpdateHealth(SetHealthPacket packet8UpdatehealthPacket)
+    public void handleUpdateHealth(SetHealthPacket setHealthPacket)
     {
-        handleInvalidPacket(packet8UpdatehealthPacket);
+        handleInvalidPacket(setHealthPacket);
     }
 
     public void handleUpdatePlayerProfile(UpdatePlayerProfilePacket updatePlayerProfilePacket)
@@ -193,24 +193,24 @@ public abstract class PacketHandler
         handleInvalidPacket(explosionPacket);
     }
 
-    public void handleOpenWindow(ContainerOpenPacket containerOpenwindow)
+    public void handleOpenWindow(ContainerOpenPacket containerOpenPacket)
     {
-        handleInvalidPacket(containerOpenwindow);
+        handleInvalidPacket(containerOpenPacket);
     }
 
-    public void handleCloseWindow(ContainerClosePacket containerClosewindow)
+    public void handleCloseWindow(ContainerClosePacket containerClosePacket)
     {
-        handleInvalidPacket(containerClosewindow);
+        handleInvalidPacket(containerClosePacket);
     }
 
-    public void handleWindowClick(ContainerClickPacket packet102WindowclickPacket)
+    public void handleWindowClick(ContainerClickPacket containerClickPacket)
     {
-        handleInvalidPacket(packet102WindowclickPacket);
+        handleInvalidPacket(containerClickPacket);
     }
 
-    public void handleTileEntityData(BlockEntityDataPacket packet)
+    public void handleTileEntityData(BlockEntityDataPacket blockEntityDataPacket)
     {
-        handleInvalidPacket(packet);
+        handleInvalidPacket(blockEntityDataPacket);
     }
 
     public void handleSetSlot(ContainerSetSlotPacket containerSetslotPacket)
@@ -218,14 +218,14 @@ public abstract class PacketHandler
         handleInvalidPacket(containerSetslotPacket);
     }
 
-    public void handleWindowItems(ContainerSetContentPacket containerSetContentPacket104Windowitems)
+    public void handleWindowItems(ContainerSetContentPacket containerSetContentPacket)
     {
-        handleInvalidPacket(containerSetContentPacket104Windowitems);
+        handleInvalidPacket(containerSetContentPacket);
     }
 
-    public void handleUpdateSign(SignUpdatePacket packet130UpdatesignUpdatePacket)
+    public void handleUpdateSign(SignUpdatePacket signUpdatePacket)
     {
-        handleInvalidPacket(packet130UpdatesignUpdatePacket);
+        handleInvalidPacket(signUpdatePacket);
     }
 
     public void handleSetMobSpawner(SetMobSpawnerPacket setMobSpawnerPacket)
@@ -233,14 +233,14 @@ public abstract class PacketHandler
         handleInvalidPacket(setMobSpawnerPacket);
     }
     
-    public void handleUpdateProgressbar(ContainerSetDataPacket containerSetDataPacket105Updateprogressbar)
+    public void handleUpdateProgressbar(ContainerSetDataPacket containerSetDataPacket)
     {
-        handleInvalidPacket(containerSetDataPacket105Updateprogressbar);
+        handleInvalidPacket(containerSetDataPacket);
     }
 
-    public void handlePlayerInventory(SetEquippedItemPacket setEquippedItemPacket5Playerinventory)
+    public void handlePlayerInventory(SetEquippedItemPacket setEquippedItemPacket)
     {
-        handleInvalidPacket(setEquippedItemPacket5Playerinventory);
+        handleInvalidPacket(setEquippedItemPacket);
     }
 
     public void handlePlayerHeldObject(SetHeldObjectPacket setHeldObjectPacket) {
@@ -252,18 +252,18 @@ public abstract class PacketHandler
         handleInvalidPacket(containerAckPacket);
     }
 
-    public void handleEntityPainting(AddPaintingPacket packet25EntitypaintingPacket)
+    public void handleEntityPainting(AddPaintingPacket addPaintingPacket)
     {
-        handleInvalidPacket(packet25EntitypaintingPacket);
+        handleInvalidPacket(addPaintingPacket);
     }
     public void handleBoatControl(BoatControlPacket boatControlPacket)
     {
         handleInvalidPacket(boatControlPacket);
     }
 
-    public void handlePlayNoteBlock(BlockEventPacket packet54PlaynoteblockEventPacket)
+    public void handleBlockEvent(BlockEventPacket blockEventPacket)
     {
-        handleInvalidPacket(packet54PlaynoteblockEventPacket);
+        handleInvalidPacket(blockEventPacket);
     }
 
     public void handleStatistic(StatisticPacket statisticPacket)
@@ -290,9 +290,9 @@ public abstract class PacketHandler
         handleInvalidPacket(mapdataPacket);
     }
 
-    public void handlePlaySoundEffect(PlaySoundEffectPacket packet61doorchange)
+    public void handlePlaySoundEffect(PlaySoundEffectPacket playSoundEffectPacket)
     {
-        handleInvalidPacket(packet61doorchange);
+        handleInvalidPacket(playSoundEffectPacket);
     }
     public void handlePlaySoundDirectly(PlaySoundEffectDirectPacket playSoundEffectDirectPacket)
     {
@@ -347,18 +347,18 @@ public abstract class PacketHandler
         handleInvalidPacket(playerListPacket);
     }
 
-    public void handleOpenFlagWindow(FlagOpenPacket packet)
+    public void handleOpenFlagWindow(FlagOpenPacket flagOpenPacket)
     {
-        handleInvalidPacket(packet);
+        handleInvalidPacket(flagOpenPacket);
     }
 
-    public void handlePhotoMode(PhotoModePacket packet)
+    public void handlePhotoMode(PhotoModePacket photoModePacket)
     {
-        handleInvalidPacket(packet);
+        handleInvalidPacket(photoModePacket);
     }
 
-    public void handlePingHandshake(PingHandshakePacket packet) {
-        handleInvalidPacket(packet);
+    public void handlePingHandshake(PingHandshakePacket pingHandshakePacket) {
+        handleInvalidPacket(pingHandshakePacket);
     }
 
     public void handleGameRule(GameRulePacket gameRulePacket) {
@@ -369,19 +369,19 @@ public abstract class PacketHandler
         handleInvalidPacket(recipeSyncPacket);
     }
     
-    public void handleIds(SyncIDsPacket packet) {
-    	handleInvalidPacket(packet);
+    public void handleIds(SyncIDsPacket syncIDsPacket) {
+    	handleInvalidPacket(syncIDsPacket);
     }
     
-    public void handleCustomPayload(CustomPayloadPacket packet) {
-    	handleInvalidPacket(packet);
+    public void handleCustomPayload(CustomPayloadPacket customPayloadPacket) {
+    	handleInvalidPacket(customPayloadPacket);
     }
 
-    public void handleCommandManagerPacket(CommandManagerPacket packet) {
-        handleInvalidPacket(packet);
+    public void handleCommandManagerPacket(CommandManagerPacket commandManagerPacket) {
+        handleInvalidPacket(commandManagerPacket);
     }
 
-    public void handleRequestCommandManagerPacket(RequestCommandManagerPacket packet) {
-        handleInvalidPacket(packet);
+    public void handleRequestCommandManagerPacket(RequestCommandManagerPacket requestCommandManagerPacket) {
+        handleInvalidPacket(requestCommandManagerPacket);
     }
 }
diff --git a/src/main/java/net/minecraft/core/net/packet/BlockEventPacket.java b/src/main/java/net/minecraft/core/net/packet/BlockEventPacket.java
index 9bb9a2cad..6924123c4 100644
--- a/src/main/java/net/minecraft/core/net/packet/BlockEventPacket.java
+++ b/src/main/java/net/minecraft/core/net/packet/BlockEventPacket.java
@@ -9,18 +9,23 @@ import java.io.*;
 
 public class BlockEventPacket extends Packet
 {
+    public int xLocation;
+    public int yLocation;
+    public int zLocation;
+    public int index;
+    public int data;
 
     public BlockEventPacket()
     {
     }
-    
-    public BlockEventPacket(int i, int j, int k, int l, int i1)
+
+    public BlockEventPacket(int x, int y, int z, int index, int data)
     {
-        xLocation = i;
-        yLocation = j;
-        zLocation = k;
-        instrumentType = l;
-        pitch = i1;
+        xLocation = x;
+        yLocation = y;
+        zLocation = z;
+        this.index = index;
+        this.data = data;
     }
 
     @Override
@@ -30,8 +35,8 @@ public class BlockEventPacket extends Packet
         xLocation = dis.readInt();
         yLocation = dis.readShort();
         zLocation = dis.readInt();
-        instrumentType = dis.read();
-        pitch = dis.read();
+        index = dis.read();
+        data = dis.read();
     }
 
     @Override
@@ -41,14 +46,14 @@ public class BlockEventPacket extends Packet
         dos.writeInt(xLocation);
         dos.writeShort(yLocation);
         dos.writeInt(zLocation);
-        dos.write(instrumentType);
-        dos.write(pitch);
+        dos.write(index);
+        dos.write(data);
     }
 
     @Override
 	public void handlePacket(PacketHandler packetHandler)
     {
-        packetHandler.handlePlayNoteBlock(this);
+        packetHandler.handleBlockEvent(this);
     }
 
     @Override
@@ -56,10 +61,4 @@ public class BlockEventPacket extends Packet
     {
         return 12;
     }
-
-    public int xLocation;
-    public int yLocation;
-    public int zLocation;
-    public int instrumentType;
-    public int pitch;
 }
diff --git a/src/main/java/net/minecraft/core/net/packet/BlockUpdatePacket.java b/src/main/java/net/minecraft/core/net/packet/BlockUpdatePacket.java
index e98e62071..bd62caaf4 100644
--- a/src/main/java/net/minecraft/core/net/packet/BlockUpdatePacket.java
+++ b/src/main/java/net/minecraft/core/net/packet/BlockUpdatePacket.java
@@ -10,20 +10,26 @@ import java.io.*;
 
 public class BlockUpdatePacket extends Packet
 {
+    public int xPosition;
+    public int yPosition;
+    public int zPosition;
+    public int blockId;
+    public int metadata;
+
 
     public BlockUpdatePacket()
     {
         isChunkDataPacket = true;
     }
-    
-    public BlockUpdatePacket(int i, int j, int k, World world)
+
+    public BlockUpdatePacket(int x, int y, int z, World world)
     {
         isChunkDataPacket = true;
-        xPosition = i;
-        yPosition = j;
-        zPosition = k;
-        type = world.getBlockId(i, j, k);
-        metadata = world.getBlockMetadata(i, j, k);
+        xPosition = x;
+        yPosition = y;
+        zPosition = z;
+        blockId = world.getBlockId(x, y, z);
+        metadata = world.getBlockMetadata(x, y, z);
     }
 
     @Override
@@ -33,7 +39,7 @@ public class BlockUpdatePacket extends Packet
         xPosition = dis.readInt();
         yPosition = dis.readShort();
         zPosition = dis.readInt();
-        type = dis.readShort();
+        blockId = dis.readShort();
         metadata = dis.read();
     }
 
@@ -44,14 +50,14 @@ public class BlockUpdatePacket extends Packet
         dos.writeInt(xPosition);
         dos.writeShort(yPosition);
         dos.writeInt(zPosition);
-        dos.writeShort(type);
+        dos.writeShort(blockId);
         dos.write(metadata);
     }
 
     @Override
 	public void handlePacket(PacketHandler packetHandler)
     {
-        packetHandler.handleBlockChange(this);
+        packetHandler.handleBlockUpdate(this);
     }
 
     @Override
@@ -59,10 +65,4 @@ public class BlockUpdatePacket extends Packet
     {
         return 11;
     }
-
-    public int xPosition;
-    public int yPosition;
-    public int zPosition;
-    public int type;
-    public int metadata;
 }
diff --git a/src/main/java/net/minecraft/core/net/packet/ChunkVisibilityPacket.java b/src/main/java/net/minecraft/core/net/packet/ChunkVisibilityPacket.java
index 6521a39ef..2741cbe9c 100644
--- a/src/main/java/net/minecraft/core/net/packet/ChunkVisibilityPacket.java
+++ b/src/main/java/net/minecraft/core/net/packet/ChunkVisibilityPacket.java
@@ -9,36 +9,39 @@ import java.io.*;
 
 public class ChunkVisibilityPacket extends Packet
 {
+    public int chunkX;
+    public int chunkZ;
+    public boolean playerAdded;
 
     public ChunkVisibilityPacket()
     {
         isChunkDataPacket = false;
     }
     
-    public ChunkVisibilityPacket(int i, int j, boolean flag)
+    public ChunkVisibilityPacket(int chunkX, int chunkZ, boolean playerAdded)
     {
         isChunkDataPacket = false;
-        xPosition = i;
-        yPosition = j;
-        mode = flag;
+        this.chunkX = chunkX;
+        this.chunkZ = chunkZ;
+        this.playerAdded = playerAdded;
     }
 
     @Override
 	public void read(DataInputStream dis)
         throws IOException
     {
-        xPosition = dis.readInt();
-        yPosition = dis.readInt();
-        mode = dis.read() != 0;
+        chunkX = dis.readInt();
+        chunkZ = dis.readInt();
+        playerAdded = dis.read() != 0;
     }
 
     @Override
 	public void write(DataOutputStream dos)
         throws IOException
     {
-        dos.writeInt(xPosition);
-        dos.writeInt(yPosition);
-        dos.write(mode ? 1 : 0);
+        dos.writeInt(chunkX);
+        dos.writeInt(chunkZ);
+        dos.write(playerAdded ? 1 : 0);
     }
 
     @Override
@@ -52,8 +55,4 @@ public class ChunkVisibilityPacket extends Packet
     {
         return 9;
     }
-
-    public int xPosition;
-    public int yPosition;
-    public boolean mode;
 }
diff --git a/src/main/java/net/minecraft/core/net/packet/MovePlayerPacket.java b/src/main/java/net/minecraft/core/net/packet/MovePlayerPacket.java
index 33765f9d1..5bda6e6ed 100644
--- a/src/main/java/net/minecraft/core/net/packet/MovePlayerPacket.java
+++ b/src/main/java/net/minecraft/core/net/packet/MovePlayerPacket.java
@@ -12,7 +12,6 @@ public class MovePlayerPacket extends Packet
     public double x;
     public double y;
     public double z;
-    public double yView;
     public float yaw;
     public float pitch;
     public boolean onGround;
@@ -92,10 +91,9 @@ public class MovePlayerPacket extends Packet
             this.hasPosition = true;
         }
 
-        public Pos(final double x, final double y, final double yView, final double z, final boolean onGround) {
+        public Pos(final double x, final double y, final double z, final boolean onGround) {
             this.x = x;
             this.y = y;
-            this.yView = yView;
             this.z = z;
             this.onGround = onGround;
             this.hasPosition = true;
@@ -105,7 +103,6 @@ public class MovePlayerPacket extends Packet
         public void read(final DataInputStream dataInputStream) throws IOException {
             this.x = dataInputStream.readDouble();
             this.y = dataInputStream.readDouble();
-            this.yView = dataInputStream.readDouble();
             this.z = dataInputStream.readDouble();
             super.read(dataInputStream);
         }
@@ -114,7 +111,6 @@ public class MovePlayerPacket extends Packet
         public void write(final DataOutputStream dataOutputStream) throws IOException {
             dataOutputStream.writeDouble(this.x);
             dataOutputStream.writeDouble(this.y);
-            dataOutputStream.writeDouble(this.yView);
             dataOutputStream.writeDouble(this.z);
             super.write(dataOutputStream);
         }
@@ -132,10 +128,9 @@ public class MovePlayerPacket extends Packet
             this.hasPosition = true;
         }
 
-        public PosRot(final double x, final double y, final double yView, final double z, final float yaw, final float pitch, final boolean onGround) {
+        public PosRot(final double x, final double y, final double z, final float yaw, final float pitch, final boolean onGround) {
             this.x = x;
             this.y = y;
-            this.yView = yView;
             this.z = z;
             this.yaw = yaw;
             this.pitch = pitch;
@@ -148,7 +143,6 @@ public class MovePlayerPacket extends Packet
         public void read(final DataInputStream dataInputStream) throws IOException {
             this.x = dataInputStream.readDouble();
             this.y = dataInputStream.readDouble();
-            this.yView = dataInputStream.readDouble();
             this.z = dataInputStream.readDouble();
             this.yaw = dataInputStream.readFloat();
             this.pitch = dataInputStream.readFloat();
@@ -159,7 +153,6 @@ public class MovePlayerPacket extends Packet
         public void write(final DataOutputStream dataOutputStream) throws IOException {
             dataOutputStream.writeDouble(this.x);
             dataOutputStream.writeDouble(this.y);
-            dataOutputStream.writeDouble(this.yView);
             dataOutputStream.writeDouble(this.z);
             dataOutputStream.writeFloat(this.yaw);
             dataOutputStream.writeFloat(this.pitch);
diff --git a/src/main/java/net/minecraft/core/net/packet/Packet.java b/src/main/java/net/minecraft/core/net/packet/Packet.java
index c7686ea16..6938b9216 100644
--- a/src/main/java/net/minecraft/core/net/packet/Packet.java
+++ b/src/main/java/net/minecraft/core/net/packet/Packet.java
@@ -271,7 +271,7 @@ public abstract class Packet
         addMapping(16, true, true, SetCarriedItemPacket.class);
         addMapping(17, true, false, SleepPacket.class);
         addMapping(18, true, true, AnimatePacket.class);
-        addMapping(19, false, true, PlayerCommandPacket.class);
+        addMapping(19, false, true, UpdatePlayerStatePacket.class);
         addMapping(20, true, false, AddPlayerPacket.class);
         addMapping(21, true, false, AddItemEntityPacket.class);
         addMapping(22, true, false, TakeItemEntityPacket.class);
diff --git a/src/main/java/net/minecraft/core/net/packet/PlayerActionPacket.java b/src/main/java/net/minecraft/core/net/packet/PlayerActionPacket.java
index 5edc6d209..49c8368f3 100644
--- a/src/main/java/net/minecraft/core/net/packet/PlayerActionPacket.java
+++ b/src/main/java/net/minecraft/core/net/packet/PlayerActionPacket.java
@@ -12,17 +12,33 @@ import net.minecraft.core.util.helper.Side;
 
 public class PlayerActionPacket extends Packet
 {
+    public static final int ACTION_DIG_START = 0;
+    public static final int ACTION_DIG_CONTINUED = 1;
+    public static final int ACTION_DIG_COMPLETE = 2;
+
+    public static final int ACTION_DROP_ITEM_SINGLE = 4;
+    public static final int ACTION_DROP_ITEM_STACK = 5;
+    public static final int ACTION_PICK_BLOCK = 6;
+
+    public int xPosition;
+    public int yPosition;
+    public int zPosition;
+    public Side side;
+    public double xHit;
+    public double yHit;
+    public int action;
+
 
     public PlayerActionPacket()
     {
     }
 
-    public PlayerActionPacket(int i, int j, int k, int l, Side side, double xHit, double yHit)
+    public PlayerActionPacket(int action, int x, int y, int z, Side side, double xHit, double yHit)
     {
-        status = i;
-        xPosition = j;
-        yPosition = k;
-        zPosition = l;
+        this.action = action;
+        xPosition = x;
+        yPosition = y;
+        zPosition = z;
         this.side = side;
         this.xHit = xHit;
         this.yHit = yHit;
@@ -32,7 +48,7 @@ public class PlayerActionPacket extends Packet
 	public void read(DataInputStream dis)
         throws IOException
     {
-        status = dis.read();
+        action = dis.read();
         xPosition = dis.readInt();
         yPosition = dis.read();
         zPosition = dis.readInt();
@@ -45,7 +61,7 @@ public class PlayerActionPacket extends Packet
 	public void write(DataOutputStream dos)
         throws IOException
     {
-        dos.write(status);
+        dos.write(action);
         dos.writeInt(xPosition);
         dos.write(yPosition);
         dos.writeInt(zPosition);
@@ -65,12 +81,4 @@ public class PlayerActionPacket extends Packet
     {
         return 19;
     }
-
-    public int xPosition;
-    public int yPosition;
-    public int zPosition;
-    public Side side;
-    public double xHit;
-    public double yHit;
-    public int status;
 }
diff --git a/src/main/java/net/minecraft/core/net/packet/PlayerCommandPacket.java b/src/main/java/net/minecraft/core/net/packet/UpdatePlayerStatePacket.java
similarity index 63%
rename from src/main/java/net/minecraft/core/net/packet/PlayerCommandPacket.java
rename to src/main/java/net/minecraft/core/net/packet/UpdatePlayerStatePacket.java
index 03dfce762..9e89c21ad 100644
--- a/src/main/java/net/minecraft/core/net/packet/PlayerCommandPacket.java
+++ b/src/main/java/net/minecraft/core/net/packet/UpdatePlayerStatePacket.java
@@ -1,6 +1,5 @@
 package net.minecraft.core.net.packet;
 
-import net.minecraft.core.entity.Entity;
 import net.minecraft.core.net.handler.PacketHandler;
 
 import java.io.*;
@@ -8,24 +7,26 @@ import java.io.*;
 // Referenced classes of package net.minecraft.src:
 //            Packet, Entity, PacketHandler
 
-public class PlayerCommandPacket extends Packet
+public class UpdatePlayerStatePacket extends Packet
 {
+    public static final int STATE_SNEAK = 1;
+    public static final int STATE_UN_SNEAK = 2;
+    public static final int STATE_LEAVE_BED = 3;
+    public int state;
 
-    public PlayerCommandPacket()
+    public UpdatePlayerStatePacket()
     {
     }
 
-    public PlayerCommandPacket(Entity entity, int i)
+    public UpdatePlayerStatePacket(int state)
     {
-        entityId = entity.id;
-        state = i;
+        this.state = state;
     }
 
     @Override
 	public void read(DataInputStream dis)
         throws IOException
     {
-        entityId = dis.readInt();
         state = dis.readByte();
     }
 
@@ -33,22 +34,19 @@ public class PlayerCommandPacket extends Packet
 	public void write(DataOutputStream dos)
         throws IOException
     {
-        dos.writeInt(entityId);
         dos.writeByte(state);
     }
 
     @Override
 	public void handlePacket(PacketHandler packetHandler)
     {
-        packetHandler.handleEntityAction(this);
+        packetHandler.handlePlayerState(this);
     }
 
     @Override
 	public int getEstimatedSize()
     {
-        return 5;
+        return 1;
     }
 
-    public int entityId;
-    public int state;
 }
diff --git a/src/main/java/net/minecraft/core/net/packet/UseItemPacket.java b/src/main/java/net/minecraft/core/net/packet/UseItemPacket.java
index 1747885cd..e3b7f6bae 100644
--- a/src/main/java/net/minecraft/core/net/packet/UseItemPacket.java
+++ b/src/main/java/net/minecraft/core/net/packet/UseItemPacket.java
@@ -14,15 +14,23 @@ import net.minecraft.core.util.helper.Direction;
 public class UseItemPacket extends Packet
 {
 
+    public int xPosition;
+    public int yPosition;
+    public int zPosition;
+    public Direction direction;
+    public double xPlaced;
+    public double yPlaced;
+    public ItemStack itemStack;
+
     public UseItemPacket()
     {
     }
 
-    public UseItemPacket(int i, int j, int k, Direction direction, ItemStack itemstack, double xPlaced, double yPlaced)
+    public UseItemPacket(int x, int y, int z, Direction direction, ItemStack itemstack, double xPlaced, double yPlaced)
     {
-        xPosition = i;
-        yPosition = j;
-        zPosition = k;
+        xPosition = x;
+        yPosition = y;
+        zPosition = z;
         this.direction = direction;
         itemStack = itemstack;
         this.xPlaced = xPlaced;
@@ -83,12 +91,4 @@ public class UseItemPacket extends Packet
     {
         return 19;
     }
-
-    public int xPosition;
-    public int yPosition;
-    public int zPosition;
-    public Direction direction;
-    public double xPlaced;
-    public double yPlaced;
-    public ItemStack itemStack;
 }
diff --git a/src/main/java/net/minecraft/core/player/inventory/container/Inventory.java b/src/main/java/net/minecraft/core/player/inventory/container/Inventory.java
index 541a829bd..7bed0c445 100644
--- a/src/main/java/net/minecraft/core/player/inventory/container/Inventory.java
+++ b/src/main/java/net/minecraft/core/player/inventory/container/Inventory.java
@@ -73,7 +73,7 @@ public class Inventory
         currentItem = index;
     }
     
-    public static int func_25054_e()
+    public static int playerMainInventorySize()
     {
         return 9 * 4;
     }
diff --git a/src/main/java/net/minecraft/core/player/inventory/menu/AbstractContainerMenu.java b/src/main/java/net/minecraft/core/player/inventory/menu/AbstractContainerMenu.java
index 0611efd83..725c99f51 100644
--- a/src/main/java/net/minecraft/core/player/inventory/menu/AbstractContainerMenu.java
+++ b/src/main/java/net/minecraft/core/player/inventory/menu/AbstractContainerMenu.java
@@ -54,19 +54,19 @@ public abstract class AbstractContainerMenu
 		else
 		{
 			containerListeners.add(containerListener);
-			containerListener.updateCraftingInventory(this, func_28127_b());
+			containerListener.updateCraftingInventory(this, getSlotStackList());
 			broadcastChanges();
 		}
 	}
 
-	public List<ItemStack> func_28127_b()
+	public List<ItemStack> getSlotStackList()
 	{
-		List<ItemStack> arraylist = new ArrayList<>();
-		for (Slot inventorySlot : slots) {
-			arraylist.add(inventorySlot.getItem());
+		List<ItemStack> itemList = new ArrayList<>();
+		for (Slot slot : slots) {
+			itemList.add(slot.getItem());
 		}
 
-		return arraylist;
+		return itemList;
 	}
 
 
diff --git a/src/main/java/net/minecraft/core/player/inventory/menu/InventoryMenu.java b/src/main/java/net/minecraft/core/player/inventory/menu/InventoryMenu.java
index 9a8ae7979..e43e805d9 100644
--- a/src/main/java/net/minecraft/core/player/inventory/menu/InventoryMenu.java
+++ b/src/main/java/net/minecraft/core/player/inventory/menu/InventoryMenu.java
@@ -3,6 +3,7 @@ package net.minecraft.core.player.inventory.menu;
 import net.minecraft.core.InventoryAction;
 import net.minecraft.core.data.registry.Registries;
 import net.minecraft.core.entity.player.Player;
+import net.minecraft.core.item.IArmorItem;
 import net.minecraft.core.item.ItemStack;
 import net.minecraft.core.player.inventory.container.Container;
 import net.minecraft.core.player.inventory.container.CraftingContainer;
@@ -39,8 +40,8 @@ public class InventoryMenu extends AbstractContainerMenu {
 		}
 		
 		for (int i = 0; i < 4; i++) {
-			int j1 = i;
-			addSlot(new ArmorSlot(this, inventory, inventory.getContainerSize() - 1 - i, 8, 8 + i * 18, j1));
+			int armorType = IArmorItem.PIECE_HEAD - i;
+			addSlot(new ArmorSlot(this, inventory, inventory.getContainerSize() - 1 - i, 8, 8 + i * 18, armorType));
 		}
 		
 		for (int i = 0; i < 3; i++) {
diff --git a/src/main/java/net/minecraft/core/player/inventory/slot/ArmorSlot.java b/src/main/java/net/minecraft/core/player/inventory/slot/ArmorSlot.java
index 23483ddae..20b34fd84 100644
--- a/src/main/java/net/minecraft/core/player/inventory/slot/ArmorSlot.java
+++ b/src/main/java/net/minecraft/core/player/inventory/slot/ArmorSlot.java
@@ -18,10 +18,10 @@ import java.util.Set;
 public class ArmorSlot extends Slot
 {
     public static String[] armorOutlines = new String[]{
-            "minecraft:item/armor_helmet_outline",
-            "minecraft:item/armor_chestplate_outline",
-            "minecraft:item/armor_leggings_outline",
-            "minecraft:item/armor_boots_outline"
+        "minecraft:item/armor_boots_outline",
+        "minecraft:item/armor_leggings_outline",
+        "minecraft:item/armor_chestplate_outline",
+        "minecraft:item/armor_helmet_outline"
     };
 
     final int armorType;
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 5dfdac277..f757fa6ed 100644
--- a/src/main/java/net/minecraft/core/util/helper/MathHelper.java
+++ b/src/main/java/net/minecraft/core/util/helper/MathHelper.java
@@ -40,6 +40,12 @@ public class MathHelper
         return d >= (double)truncated ? truncated : truncated - 1;
     }
 
+    public static int ceil(double d)
+    {
+        int truncated = (int)d;
+        return d == (double)truncated ? truncated : truncated + 1;
+    }
+
     public static int round(double d) {
         int truncated = (int) d;
         return d <= truncated + 0.5 ? truncated : truncated + 1;
diff --git a/src/main/java/net/minecraft/core/world/ExplosionCannonball.java b/src/main/java/net/minecraft/core/world/ExplosionCannonball.java
index 0ffb886b1..4770942a2 100644
--- a/src/main/java/net/minecraft/core/world/ExplosionCannonball.java
+++ b/src/main/java/net/minecraft/core/world/ExplosionCannonball.java
@@ -157,7 +157,7 @@ public class ExplosionCannonball extends Explosion{
                 d3 /= d6;
                 d4 /= d6;
                 d5 /= d6;
-                double d7 = 0.5D / (d6 / (double)explosionSize + 0.10000000000000001D);
+                double d7 = 0.5D / (d6 / (double)explosionSize + 0.1D);
                 d7 *= worldObj.rand.nextFloat() * worldObj.rand.nextFloat() + 0.3F;
                 d3 *= d7;
                 d4 *= d7;
diff --git a/src/main/java/net/minecraft/core/world/LevelListener.java b/src/main/java/net/minecraft/core/world/LevelListener.java
index 9cf700e2a..1ee3a7475 100644
--- a/src/main/java/net/minecraft/core/world/LevelListener.java
+++ b/src/main/java/net/minecraft/core/world/LevelListener.java
@@ -11,16 +11,46 @@ import net.minecraft.core.sound.SoundCategory;
 
 public interface LevelListener
 {
-    public static final int EVENT_DISPENSER_ITEM = 1000;
-    public static final int EVENT_DISPENSER_EMPTY = 1001;
-    public static final int EVENT_DISPENSER_PROJECTILE = 1002;
-    public static final int EVENT_DOOR_SOUND = 1003;
-    public static final int EVENT_DISPENSER_PARTICLES = 2000;
-    public static final int EVENT_BLOCK_BREAK = 2001;
-    public static final int EVENT_FIRE_EXTINGUISH = 1004;
-    public static final int EVENT_JUKEBOX_TOGGLE = 1005;
-    public static final int EVENT_PISTON_EXTEND = 1006;
-    public static final int EVENT_PISTON_RETRACT = 1007;
+    /**
+     * data: unused
+     */
+    int EVENT_DISPENSER_ITEM = 1000;
+    /**
+     * data: unused
+     */
+    int EVENT_DISPENSER_EMPTY = 1001;
+    /**
+     * data: unused
+     */
+    int EVENT_DISPENSER_PROJECTILE = 1002;
+    /**
+     * data: unused
+     */
+    int EVENT_DOOR_SOUND = 1003;
+    /**
+     * data: {@link net.minecraft.core.util.helper.Direction Direction} id for the direction particles should be ejected
+     */
+    int EVENT_DISPENSER_PARTICLES = 2000;
+    /**
+     * data: block ID of the particles to create
+     */
+    int EVENT_BLOCK_BREAK = 2001;
+    /**
+     * data: unused
+     */
+    int EVENT_FIRE_EXTINGUISH = 1004;
+    /**
+     * data: item ID of the music disc to play, 0 to stop playback
+     */
+    int EVENT_JUKEBOX_TOGGLE = 1005;
+    /**
+     * data: unused
+     */
+    int EVENT_PISTON_EXTEND = 1006;
+    /**
+     * data: unused
+     */
+    int EVENT_PISTON_RETRACT = 1007;
 
 	/**
 	 * Redraw block in singleplayer and send block change packet in multiplayer. <br>
diff --git a/src/main/java/net/minecraft/core/world/SpawnerMobs.java b/src/main/java/net/minecraft/core/world/SpawnerMobs.java
index 378da74f8..59e1f0af1 100644
--- a/src/main/java/net/minecraft/core/world/SpawnerMobs.java
+++ b/src/main/java/net/minecraft/core/world/SpawnerMobs.java
@@ -20,6 +20,7 @@ import net.minecraft.core.world.chunk.Chunk;
 import net.minecraft.core.world.chunk.ChunkCoordinate;
 import net.minecraft.core.world.chunk.ChunkCoordinates;
 import net.minecraft.core.world.chunk.ChunkPosition;
+import net.minecraft.core.world.config.spawning.SpawnerConfig;
 import net.minecraft.core.world.pathfinder.Node;
 import net.minecraft.core.world.pathfinder.Path;
 import net.minecraft.core.world.pathfinder.PathFinder;
@@ -297,7 +298,7 @@ public final class SpawnerMobs
 									entity.spawnInit();
 									world.entityJoinedWorld(entity);
 									player.wakeUpPlayer(true, false);
-									world.playBlockEvent(null, 2001, (int) player.x, (int) player.y - 1, (int) player.z, world.getBlockId((int) player.x, (int) player.y - 1, (int) player.z));
+									world.playBlockEvent(null, LevelListener.EVENT_BLOCK_BREAK, (int) player.x, (int) player.y - 1, (int) player.z, world.getBlockId((int) player.x, (int) player.y - 1, (int) player.z));
 									entity.playLivingSound();
 									spawnedEntity = true;
 									spawnedEntityForPlayer = true;
@@ -311,38 +312,4 @@ public final class SpawnerMobs
 		}
 		return spawnedEntity;
 	}
-    public static class SpawnerConfig {
-        private boolean allowPassive = true;
-        private boolean allowHostile = true;
-        private final Map<String, Boolean> mobSpawnOverrides = new HashMap<>();
-
-        public boolean canPassiveSpawn(World world) {
-            return allowPassive;
-        }
-
-        public void setPassiveSpawning(boolean flag) {
-            allowPassive = flag;
-        }
-
-        public boolean canHostileSpawn(World world) {
-            return allowHostile && world.getDifficulty().canHostileMobsSpawn();
-        }
-
-        public void setHostileSpawning(boolean flag) {
-            allowHostile = flag;
-        }
-
-        public boolean canMobSpawn(String mobID) {
-            return mobSpawnOverrides.getOrDefault(mobID.toLowerCase(Locale.ROOT), true);
-        }
-
-        public void setMobSpawn(String mobID, boolean flag) {
-            mobSpawnOverrides.put(mobID.toLowerCase(Locale.ROOT), flag);
-        }
-
-        public Collection<Map.Entry<String, Boolean>> getSpawnEntries() {
-            return mobSpawnOverrides.entrySet();
-        }
-    }
-
 }
diff --git a/src/main/java/net/minecraft/core/world/World.java b/src/main/java/net/minecraft/core/world/World.java
index 9ff87705c..2a9e7d557 100644
--- a/src/main/java/net/minecraft/core/world/World.java
+++ b/src/main/java/net/minecraft/core/world/World.java
@@ -5,7 +5,6 @@ import static net.minecraft.core.Global.*;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Random;
@@ -58,6 +57,7 @@ import net.minecraft.core.world.chunk.ChunkSection;
 import net.minecraft.core.world.chunk.IChunkLoader;
 import net.minecraft.core.world.chunk.LightUpdate;
 import net.minecraft.core.world.chunk.provider.IChunkProvider;
+import net.minecraft.core.world.config.spawning.SpawnerConfig;
 import net.minecraft.core.world.pathfinder.Path;
 import net.minecraft.core.world.pathfinder.PathFinder;
 import net.minecraft.core.world.save.DimensionData;
@@ -82,6 +82,15 @@ public class World implements WorldSource {
 
     public static final int HEIGHT_BLOCKS = 256;
     public static final int MAX_BRIGHTNESS = 15;
+
+    public static final int MAX_BLOCK_X = 32000000;
+    public static final int MAX_BLOCK_Z = 32000000;
+    public static final int MIN_BLOCK_X = -32000000;
+    public static final int MIN_BLOCK_Z = -32000000;
+
+    public static final int MAX_SCHEDULED_TICKS_IN_TICK = 1000;
+    public static final int ANIMATION_TICKS_PER_TICK = 1000;
+
     private final List<LightUpdate> lightingToUpdate = new LinkedList<>();
     public List<Entity> loadedEntityList = new ArrayList<>();
     private final List<Entity> unloadedEntityList = new ArrayList<>();
@@ -120,7 +129,6 @@ public class World implements WorldSource {
     public SavedDataStorage savedDataStorage;
     private boolean updatingBlockEntities;
     private int lightingUpdatesCounter = 0;
-    public final SpawnerMobs.SpawnerConfig spawningConfig;
     static int lightingUpdatesScheduled = 0;
     private int caveSoundCounter = rand.nextInt(12000);
     public boolean isClientSide = false;
@@ -139,12 +147,12 @@ public class World implements WorldSource {
     private CommandManager commandManager;
 
     //Usually called when a world is loaded or generated (Singleplayer & Server)
-    public World(LevelStorage saveHandler, String name, long seed, Dimension dimension, WorldType worldType, SpawnerMobs.SpawnerConfig spawningConfig)
+    public World(LevelStorage saveHandler, String name, long seed, Dimension dimension, WorldType worldType)
     {
         this.saveHandler = saveHandler;
         this.savedDataStorage = new SavedDataStorage(saveHandler);
         this.levelData = saveHandler.getLevelData();
-        this.spawningConfig = spawningConfig;
+
         this.isNewWorld = levelData == null;
 
         // Attempt to determine the correct dimension for this world
@@ -236,7 +244,6 @@ public class World implements WorldSource {
         saveHandler = world.saveHandler;
 
         levelData = new LevelData(world.levelData);
-        this.spawningConfig = world.spawningConfig;
 
         dimensionData = world.saveHandler.getDimensionData(dimension.id);
         if (dimensionData == null)
@@ -292,8 +299,6 @@ public class World implements WorldSource {
 
         biomeProvider = this.worldType.createBiomeProvider(this);
 
-        spawningConfig = new SpawnerMobs.SpawnerConfig();
-
         this.commandManager = new CommandManager(isServer);
         this.commandManager.init();
     }
@@ -313,8 +318,6 @@ public class World implements WorldSource {
         auroraProvider = new AuroraProvider(this, 0);
 
         biomeProvider = this.worldType.createBiomeProvider(this);
-
-        spawningConfig = new SpawnerMobs.SpawnerConfig();
     }
 
     public <T> T getGameRuleValue(GameRule<T> gameRule)
@@ -322,6 +325,10 @@ public class World implements WorldSource {
         return levelData.getGameRules().getValue(gameRule);
     }
 
+    public SpawnerConfig getSpawnerConfig() {
+        return levelData.getSpawnerConfig();
+    }
+
     public int getHeightBlocks()
     {
         return Chunk.CHUNK_SECTIONS * ChunkSection.SECTION_SIZE_Y;
@@ -442,7 +449,7 @@ public class World implements WorldSource {
     @Override
     public int getBlockId(int x, int y, int z)
     {
-        if(x < 0xfe17b800 || z < 0xfe17b800 || x >= 0x1e84800 || z > 0x1e84800)
+        if(x < MIN_BLOCK_X || z < MIN_BLOCK_Z || x >= MAX_BLOCK_X || z > MAX_BLOCK_Z)
         {
             return 0;
         }
@@ -467,7 +474,7 @@ public class World implements WorldSource {
     @Override
     public double getBlockTemperature(int x, int z)
     {
-        if(x < 0xfe17b800 || z < 0xfe17b800 || x >= 0x1e84800 || z > 0x1e84800)
+        if(x < MIN_BLOCK_X || z < MIN_BLOCK_Z || x >= MAX_BLOCK_X || z > MAX_BLOCK_Z)
         {
             return 0;
         }
@@ -499,7 +506,7 @@ public class World implements WorldSource {
     @Override
     public double getBlockHumidity(int x, int z)
     {
-        if(x < 0xfe17b800 || z < 0xfe17b800 || x >= 0x1e84800 || z > 0x1e84800)
+        if(x < MIN_BLOCK_X || z < MIN_BLOCK_Z || x >= MAX_BLOCK_X || z > MAX_BLOCK_Z)
         {
             return 0;
         }
@@ -536,7 +543,7 @@ public class World implements WorldSource {
 
     public double getBlockVariety(int x, int z)
     {
-        if(x < 0xfe17b800 || z < 0xfe17b800 || x >= 0x1e84800 || z > 0x1e84800)
+        if(x < MIN_BLOCK_X || z < MIN_BLOCK_Z || x >= MAX_BLOCK_X || z > MAX_BLOCK_Z)
         {
             return 0;
         }
@@ -569,7 +576,7 @@ public class World implements WorldSource {
     @Override
     public @NotNull Biome getBlockBiome(int x, int y, int z)
     {
-        if(x < -32000000 || z < -32000000 || x >= 32000000 || z > 32000000)
+        if(x < MIN_BLOCK_X || z < MIN_BLOCK_Z || x >= MAX_BLOCK_X || z > MAX_BLOCK_Z)
         {
             return Biomes.OVERWORLD_PLAINS;
         }
@@ -603,7 +610,7 @@ public class World implements WorldSource {
 
     public boolean getBlockLitInteriorSurface(int x, int y, int z)
     {
-        if(x < 0xfe17b800 || z < 0xfe17b800 || x >= 0x1e84800 || z > 0x1e84800)
+        if(x < MIN_BLOCK_X || z < MIN_BLOCK_Z || x >= MAX_BLOCK_X || z > MAX_BLOCK_Z)
         {
             return true;
         }
@@ -683,7 +690,7 @@ public class World implements WorldSource {
 
     public boolean setBlockAndMetadata(int x, int y, int z, int id, int meta)
     {
-        if(x < 0xfe17b800 || z < 0xfe17b800 || x >= 0x1e84800 || z > 0x1e84800)
+        if(x < MIN_BLOCK_X || z < MIN_BLOCK_Z || x >= MAX_BLOCK_X || z > MAX_BLOCK_Z)
         {
             return false;
         }
@@ -701,9 +708,12 @@ public class World implements WorldSource {
         }
     }
 
-    public boolean setBlockRaw(int x, int y, int z, int id)
+    public boolean setBlockRaw(int x, int y, int z, int id) {
+        return setBlockAndMetadataRaw(x, y, z, id, getBlockMetadata(x, y, z));
+    }
+    public boolean setBlockAndMetadataRaw(int x, int y, int z, int id, int meta)
     {
-        if(x < 0xfe17b800 || z < 0xfe17b800 || x >= 0x1e84800 || z > 0x1e84800)
+        if(x < MIN_BLOCK_X || z < MIN_BLOCK_Z || x >= MAX_BLOCK_X || z > MAX_BLOCK_Z)
         {
             return false;
         }
@@ -717,13 +727,13 @@ public class World implements WorldSource {
         } else
         {
             Chunk chunk = getChunkFromChunkCoords(Math.floorDiv(x, Chunk.CHUNK_SIZE_X), Math.floorDiv(z, Chunk.CHUNK_SIZE_Z));
-            return chunk.setBlockIDRaw(x & (Chunk.CHUNK_SIZE_X - 1), y, z & (Chunk.CHUNK_SIZE_Z - 1), id);
+            return chunk.setBlockIDWithMetadataRaw(x & (Chunk.CHUNK_SIZE_X - 1), y, z & (Chunk.CHUNK_SIZE_Z - 1), id, meta);
         }
     }
 
     public boolean setBlock(int x, int y, int z, int id)
     {
-        if(x < 0xfe17b800 || z < 0xfe17b800 || x >= 0x1e84800 || z > 0x1e84800)
+        if(x < MIN_BLOCK_X || z < MIN_BLOCK_Z || x >= MAX_BLOCK_X || z > MAX_BLOCK_Z)
         {
             return false;
         }
@@ -757,7 +767,7 @@ public class World implements WorldSource {
     @Override
     public int getBlockMetadata(int x, int y, int z)
     {
-        if(x < 0xfe17b800 || z < 0xfe17b800 || x >= 0x1e84800 || z > 0x1e84800)
+        if(x < MIN_BLOCK_X || z < MIN_BLOCK_Z || x >= MAX_BLOCK_X || z > MAX_BLOCK_Z)
         {
             return 0;
         }
@@ -783,8 +793,7 @@ public class World implements WorldSource {
         {
             markBlockNeedsUpdate(x, y, z);
             int id = getBlockId(x, y, z);
-            // TODO
-            // The name neighborNotifyOnMetadataChangeDisabled suggests that this should be inverted, but doing that breaks redstone
+            // TODO The name neighborNotifyOnMetadataChangeDisabled suggests that this should be inverted, but doing that breaks redstone
             if(Block.neighborNotifyOnMetadataChangeDisabled[id & 0x3fff])
             {
                 notifyBlocksOfNeighborChange(x, y, z, id);
@@ -794,7 +803,7 @@ public class World implements WorldSource {
 
     public boolean setBlockMetadata(int x, int y, int z, int meta)
     {
-        if(x < 0xfe17b800 || z < 0xfe17b800 || x >= 0x1e84800 || z > 0x1e84800)
+        if(x < MIN_BLOCK_X || z < MIN_BLOCK_Z || x >= MAX_BLOCK_X || z > MAX_BLOCK_Z)
         {
             return false;
         }
@@ -815,18 +824,6 @@ public class World implements WorldSource {
         }
     }
 
-    public boolean setBlockRawWithNotify(int x, int y, int z, int id)
-    {
-        if(setBlockRaw(x, y, z, id))
-        {
-            notifyBlockChange(x, y, z, id);
-            return true;
-        } else
-        {
-            return false;
-        }
-    }
-
     public boolean setBlockWithNotify(int x, int y, int z, int id)
     {
         if(setBlock(x, y, z, id))
@@ -933,26 +930,26 @@ public class World implements WorldSource {
         return getChunkFromChunkCoords(Math.floorDiv(x, Chunk.CHUNK_SIZE_X), Math.floorDiv(z, Chunk.CHUNK_SIZE_Z)).getRawBrightness(x & (Chunk.CHUNK_SIZE_X - 1), y, z & (Chunk.CHUNK_SIZE_Z - 1), 0);
     }
 
-    public int getBlockLightValue(int i, int j, int k)
+    public int getBlockLightValue(int x, int y, int z)
     {
-        return getBlockLightValue_do(i, j, k, true);
+        return getBlockLightValue_do(x, y, z, true);
     }
 
-    public int getBlockLightValue_do(int i, int j, int k, boolean flag)
+    public int getBlockLightValue_do(int x, int y, int z, boolean first)
     {
-        if(i < 0xfe17b800 || k < 0xfe17b800 || i >= 0x1e84800 || k > 0x1e84800)
+        if(x < MIN_BLOCK_X || z < MIN_BLOCK_Z || x >= MAX_BLOCK_X || z > MAX_BLOCK_Z)
         {
             return MAX_BRIGHTNESS;
         }
-        if(flag)
+        if(first)
         {
-            if(getBlockLitInteriorSurface(i, j, k))
+            if(getBlockLitInteriorSurface(x, y, z))
             {
-                int i1 = getBlockLightValue_do(i, j + 1, k, false);
-                int j1 = getBlockLightValue_do(i + 1, j, k, false);
-                int k1 = getBlockLightValue_do(i - 1, j, k, false);
-                int l1 = getBlockLightValue_do(i, j, k + 1, false);
-                int i2 = getBlockLightValue_do(i, j, k - 1, false);
+                int i1 = getBlockLightValue_do(x, y + 1, z, false);
+                int j1 = getBlockLightValue_do(x + 1, y, z, false);
+                int k1 = getBlockLightValue_do(x - 1, y, z, false);
+                int l1 = getBlockLightValue_do(x, y, z + 1, false);
+                int i2 = getBlockLightValue_do(x, y, z - 1, false);
                 if(j1 > i1)
                 {
                     i1 = j1;
@@ -972,60 +969,60 @@ public class World implements WorldSource {
                 return i1;
             }
         }
-        if(j < 0)
+        if(y < 0)
         {
             return 0;
         }
-        if(j >= getHeightBlocks())
+        if(y >= getHeightBlocks())
         {
-            j = getHeightBlocks() - 1;
+            y = getHeightBlocks() - 1;
         }
-        Chunk chunk = getChunkFromChunkCoords(Math.floorDiv(i, Chunk.CHUNK_SIZE_X), Math.floorDiv(k, Chunk.CHUNK_SIZE_Z));
-        i &= (Chunk.CHUNK_SIZE_X - 1);
-        k &= (Chunk.CHUNK_SIZE_Z - 1);
-        return chunk.getRawBrightness(i, j, k, skyDarken);
+        Chunk chunk = getChunkFromChunkCoords(Math.floorDiv(x, Chunk.CHUNK_SIZE_X), Math.floorDiv(z, Chunk.CHUNK_SIZE_Z));
+        x &= (Chunk.CHUNK_SIZE_X - 1);
+        z &= (Chunk.CHUNK_SIZE_Z - 1);
+        return chunk.getRawBrightness(x, y, z, skyDarken);
     }
 
-    public boolean canExistingBlockSeeTheSky(int i, int j, int k)
+    public boolean canExistingBlockSeeTheSky(int x, int y, int z)
     {
-        if(i < 0xfe17b800 || k < 0xfe17b800 || i >= 0x1e84800 || k > 0x1e84800)
+        if(x < MIN_BLOCK_X || z < MIN_BLOCK_Z || x >= MAX_BLOCK_X || z > MAX_BLOCK_Z)
         {
             return false;
         }
-        if(j < 0)
+        if(y < 0)
         {
             return false;
         }
-        if(j >= getHeightBlocks())
+        if(y >= getHeightBlocks())
         {
             return true;
         }
-        if(!isChunkLoaded(Math.floorDiv(i, Chunk.CHUNK_SIZE_X), Math.floorDiv(k, Chunk.CHUNK_SIZE_Z)))
+        if(!isChunkLoaded(Math.floorDiv(x, Chunk.CHUNK_SIZE_X), Math.floorDiv(z, Chunk.CHUNK_SIZE_Z)))
         {
             return false;
         } else
         {
-            Chunk chunk = getChunkFromChunkCoords(Math.floorDiv(i, Chunk.CHUNK_SIZE_X), Math.floorDiv(k, Chunk.CHUNK_SIZE_Z));
-            i &= (Chunk.CHUNK_SIZE_X - 1);
-            k &= (Chunk.CHUNK_SIZE_Z - 1);
-            return chunk.canBlockSeeTheSky(i, j, k);
+            Chunk chunk = getChunkFromChunkCoords(Math.floorDiv(x, Chunk.CHUNK_SIZE_X), Math.floorDiv(z, Chunk.CHUNK_SIZE_Z));
+            x &= (Chunk.CHUNK_SIZE_X - 1);
+            z &= (Chunk.CHUNK_SIZE_Z - 1);
+            return chunk.canBlockSeeTheSky(x, y, z);
         }
     }
 
-    public int getHeightValue(int i, int j)
+    public int getHeightValue(int x, int z)
     {
-        if(i < 0xfe17b800 || j < 0xfe17b800 || i >= 0x1e84800 || j > 0x1e84800)
+        if(x < World.MIN_BLOCK_X || z < World.MIN_BLOCK_Z || x >= World.MAX_BLOCK_X || z > World.MAX_BLOCK_Z)
         {
             return 0;
         }
-        if(!isChunkLoaded(Math.floorDiv(i, Chunk.CHUNK_SIZE_X), Math.floorDiv(j, Chunk.CHUNK_SIZE_Z)))
+        if(!isChunkLoaded(Math.floorDiv(x, Chunk.CHUNK_SIZE_X), Math.floorDiv(z, Chunk.CHUNK_SIZE_Z)))
         {
             return 0;
         }
         else
         {
-            Chunk chunk = getChunkFromChunkCoords(Math.floorDiv(i, Chunk.CHUNK_SIZE_X), Math.floorDiv(j, Chunk.CHUNK_SIZE_Z));
-            return chunk.getHeightValue(i & (Chunk.CHUNK_SIZE_X - 1), j & (Chunk.CHUNK_SIZE_Z - 1));
+            Chunk chunk = getChunkFromChunkCoords(Math.floorDiv(x, Chunk.CHUNK_SIZE_X), Math.floorDiv(z, Chunk.CHUNK_SIZE_Z));
+            return chunk.getHeightValue(x & (Chunk.CHUNK_SIZE_X - 1), z & (Chunk.CHUNK_SIZE_Z - 1));
         }
     }
 
@@ -1071,7 +1068,7 @@ public class World implements WorldSource {
         {
             y = getHeightBlocks() - 1;
         }
-        if(y < 0 || y >= getHeightBlocks() || x < 0xfe17b800 || z < 0xfe17b800 || x >= 0x1e84800 || z > 0x1e84800)
+        if(y < 0 || y >= getHeightBlocks() || x < MIN_BLOCK_X || z < MIN_BLOCK_Z || x >= MAX_BLOCK_X || z > MAX_BLOCK_Z)
         {
             return layer.defaultLightLevel;
         }
@@ -1090,7 +1087,7 @@ public class World implements WorldSource {
 
     public void setLightValue(LightLayer layer, int x, int y, int z, int value)
     {
-        if(x < 0xfe17b800 || z < 0xfe17b800 || x >= 0x1e84800 || z > 0x1e84800)
+        if(x < MIN_BLOCK_X || z < MIN_BLOCK_Z || x >= MAX_BLOCK_X || z > MAX_BLOCK_Z)
         {
             return;
         }
@@ -1192,10 +1189,10 @@ public class World implements WorldSource {
         Block block = Block.blocksList[id];
         if((!ignoreNonColliderBlocks || block == null || block.getCollisionBoundingBoxFromPool(this, blockStartX, blockStartY, blockStartZ) != null) && id > 0 && (block.canCollideCheck(meta, shouldCollideWithFluids)))
         {
-            HitResult movingobjectposition = block.collisionRayTrace(this, blockStartX, blockStartY, blockStartZ, start, end);
-            if(movingobjectposition != null)
+            HitResult hitResult = block.collisionRayTrace(this, blockStartX, blockStartY, blockStartZ, start, end);
+            if(hitResult != null)
             {
-                return movingobjectposition;
+                return hitResult;
             }
         }
         for(int l1 = 200; l1-- >= 0;)
@@ -1323,15 +1320,14 @@ public class World implements WorldSource {
                 blockStartZ--;
                 vec32.z++;
             }
-            int j2 = getBlockId(blockStartX, blockStartY, blockStartZ);
-            int k2 = getBlockMetadata(blockStartX, blockStartY, blockStartZ);
-            Block block1 = Block.blocksList[j2];
-            if((!ignoreNonColliderBlocks || block1 == null || block1.getCollisionBoundingBoxFromPool(this, blockStartX, blockStartY, blockStartZ) != null) && j2 > 0 && block1.canCollideCheck(k2, shouldCollideWithFluids))
+            Block block1 = getBlock(blockStartX, blockStartY, blockStartZ);
+            int metadata1 = getBlockMetadata(blockStartX, blockStartY, blockStartZ);
+            if((!ignoreNonColliderBlocks || block1 == null || block1.getCollisionBoundingBoxFromPool(this, blockStartX, blockStartY, blockStartZ) != null) && block1 != null && block1.canCollideCheck(metadata1, shouldCollideWithFluids))
             {
-                HitResult movingobjectposition1 = block1.collisionRayTrace(this, blockStartX, blockStartY, blockStartZ, start, end);
-                if(movingobjectposition1 != null)
+                HitResult hitResult = block1.collisionRayTrace(this, blockStartX, blockStartY, blockStartZ, start, end);
+                if(hitResult != null)
                 {
-                    return movingobjectposition1;
+                    return hitResult;
                 }
             }
         }
@@ -1339,7 +1335,7 @@ public class World implements WorldSource {
         return null;
     }
     
-    public void playSoundAtEntity(@Nullable Entity player, Entity entity, String soundPath, float volume, float pitch)
+    public void playSoundAtEntity(@Nullable Entity player, @NotNull Entity entity, String soundPath, float volume, float pitch)
     {
         for (LevelListener listener : listeners)
         {
@@ -1584,13 +1580,13 @@ public class World implements WorldSource {
         }
 
         double d = 0.25D;
-        List list = getEntitiesWithinAABBExcludingEntity(entity, axisalignedbb.grow(d, d, d));
+        List<Entity> list = getEntitiesWithinAABBExcludingEntity(entity, axisalignedbb.grow(d, d, d));
         for(int j2 = 0; j2 < list.size(); j2++)
         {
-            AABB axisalignedbb1 = ((Entity)list.get(j2)).getBb();
-            if(axisalignedbb1 != null && axisalignedbb1.intersects(axisalignedbb))
+            AABB aabb = ((Entity)list.get(j2)).getBb();
+            if(aabb != null && aabb.intersects(axisalignedbb))
             {
-                collidingBoundingBoxes.add(axisalignedbb1);
+                collidingBoundingBoxes.add(aabb);
             }
         }
 
@@ -1746,22 +1742,22 @@ public class World implements WorldSource {
         return -1;
     }
     
-    public int findTopSolidNonLiquidBlock(int i, int j)
+    public int findTopSolidNonLiquidBlock(int x, int z)
     {
-        Chunk chunk = getChunkFromBlockCoords(i, j);
-        int k = getHeightBlocks() - 1;
-        i &= (Chunk.CHUNK_SIZE_X - 1);
-        j &= (Chunk.CHUNK_SIZE_Z - 1);
-        while(k > 0) 
+        Chunk chunk = getChunkFromBlockCoords(x, z);
+        int y = getHeightBlocks() - 1;
+        x &= (Chunk.CHUNK_SIZE_X - 1);
+        z &= (Chunk.CHUNK_SIZE_Z - 1);
+        while(y > 0)
         {
-            int l = chunk.getBlockID(i, k, j);
-            Material material = l != 0 ? Block.blocksList[l].blockMaterial : Material.air;
+            Block block = Block.getBlock(chunk.getBlockID(x, y, z));
+            Material material = block != null ? block.blockMaterial : Material.air;
             if(!material.blocksMotion())
             {
-                k--;
+                y--;
             } else
             {
-                return k + 1;
+                return y + 1;
             }
         }
         return -1;
@@ -1975,10 +1971,10 @@ public class World implements WorldSource {
     public boolean checkIfAABBIsClear(AABB axisalignedbb)
     {
         if (axisalignedbb == null) return true;
-        List list = getEntitiesWithinAABBExcludingEntity(null, axisalignedbb);
+        List<Entity> list = getEntitiesWithinAABBExcludingEntity(null, axisalignedbb);
         for(int i = 0; i < list.size(); i++)
         {
-            Entity entity = (Entity)list.get(i);
+            Entity entity = list.get(i);
             if (entity instanceof FireflyClusterMob) continue;
             if(!entity.removed && entity.blocksBuilding)
             {
@@ -2011,9 +2007,9 @@ public class World implements WorldSource {
 		List<Entity> entities = getEntitiesWithinAABBExcludingEntity(null, boundingBox);
 
         for (Entity entity : entities) {
-            AABB axisalignedbb1 = entity.getBb();
-            if (axisalignedbb1 != null && axisalignedbb1.intersects(boundingBox)) {
-                collidingBoundingBoxes.add(axisalignedbb1);
+            AABB aabb = entity.getBb();
+            if (aabb != null && aabb.intersects(boundingBox)) {
+                collidingBoundingBoxes.add(aabb);
             }
         }
 		
@@ -2043,19 +2039,19 @@ public class World implements WorldSource {
 		return false;
 	}
 
-    public boolean isBoundingBoxBurning(AABB axisalignedbb)
+    public boolean isBoundingBoxBurning(AABB aabb)
     {
-        return isMaterialInBB(axisalignedbb, Material.fire, Material.lava);
+        return isMaterialInBB(aabb, Material.fire, Material.lava);
     }
 
-    public boolean handleMaterialAcceleration(AABB axisalignedbb, Material material, Entity entity, boolean addVelocity)
+    public boolean handleMaterialAcceleration(AABB aabb, Material material, Entity entity, boolean addVelocity)
     {
-        int i = MathHelper.floor(axisalignedbb.minX);
-        int j = MathHelper.floor(axisalignedbb.maxX + 1.0D);
-        int k = MathHelper.floor(axisalignedbb.minY);
-        int l = MathHelper.floor(axisalignedbb.maxY + 1.0D);
-        int i1 = MathHelper.floor(axisalignedbb.minZ);
-        int j1 = MathHelper.floor(axisalignedbb.maxZ + 1.0D);
+        int i = MathHelper.floor(aabb.minX);
+        int j = MathHelper.floor(aabb.maxX + 1.0D);
+        int k = MathHelper.floor(aabb.minY);
+        int l = MathHelper.floor(aabb.maxY + 1.0D);
+        int i1 = MathHelper.floor(aabb.minZ);
+        int j1 = MathHelper.floor(aabb.maxZ + 1.0D);
         if(!areBlocksLoaded(i, k, i1, j, l, j1))
         {
             return false;
@@ -2069,7 +2065,7 @@ public class World implements WorldSource {
                 for(int i2 = i1; i2 < j1; i2++)
                 {
                     Block block = Block.blocksList[getBlockId(k1, l1, i2)];
-                    if(block == null || !isMaterialInBB(axisalignedbb, material))
+                    if(block == null || !isMaterialInBB(aabb, material))
                     {
                         continue;
                     }
@@ -2170,8 +2166,7 @@ public class World implements WorldSource {
         return false;
     }
 
-    public Explosion createExplosion(Entity entity, double x, double y, double z,
-                                     float explosionSize)
+    public Explosion createExplosion(Entity entity, double x, double y, double z, float explosionSize)
     {
         return newExplosion(entity, x, y, z, explosionSize, false, false);
     }
@@ -2226,7 +2221,7 @@ public class World implements WorldSource {
         z += side.getOffsetZ();
         if(getBlockId(x, y, z) == Blocks.FIRE.id)
         {
-            playBlockEvent(entityplayer, 1004, x, y, z, 0);
+            playBlockEvent(entityplayer, LevelListener.EVENT_FIRE_EXTINGUISH, x, y, z, 0);
             setBlockWithNotify(x, y, z, 0);
         }
     }
@@ -2366,7 +2361,7 @@ public class World implements WorldSource {
         lightingUpdatesCounter++;
         try
         {
-            for (int i = 499; lightingToUpdate.size() > 0 && i >= 0; i--)
+            for (int i = 499; !lightingToUpdate.isEmpty() && i >= 0; i--)
             {
                 lightingToUpdate.remove(lightingToUpdate.size() - 1).performLightUpdate(this);
                 if (i == 0)
@@ -2456,7 +2451,7 @@ public class World implements WorldSource {
         if(areEnoughPlayersFullyAsleep())
         {
             boolean wasInterrupted = false;
-            if(spawningConfig.canHostileSpawn(this) && getPlayersRequiredToSkipNight() <= 1)
+            if(getSpawnerConfig().canHostileSpawn(this) && getPlayersRequiredToSkipNight() <= 1)
             {
                 wasInterrupted = SpawnerMobs.performSleepSpawning(this, players);
             }
@@ -2479,7 +2474,7 @@ public class World implements WorldSource {
 		updateSleepingPlayers();
         Debug.change("spawning");
         // TODO mob spawning seems to be the cause of many lag spikes, specifically the checks for is a mob is allowed to spawn at a certain xyz position seem to be the worst offenders
-		SpawnerMobs.performSpawning(this, spawningConfig);
+		SpawnerMobs.performSpawning(this, getSpawnerConfig());
         Debug.change("chunk");
 		chunkProvider.tick();
 
@@ -2577,8 +2572,8 @@ public class World implements WorldSource {
                 blockX += chunkBlockX;
                 blockZ += chunkBlockZ;
                 if (id == 0 && getFullBlockLightValue(blockX, blockY, blockZ) <= rand.nextInt(8) && getSavedLightValue(LightLayer.Sky, blockX, blockY, blockZ) <= 0) {
-                    Player entityplayer1 = getClosestPlayer((double) blockX + 0.5D, (double) blockY + 0.5D, (double) blockZ + 0.5D, 8D);
-                    if (entityplayer1 != null && entityplayer1.distanceToSqr((double) blockX + 0.5D, (double) blockY + 0.5D, (double) blockZ + 0.5D) > 4D) {
+                    Player closestPlayer = getClosestPlayer((double) blockX + 0.5D, (double) blockY + 0.5D, (double) blockZ + 0.5D, 8D);
+                    if (closestPlayer != null && closestPlayer.distanceToSqr((double) blockX + 0.5D, (double) blockY + 0.5D, (double) blockZ + 0.5D) > 4D) {
                         playSoundEffect(null, SoundCategory.CAVE_SOUNDS, (double) blockX + 0.5D, (double) blockY + 0.5D, (double) blockZ + 0.5D, "ambient.cave.cave", 0.7F, 0.8F + rand.nextFloat() * 0.2F);
                         caveSoundCounter = rand.nextInt(12000) + 6000;
                     }
@@ -2616,9 +2611,9 @@ public class World implements WorldSource {
         {
             throw new IllegalStateException("TickNextTick list out of sync");
         }
-        if(count > 1000)
+        if(count > MAX_SCHEDULED_TICKS_IN_TICK)
         {
-            count = 1000;
+            count = MAX_SCHEDULED_TICKS_IN_TICK;
         }
         for(int j = 0; j < count; j++)
         {
@@ -2629,34 +2624,33 @@ public class World implements WorldSource {
             }
             scheduledTickTreeSet.remove(entry);
             scheduledTickSet.remove(entry);
-            byte byte0 = 8;
-            if(!areBlocksLoaded(entry.x - byte0, entry.y - byte0, entry.z - byte0, entry.x + byte0, entry.y + byte0, entry.z + byte0))
+            final byte radius = 8;
+            if(!areBlocksLoaded(entry.x - radius, entry.y - radius, entry.z - radius, entry.x + radius, entry.y + radius, entry.z + radius))
             {
                 continue;
             }
-            int k = getBlockId(entry.x, entry.y, entry.z);
-            if(k == entry.blockId && k > 0)
+            int blockId = getBlockId(entry.x, entry.y, entry.z);
+            if(blockId == entry.blockId && blockId > 0)
             {
-                Block.blocksList[k].updateTick(this, entry.x, entry.y, entry.z, rand);
+                Block.blocksList[blockId].updateTick(this, entry.x, entry.y, entry.z, rand);
             }
         }
 
-        return scheduledTickTreeSet.size() != 0;
+        return !scheduledTickTreeSet.isEmpty();
     }
 
     public void randomDisplayUpdates(int x, int y, int z)
     {
-        byte radius = 16;
+        final byte radius = 16;
         Random random = new Random();
-        for(int i = 0; i < 1000; i++)
+        for(int i = 0; i < ANIMATION_TICKS_PER_TICK; i++)
         {
             int rx = (x + rand.nextInt(radius)) - rand.nextInt(radius);
             int ry = (y + rand.nextInt(radius)) - rand.nextInt(radius);
             int rz = (z + rand.nextInt(radius)) - rand.nextInt(radius);
-            int id = getBlockId(rx, ry, rz);
-            if(id > 0)
-            {
-                Block.blocksList[id].animationTick(this, rx, ry, rz, random);
+            Block block = getBlock(rx, ry, rz);
+            if (block != null) {
+                block.animationTick(this, rx, ry, rz, random);
             }
         }
 
@@ -2756,7 +2750,8 @@ public class World implements WorldSource {
 
     public void dropOldChunks()
     {
-        while(chunkProvider.tick()) ;
+        // TODO chunkProvider#tick should be renamed, current name is extremely misleading as its called "tick" whilst not even being remotely connected to the actual tick system
+        while(chunkProvider.tick());
     }
 
     public boolean canBlockBePlacedAt(int blockId, int x, int y, int z, boolean flag, Side side)
@@ -2799,20 +2794,20 @@ public class World implements WorldSource {
         return (new PathFinder(chunkcache)).findPath(entity, entityToTravelTo, distance);
     }
 
-    public Path getEntityPathToXYZ(Entity entity, int i, int j, int k, float f)
+    public Path getEntityPathToXYZ(Entity entity, int x, int y, int z, float distance)
     {
-        int l = MathHelper.floor(entity.x);
-        int i1 = MathHelper.floor(entity.y);
-        int j1 = MathHelper.floor(entity.z);
-        int k1 = (int)(f + 8F);
-        int l1 = l - k1;
-        int i2 = i1 - k1;
-        int j2 = j1 - k1;
-        int k2 = l + k1;
-        int l2 = i1 + k1;
-        int i3 = j1 + k1;
-        ChunkCache chunkcache = new ChunkCache(this, l1, i2, j2, k2, l2, i3);
-        return (new PathFinder(chunkcache)).findPath(entity, i, j, k, f);
+        int eBlockX = MathHelper.floor(entity.x);
+        int eBlockY = MathHelper.floor(entity.y);
+        int eBlockZ = MathHelper.floor(entity.z);
+        int cacheRadius = (int)(distance + 8F);
+        int cacheMinX = eBlockX - cacheRadius;
+        int cacheMinY = eBlockY - cacheRadius;
+        int cacheMinZ = eBlockZ - cacheRadius;
+        int cacheMaxX = eBlockX + cacheRadius;
+        int cacheMaxY = eBlockY + cacheRadius;
+        int cacheMaxZ = eBlockZ + cacheRadius;
+        ChunkCache chunkcache = new ChunkCache(this, cacheMinX, cacheMinY, cacheMinZ, cacheMaxX, cacheMaxY, cacheMaxZ);
+        return (new PathFinder(chunkcache)).findPath(entity, x, y, z, distance);
     }
 
     public boolean getDirectSignal(int x, int y, int z, Side side) {
@@ -3035,9 +3030,7 @@ public class World implements WorldSource {
     public void setWorldTimeUpdateTicks(long l)
     {
         long l1 = l - levelData.getWorldTime();
-        for(Iterator iterator = scheduledTickSet.iterator(); iterator.hasNext();)
-        {
-            NextTickListEntry nextticklistentry = (NextTickListEntry)iterator.next();
+        for (NextTickListEntry nextticklistentry : scheduledTickSet) {
             nextticklistentry.delay += l1;
         }
 
@@ -3095,7 +3088,7 @@ public class World implements WorldSource {
         }
     }
 
-    public boolean canMineBlock(Player entityplayer, int i, int j, int k)
+    public boolean canMineBlock(Player entityplayer, int x, int y, int z)
     {
         return true;
     }
@@ -3118,11 +3111,11 @@ public class World implements WorldSource {
         for(int i = 0; i < unloadedEntityList.size(); i++)
         {
             Entity entity = unloadedEntityList.get(i);
-            int l = entity.chunkCoordX;
-            int j1 = entity.chunkCoordZ;
-            if(entity.addedToChunk && isChunkLoaded(l, j1))
+            int cX = entity.chunkCoordX;
+            int cZ = entity.chunkCoordZ;
+            if(entity.addedToChunk && isChunkLoaded(cX, cZ))
             {
-                getChunkFromChunkCoords(l, j1).removeEntity(entity);
+                getChunkFromChunkCoords(cX, cZ).removeEntity(entity);
             }
         }
 
@@ -3132,30 +3125,30 @@ public class World implements WorldSource {
         }
 
         unloadedEntityList.clear();
-        for(int k = 0; k < loadedEntityList.size(); k++)
+        for(int i = 0; i < loadedEntityList.size(); i++)
         {
-            Entity entity1 = loadedEntityList.get(k);
-            if(entity1.vehicle != null)
+            Entity entity = loadedEntityList.get(i);
+            if(entity.vehicle != null)
             {
-                if(!entity1.vehicle.isRemoved() && entity1.vehicle.getPassenger() == entity1)
+                if(!entity.vehicle.isRemoved() && entity.vehicle.getPassenger() == entity)
                 {
                     continue;
                 }
-                entity1.vehicle.setPassenger(null);
-                entity1.vehicle = null;
+                entity.vehicle.setPassenger(null);
+                entity.vehicle = null;
             }
-            if(!entity1.removed)
+            if(!entity.removed)
             {
                 continue;
             }
-            int i1 = entity1.chunkCoordX;
-            int k1 = entity1.chunkCoordZ;
-            if(entity1.addedToChunk && isChunkLoaded(i1, k1))
+            int cX = entity.chunkCoordX;
+            int cZ = entity.chunkCoordZ;
+            if(entity.addedToChunk && isChunkLoaded(cX, cZ))
             {
-                getChunkFromChunkCoords(i1, k1).removeEntity(entity1);
+                getChunkFromChunkCoords(cX, cZ).removeEntity(entity);
             }
-            loadedEntityList.remove(k--);
-            releaseEntitySkin(entity1);
+            loadedEntityList.remove(i--);
+            releaseEntitySkin(entity);
         }
 
     }
@@ -3187,7 +3180,7 @@ public class World implements WorldSource {
     public void updateEnoughPlayersSleepingFlag(Player player)
     {
         enoughPlayersSleeping = false;
-        if(players.size() > 0) {
+        if(!players.isEmpty()) {
             int playersSleeping = 0;
             int req = getPlayersRequiredToSkipNight();
             for(Player p : players)
@@ -3206,19 +3199,11 @@ public class World implements WorldSource {
     protected void wakeUpAllPlayers()
     {
         enoughPlayersSleeping = false;
-        Iterator iterator = players.iterator();
-        do
-        {
-            if(!iterator.hasNext())
-            {
-                break;
-            }
-            Player entityplayer = (Player)iterator.next();
-            if(entityplayer.isPlayerSleeping())
-            {
+        for (Player entityplayer : players) {
+            if (entityplayer.isPlayerSleeping()) {
                 entityplayer.wakeUpPlayer(false, false);
             }
-        } while(true);
+        }
         if (getCurrentWeather() != null && getCurrentWeather().spawnRainParticles)
         {
             weatherManager.overrideWeather(worldType.getDefaultWeather());
@@ -3263,14 +3248,14 @@ public class World implements WorldSource {
         return true;
     }
 
-    public void setSavedData(String s, SavedData mapdatabase)
+    public void setSavedData(String id, SavedData savedData)
     {
-        savedDataStorage.set(s, mapdatabase);
+        savedDataStorage.set(id, savedData);
     }
 
-    public SavedData getSavedData(Class class1, String s)
+    public SavedData getSavedData(Class<? extends SavedData> saveDataClass, String id)
     {
-        return savedDataStorage.load(class1, s);
+        return savedDataStorage.load(saveDataClass, id);
     }
 
     public int getUniqueDataId(String s)
@@ -3301,10 +3286,10 @@ public class World implements WorldSource {
         double x1 = (double) (rand.nextFloat() * f) + (double) (1.0F - f) * 0.5D;
         double y1 = (double) (rand.nextFloat() * f) + (double) (1.0F - f) * 0.5D;
         double z1 = (double) (rand.nextFloat() * f) + (double) (1.0F - f) * 0.5D;
-        ItemEntity entityitem = new ItemEntity(this, (double) x + x1, (double) y + y1, (double) z + z1, itemStack);
-        entityitem.pickupDelay = 10;
-        entityJoinedWorld(entityitem);
-        return entityitem;
+        ItemEntity item = new ItemEntity(this, (double) x + x1, (double) y + y1, (double) z + z1, itemStack);
+        item.pickupDelay = 10;
+        entityJoinedWorld(item);
+        return item;
     }
     public void sendGlobalMessage(String message){
         for (Player player: players){
diff --git a/src/main/java/net/minecraft/core/world/chunk/Chunk.java b/src/main/java/net/minecraft/core/world/chunk/Chunk.java
index 3d86cbb7f..c3d5908f1 100644
--- a/src/main/java/net/minecraft/core/world/chunk/Chunk.java
+++ b/src/main/java/net/minecraft/core/world/chunk/Chunk.java
@@ -260,7 +260,8 @@ public class Chunk
         return getSection(y / ChunkSection.SECTION_SIZE_Y).getBlock(x, y % ChunkSection.SECTION_SIZE_Y, z);
     }
 
-    public boolean setBlockIDWithMetadata(int x, int y, int z, int id, int data)
+    // will not trigger onBlockRemoved or onBlockPlacedByWorld
+    public boolean setBlockIDWithMetadataRaw(int x, int y, int z, int id, int data)
     {
         if (x < 0 || x >= CHUNK_SIZE_X || y < 0 || y >= CHUNK_SECTIONS * ChunkSection.SECTION_SIZE_Y || z < 0 || z >= CHUNK_SIZE_Z) return false;
 
@@ -279,10 +280,6 @@ public class Chunk
 
         int worldX = xPosition * CHUNK_SIZE_X + x;
         int worldZ = zPosition * CHUNK_SIZE_Z + z;
-        if(currentId != 0 && !world.isClientSide)
-        {
-            Block.blocksList[currentId].onBlockRemoved(world, worldX, y, worldZ, currentData);
-        }
 
         if(!world.worldType.hasCeiling())
         {
@@ -300,45 +297,63 @@ public class Chunk
         world.scheduleLightingUpdate(LightLayer.Block, worldX, y, worldZ, worldX, y, worldZ);
         lightGaps(x, z);
 
-        if(Block.getBlock(id) != null) {
-            Block.blocksList[id].onBlockPlacedByWorld(world, worldX, y, worldZ);
-        }
-
         isModified = true;
         return true;
     }
 
-    public boolean setBlockID(int x, int y, int z, int id)
-    {
-        return setBlockIDWithMetadata(x, y, z, id, 0);
-    }
-
-    // will not trigger onBlockRemoved or onBlockAdded
-    public boolean setBlockIDRaw(int x, int y, int z, int id)
+    public boolean setBlockIDWithMetadata(int x, int y, int z, int id, int data)
     {
         if (x < 0 || x >= CHUNK_SIZE_X || y < 0 || y >= CHUNK_SECTIONS * ChunkSection.SECTION_SIZE_Y || z < 0 || z >= CHUNK_SIZE_Z) return false;
 
         ChunkSection section = getSection(y / ChunkSection.SECTION_SIZE_Y);
+        int heightValue = getHeightValue(x, z);
 
         int currentId = section.getBlock(x, y % ChunkSection.SECTION_SIZE_Y, z);
-        if(currentId == id) {
+        int currentData = section.getData(x, y % ChunkSection.SECTION_SIZE_Y, z);
+
+        if(currentId == id && currentData == data) {
             return false;
         }
 
         section.setBlock(x, y % ChunkSection.SECTION_SIZE_Y, z, id);
-        section.setData(x, y % ChunkSection.SECTION_SIZE_Y, z, 0);
+        section.setData(x, y % ChunkSection.SECTION_SIZE_Y, z, data);
 
         int worldX = xPosition * CHUNK_SIZE_X + x;
         int worldZ = zPosition * CHUNK_SIZE_Z + z;
+        if(currentId != 0 && !world.isClientSide)
+        {
+            Block.blocksList[currentId].onBlockRemoved(world, worldX, y, worldZ, currentData);
+        }
+
+        if(!world.worldType.hasCeiling())
+        {
+            if(Block.lightBlock[id & 0x3fff] != 0) {
+                if(y >= heightValue) {
+                    recalcHeight(x, y + 1, z);
+                }
+            }
+            else if(y == heightValue - 1) {
+                recalcHeight(x, y, z);
+            }
+            world.scheduleLightingUpdate(LightLayer.Sky, worldX, y, worldZ, worldX, y, worldZ);
+        }
 
         world.scheduleLightingUpdate(LightLayer.Block, worldX, y, worldZ, worldX, y, worldZ);
-        world.scheduleLightingUpdate(LightLayer.Sky, worldX, y, worldZ, worldX, y, worldZ);
         lightGaps(x, z);
 
+        if(Block.getBlock(id) != null) {
+            Block.blocksList[id].onBlockPlacedByWorld(world, worldX, y, worldZ);
+        }
+
         isModified = true;
         return true;
     }
 
+    public boolean setBlockID(int x, int y, int z, int id)
+    {
+        return setBlockIDWithMetadata(x, y, z, id, 0);
+    }
+
     public int getBlockMetadata(int x, int y, int z)
     {
         if (x < 0 || x >= CHUNK_SIZE_X || y < 0 || y >= CHUNK_SECTIONS * ChunkSection.SECTION_SIZE_Y || z < 0 || z >= CHUNK_SIZE_Z) return 0;
diff --git a/src/main/java/net/minecraft/core/world/chunk/ChunkCache.java b/src/main/java/net/minecraft/core/world/chunk/ChunkCache.java
index a291db9a6..a0b76faa2 100644
--- a/src/main/java/net/minecraft/core/world/chunk/ChunkCache.java
+++ b/src/main/java/net/minecraft/core/world/chunk/ChunkCache.java
@@ -82,22 +82,22 @@ public class ChunkCache
         return chunkArray[l][i1].getBlockEntity(x & (Chunk.CHUNK_SIZE_X - 1), y, z & (Chunk.CHUNK_SIZE_Z - 1));
     }
 
-    public boolean getBlockLitInteriorSurface(int i, int j, int k)
+    public boolean getBlockLitInteriorSurface(int x, int y, int z)
     {
-        if(i < 0xfe17b800 || k < 0xfe17b800 || i >= 0x1e84800 || k > 0x1e84800)
+        if(x < World.MIN_BLOCK_X || z < World.MIN_BLOCK_Z || x >= World.MAX_BLOCK_X || z > World.MAX_BLOCK_Z)
         {
             return true;
         }
-        if(j < 0)
+        if(y < 0)
         {
             return true;
         }
-        if(j >= worldObj.getHeightBlocks())
+        if(y >= worldObj.getHeightBlocks())
         {
             return true;
         } else
         {
-            return Block.getIsLitInteriorSurface(worldObj, i, j, k);
+            return Block.getIsLitInteriorSurface(worldObj, x, y, z);
         }
     }
 
@@ -140,26 +140,26 @@ public class ChunkCache
         return worldObj.worldType.getBrightnessRamp()[getLightValue(x, y, z)];
     }
 
-    public int getLightValue(int i, int j, int k)
+    public int getLightValue(int x, int y, int z)
     {
-        return getLightValueExt(i, j, k, true);
+        return getLightValueExt(x, y, z, true);
     }
 
-    public int getLightValueExt(int i, int j, int k, boolean flag)
+    public int getLightValueExt(int x, int y, int z, boolean first)
     {
-        if(i < 0xfe17b800 || k < 0xfe17b800 || i >= 0x1e84800 || k > 0x1e84800)
+        if(x < World.MIN_BLOCK_X || z < World.MIN_BLOCK_Z || x >= World.MAX_BLOCK_X || z > World.MAX_BLOCK_Z)
         {
             return 15;
         }
-        if(flag)
+        if(first)
         {
-            if(getBlockLitInteriorSurface(i, j, k))
+            if(getBlockLitInteriorSurface(x, y, z))
             {
-                int k1 = getLightValueExt(i, j + 1, k, false);
-                int i2 = getLightValueExt(i + 1, j, k, false);
-                int j2 = getLightValueExt(i - 1, j, k, false);
-                int k2 = getLightValueExt(i, j, k + 1, false);
-                int l2 = getLightValueExt(i, j, k - 1, false);
+                int k1 = getLightValueExt(x, y + 1, z, false);
+                int i2 = getLightValueExt(x + 1, y, z, false);
+                int j2 = getLightValueExt(x - 1, y, z, false);
+                int k2 = getLightValueExt(x, y, z + 1, false);
+                int l2 = getLightValueExt(x, y, z - 1, false);
                 if(i2 > k1)
                 {
                     k1 = i2;
@@ -179,11 +179,11 @@ public class ChunkCache
                 return k1;
             }
         }
-        if(j < 0)
+        if(y < 0)
         {
             return 0;
         }
-        if(j >= worldObj.getHeightBlocks())
+        if(y >= worldObj.getHeightBlocks())
         {
             int i1 = 15 - worldObj.skyDarken;
             if(i1 < 0)
@@ -193,9 +193,9 @@ public class ChunkCache
             return i1;
         } else
         {
-            int j1 = Math.floorDiv(i, Chunk.CHUNK_SIZE_X) - chunkX;
-            int l1 = Math.floorDiv(k, Chunk.CHUNK_SIZE_Z) - chunkZ;
-            return chunkArray[j1][l1].getRawBrightness(i & (Chunk.CHUNK_SIZE_X - 1), j, k & (Chunk.CHUNK_SIZE_Z - 1), worldObj.skyDarken);
+            int j1 = Math.floorDiv(x, Chunk.CHUNK_SIZE_X) - chunkX;
+            int l1 = Math.floorDiv(z, Chunk.CHUNK_SIZE_Z) - chunkZ;
+            return chunkArray[j1][l1].getRawBrightness(x & (Chunk.CHUNK_SIZE_X - 1), y, z & (Chunk.CHUNK_SIZE_Z - 1), worldObj.skyDarken);
         }
     }
 
diff --git a/src/main/java/net/minecraft/core/world/chunk/ChunkCoordinates.java b/src/main/java/net/minecraft/core/world/chunk/ChunkCoordinates.java
index 40df26fb3..5677ee88a 100644
--- a/src/main/java/net/minecraft/core/world/chunk/ChunkCoordinates.java
+++ b/src/main/java/net/minecraft/core/world/chunk/ChunkCoordinates.java
@@ -47,11 +47,11 @@ public class ChunkCoordinates implements Comparable<ChunkCoordinates> {
 		}
 	}
 
-	public double getSqDistanceTo(int i, int j, int k) {
-		int l = x - i;
-		int i1 = y - j;
-		int j1 = z - k;
-		return Math.sqrt(l * l + i1 * i1 + j1 * j1);
+	public double getSqDistanceTo(int x, int y, int z) {
+		int dx = this.x - x;
+		int dy = this.y - y;
+		int dz = this.z - z;
+		return Math.sqrt(dx * dx + dy * dy + dz * dz);
 	}
 
 	@Override
diff --git a/src/main/java/net/minecraft/core/world/config/spawning/SpawnerConfig.java b/src/main/java/net/minecraft/core/world/config/spawning/SpawnerConfig.java
new file mode 100644
index 000000000..3f8e56fb6
--- /dev/null
+++ b/src/main/java/net/minecraft/core/world/config/spawning/SpawnerConfig.java
@@ -0,0 +1,72 @@
+package net.minecraft.core.world.config.spawning;
+
+import com.mojang.nbt.ByteTag;
+import com.mojang.nbt.CompoundTag;
+import com.mojang.nbt.Tag;
+import net.minecraft.core.world.World;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Locale;
+import java.util.Map;
+
+public class SpawnerConfig {
+    private boolean allowPassive = true;
+    private boolean allowHostile = true;
+    private final Map<String, Boolean> mobSpawnOverrides = new HashMap<>();
+
+    public boolean canPassiveSpawn(World world) {
+        return allowPassive;
+    }
+
+    public void setPassiveSpawning(boolean flag) {
+        allowPassive = flag;
+    }
+
+    public boolean canHostileSpawn(World world) {
+        return allowHostile && world.getDifficulty().canHostileMobsSpawn();
+    }
+
+    public void setHostileSpawning(boolean flag) {
+        allowHostile = flag;
+    }
+
+    public boolean canMobSpawn(String mobID) {
+        return mobSpawnOverrides.getOrDefault(mobID.toLowerCase(Locale.ROOT), true);
+    }
+
+    public void setMobSpawn(String mobID, boolean flag) {
+        mobSpawnOverrides.put(mobID.toLowerCase(Locale.ROOT), flag);
+    }
+
+    public Collection<Map.Entry<String, Boolean>> getSpawnEntries() {
+        return mobSpawnOverrides.entrySet();
+    }
+
+    public void writeToTag(CompoundTag tag) {
+        tag.putBoolean("passive", allowPassive);
+        tag.putBoolean("hostile", allowHostile);
+        CompoundTag overridesTag = new CompoundTag();
+        for (Map.Entry<String, Boolean> e : mobSpawnOverrides.entrySet()) {
+            overridesTag.putBoolean(e.getKey(), e.getValue());
+        }
+        tag.putCompound("overrides", overridesTag);
+    }
+
+    public void readFromTag(CompoundTag tag) {
+        allowPassive = tag.getBoolean("passive");
+        allowHostile = tag.getBoolean("hostile");
+        CompoundTag overrides = tag.getCompound("overrides");
+        for (Map.Entry<String, Tag<?>> tagEntry : overrides.getValue().entrySet()) {
+            mobSpawnOverrides.put(tagEntry.getKey(), ((ByteTag)tagEntry.getValue()).getValue() != 0);
+        }
+    }
+
+    public static SpawnerConfig createFromTag(CompoundTag tag) {
+        SpawnerConfig config = new SpawnerConfig();
+        if (tag != null) {
+            config.readFromTag(tag);
+        }
+        return config;
+    }
+}
diff --git a/src/main/java/net/minecraft/core/world/generate/feature/tree/WorldFeatureTreeEucalyptus.java b/src/main/java/net/minecraft/core/world/generate/feature/tree/WorldFeatureTreeEucalyptus.java
index cb42e364f..2a3ed91ff 100644
--- a/src/main/java/net/minecraft/core/world/generate/feature/tree/WorldFeatureTreeEucalyptus.java
+++ b/src/main/java/net/minecraft/core/world/generate/feature/tree/WorldFeatureTreeEucalyptus.java
@@ -125,13 +125,13 @@ public class WorldFeatureTreeEucalyptus extends WorldFeature
         System.arraycopy(ai, 0, foliageCoords, 0, k);
     }
 
-    void crossSection(int i, int j, int k, float f, byte byte0, int l)
+    void crossSection(int x, int y, int z, float f, byte byte0, int l)
     {
         int i1 = (int)((double)f + 0.61799999999999999D);
         byte byte1 = axisConversionArray[byte0];
         byte byte2 = axisConversionArray[byte0 + 3];
         int[] ai = {
-                i, j, k
+                x, y, z
         };
         int ai1[] = {
                 0, 0, 0
diff --git a/src/main/java/net/minecraft/core/world/generate/feature/tree/WorldFeatureTreeFancyRainforest.java b/src/main/java/net/minecraft/core/world/generate/feature/tree/WorldFeatureTreeFancyRainforest.java
index e5c5d7cb6..0eb9c3b0f 100644
--- a/src/main/java/net/minecraft/core/world/generate/feature/tree/WorldFeatureTreeFancyRainforest.java
+++ b/src/main/java/net/minecraft/core/world/generate/feature/tree/WorldFeatureTreeFancyRainforest.java
@@ -14,6 +14,7 @@ import java.util.Random;
 
 public class WorldFeatureTreeFancyRainforest extends WorldFeature
 {
+    // TODO these fucking hellish copy pasted fancy tree code classes are the most miserable things to parse
 	protected int leavesID;
 	protected int logID;
     @MethodParametersAnnotation(names = {"leavesID", "logID"})
@@ -290,7 +291,7 @@ public class WorldFeatureTreeFancyRainforest extends WorldFeature
 
     boolean func_527_c(int i)
     {
-        return (double)i >= (double)field_878_e * 0.20000000000000001D;
+        return (double)i >= (double)field_878_e * 0.2D;
     }
 
     void func_529_c()
diff --git a/src/main/java/net/minecraft/core/world/pathfinder/Node.java b/src/main/java/net/minecraft/core/world/pathfinder/Node.java
index 31fc6d1e7..c6861796d 100644
--- a/src/main/java/net/minecraft/core/world/pathfinder/Node.java
+++ b/src/main/java/net/minecraft/core/world/pathfinder/Node.java
@@ -25,9 +25,9 @@ public class Node
         hash = createHash(x, y, z);
     }
 
-    public static int createHash(int i, int j, int k)
+    public static int createHash(int x, int y, int z)
     {
-        return j & 0xff | (i & 0x7fff) << 8 | (k & 0x7fff) << 24 | (i >= 0 ? 0 : 0x80000000) | (k >= 0 ? 0 : 0x8000);
+        return y & 0xff | (x & 0x7fff) << 8 | (z & 0x7fff) << 24 | (x >= 0 ? 0 : 0x80000000) | (z >= 0 ? 0 : 0x8000);
     }
 
     public float distanceTo(Node other)
diff --git a/src/main/java/net/minecraft/core/world/save/LevelData.java b/src/main/java/net/minecraft/core/world/save/LevelData.java
index 14e4a405f..9277ba43b 100644
--- a/src/main/java/net/minecraft/core/world/save/LevelData.java
+++ b/src/main/java/net/minecraft/core/world/save/LevelData.java
@@ -6,6 +6,7 @@ import net.minecraft.core.data.gamerule.GameRuleCollection;
 import net.minecraft.core.entity.player.Player;
 import com.mojang.nbt.CompoundTag;
 import com.mojang.nbt.NbtIo;
+import net.minecraft.core.world.config.spawning.SpawnerConfig;
 import org.jetbrains.annotations.NotNull;
 import org.slf4j.Logger;
 
@@ -33,6 +34,7 @@ public class LevelData
     private @NotNull Difficulty difficulty = Difficulty.NORMAL;
     private boolean difficultyLocked;
     private GameRuleCollection gameRules;
+    private SpawnerConfig spawnerConfig;
 
 
     public LevelData(CompoundTag tag)
@@ -41,17 +43,19 @@ public class LevelData
     }
 
     //do *not* add @NotNull to name here, breaks modding for some abstract reason
-    public LevelData(long seed, String name)
+    public LevelData(long seed, @NotNull String name)
     {
         randomSeed = seed;
         levelName = name;
+        spawnerConfig = new SpawnerConfig();
         gameRules = new GameRuleCollection();
     }
 
-    public LevelData(long seed, String name, GameRuleCollection gameRules)
+    public LevelData(long seed, @NotNull String name, GameRuleCollection gameRules)
     {
         randomSeed = seed;
         levelName = name;
+        spawnerConfig = new SpawnerConfig();
         this.gameRules = gameRules;
     }
 
@@ -70,7 +74,8 @@ public class LevelData
         saveVersion = levelData.saveVersion;
         cheatsEnabled = levelData.cheatsEnabled;
         gamemode = levelData.gamemode;
-        gameRules = levelData.gameRules.copy();
+        gameRules = levelData.gameRules;
+        spawnerConfig = levelData.getSpawnerConfig();
         difficulty = levelData.difficulty;
         difficultyLocked = levelData.difficultyLocked;
     }
@@ -113,6 +118,10 @@ public class LevelData
         {
             gameRules = new GameRuleCollection();
         }
+
+        if (spawnerConfig == null) {
+            spawnerConfig = new SpawnerConfig();
+        }
     }
 
     public CompoundTag getNBTTagCompound()
@@ -162,6 +171,12 @@ public class LevelData
         CompoundTag gameRulesTag = new CompoundTag();
         GameRuleCollection.writeToNBT(gameRulesTag, gameRules);
         levelTag.put("GameRules", gameRulesTag);
+
+        if (spawnerConfig != null) {
+            CompoundTag spawnerConfigTag = new CompoundTag();
+            spawnerConfig.writeToTag(spawnerConfigTag);
+            levelTag.put("SpawnConfig", spawnerConfigTag);
+        }
     }
 
     private void readFromCompoundTag(CompoundTag tag)
@@ -193,6 +208,13 @@ public class LevelData
         {
             gameRules = new GameRuleCollection();
         }
+
+        if (tag.containsKey("SpawnConfig")) {
+            CompoundTag spawnConfigTag = tag.getCompound("SpawnConfig");
+            spawnerConfig = SpawnerConfig.createFromTag(spawnConfigTag);
+        } else {
+            spawnerConfig = new SpawnerConfig();
+        }
     }
 
     public long getRandomSeed()
@@ -312,6 +334,10 @@ public class LevelData
         return gameRules;
     }
 
+    public SpawnerConfig getSpawnerConfig() {
+        return spawnerConfig;
+    }
+
     public boolean getCheatsEnabled()
     {
     	return cheatsEnabled;
diff --git a/src/main/java/net/minecraft/core/world/season/SeasonManagerCycle.java b/src/main/java/net/minecraft/core/world/season/SeasonManagerCycle.java
index a4380a8b1..c2d068a1d 100644
--- a/src/main/java/net/minecraft/core/world/season/SeasonManagerCycle.java
+++ b/src/main/java/net/minecraft/core/world/season/SeasonManagerCycle.java
@@ -137,4 +137,8 @@ public final class SeasonManagerCycle
         int seasonTime = (int)(getSeasonLengthTicks(season) * progress);
         return seasonTime / Global.DAY_LENGTH_TICKS;
     }
+
+    public int getYearLengthTicks() {
+        return yearLengthTicks;
+    }
 }
diff --git a/src/main/java/net/minecraft/core/world/weather/WeatherManager.java b/src/main/java/net/minecraft/core/world/weather/WeatherManager.java
index 417b846d5..819bf4333 100644
--- a/src/main/java/net/minecraft/core/world/weather/WeatherManager.java
+++ b/src/main/java/net/minecraft/core/world/weather/WeatherManager.java
@@ -1,6 +1,7 @@
 package net.minecraft.core.world.weather;
 
 import net.minecraft.core.Global;
+import net.minecraft.core.data.gamerule.GameRules;
 import net.minecraft.core.util.helper.MathHelper;
 import net.minecraft.core.world.World;
 import net.minecraft.core.world.season.Season;
@@ -124,7 +125,9 @@ public class WeatherManager {
             }
         }
 
-        weatherDuration--;
+        if (world.getGameRuleValue(GameRules.DO_WEATHER_CYCLE)) {
+            weatherDuration--;
+        }
         if (weatherDuration <= 0)
         {
             if (currentWeather != world.worldType.getDefaultWeather()) {
@@ -151,14 +154,8 @@ public class WeatherManager {
         }
 
         world.dimensionData.setCurrentWeather(currentWeather);
-        if (nextWeather != null)
-        {
-            world.dimensionData.setNextWeather(nextWeather);
-        }
-        else
-        {
-            world.dimensionData.setNextWeather(null);
-        }
+        world.dimensionData.setNextWeather(nextWeather);
+
         world.dimensionData.setWeatherDuration(weatherDuration);
         world.dimensionData.setWeatherIntensity(weatherIntensity);
         world.dimensionData.setWeatherPower(weatherPower);
diff --git a/src/main/java/net/minecraft/core/world/weather/WeatherSnow.java b/src/main/java/net/minecraft/core/world/weather/WeatherSnow.java
index 4a82a9c4b..274711ec0 100644
--- a/src/main/java/net/minecraft/core/world/weather/WeatherSnow.java
+++ b/src/main/java/net/minecraft/core/world/weather/WeatherSnow.java
@@ -58,12 +58,12 @@ zLoop:		for (int z = 0; z < 16; z++)
 				{
 					if (blockId == 0 && Blocks.LAYER_SNOW.canPlaceBlockAt(world, worldX, y, worldZ) && blockIdBelow != Blocks.ICE.id)
 					{
-						chunk.setBlockIDRaw(x, y, z, Blocks.LAYER_SNOW.id);
+						chunk.setBlockIDWithMetadataRaw(x, y, z, Blocks.LAYER_SNOW.id, chunk.getBlockMetadata(x, y, z));
 					}
 					else if (blockIdBelow == Blocks.FLUID_WATER_STILL.id && chunk.getBlockMetadata(x, y - 1, z) == 0) {
-						chunk.setBlockIDRaw(x, y - 1, z, Blocks.ICE.id);
+						chunk.setBlockIDWithMetadataRaw(x, y - 1, z, Blocks.ICE.id, chunk.getBlockMetadata(x, y - 1, z));
 						if (chunk.getBlockID(x, y - 2, z) == Blocks.FLUID_WATER_STILL.id){
-							chunk.setBlockIDRaw(x, y - 2, z, Blocks.FLUID_WATER_FLOWING.id);
+							chunk.setBlockIDWithMetadataRaw(x, y - 2, z, Blocks.FLUID_WATER_FLOWING.id, chunk.getBlockMetadata(x, y - 2, z));
 						}
 					}
 				}
diff --git a/src/main/java/net/minecraft/datagen/SmeltingGenerator.java b/src/main/java/net/minecraft/datagen/SmeltingGenerator.java
index e3c361dfd..963195b02 100644
--- a/src/main/java/net/minecraft/datagen/SmeltingGenerator.java
+++ b/src/main/java/net/minecraft/datagen/SmeltingGenerator.java
@@ -45,6 +45,7 @@ public class SmeltingGenerator {
         blastRecipe("cobble_permafrost_to_permafrost", Blocks.COBBLE_PERMAFROST.getDefaultStack(), Blocks.PERMAFROST.getDefaultStack());
         blastRecipe("cobble_stone_to_slate", Blocks.COBBLE_STONE.getDefaultStack(), Blocks.SLATE.getDefaultStack());
         blastRecipe("iron_ingot_to_crude_steel", Items.INGOT_IRON.getDefaultStack(), Items.INGOT_STEEL_CRUDE.getDefaultStack());
+        blastRecipe("cobble_netherrack_to_igneous_netherrack", Blocks.COBBLE_NETHERRACK.getDefaultStack(), Blocks.COBBLE_NETHERRACK_IGNEOUS.getDefaultStack());
     }
 
     private static void furnaceRecipe(String id, ItemStack input, ItemStack output) {
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 7ad832bdf..e21991249 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -28,7 +28,6 @@ import net.minecraft.core.util.helper.RestHandler;
 import net.minecraft.core.util.phys.AABB;
 import net.minecraft.core.util.phys.Vec3;
 import net.minecraft.core.world.Dimension;
-import net.minecraft.core.world.SpawnerMobs;
 import net.minecraft.core.world.World;
 import net.minecraft.core.world.biome.provider.BiomeProviderOverworld;
 import net.minecraft.core.world.chunk.ChunkCoordinates;
@@ -112,7 +111,9 @@ public class MinecraftServer
     public int autoSaveInterval = 5;
     public int chunksSavedPerAutosave = 24;
     public boolean forceSaveAllChunksOnAutosave = false;
-    public SpawnerMobs.SpawnerConfig spawnerConfig = new SpawnerMobs.SpawnerConfig();
+
+    private boolean spawnAnimals;
+    private boolean spawnHostiles;
 
     public MinecraftServer()
     {
@@ -174,8 +175,8 @@ public class MinecraftServer
         propertyManager = new PropertyManager(new File("server.properties"));
         String s = propertyManager.getStringProperty("server-ip", "");
         onlineMode = propertyManager.getBooleanProperty("online-mode", true);
-        spawnerConfig.setPassiveSpawning(propertyManager.getBooleanProperty("spawn-animals", true));
-        spawnerConfig.setHostileSpawning(propertyManager.getBooleanProperty("spawn-monsters", true));
+        spawnAnimals = propertyManager.getBooleanProperty("spawn-animals", true);
+        spawnHostiles = propertyManager.getBooleanProperty("spawn-monsters", true);
         pvpOn = propertyManager.getBooleanProperty("pvp", true);
         allowFlight = propertyManager.getBooleanProperty("allow-flight", false);
         statsToken = propertyManager.getStringProperty("stats-token", "only-enter-a-value-if-you-are-a-registered-server");
@@ -409,16 +410,18 @@ public class MinecraftServer
             WorldServer worldServer;
             if (dimId == 0)
             {
-                worldServer = new WorldServer(this, saveHandler, worldDirName, dimId, defaultWorldType, l, spawnerConfig);
+                worldServer = new WorldServer(this, saveHandler, worldDirName, dimId, defaultWorldType, l);
             }
             else
             {
-                worldServer = new WorldServerMulti(this, saveHandler, worldDirName, dimId, dimension.defaultWorldType, l, dimensionWorlds.get(0), spawnerConfig);
+                worldServer = new WorldServerMulti(this, saveHandler, worldDirName, dimId, dimension.defaultWorldType, l, dimensionWorlds.get(0));
             }
             dimensionWorlds.put(dimId, worldServer);
             worldServer.addListener(new WorldManager(this, dimensionWorlds.get(dimId)));
             worldServer.setDifficulty(difficulty, true);
             worldServer.sleepPercent = sleepPercentage;
+            worldServer.getSpawnerConfig().setHostileSpawning(spawnHostiles);
+            worldServer.getSpawnerConfig().setPassiveSpawning(spawnAnimals);
             playerList.setPlayerManager(dimensionWorlds);
         }
 
@@ -697,9 +700,9 @@ public class MinecraftServer
 
     }
 
-    public void func_6022_a(IUpdatePlayerListBox iupdateplayerlistbox)
+    public void addPlayerListBox(IUpdatePlayerListBox listBox)
     {
-        playerListBoxes.add(iupdateplayerlistbox);
+        playerListBoxes.add(listBox);
     }
 
     public static void main(String[] args)
diff --git a/src/main/java/net/minecraft/server/entity/player/ServerPlayer.java b/src/main/java/net/minecraft/server/entity/player/ServerPlayer.java
index 4e6f1520d..a554a441b 100644
--- a/src/main/java/net/minecraft/server/entity/player/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/entity/player/ServerPlayer.java
@@ -165,7 +165,7 @@ public class ServerPlayer extends Player implements ContainerListener {
     {
     }
 
-    public void func_20057_k()
+    public void setupCraftingInventoryListener()
     {
         craftingInventory.addSlotListener(this);
     }
@@ -441,18 +441,18 @@ public class ServerPlayer extends Player implements ContainerListener {
     }
 
     @Override
-	public EnumSleepStatus sleepInBedAt(int i, int j, int k)
+	public EnumSleepStatus sleepInBedAt(int x, int y, int z)
     {
-        EnumSleepStatus enumstatus = super.sleepInBedAt(i, j, k);
-        if (enumstatus == EnumSleepStatus.OK)
+        EnumSleepStatus status = super.sleepInBedAt(x, y, z);
+        if (status == EnumSleepStatus.OK)
         {
             EntityTracker entitytracker = mcServer.getEntityTracker(dimension);
-            SleepPacket sleepPacket = new SleepPacket(this, 0, i, j, k);
+            SleepPacket sleepPacket = new SleepPacket(this, 0, x, y, z);
             entitytracker.sendPacketToTrackedPlayers(this, sleepPacket);
-            playerNetServerHandler.teleportAndRotate(x, y, z, yRot, xRot);
+            playerNetServerHandler.teleportAndRotate(this.x, this.y, this.z, yRot, xRot);
             playerNetServerHandler.sendPacket(sleepPacket);
         }
-        return enumstatus;
+        return status;
     }
 
     @Override
@@ -620,9 +620,9 @@ public class ServerPlayer extends Player implements ContainerListener {
         }
     }
 
-    public void func_28017_a(AbstractContainerMenu container)
+    public void initializeCraftingInventory(AbstractContainerMenu container)
     {
-        updateCraftingInventory(container, container.func_28127_b());
+        updateCraftingInventory(container, container.getSlotStackList());
     }
 
     @Override
@@ -717,7 +717,7 @@ public class ServerPlayer extends Player implements ContainerListener {
         }
     }
 
-    public void func_30001_B()
+    public void initializeLastFieldValues()
     {
         lastHealth = Integer.MIN_VALUE;
         lastScore = Integer.MIN_VALUE;
@@ -759,15 +759,18 @@ public class ServerPlayer extends Player implements ContainerListener {
     public ServerPacketHandler playerNetServerHandler;
     public MinecraftServer mcServer;
     public ServerPlayerController playerController;
-    public double field_9155_d;
-    public double field_9154_e;
-    public List loadedChunks;
-    public Set field_420_ah;
+
+    // Center of the player's view radius in MP
+    public double viewingX;
+    public double viewingZ;
+
+    public List<ChunkCoordinate> loadedChunks;
+    public Set<ChunkCoordinate> field_420_ah;
 
     private int lastHealth;
     private int lastScore;
     private int ticksOfInvuln;
-    private ItemStack playerInventory[] = {
+    private ItemStack[] playerInventory = {
             null, null, null, null, null
     };
     private int currentWindowId;
diff --git a/src/main/java/net/minecraft/server/net/PlayerList.java b/src/main/java/net/minecraft/server/net/PlayerList.java
index 3defc4b7c..b6211d6ea 100644
--- a/src/main/java/net/minecraft/server/net/PlayerList.java
+++ b/src/main/java/net/minecraft/server/net/PlayerList.java
@@ -151,9 +151,9 @@ public class PlayerList
         getPlayerManager(player.dimension).addPlayer(player);
     }
 
-    public void func_613_b(ServerPlayer entityplayermp)
+    public void onPlayerMoved(ServerPlayer player)
     {
-        getPlayerManager(entityplayermp.dimension).func_543_c(entityplayermp);
+        getPlayerManager(player.dimension).onPlayerMoved(player);
     }
 
     public void playerLoggedOut(ServerPlayer entityplayermp)
@@ -237,11 +237,11 @@ public class PlayerList
         newPlayer.playerNetServerHandler.sendPacket(new RespawnPacket((byte) newPlayer.dimension, (byte) Registries.WORLD_TYPES.getNumericIdOfItem(worldserver.worldType)));
         server.playerList.sendPacketToAllPlayers(new PlayerGamemodePacket(newPlayer.id, newPlayer.gamemode.getId()));
         newPlayer.playerNetServerHandler.teleportAndRotate(newPlayer.x, newPlayer.y, newPlayer.z, newPlayer.yRot, newPlayer.xRot);
-        func_28170_a(newPlayer, worldserver);
+        setTime(newPlayer, worldserver);
         getPlayerManager(newPlayer.dimension).addPlayer(newPlayer);
         worldserver.entityJoinedWorld(newPlayer);
         playerEntities.add(newPlayer);
-        newPlayer.func_20057_k();
+        newPlayer.setupCraftingInventoryListener();
         newPlayer.func_22068_s();
         newPlayer.playerNetServerHandler.sendPacket(new GameRulePacket(server.getDimensionWorld(0).getLevelData().getGameRules()));
         return newPlayer;
@@ -296,8 +296,8 @@ public class PlayerList
         serverPlayer.playerNetServerHandler.teleportAndRotate(serverPlayer.x, serverPlayer.y, serverPlayer.z, serverPlayer.yRot, serverPlayer.xRot);
         server.playerList.sendPacketToAllPlayers(new PlayerGamemodePacket(serverPlayer.id, serverPlayer.gamemode.getId()));
         serverPlayer.setWorld(worldserver1);
-        func_28170_a(serverPlayer, worldserver1);
-        func_30008_g(serverPlayer);
+        setTime(serverPlayer, worldserver1);
+        initializePlayerObject(serverPlayer);
         serverPlayer.playerNetServerHandler.sendPacket(new GameRulePacket(server.getDimensionWorld(0).getLevelData().getGameRules()));
     }
 
@@ -308,9 +308,9 @@ public class PlayerList
         }
     }
 
-    public void markBlockNeedsUpdate(int i, int j, int k, int l)
+    public void markBlockNeedsUpdate(int x, int y, int z, int dimension)
     {
-        getPlayerManager(l).markBlockNeedsUpdate(i, j, k);
+        getPlayerManager(dimension).markBlockNeedsUpdate(x, y, z);
     }
 
     public void sendPacketToAllPlayers(Packet packet)
@@ -650,7 +650,7 @@ public class PlayerList
 
     }
 
-    public void sendTileEntityToPlayer(int i, int j, int k, BlockEntity tileentity)
+    public void sendBlockEntityToPlayer(int x, int y, int z, BlockEntity blockEntity)
     {
     }
 
@@ -676,19 +676,19 @@ public class PlayerList
         loadWhiteList();
     }
 
-    public void func_28170_a(ServerPlayer entityplayermp, WorldServer worldserver)
+    public void setTime(ServerPlayer player, WorldServer worldserver)
     {
-        entityplayermp.playerNetServerHandler.sendPacket(new SetTimePacket(worldserver.getWorldTime()));
+        player.playerNetServerHandler.sendPacket(new SetTimePacket(worldserver.getWorldTime()));
 //        if(worldserver.func_27068_v())
 //        {
-//            entityplayermp.playerNetServerHandler.sendPacket(new BedMessagePacket(1));
+//            player.playerNetServerHandler.sendPacket(new BedMessagePacket(1));
 //        }
     }
 
-    public void func_30008_g(ServerPlayer entityplayermp)
+    public void initializePlayerObject(ServerPlayer player)
     {
-        entityplayermp.func_28017_a(entityplayermp.inventorySlots);
-        entityplayermp.func_30001_B();
+        player.initializeCraftingInventory(player.inventorySlots);
+        player.initializeLastFieldValues();
     }
 
 }
diff --git a/src/main/java/net/minecraft/server/net/handler/LoginPacketHandler.java b/src/main/java/net/minecraft/server/net/handler/LoginPacketHandler.java
index 192eed88d..9ebdd6156 100644
--- a/src/main/java/net/minecraft/server/net/handler/LoginPacketHandler.java
+++ b/src/main/java/net/minecraft/server/net/handler/LoginPacketHandler.java
@@ -191,7 +191,7 @@ public class LoginPacketHandler extends PacketHandler
             }
 
             packetHandler.sendPacket(new SetSpawnPositionPacket(chunkcoordinates.x, chunkcoordinates.y, chunkcoordinates.z));
-            mcServer.playerList.func_28170_a(player, worldserver);
+            mcServer.playerList.setTime(player, worldserver);
             mcServer.playerList.sendPacketToAllPlayers(new ChatPacket(TextFormatting.YELLOW + player.getDisplayName() + TextFormatting.YELLOW + " joined the game."));
             mcServer.playerList.sendPacketToAllPlayers(new UpdatePlayerProfilePacket(player.username, player.nickname, player.uuid, player.score, player.chatColor, true, player.isOperator()));
 
@@ -205,7 +205,7 @@ public class LoginPacketHandler extends PacketHandler
             mcServer.networkServer.addPlayer(packetHandler);
             mcServer.playerList.sendPacketToAllPlayers(new PlayerGamemodePacket(player.id, player.gamemode.getId()));
             packetHandler.sendPacket(new SetTimePacket(worldserver.getWorldTime()));
-            player.func_20057_k();
+            player.setupCraftingInventoryListener();
             if (MinecraftServer.statsStatus)
             {
                 RestHandler.post("https://api.betterthanadventure.net/stats?serverToken=" + MinecraftServer.statsToken + "&count=" + mcServer.playerList.playerEntities.size());
@@ -234,9 +234,9 @@ public class LoginPacketHandler extends PacketHandler
     }
 
     @Override
-    public void handlePingHandshake(PingHandshakePacket packet) {
+    public void handlePingHandshake(PingHandshakePacket pingHandshakePacket) {
         String msg = "";
-        if (packet.pingHostString.equals("MC|PingHost")) {
+        if (pingHandshakePacket.pingHostString.equals("MC|PingHost")) {
             msg =
                 "§1" +
                 '\0' +
@@ -249,7 +249,7 @@ public class LoginPacketHandler extends PacketHandler
                 0 +
                 '\0' +
                 0;
-        } else if (packet.pingHostString.equals("BTAPingHost")) {
+        } else if (pingHandshakePacket.pingHostString.equals("BTAPingHost")) {
             msg =
                 "§1" +
                 '\0' +
diff --git a/src/main/java/net/minecraft/server/net/handler/ServerPacketHandler.java b/src/main/java/net/minecraft/server/net/handler/ServerPacketHandler.java
index 458320918..5f9b17c1e 100644
--- a/src/main/java/net/minecraft/server/net/handler/ServerPacketHandler.java
+++ b/src/main/java/net/minecraft/server/net/handler/ServerPacketHandler.java
@@ -17,6 +17,7 @@ import net.minecraft.core.net.ChatEmotes;
 import net.minecraft.core.net.ICommandListener;
 import net.minecraft.core.net.NetworkManager;
 import net.minecraft.core.net.command.TextFormatting;
+import net.minecraft.core.world.World;
 import net.minecraft.server.net.command.ServerCommandSource;
 import net.minecraft.core.net.handler.PacketHandler;
 import net.minecraft.core.net.packet.*;
@@ -63,7 +64,6 @@ public class ServerPacketHandler extends PacketHandler
 
     public void handlePackets()
     {
-        field_22003_h = false;
         netManager.processReadPackets();
         if (field_15_f - field_22004_g > 20)
         {
@@ -71,6 +71,10 @@ public class ServerPacketHandler extends PacketHandler
         }
     }
 
+    public boolean canInteract() {
+        return playerEntity.getGamemode().canInteract() && playerEntity.isAlive();
+    }
+
     public void kickPlayer(String s)
     {
         playerEntity.func_30002_A();
@@ -110,174 +114,172 @@ public class ServerPacketHandler extends PacketHandler
         if (!playerEntity.isAlive()) return;
         WorldServer worldserver = mcServer.getDimensionWorld(playerEntity.dimension);
 
-        field_22003_h = true;
         if (!hasMoved)
         {
             double d = packet.y - lastPosY;
-            if (packet.x == lastPosX && d * d < 0.01D && packet.z == lastPosZ)
+            double dx = packet.x - lastPosX;
+            double dy = packet.y - lastPosY;
+            double dz = packet.z - lastPosZ;
+            dx *= dx;
+            dy *= dy;
+            dz *= dz;
+            if (dx * dx < 0.01D && dy * dy < 0.01D && dz * dz < 0.01D)
             {
                 hasMoved = true;
             }
         }
-        if (hasMoved)
+        if (!hasMoved) return;
+        // Set rotation
+        float yRot = playerEntity.yRot;
+        float xRot = playerEntity.xRot;
+        if (packet.hasRotation)
+        {
+            yRot = MathHelper.normalizeRotation(packet.yaw);
+            xRot = MathHelper.normalizeRotation(packet.pitch);
+        }
+
+        // No moving when sleeping or sitting in a static vehicle
+        boolean sleeping = playerEntity.isPlayerSleeping();
+        boolean sitting = playerEntity.vehicle != null && !(playerEntity.vehicle instanceof Entity);
+        if (sleeping || sitting)
+        {
+            if (sitting) playerEntity.vehicle.positionRider();
+            playerEntity.onUpdateEntity();
+            // onUpdateEntity updates the lastPos*
+            playerEntity.absMoveTo(lastPosX, lastPosY, lastPosZ, playerEntity.yRot, playerEntity.xRot);
+            worldserver.updateEntity(playerEntity);
+            return;
+        }
+
+        // In a entity vehicle
+        if (playerEntity.vehicle instanceof Entity)
         {
-            if (playerEntity.vehicle != null)
+            playerEntity.vehicle.positionRider();
+            double xd = 0.0D;
+            double zd = 0.0D;
+            if (packet.hasPosition && packet.y == -999D)
             {
-                float f = playerEntity.yRot;
-                float f1 = playerEntity.xRot;
-                playerEntity.vehicle.positionRider();
-                double d2 = playerEntity.x;
-                double d4 = playerEntity.y;
-                double d6 = playerEntity.z;
-                double d8 = 0.0D;
-                double d9 = 0.0D;
-                if (packet.hasRotation)
-                {
-                    f = packet.yaw;
-                    f1 = packet.pitch;
-                }
-                if (packet.hasPosition && packet.y == -999D && packet.yView == -999D)
-                {
-                    d8 = packet.x;
-                    d9 = packet.z;
-                }
-                playerEntity.onGround = packet.onGround;
-                playerEntity.onUpdateEntity();
-                playerEntity.move(d8, 0.0D, d9);
-                playerEntity.absMoveTo(d2, d4, d6, f, f1);
-                playerEntity.xd = d8;
-                playerEntity.zd = d9;
-                if (playerEntity.vehicle != null && playerEntity.vehicle instanceof Entity)
-                {
-                    worldserver.func_12017_b((Entity) playerEntity.vehicle, true);
-                }
-                if (playerEntity.vehicle != null)
-                {
-                    playerEntity.vehicle.positionRider();
-                }
-                mcServer.playerList.func_613_b(playerEntity);
-                lastPosX = playerEntity.x;
-                lastPosY = playerEntity.y;
-                lastPosZ = playerEntity.z;
-                worldserver.updateEntity(playerEntity);
-                return;
+                xd = packet.x;
+                zd = packet.z;
             }
-            if (playerEntity.isPlayerSleeping())
+            playerEntity.onGround = packet.onGround;
+            playerEntity.onUpdateEntity();
+            playerEntity.move(xd, 0.0D, zd);
+            playerEntity.absMoveTo(playerEntity.x, playerEntity.y, playerEntity.z, yRot, xRot);
+            playerEntity.xd = xd;
+            playerEntity.zd = zd;
+            // TODO: Is this needing? It does allow for fast-tick exploits.
+            //worldserver.func_12017_b((Entity) playerEntity.vehicle, true);
+            playerEntity.vehicle.positionRider();
+            return;
+        }
+
+        // Not sitting, sleeping, or riding. Move them normally
+        lastPosX = playerEntity.x;
+        lastPosY = playerEntity.y;
+        lastPosZ = playerEntity.z;
+        double newPosX = playerEntity.x;
+        double newPosY = playerEntity.y;
+        double oldPosY = playerEntity.y;
+        double newPosZ = playerEntity.z;
+        if (packet.hasPosition && packet.y == -999D)
+        {
+            packet.hasPosition = false;
+        }
+        if (packet.hasPosition)
+        {
+            newPosX = packet.x;
+            newPosY = packet.y;
+            newPosZ = packet.z;
+            // Lag back the player if they attempt to move to an illegal position
+            if (Math.abs(packet.x) > World.MAX_BLOCK_X || Math.abs(packet.z) > World.MAX_BLOCK_Z || Double.isNaN(packet.x) || Double.isNaN(packet.y) || Double.isNaN(packet.z))
             {
-                playerEntity.onUpdateEntity();
-                playerEntity.absMoveTo(lastPosX, lastPosY, lastPosZ, playerEntity.yRot, playerEntity.xRot);
-                worldserver.updateEntity(playerEntity);
+                //kickPlayer("Illegal position");
+                LOGGER.warn("{} tried to move to an illegal position", playerEntity.username);
+                teleportAndRotate(lastPosX, lastPosY, lastPosZ, yRot, xRot);
                 return;
             }
-            double oldY = playerEntity.y;
-            lastPosX = playerEntity.x;
-            lastPosY = playerEntity.y;
-            lastPosZ = playerEntity.z;
-            double newPosX = playerEntity.x;
-            double newPosY = playerEntity.y;
-            double newPosZ = playerEntity.z;
-            float f2 = playerEntity.yRot;
-            float f3 = playerEntity.xRot;
-            if (packet.hasPosition && packet.y == -999D && packet.yView == -999D)
-            {
-                packet.hasPosition = false;
-            }
-            if (packet.hasPosition)
+        }
+        // TODO: THIS IS VERY BAD! Fix ASAP!
+        playerEntity.onUpdateEntity();
+        playerEntity.ySlideOffset = 0.0F;
+        playerEntity.absMoveTo(lastPosX, lastPosY, lastPosZ, yRot, xRot);
+        if (!hasMoved)
+        {
+            return;
+        }
+        double dx = newPosX - playerEntity.x;
+        double dy = newPosY - playerEntity.y;
+        double dz = newPosZ - playerEntity.z;
+        double velSquared = dx * dx + dy * dy + dz * dz;
+        // Lag back the player if they move too quickly
+        if (velSquared > 100D)
+        {
+            // This doesn't mean they are necessarily hacking, it's easy to do by hitting the vanilla speed limit
+            LOGGER.warn("{} moved too quickly!", playerEntity.username);
+            teleportAndRotate(lastPosX, lastPosY, lastPosZ, yRot, xRot);
+            //kickPlayer("You moved too quickly :( (Hacking?)");
+            return;
+        }
+        // Time to trying and move like they did
+        float bb_expand = 0.0625F;
+        boolean insideBlockOld = worldserver.getCubes(playerEntity, playerEntity.bb.copy().getInsetBoundingBox(bb_expand, bb_expand, bb_expand)).isEmpty();
+        playerEntity.move(dx, dy, dz);
+        // Get the difference in intended move and actual move
+        dx = newPosX - playerEntity.x;
+        double ndy = newPosY - playerEntity.y;
+        dz = newPosZ - playerEntity.z;
+        velSquared = dx * dx + ndy * ndy + dz * dz;
+        boolean movedWrong = false;
+        // TODO: Check if the player is flying instead of if they can fly, this information should be synced as in BTA flying is more than just no gravity
+        if (!playerEntity.getGamemode().canPlayerFly() && velSquared > 0.0625D && !playerEntity.isPlayerSleeping())
+        {
+            movedWrong = true;
+            LOGGER.warn("{} moved wrongly!", playerEntity.username);
+            LOGGER.warn("Got position {}, {}, {}", newPosX, newPosY, newPosZ);
+            LOGGER.warn("Expected {}, {}, {}", playerEntity.x, playerEntity.y, playerEntity.z);
+        }
+        playerEntity.absMoveTo(newPosX, newPosY, newPosZ, yRot, xRot);
+        boolean insideBlockNew = worldserver.getCubes(playerEntity, playerEntity.bb.copy().getInsetBoundingBox(bb_expand, bb_expand, bb_expand)).isEmpty();
+        if (!playerEntity.getGamemode().canPlayerFly() && insideBlockOld && (movedWrong || !insideBlockNew) && !playerEntity.isPlayerSleeping())
+        {
+            // If the player:
+            // - Is inside a block and wasn't on the last tick
+            // - Moved wrongly
+            // - And is not sleeping or flying
+            // Bounce them back
+            teleportAndRotate(lastPosX, lastPosY, lastPosZ, yRot, xRot);
+            return;
+        }
+
+        // Falling and ground collision
+        AABB aabb = playerEntity.bb.copy().grow(bb_expand, bb_expand, bb_expand).expand(0.0D, -0.55D, 0.0D);
+        if (!playerEntity.getGamemode().canPlayerFly() && !mcServer.allowFlight && !worldserver.getIsAnySolidGround(aabb))
+        {
+            // Don't tick fly counter if they are falling
+            if (dy > -0.03125D)
             {
-                newPosX = packet.x;
-                newPosY = packet.y;
-                newPosZ = packet.z;
-                // I don't see why the server really needs to care about stance
-//                double d10 = packet.stance - packet.yPosition;
-//                if (!playerEntity.isPlayerSleeping() && (d10 > 1.65D || d10 < 0.1D))
-//                {
-//                    kickPlayer("Illegal stance");
-//                    return;
-//                }
-                // Lag back the player if they attempt to move to an illegal position
-                if (java.lang.Math.abs(packet.x) > 32000000D || java.lang.Math.abs(packet.z) > 32000000D)
-                {
-//                    kickPlayer("Illegal position");
-                    LOGGER.warn("{} tried to move to an illegal position", playerEntity.username);
-                    teleportAndRotate(lastPosX, lastPosY, lastPosZ, f2, f3);
+                playerInAirTime++;
+                if (playerInAirTime > 100) {
+                    LOGGER.warn(playerEntity.username + " was kicked for floating too long!");
+                    kickPlayer("Flying is not enabled on this server");
                     return;
                 }
-            }
-            if (packet.hasRotation)
-            {
-                f2 = packet.yaw;
-                f3 = packet.pitch;
-            }
-            playerEntity.onUpdateEntity();
-            playerEntity.ySlideOffset = 0.0F;
-            playerEntity.absMoveTo(lastPosX, lastPosY, lastPosZ, f2, f3);
-            if (!hasMoved)
-            {
-                return;
-            }
-            double dx = newPosX - playerEntity.x;
-            double dy = newPosY - playerEntity.y;
-            double dz = newPosZ - playerEntity.z;
-            double velSquared = dx * dx + dy * dy + dz * dz;
-            // Lag back the player if they move too quickly
-            if (velSquared > 100D)
-            {
-                LOGGER.warn("{} moved too quickly!", playerEntity.username);
-                teleportAndRotate(lastPosX, lastPosY, lastPosZ, f2, f3);
-//                kickPlayer("You moved too quickly :( (Hacking?)");
-                return;
-            }
-            float f4 = 0.0625F;
-            boolean flag = worldserver.getCubes(playerEntity, playerEntity.bb.copy().getInsetBoundingBox(f4, f4, f4)).size() == 0;
-            playerEntity.move(dx, dy, dz);
-            dx = newPosX - playerEntity.x;
-            dy = newPosY - playerEntity.y;
-            if (dy > -0.5D || dy < 0.5D)
-            {
-                dy = 0.0D;
-            }
-            dz = newPosZ - playerEntity.z;
-            velSquared = dx * dx + dy * dy + dz * dz;
-            boolean flag1 = false;
-            if (!playerEntity.getGamemode().canPlayerFly() && velSquared > 0.0625D && !playerEntity.isPlayerSleeping() && playerEntity.pushTime < 0.05)
-            {
-                flag1 = true;
-                LOGGER.warn("{} moved wrongly!", playerEntity.username);
-                LOGGER.warn("Got position {}, {}, {}", newPosX, newPosY, newPosZ);
-                LOGGER.warn("Expected {}, {}, {}", playerEntity.x, playerEntity.y, playerEntity.z);
-            }
-            playerEntity.absMoveTo(newPosX, newPosY, newPosZ, f2, f3);
-            boolean flag2 = worldserver.getCubes(playerEntity, playerEntity.bb.copy().getInsetBoundingBox(f4, f4, f4)).isEmpty();
-            if (!playerEntity.getGamemode().canPlayerFly() && flag && (flag1 || !flag2) && !playerEntity.isPlayerSleeping() && playerEntity.pushTime < 0.05)
-            {
-                teleportAndRotate(lastPosX, lastPosY, lastPosZ, f2, f3);
-                return;
-            }
-            AABB aabb = playerEntity.bb.copy().grow(f4, f4, f4).expand(0.0D, -0.55D, 0.0D);
-            if (!playerEntity.getGamemode().canPlayerFly() && !mcServer.allowFlight && !worldserver.getIsAnySolidGround(aabb) && playerEntity.pushTime < 0.05)
-            {
-                if (dy > -0.03125D)
+                // I'm not sure what this is, but it seems like it wouldn't work.
+                /*} else if (playerInAirTime > 80)
                 {
-                    playerInAirTime++;
-                    if (playerInAirTime > 100) {
-                        LOGGER.warn(playerEntity.username + " was kicked for floating too long!");
-                        kickPlayer("Flying is not enabled on this server");
-                        return;
-                    } else if (playerInAirTime > 80)
-                    {
-                        teleportAndRotate(lastPosX, lastPosY, lastPosZ, f2, f3);
-                    }
-                }
-            }
-            else
-            {
-                playerInAirTime = 0;
+                    teleportAndRotate(lastPosX, lastPosY, lastPosZ, yRot, xRot);
+                }*/
             }
-            playerEntity.onGround = packet.onGround;
-            mcServer.playerList.func_613_b(playerEntity);
-            playerEntity.handleFalling(playerEntity.y - oldY, packet.onGround);
-
         }
+        else
+        {
+            playerInAirTime = 0;
+        }
+        // TODO: Should we really trust the client to tell the server if they are on the ground?
+        playerEntity.onGround = packet.onGround;
+        mcServer.playerList.onPlayerMoved(playerEntity);
+        playerEntity.handleFalling(playerEntity.y - oldPosY, packet.onGround);
     }
 
 	public void teleport(double x, double y, double z) {
@@ -286,7 +288,7 @@ public class ServerPacketHandler extends PacketHandler
 		lastPosY = y;
 		lastPosZ = z;
 		playerEntity.absMoveTo(x, y, z, playerEntity.yRot, playerEntity.xRot);
-		playerEntity.playerNetServerHandler.sendPacket(new MovePlayerPacket.Pos(x, y + 1.625, y, z, false));
+		playerEntity.playerNetServerHandler.sendPacket(new MovePlayerPacket.Pos(x, y + 1.625, z, false));
 	}
 
 	public void teleportAndRotate(double x, double y, double z, float yaw, float pitch) {
@@ -295,26 +297,26 @@ public class ServerPacketHandler extends PacketHandler
 		lastPosY = y;
 		lastPosZ = z;
 		playerEntity.absMoveTo(x, y, z, yaw, pitch);
-		playerEntity.playerNetServerHandler.sendPacket(new MovePlayerPacket.PosRot(x, y + 1.625, y, z, yaw, pitch, false));
+		playerEntity.playerNetServerHandler.sendPacket(new MovePlayerPacket.PosRot(x, y + 1.625, z, yaw, pitch, false));
 	}
 
     @Override
-    public void handleBlockDig(PlayerActionPacket packet) {
-        final int x = packet.xPosition;
-        final int y = packet.yPosition;
-        final int z = packet.zPosition;
+    public void handleBlockDig(PlayerActionPacket playerActionPacket) {
+        final int x = playerActionPacket.xPosition;
+        final int y = playerActionPacket.yPosition;
+        final int z = playerActionPacket.zPosition;
 
-        if (!playerEntity.getGamemode().canInteract() || !playerEntity.isAlive() || playerEntity.getHeldObject() != null /*Forbid digging while holding object*/) return;
+        if (!canInteract() || playerEntity.getHeldObject() != null /*Forbid digging while holding object*/) return;
         WorldServer world = mcServer.getDimensionWorld(playerEntity.dimension);
-        if(packet.status == 4) {
+        if(playerActionPacket.action == PlayerActionPacket.ACTION_DROP_ITEM_SINGLE) {
             // Drop single item
             playerEntity.dropCurrentItem(false);
             return;
-        }else if(packet.status == 5) {
+        }else if(playerActionPacket.action == PlayerActionPacket.ACTION_DROP_ITEM_STACK) {
             // Drop full stack
             playerEntity.dropCurrentItem(true);
             return;
-        }else if(packet.status == 6) {
+        }else if(playerActionPacket.action == PlayerActionPacket.ACTION_PICK_BLOCK) {
             // Pick Block
             playerEntity.pickBlock(x, y, z);
             return;
@@ -341,15 +343,15 @@ public class ServerPacketHandler extends PacketHandler
         }
 
         // handles spawn protection
-        if(packet.status == 0) {
+        if(playerActionPacket.action == PlayerActionPacket.ACTION_DIG_START) {
             // Start Mining
-            playerEntity.playerController.startMining(x, y, z, packet.side);
-        } else if(packet.status == 1) {
+            playerEntity.playerController.startMining(x, y, z, playerActionPacket.side);
+        } else if(playerActionPacket.action == PlayerActionPacket.ACTION_DIG_CONTINUED) {
             // Hit Block
-            playerEntity.playerController.hitBlock(x, y, z, packet.side, packet.xHit, packet.yHit);
-        } else if(packet.status == 2) {
+            playerEntity.playerController.hitBlock(x, y, z, playerActionPacket.side, playerActionPacket.xHit, playerActionPacket.yHit);
+        } else if(playerActionPacket.action == PlayerActionPacket.ACTION_DIG_COMPLETE) {
             // Block Destroy
-            if(!playerEntity.playerController.destroyBlock(x, y, z, packet.side)) {
+            if(!playerEntity.playerController.destroyBlock(x, y, z, playerActionPacket.side)) {
                 playerEntity.playerNetServerHandler.sendPacket(new BlockUpdatePacket(x, y, z, world));
             }
         }
@@ -366,7 +368,7 @@ public class ServerPacketHandler extends PacketHandler
     @Override
     public void handlePlace(UseItemPacket packet)
     {
-        if (!playerEntity.getGamemode().canInteract() || !playerEntity.isAlive()) return;
+        if (!canInteract()) return;
         WorldServer worldserver = mcServer.getDimensionWorld(playerEntity.dimension);
         ItemStack itemstack = playerEntity.inventory.getCurrentItem();
         boolean ignoreSpawnProtection = mcServer.spawnProtectionRange <= 0 || worldserver.dimension.id != 0 || mcServer.playerList.isOp(playerEntity.uuid);
@@ -424,9 +426,9 @@ public class ServerPacketHandler extends PacketHandler
     }
 
     @Override
-    public void handleErrorMessage(String s, Object[] aobj)
+    public void handleErrorMessage(String message, Object[] objects)
     {
-        LOGGER.info(playerEntity.username + " lost connection: " + s);
+        LOGGER.info(playerEntity.username + " lost connection: " + message);
         mcServer.playerList.sendPacketToAllPlayers(new ChatPacket(playerEntity.getDisplayName() + TextFormatting.YELLOW + " left the game."));
         mcServer.playerList.sendPacketToAllPlayers(new UpdatePlayerProfilePacket(playerEntity.username, playerEntity.nickname, playerEntity.uuid, playerEntity.score, playerEntity.chatColor, false, playerEntity.isOperator()));
         mcServer.playerList.playerLoggedOut(playerEntity);
@@ -452,20 +454,18 @@ public class ServerPacketHandler extends PacketHandler
     }
 
     @Override
-    public void handleBlockItemSwitch(SetCarriedItemPacket packet)
+    public void handleBlockItemSwitch(SetCarriedItemPacket setCarriedItemPacket)
     {
-        if (packet.id < 0 || packet.id > Inventory.func_25054_e())
+        if (setCarriedItemPacket.id < 0 || setCarriedItemPacket.id > Inventory.playerMainInventorySize())
         {
             LOGGER.warn("{} tried to set an invalid carried item", playerEntity.username);
-            return;
         }
         else
         {
-            playerEntity.inventory.setCurrentItemIndex(packet.id, false);
-            if (packet.id != playerEntity.inventory.getCurrentItemIndex()) { // If client tried to set current item while locked then send a packet back attempting to resync them
-                sendPacket(new SetCarriedItemPacket(packet.id));
+            playerEntity.inventory.setCurrentItemIndex(setCarriedItemPacket.id, false);
+            if (setCarriedItemPacket.id != playerEntity.inventory.getCurrentItemIndex()) { // If client tried to set current item while locked then send a packet back attempting to resync them
+                sendPacket(new SetCarriedItemPacket(setCarriedItemPacket.id));
             }
-            return;
         }
     }
 
@@ -528,18 +528,18 @@ public class ServerPacketHandler extends PacketHandler
     }
 
     @Override
-    public void handleEntityAction(PlayerCommandPacket packet)
+    public void handlePlayerState(UpdatePlayerStatePacket updatePlayerStatePacket)
     {
         if (!playerEntity.isAlive()) return;
-        if (packet.state == 1)
+        if (updatePlayerStatePacket.state == UpdatePlayerStatePacket.STATE_SNEAK)
         {
             playerEntity.setSneaking(true);
         }
-        else if (packet.state == 2)
+        else if (updatePlayerStatePacket.state == UpdatePlayerStatePacket.STATE_UN_SNEAK)
         {
             playerEntity.setSneaking(false);
         }
-        else if (packet.state == 3)
+        else if (updatePlayerStatePacket.state == UpdatePlayerStatePacket.STATE_LEAVE_BED)
         {
             playerEntity.wakeUpPlayer(false, true);
             hasMoved = false;
@@ -548,8 +548,8 @@ public class ServerPacketHandler extends PacketHandler
     @Override
     public void handleBoatControl(BoatControlPacket boatControlPacket)
     {
-        if (!playerEntity.getGamemode().canInteract() || !playerEntity.isAlive()) return;
-        if (playerEntity.vehicle != null && playerEntity.vehicle instanceof BoatEntity){
+        if (!canInteract()) return;
+        if (playerEntity.vehicle != null && playerEntity.vehicle instanceof BoatEntity && !Double.isNaN(boatControlPacket.targetXD) && !Double.isNaN(boatControlPacket.targetZD)) {
             BoatEntity boat = (BoatEntity) playerEntity.vehicle;
             boat.handleControlDirect(boatControlPacket.targetXD, boatControlPacket.targetZD, boatControlPacket.targetYRot);
             boatControlPacket.entityId = boat.id;
@@ -581,11 +581,11 @@ public class ServerPacketHandler extends PacketHandler
     }
 
     @Override
-    public void handleUseEntity(InteractPacket packet)
+    public void handleUseEntity(InteractPacket interactPacket)
     {
         if (!playerEntity.getGamemode().canInteract() || !playerEntity.isAlive() || playerEntity.getHeldObject() != null /*TODO consider adding entity interactions while holding object*/) return;
         WorldServer worldserver = mcServer.getDimensionWorld(playerEntity.dimension);
-        Entity targetEntity = worldserver.getEntityFromId(packet.targetEntityID);
+        Entity targetEntity = worldserver.getEntityFromId(interactPacket.targetEntityID);
         if (targetEntity != null && playerEntity.distanceToSqr(targetEntity) < 36D)
         {
             boolean canAttack = playerEntity.canEntityBeSeen(targetEntity);
@@ -614,11 +614,11 @@ public class ServerPacketHandler extends PacketHandler
             }
             if (canAttack)
             {
-                if (packet.action == InteractPacket.ACTION_INTERACT)
+                if (interactPacket.action == InteractPacket.ACTION_INTERACT)
                 {
                     playerEntity.useCurrentItemOnEntity(targetEntity);
                 }
-                else if (packet.action == InteractPacket.ACTION_ATTACK)
+                else if (interactPacket.action == InteractPacket.ACTION_ATTACK)
                 {
                     playerEntity.attackTargetEntityWithCurrentItem(targetEntity);
                 }
@@ -641,20 +641,20 @@ public class ServerPacketHandler extends PacketHandler
     }
 
     @Override
-    public void handleCloseWindow(ContainerClosePacket packet)
+    public void handleCloseWindow(ContainerClosePacket containerClosePacket)
     {
         playerEntity.closeCraftingGui();
     }
 
     @Override
-    public void handleWindowClick(ContainerClickPacket packet)
+    public void handleWindowClick(ContainerClickPacket containerClickPacket)
     {
-        if (playerEntity.craftingInventory.containerId == packet.window_Id && playerEntity.craftingInventory.isSynched(playerEntity))
+        if (playerEntity.craftingInventory.containerId == containerClickPacket.window_Id && playerEntity.craftingInventory.isSynched(playerEntity))
         {
-            ItemStack itemstack = playerEntity.craftingInventory.clicked(packet.action, packet.args, playerEntity);
-            if (ItemStack.areItemStacksEqual(packet.itemStack, itemstack))
+            ItemStack itemstack = playerEntity.craftingInventory.clicked(containerClickPacket.action, containerClickPacket.args, playerEntity);
+            if (ItemStack.areItemStacksEqual(containerClickPacket.itemStack, itemstack))
             {
-                playerEntity.playerNetServerHandler.sendPacket(new ContainerAckPacket(packet.window_Id, packet.actionId, true));
+                playerEntity.playerNetServerHandler.sendPacket(new ContainerAckPacket(containerClickPacket.window_Id, containerClickPacket.actionId, true));
                 playerEntity.isChangingQuantityOnly = true;
                 playerEntity.craftingInventory.broadcastChanges();
                 playerEntity.updateHeldItem();
@@ -662,8 +662,8 @@ public class ServerPacketHandler extends PacketHandler
             }
             else
             {
-                guiIdMap.put(playerEntity.craftingInventory.containerId, packet.actionId);
-                playerEntity.playerNetServerHandler.sendPacket(new ContainerAckPacket(packet.window_Id, packet.actionId, false));
+                guiIdMap.put(playerEntity.craftingInventory.containerId, containerClickPacket.actionId);
+                playerEntity.playerNetServerHandler.sendPacket(new ContainerAckPacket(containerClickPacket.window_Id, containerClickPacket.actionId, false));
                 playerEntity.craftingInventory.setSynched(playerEntity, false);
                 ArrayList<ItemStack> arraylist = new ArrayList<>();
                 for (int i = 0; i < playerEntity.craftingInventory.slots.size(); i++)
@@ -687,13 +687,13 @@ public class ServerPacketHandler extends PacketHandler
     }
 
     @Override
-    public void handleUpdateSign(SignUpdatePacket packet)
+    public void handleUpdateSign(SignUpdatePacket signUpdatePacket)
     {
         if (!playerEntity.getGamemode().canInteract() || !playerEntity.isAlive()) return;
         WorldServer worldserver = mcServer.getDimensionWorld(playerEntity.dimension);
-        if (worldserver.isBlockLoaded(packet.xPosition, packet.yPosition, packet.zPosition))
+        if (worldserver.isBlockLoaded(signUpdatePacket.xPosition, signUpdatePacket.yPosition, signUpdatePacket.zPosition))
         {
-            BlockEntity blockEntity = worldserver.getBlockEntity(packet.xPosition, packet.yPosition, packet.zPosition);
+            BlockEntity blockEntity = worldserver.getBlockEntity(signUpdatePacket.xPosition, signUpdatePacket.yPosition, signUpdatePacket.zPosition);
             if (blockEntity instanceof SignBlockEntity)
             {
                 SignBlockEntity sign = (SignBlockEntity) blockEntity;
@@ -706,16 +706,16 @@ public class ServerPacketHandler extends PacketHandler
             for (int i = 0; i < 4; i++)
             {
                 boolean isLineValid = true;
-                if (packet.signLines[i].length() > 15)
+                if (signUpdatePacket.signLines[i].length() > 15)
                 {
                     isLineValid = false;
                 }
                 else
                 {
-                    packet.signLines[i] = packet.signLines[i].replaceAll("§", "$");
-                    for (int l = 0; l < packet.signLines[i].length(); l++)
+                    signUpdatePacket.signLines[i] = signUpdatePacket.signLines[i].replaceAll("§", "$");
+                    for (int l = 0; l < signUpdatePacket.signLines[i].length(); l++)
                     {
-                        if (ChatAllowedCharacters.ALLOWED_CHARACTERS.indexOf(packet.signLines[i].charAt(l)) < 0)
+                        if (ChatAllowedCharacters.ALLOWED_CHARACTERS.indexOf(signUpdatePacket.signLines[i].charAt(l)) < 0)
                         {
                             isLineValid = false;
                             break;
@@ -724,20 +724,20 @@ public class ServerPacketHandler extends PacketHandler
                 }
                 if (!isLineValid)
                 {
-                    packet.signLines[i] = "!?";
+                    signUpdatePacket.signLines[i] = "!?";
                 }
             }
 
             if (blockEntity instanceof SignBlockEntity)
             {
-                int x = packet.xPosition;
-                int y = packet.yPosition;
-                int z = packet.zPosition;
+                int x = signUpdatePacket.xPosition;
+                int y = signUpdatePacket.yPosition;
+                int z = signUpdatePacket.zPosition;
                 SignBlockEntity tileEntity = (SignBlockEntity) blockEntity;
-                System.arraycopy(packet.signLines, 0, tileEntity.signText, 0, 4);
+                System.arraycopy(signUpdatePacket.signLines, 0, tileEntity.signText, 0, 4);
 
-                tileEntity.setColor(TextFormatting.FORMATTINGS[packet.color]);
-                tileEntity.setPicture(EnumSignPicture.values()[packet.picture]);
+                tileEntity.setColor(TextFormatting.FORMATTINGS[signUpdatePacket.color]);
+                tileEntity.setPicture(EnumSignPicture.values()[signUpdatePacket.picture]);
 
                 tileEntity.setChanged();
                 worldserver.markBlockNeedsUpdate(x, y, z);
@@ -773,28 +773,28 @@ public class ServerPacketHandler extends PacketHandler
     }
 
     @Override
-    public void handleSetPaintingMotive(SetPaintingArtPacket packet)
+    public void handleSetPaintingMotive(SetPaintingArtPacket setPaintingArtPacket)
     {
-        playerEntity.setSelectedArt(ArtType.values.get(packet.motive));
+        playerEntity.setSelectedArt(ArtType.values.get(setPaintingArtPacket.motive));
     }
     
     @Override
-    public void handleCustomPayload(CustomPayloadPacket packet) {
-    	if("BTA|RotationLock".equals(packet.channel)) {
-    		if(packet.data.length == 4) {
-        		playerEntity.rotationLock = Direction.getDirectionById(packet.data[0]);
-        		playerEntity.rotationLockHorizontal = Direction.getDirectionById(packet.data[1]);
-        		playerEntity.rotationLockVertical = Direction.getDirectionById(packet.data[2]);
-        		playerEntity.placementModeOverride = PlacementMode.get(packet.data[3]);
+    public void handleCustomPayload(CustomPayloadPacket customPayloadPacket) {
+    	if("BTA|RotationLock".equals(customPayloadPacket.channel)) {
+    		if(customPayloadPacket.data.length == 4) {
+        		playerEntity.rotationLock = Direction.getDirectionById(customPayloadPacket.data[0]);
+        		playerEntity.rotationLockHorizontal = Direction.getDirectionById(customPayloadPacket.data[1]);
+        		playerEntity.rotationLockVertical = Direction.getDirectionById(customPayloadPacket.data[2]);
+        		playerEntity.placementModeOverride = PlacementMode.get(customPayloadPacket.data[3]);
     		}
-    	}else if("BTA|Flag".equals(packet.channel)) {
-    		if(packet.data.length == 24 * 16 && playerEntity.craftingInventory instanceof FlagMenu) {
+    	}else if("BTA|Flag".equals(customPayloadPacket.channel)) {
+    		if(customPayloadPacket.data.length == 24 * 16 && playerEntity.craftingInventory instanceof FlagMenu) {
     			FlagMenu flagMenu = (FlagMenu) playerEntity.craftingInventory;
     			FlagBlockEntity flag = flagMenu.flag;
 
     			if(flag.owner == null || flag.owner.equals(playerEntity.uuid)) {
                     flag.owner = playerEntity.uuid;
-        			System.arraycopy(packet.data, 0, flag.flagColors, 0, 24 * 16);
+        			System.arraycopy(customPayloadPacket.data, 0, flag.flagColors, 0, 24 * 16);
 
         			playerEntity.world.markBlockNeedsUpdate(flag.x, flag.y, flag.z);
     			}else {
@@ -804,9 +804,9 @@ public class ServerPacketHandler extends PacketHandler
     				playerEntity.world.markBlockNeedsUpdate(flag.x, flag.y, flag.z);
     			}
     		}
-    	} else if ("BTA|WandMonster".equals(packet.channel)) {
+    	} else if ("BTA|WandMonster".equals(customPayloadPacket.channel)) {
             if (playerEntity.getHeldItem() != null && playerEntity.getHeldItem().getItem() == Items.WAND_MONSTER_SPAWNER){
-                String id = new String(packet.data, StandardCharsets.UTF_8);
+                String id = new String(customPayloadPacket.data, StandardCharsets.UTF_8);
                 playerEntity.getHeldItem().getData().putString("monster", id);
             }
         }
@@ -814,13 +814,11 @@ public class ServerPacketHandler extends PacketHandler
 
     @Override
     public void handleRequestCommandManagerPacket(RequestCommandManagerPacket packet) {
-        ServerPlayer player = this.mcServer.playerList.getPlayerEntity(packet.username);
-        if (player == null) return;
-        player.playerNetServerHandler.sendPacket(
+        sendPacket(
             new CommandManagerPacket(
-                this.mcServer.getDimensionWorld(player.dimension)
+                this.mcServer.getDimensionWorld(playerEntity.dimension)
                     .getCommandManager().getDispatcher(),
-                new ServerCommandSource(this.mcServer, player),
+                new ServerCommandSource(this.mcServer, playerEntity),
                 packet.text,
                 packet.cursor
             )
@@ -842,7 +840,6 @@ public class ServerPacketHandler extends PacketHandler
     private int field_15_f;
     private int field_22004_g;
     private int playerInAirTime;
-    private boolean field_22003_h;
     private double lastPosX;
     private double lastPosY;
     private double lastPosZ;
diff --git a/src/main/java/net/minecraft/server/player/PlayerListBox.java b/src/main/java/net/minecraft/server/player/PlayerListBox.java
index 7253843ee..1b6dbbd76 100644
--- a/src/main/java/net/minecraft/server/player/PlayerListBox.java
+++ b/src/main/java/net/minecraft/server/player/PlayerListBox.java
@@ -3,22 +3,20 @@ package net.minecraft.server.player;
 import java.util.Vector;
 import javax.swing.JList;
 
-import net.minecraft.server.entity.player.ServerPlayer;
 import net.minecraft.server.MinecraftServer;
 import net.minecraft.core.net.IUpdatePlayerListBox;
 
-// Referenced classes of package net.minecraft.src:
-//            IUpdatePlayerListBox, ServerConfigurationManager, ServerPlayer
-
-public class PlayerListBox extends JList
+public class PlayerListBox extends JList<String>
     implements IUpdatePlayerListBox
 {
+    private final MinecraftServer mcServer;
+    private int updateCounter;
 
     public PlayerListBox(MinecraftServer minecraftserver)
     {
         updateCounter = 0;
         mcServer = minecraftserver;
-        minecraftserver.func_6022_a(this);
+        minecraftserver.addPlayerListBox(this);
     }
 
     @Override
@@ -26,16 +24,13 @@ public class PlayerListBox extends JList
     {
         if(updateCounter++ % 20 == 0)
         {
-            Vector vector = new Vector();
+            Vector<String> vector = new Vector<>();
             for(int i = 0; i < mcServer.playerList.playerEntities.size(); i++)
             {
-                vector.add(((ServerPlayer)mcServer.playerList.playerEntities.get(i)).username);
+                vector.add(mcServer.playerList.playerEntities.get(i).username);
             }
 
             setListData(vector);
         }
     }
-
-    private MinecraftServer mcServer;
-    private int updateCounter;
 }
diff --git a/src/main/java/net/minecraft/server/player/PlayerManager.java b/src/main/java/net/minecraft/server/player/PlayerManager.java
index f9f855ec3..e69a24bef 100644
--- a/src/main/java/net/minecraft/server/player/PlayerManager.java
+++ b/src/main/java/net/minecraft/server/player/PlayerManager.java
@@ -82,8 +82,8 @@ public class PlayerManager
     {
         int xChunk = (int)player.x >> 4;
         int zChunk = (int)player.z >> 4;
-        player.field_9155_d = player.x;
-        player.field_9154_e = player.z;
+        player.viewingX = player.x;
+        player.viewingZ = player.z;
         int k = 0;
         int radius = viewRadius;
         int dx = 0;
@@ -116,8 +116,8 @@ public class PlayerManager
 
     public void removePlayer(ServerPlayer entityplayermp)
     {
-        int i = (int)entityplayermp.field_9155_d >> 4;
-        int j = (int)entityplayermp.field_9154_e >> 4;
+        int i = (int)entityplayermp.viewingX >> 4;
+        int j = (int)entityplayermp.viewingZ >> 4;
         for(int k = i - viewRadius; k <= i + viewRadius; k++)
         {
             for(int l = j - viewRadius; l <= j + viewRadius; l++)
@@ -134,59 +134,55 @@ public class PlayerManager
         players.remove(entityplayermp);
     }
 
-    private boolean func_544_a(int i, int j, int k, int l)
+    private boolean chunkWithinViewRadius(int chunkX, int chunkZ, int originX, int originZ)
     {
-        int i1 = i - k;
-        int j1 = j - l;
-        if(i1 < -viewRadius || i1 > viewRadius)
-        {
-            return false;
-        }
-        return j1 >= -viewRadius && j1 <= viewRadius;
+        int cDX = chunkX - originX;
+        int cDZ = chunkZ - originZ;
+        return cDZ >= -viewRadius && cDZ <= viewRadius && cDX >= -viewRadius && cDX <= viewRadius;
     }
 
-    public void func_543_c(ServerPlayer entityplayermp)
+    public void onPlayerMoved(ServerPlayer player)
     {
-        int i = (int)entityplayermp.x >> 4;
-        int j = (int)entityplayermp.z >> 4;
-        double d = entityplayermp.field_9155_d - entityplayermp.x;
-        double d1 = entityplayermp.field_9154_e - entityplayermp.z;
-        double d2 = d * d + d1 * d1;
-        if(d2 < 64D)
+        int chunkX = (int)player.x >> 4;
+        int chunkZ = (int)player.z >> 4;
+        double dx = player.viewingX - player.x;
+        double dz = player.viewingZ - player.z;
+        double dSqr = dx * dx + dz * dz;
+        if(dSqr < 64D) // Do nothing If moved less then 8 blocks horizontally
         {
             return;
         }
-        int k = (int)entityplayermp.field_9155_d >> 4;
-        int l = (int)entityplayermp.field_9154_e >> 4;
-        int i1 = i - k;
-        int j1 = j - l;
-        if(i1 == 0 && j1 == 0)
+        int playerChunkX = (int)player.viewingX >> 4;
+        int playerChunkZ = (int)player.viewingZ >> 4;
+        int cDX = chunkX - playerChunkX;
+        int cDZ = chunkZ - playerChunkZ;
+        if(cDX == 0 && cDZ == 0) // If still on same chunk
         {
             return;
         }
-        for(int k1 = i - viewRadius; k1 <= i + viewRadius; k1++)
+        for(int _cx = chunkX - viewRadius; _cx <= chunkX + viewRadius; _cx++)
         {
-            for(int l1 = j - viewRadius; l1 <= j + viewRadius; l1++)
+            for(int _cz = chunkZ - viewRadius; _cz <= chunkZ + viewRadius; _cz++)
             {
-                if(!func_544_a(k1, l1, k, l))
+                if(!chunkWithinViewRadius(_cx, _cz, playerChunkX, playerChunkZ)) // If chunk was not in previous render radius add the chunk to the player
                 {
-                    getPlayerInstance(k1, l1, true).addPlayer(entityplayermp);
+                    getPlayerInstance(_cx, _cz, true).addPlayer(player);
                 }
-                if(func_544_a(k1 - i1, l1 - j1, i, j))
+                if(chunkWithinViewRadius(_cx - cDX, _cz - cDZ, chunkX, chunkZ))
                 {
                     continue;
                 }
-                PlayerInstance playerinstance = getPlayerInstance(k1 - i1, l1 - j1, false);
+                PlayerInstance playerinstance = getPlayerInstance(_cx - cDX, _cz - cDZ, false);
                 if(playerinstance != null)
                 {
-                    playerinstance.removePlayer(entityplayermp);
+                    playerinstance.removePlayer(player);
                 }
             }
 
         }
 
-        entityplayermp.field_9155_d = entityplayermp.x;
-        entityplayermp.field_9154_e = entityplayermp.z;
+        player.viewingX = player.x;
+        player.viewingZ = player.z;
     }
 
     public int getMaxTrackingDistance()
@@ -209,7 +205,7 @@ public class PlayerManager
         private int maxZ;
 
         public PlayerInstance(int chunkX, int chunkZ) {
-            players = new ArrayList();
+            players = new ArrayList<>();
             blocksToUpdate = new int[10];
             numBlocksToUpdate = 0;
             this.chunkX = chunkX;
@@ -240,7 +236,7 @@ public class PlayerManager
                 if (numBlocksToUpdate > 0) {
                     playerInstancesToUpdate.remove(this);
                 }
-                server.getDimensionWorld(dimension).chunkProviderServer.func_35391_d(chunkX, chunkZ);
+                server.getDimensionWorld(dimension).chunkProviderServer.dropChunk(chunkX, chunkZ);
             }
             player.loadedChunks.remove(currentChunk);
             if (player.field_420_ah.contains(currentChunk)) {
diff --git a/src/main/java/net/minecraft/server/world/ServerPlayerController.java b/src/main/java/net/minecraft/server/world/ServerPlayerController.java
index 9a92019e7..63b7cc607 100644
--- a/src/main/java/net/minecraft/server/world/ServerPlayerController.java
+++ b/src/main/java/net/minecraft/server/world/ServerPlayerController.java
@@ -14,6 +14,7 @@ import net.minecraft.core.item.Item;
 import net.minecraft.core.item.ItemStack;
 import net.minecraft.core.net.packet.BlockUpdatePacket;
 import net.minecraft.core.util.helper.Side;
+import net.minecraft.core.world.LevelListener;
 import net.minecraft.core.world.World;
 import net.minecraft.server.entity.player.ServerPlayer;
 
@@ -121,7 +122,7 @@ public class ServerPlayerController
     	}
         Block block = Block.getBlock(id);
         BlockEntity blockEntity = thisWorld.getBlockEntity(x, y, z);
-        thisWorld.playBlockEvent(player, 2001, x, y, z, id);
+        thisWorld.playBlockEvent(player, LevelListener.EVENT_BLOCK_BREAK, x, y, z, id);
         boolean flag = removeBlock(x, y, z);
         if(flag) {
         	if(block != null) {
diff --git a/src/main/java/net/minecraft/server/world/WorldManager.java b/src/main/java/net/minecraft/server/world/WorldManager.java
index cb300ce19..5cf17d11a 100644
--- a/src/main/java/net/minecraft/server/world/WorldManager.java
+++ b/src/main/java/net/minecraft/server/world/WorldManager.java
@@ -113,7 +113,7 @@ public class WorldManager
     @Override
 	public void tileEntityChanged(int x, int y, int z, BlockEntity blockEntity)
     {
-        mcServer.playerList.sendTileEntityToPlayer(x, y, z, blockEntity);
+        mcServer.playerList.sendBlockEntityToPlayer(x, y, z, blockEntity);
     }
 
     @Override
diff --git a/src/main/java/net/minecraft/server/world/WorldServer.java b/src/main/java/net/minecraft/server/world/WorldServer.java
index 05158ca3d..92a7d413b 100644
--- a/src/main/java/net/minecraft/server/world/WorldServer.java
+++ b/src/main/java/net/minecraft/server/world/WorldServer.java
@@ -19,20 +19,12 @@ import net.minecraft.core.world.save.LevelStorage;
 import net.minecraft.core.world.type.WorldType;
 import net.minecraft.server.MinecraftServer;
 
-// Referenced classes of package net.minecraft.src:
-//            World, WorldProvider, MCHash, Animal,
-//            EntityWaterMob, Entity, Player, ISaveHandler,
-//            ChunkProviderServer, BlockEntity, WorldInfo, MathHelper,
-//            ServerConfigurationManager, WeatherEffectPacket, EnitityEventPacket, EntityTracker,
-//            Explosion, ExplosionPacket, BlockEventPacket, BedMessagePacket,
-//            IChunkProvider
-
 public class WorldServer extends World
 {
 
-    public WorldServer(MinecraftServer minecraftserver, LevelStorage isavehandler, String name, int dimensionId, WorldType worldType, long seed, SpawnerMobs.SpawnerConfig spawnerConfig)
+    public WorldServer(MinecraftServer minecraftserver, LevelStorage isavehandler, String name, int dimensionId, WorldType worldType, long seed)
     {
-        super(isavehandler, name, seed, Dimension.getDimensionList().get(dimensionId), worldType, spawnerConfig);
+        super(isavehandler, name, seed, Dimension.getDimensionList().get(dimensionId), worldType);
         entityIntHashMap = new IntHashMap<>();
         mcServer = minecraftserver;
     }
@@ -46,11 +38,6 @@ public class WorldServer extends World
         }
     }
 
-    public void func_12017_b(Entity entity, boolean flag)
-    {
-        super.updateEntityWithOptionalForce(entity, flag);
-    }
-
     @Override
     protected IChunkProvider createChunkProvider()
     {
@@ -75,10 +62,11 @@ public class WorldServer extends World
     }
 
     @Override
-    public boolean canMineBlock(Player entityplayer, int i, int j, int k)
+    public boolean canMineBlock(Player entityplayer, int x, int y, int z)
     {
-        int l = (int)MathHelper.abs(i - levelData.getSpawnX());
-        int i1 = (int)MathHelper.abs(k - levelData.getSpawnZ());
+        // TODO make spawn protection a named constant *and* server configurable
+        int l = (int)MathHelper.abs(x - levelData.getSpawnX());
+        int i1 = (int)MathHelper.abs(z - levelData.getSpawnZ());
         if(l > i1)
         {
             i1 = l;
@@ -107,7 +95,7 @@ public class WorldServer extends World
         if(areEnoughPlayersFullyAsleep())
         {
             boolean wasInterrupted = false;
-            if(spawningConfig.canHostileSpawn(this) && getPlayersRequiredToSkipNight() <= 1)
+            if(getSpawnerConfig().canHostileSpawn(this) && getPlayersRequiredToSkipNight() <= 1)
             {
                 wasInterrupted = SpawnerMobs.performSleepSpawning(this, players);
             }
diff --git a/src/main/java/net/minecraft/server/world/WorldServerMulti.java b/src/main/java/net/minecraft/server/world/WorldServerMulti.java
index a0b3d1e7b..2984ad475 100644
--- a/src/main/java/net/minecraft/server/world/WorldServerMulti.java
+++ b/src/main/java/net/minecraft/server/world/WorldServerMulti.java
@@ -1,6 +1,5 @@
 package net.minecraft.server.world;
 
-import net.minecraft.core.world.SpawnerMobs;
 import net.minecraft.core.world.type.WorldType;
 import net.minecraft.server.MinecraftServer;
 import net.minecraft.core.world.save.LevelStorage;
@@ -11,9 +10,9 @@ import net.minecraft.core.world.save.LevelStorage;
 public class WorldServerMulti extends WorldServer
 {
 
-    public WorldServerMulti(MinecraftServer minecraftserver, LevelStorage isavehandler, String name, int dimensionId, WorldType worldType, long seed, WorldServer worldserver, SpawnerMobs.SpawnerConfig spawnerConfig)
+    public WorldServerMulti(MinecraftServer minecraftserver, LevelStorage isavehandler, String name, int dimensionId, WorldType worldType, long seed, WorldServer worldserver)
     {
-        super(minecraftserver, isavehandler, name, dimensionId, worldType, seed, spawnerConfig);
+        super(minecraftserver, isavehandler, name, dimensionId, worldType, seed);
         savedDataStorage = worldserver.savedDataStorage;
     }
 }
diff --git a/src/main/java/net/minecraft/server/world/chunk/provider/ChunkProviderServer.java b/src/main/java/net/minecraft/server/world/chunk/provider/ChunkProviderServer.java
index 7abb9ff4f..e5ba04ba6 100644
--- a/src/main/java/net/minecraft/server/world/chunk/provider/ChunkProviderServer.java
+++ b/src/main/java/net/minecraft/server/world/chunk/provider/ChunkProviderServer.java
@@ -42,13 +42,13 @@ public class ChunkProviderServer
         return chunkMap.containsKey(ChunkCoordinate.toInt(chunkX, chunkZ));
     }
 
-    public void func_35391_d(int chunkX, int chunkZ)
+    public void dropChunk(int chunkX, int chunkZ)
     {
         ChunkCoordinates spawnCoords = world.getSpawnPoint();
         int spawnDistanceX = (chunkX * 16 + 8) - spawnCoords.x;
         int spawnDistanceZ = (chunkZ * 16 + 8) - spawnCoords.z;
-        int r = 128;
-        if(spawnDistanceX < -r || spawnDistanceX > r || spawnDistanceZ < -r || spawnDistanceZ > r)
+        int r = 128; // TODO replace spawn chunk values with a named constant
+        if(spawnDistanceX < -r || spawnDistanceX > r || spawnDistanceZ < -r || spawnDistanceZ > r) // Drop chunk if outside of spawn radius
         {
             droppedChunksSet.add(ChunkCoordinate.toInt(chunkX, chunkZ));
         }
diff --git a/src/main/resources/assets/minecraft/textures/block/activator_bottom.png b/src/main/resources/assets/minecraft/textures/block/activator_bottom.png
new file mode 100644
index 000000000..ff08b5c55
Binary files /dev/null and b/src/main/resources/assets/minecraft/textures/block/activator_bottom.png differ
diff --git a/src/main/resources/assets/minecraft/textures/block/activator_front_active.png b/src/main/resources/assets/minecraft/textures/block/activator_front_active.png
index 82783c98e..561fb6357 100644
Binary files a/src/main/resources/assets/minecraft/textures/block/activator_front_active.png and b/src/main/resources/assets/minecraft/textures/block/activator_front_active.png differ
diff --git a/src/main/resources/assets/minecraft/textures/block/activator_front_active_overlay.png b/src/main/resources/assets/minecraft/textures/block/activator_front_active_overlay.png
index afcac194b..759d8910e 100644
Binary files a/src/main/resources/assets/minecraft/textures/block/activator_front_active_overlay.png and b/src/main/resources/assets/minecraft/textures/block/activator_front_active_overlay.png differ
diff --git a/src/main/resources/assets/minecraft/textures/block/activator_side.png b/src/main/resources/assets/minecraft/textures/block/activator_side.png
index 60bbf3a47..512adf1f4 100644
Binary files a/src/main/resources/assets/minecraft/textures/block/activator_side.png and b/src/main/resources/assets/minecraft/textures/block/activator_side.png differ
diff --git a/src/main/resources/assets/minecraft/textures/block/activator_side_active.png b/src/main/resources/assets/minecraft/textures/block/activator_side_active.png
new file mode 100644
index 000000000..77904f909
Binary files /dev/null and b/src/main/resources/assets/minecraft/textures/block/activator_side_active.png differ
diff --git a/src/main/resources/assets/minecraft/textures/block/activator_side_active_overlay.png b/src/main/resources/assets/minecraft/textures/block/activator_side_active_overlay.png
new file mode 100644
index 000000000..14bff6a5c
Binary files /dev/null and b/src/main/resources/assets/minecraft/textures/block/activator_side_active_overlay.png differ
diff --git a/src/main/resources/assets/minecraft/textures/block/activator_top.png b/src/main/resources/assets/minecraft/textures/block/activator_top.png
index db9c8abd5..a6f177184 100644
Binary files a/src/main/resources/assets/minecraft/textures/block/activator_top.png and b/src/main/resources/assets/minecraft/textures/block/activator_top.png differ
diff --git a/src/main/resources/assets/minecraft/textures/block/activator_top_active.png b/src/main/resources/assets/minecraft/textures/block/activator_top_active.png
new file mode 100644
index 000000000..199439a6c
Binary files /dev/null and b/src/main/resources/assets/minecraft/textures/block/activator_top_active.png differ
diff --git a/src/main/resources/assets/minecraft/textures/block/activator_top_active_overlay.png b/src/main/resources/assets/minecraft/textures/block/activator_top_active_overlay.png
new file mode 100644
index 000000000..45d436aef
Binary files /dev/null and b/src/main/resources/assets/minecraft/textures/block/activator_top_active_overlay.png differ
diff --git a/src/main/resources/assets/minecraft/textures/block/block_steel_bottom.png b/src/main/resources/assets/minecraft/textures/block/block_steel_bottom.png
index 93d4ffa90..9ea6d2610 100644
Binary files a/src/main/resources/assets/minecraft/textures/block/block_steel_bottom.png and b/src/main/resources/assets/minecraft/textures/block/block_steel_bottom.png differ
diff --git a/src/main/resources/assets/minecraft/textures/block/block_steel_side.png b/src/main/resources/assets/minecraft/textures/block/block_steel_side.png
index 7a1f7afcd..c34b7373d 100644
Binary files a/src/main/resources/assets/minecraft/textures/block/block_steel_side.png and b/src/main/resources/assets/minecraft/textures/block/block_steel_side.png differ
diff --git a/src/main/resources/assets/minecraft/textures/block/block_steel_top.png b/src/main/resources/assets/minecraft/textures/block/block_steel_top.png
index 3dce8266d..12e0e819c 100644
Binary files a/src/main/resources/assets/minecraft/textures/block/block_steel_top.png and b/src/main/resources/assets/minecraft/textures/block/block_steel_top.png differ
diff --git a/src/main/resources/assets/minecraft/textures/block/dispenser_bottom.png b/src/main/resources/assets/minecraft/textures/block/dispenser_bottom.png
new file mode 100644
index 000000000..e0d1a3d65
Binary files /dev/null and b/src/main/resources/assets/minecraft/textures/block/dispenser_bottom.png differ
diff --git a/src/main/resources/assets/minecraft/textures/block/door_steel_bottom.png b/src/main/resources/assets/minecraft/textures/block/door_steel_bottom.png
index a88cc6a66..4b059a7b4 100644
Binary files a/src/main/resources/assets/minecraft/textures/block/door_steel_bottom.png and b/src/main/resources/assets/minecraft/textures/block/door_steel_bottom.png differ
diff --git a/src/main/resources/assets/minecraft/textures/block/door_steel_frame_top.png b/src/main/resources/assets/minecraft/textures/block/door_steel_frame_top.png
new file mode 100644
index 000000000..5043fbd18
Binary files /dev/null and b/src/main/resources/assets/minecraft/textures/block/door_steel_frame_top.png differ
diff --git a/src/main/resources/assets/minecraft/textures/block/door_steel_top.png b/src/main/resources/assets/minecraft/textures/block/door_steel_top.png
index ca8f8448e..6baeacc43 100644
Binary files a/src/main/resources/assets/minecraft/textures/block/door_steel_top.png and b/src/main/resources/assets/minecraft/textures/block/door_steel_top.png differ
diff --git a/src/main/resources/assets/minecraft/textures/block/furnace_stone_bottom.png b/src/main/resources/assets/minecraft/textures/block/furnace_stone_bottom.png
new file mode 100644
index 000000000..b925fefc0
Binary files /dev/null and b/src/main/resources/assets/minecraft/textures/block/furnace_stone_bottom.png differ
diff --git a/src/main/resources/assets/minecraft/textures/block/glass_steel.png b/src/main/resources/assets/minecraft/textures/block/glass_steel.png
index 873b2a244..b4a228f9d 100644
Binary files a/src/main/resources/assets/minecraft/textures/block/glass_steel.png and b/src/main/resources/assets/minecraft/textures/block/glass_steel.png differ
diff --git a/src/main/resources/assets/minecraft/textures/block/trapdoor_steel_side.png b/src/main/resources/assets/minecraft/textures/block/trapdoor_steel_side.png
index 332f8874e..367f60d67 100644
Binary files a/src/main/resources/assets/minecraft/textures/block/trapdoor_steel_side.png and b/src/main/resources/assets/minecraft/textures/block/trapdoor_steel_side.png differ
diff --git a/src/main/resources/assets/minecraft/textures/block/trapdoor_steel_top.png b/src/main/resources/assets/minecraft/textures/block/trapdoor_steel_top.png
index 00aeb44a8..c29eefa55 100644
Binary files a/src/main/resources/assets/minecraft/textures/block/trapdoor_steel_top.png and b/src/main/resources/assets/minecraft/textures/block/trapdoor_steel_top.png differ
diff --git a/src/main/resources/assets/minecraft/textures/gui/sprites/achievement/achievement.png b/src/main/resources/assets/minecraft/textures/gui/sprites/screen/achievement/achievement.png
similarity index 100%
rename from src/main/resources/assets/minecraft/textures/gui/sprites/achievement/achievement.png
rename to src/main/resources/assets/minecraft/textures/gui/sprites/screen/achievement/achievement.png
diff --git a/src/main/resources/assets/minecraft/textures/gui/sprites/achievement/achievement_secret.png b/src/main/resources/assets/minecraft/textures/gui/sprites/screen/achievement/achievement_secret.png
similarity index 100%
rename from src/main/resources/assets/minecraft/textures/gui/sprites/achievement/achievement_secret.png
rename to src/main/resources/assets/minecraft/textures/gui/sprites/screen/achievement/achievement_secret.png
diff --git a/src/main/resources/assets/minecraft/textures/gui/sprites/achievement/achievement_special.png b/src/main/resources/assets/minecraft/textures/gui/sprites/screen/achievement/achievement_special.png
similarity index 100%
rename from src/main/resources/assets/minecraft/textures/gui/sprites/achievement/achievement_special.png
rename to src/main/resources/assets/minecraft/textures/gui/sprites/screen/achievement/achievement_special.png
diff --git a/src/main/resources/assets/minecraft/textures/gui/sprites/achievement/star.png b/src/main/resources/assets/minecraft/textures/gui/sprites/screen/achievement/star.png
similarity index 100%
rename from src/main/resources/assets/minecraft/textures/gui/sprites/achievement/star.png
rename to src/main/resources/assets/minecraft/textures/gui/sprites/screen/achievement/star.png
diff --git a/src/main/resources/assets/minecraft/textures/gui/sprites/screen/creative/clear.png b/src/main/resources/assets/minecraft/textures/gui/sprites/screen/creative/clear.png
new file mode 100644
index 000000000..10f7b5426
Binary files /dev/null and b/src/main/resources/assets/minecraft/textures/gui/sprites/screen/creative/clear.png differ
diff --git a/src/main/resources/assets/minecraft/textures/gui/sprites/screen/creative/clear_highlighted.png b/src/main/resources/assets/minecraft/textures/gui/sprites/screen/creative/clear_highlighted.png
new file mode 100644
index 000000000..3a21fcf24
Binary files /dev/null and b/src/main/resources/assets/minecraft/textures/gui/sprites/screen/creative/clear_highlighted.png differ
diff --git a/src/main/resources/assets/minecraft/textures/gui/sprites/slot.png b/src/main/resources/assets/minecraft/textures/gui/sprites/screen/guidebook/slot.png
similarity index 100%
rename from src/main/resources/assets/minecraft/textures/gui/sprites/slot.png
rename to src/main/resources/assets/minecraft/textures/gui/sprites/screen/guidebook/slot.png
diff --git a/src/main/resources/assets/minecraft/textures/gui/sprites/arrow_down.png b/src/main/resources/assets/minecraft/textures/gui/sprites/screen/stats/arrow_down.png
similarity index 100%
rename from src/main/resources/assets/minecraft/textures/gui/sprites/arrow_down.png
rename to src/main/resources/assets/minecraft/textures/gui/sprites/screen/stats/arrow_down.png
diff --git a/src/main/resources/assets/minecraft/textures/gui/sprites/arrow_up.png b/src/main/resources/assets/minecraft/textures/gui/sprites/screen/stats/arrow_up.png
similarity index 100%
rename from src/main/resources/assets/minecraft/textures/gui/sprites/arrow_up.png
rename to src/main/resources/assets/minecraft/textures/gui/sprites/screen/stats/arrow_up.png
diff --git a/src/main/resources/assets/minecraft/textures/gui/sprites/crafted.png b/src/main/resources/assets/minecraft/textures/gui/sprites/screen/stats/crafted.png
similarity index 100%
rename from src/main/resources/assets/minecraft/textures/gui/sprites/crafted.png
rename to src/main/resources/assets/minecraft/textures/gui/sprites/screen/stats/crafted.png
diff --git a/src/main/resources/assets/minecraft/textures/gui/sprites/depleted.png b/src/main/resources/assets/minecraft/textures/gui/sprites/screen/stats/depleted.png
similarity index 100%
rename from src/main/resources/assets/minecraft/textures/gui/sprites/depleted.png
rename to src/main/resources/assets/minecraft/textures/gui/sprites/screen/stats/depleted.png
diff --git a/src/main/resources/assets/minecraft/textures/gui/sprites/mined.png b/src/main/resources/assets/minecraft/textures/gui/sprites/screen/stats/mined.png
similarity index 100%
rename from src/main/resources/assets/minecraft/textures/gui/sprites/mined.png
rename to src/main/resources/assets/minecraft/textures/gui/sprites/screen/stats/mined.png
diff --git a/src/main/resources/assets/minecraft/textures/gui/sprites/screen/stats/slot.png b/src/main/resources/assets/minecraft/textures/gui/sprites/screen/stats/slot.png
new file mode 100644
index 000000000..690688780
Binary files /dev/null and b/src/main/resources/assets/minecraft/textures/gui/sprites/screen/stats/slot.png differ
diff --git a/src/main/resources/assets/minecraft/textures/gui/sprites/slot_raised.png b/src/main/resources/assets/minecraft/textures/gui/sprites/screen/stats/slot_raised.png
similarity index 100%
rename from src/main/resources/assets/minecraft/textures/gui/sprites/slot_raised.png
rename to src/main/resources/assets/minecraft/textures/gui/sprites/screen/stats/slot_raised.png
diff --git a/src/main/resources/assets/minecraft/textures/gui/sprites/used.png b/src/main/resources/assets/minecraft/textures/gui/sprites/screen/stats/used.png
similarity index 100%
rename from src/main/resources/assets/minecraft/textures/gui/sprites/used.png
rename to src/main/resources/assets/minecraft/textures/gui/sprites/screen/stats/used.png
diff --git a/src/main/resources/assets/minecraft/textures/gui/sprites/widgets/button.png.mcmeta b/src/main/resources/assets/minecraft/textures/gui/sprites/widgets/button.png.mcmeta
deleted file mode 100644
index a9b84c3cb..000000000
--- a/src/main/resources/assets/minecraft/textures/gui/sprites/widgets/button.png.mcmeta
+++ /dev/null
@@ -1,13 +0,0 @@
-{
-    "gui": {
-        "type": "nine_slice",
-        "width": 200,
-        "height": 20,
-        "border": {
-            "top": 2,
-            "left": 2,
-            "right": 2,
-            "bottom": 3
-        }
-    }
-}
\ No newline at end of file
diff --git a/src/main/resources/assets/minecraft/textures/gui/sprites/widgets/button.png b/src/main/resources/assets/minecraft/textures/gui/sprites/widgets/button/button.png
similarity index 100%
rename from src/main/resources/assets/minecraft/textures/gui/sprites/widgets/button.png
rename to src/main/resources/assets/minecraft/textures/gui/sprites/widgets/button/button.png
diff --git a/src/main/resources/assets/minecraft/textures/gui/sprites/widgets/button/button.png.mcmeta b/src/main/resources/assets/minecraft/textures/gui/sprites/widgets/button/button.png.mcmeta
new file mode 100644
index 000000000..6f27a3b2b
--- /dev/null
+++ b/src/main/resources/assets/minecraft/textures/gui/sprites/widgets/button/button.png.mcmeta
@@ -0,0 +1,15 @@
+{
+    "gui": {
+        "scaling": {
+            "type": "nine_slice",
+            "width": 200,
+            "height": 20,
+            "border": {
+                "top": 2,
+                "left": 2,
+                "right": 2,
+                "bottom": 3
+            }
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/main/resources/assets/minecraft/textures/gui/sprites/widgets/button_disabled.png b/src/main/resources/assets/minecraft/textures/gui/sprites/widgets/button/button_disabled.png
similarity index 100%
rename from src/main/resources/assets/minecraft/textures/gui/sprites/widgets/button_disabled.png
rename to src/main/resources/assets/minecraft/textures/gui/sprites/widgets/button/button_disabled.png
diff --git a/src/main/resources/assets/minecraft/textures/gui/sprites/widgets/button/button_disabled.png.mcmeta b/src/main/resources/assets/minecraft/textures/gui/sprites/widgets/button/button_disabled.png.mcmeta
new file mode 100644
index 000000000..b321e532b
--- /dev/null
+++ b/src/main/resources/assets/minecraft/textures/gui/sprites/widgets/button/button_disabled.png.mcmeta
@@ -0,0 +1,10 @@
+{
+    "gui": {
+        "scaling": {
+            "type": "nine_slice",
+            "width": 200,
+            "height": 20,
+            "border": 1
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/main/resources/assets/minecraft/textures/gui/sprites/widgets/button_highlighted.png b/src/main/resources/assets/minecraft/textures/gui/sprites/widgets/button/button_highlighted.png
similarity index 100%
rename from src/main/resources/assets/minecraft/textures/gui/sprites/widgets/button_highlighted.png
rename to src/main/resources/assets/minecraft/textures/gui/sprites/widgets/button/button_highlighted.png
diff --git a/src/main/resources/assets/minecraft/textures/gui/sprites/widgets/button/button_highlighted.png.mcmeta b/src/main/resources/assets/minecraft/textures/gui/sprites/widgets/button/button_highlighted.png.mcmeta
new file mode 100644
index 000000000..6f27a3b2b
--- /dev/null
+++ b/src/main/resources/assets/minecraft/textures/gui/sprites/widgets/button/button_highlighted.png.mcmeta
@@ -0,0 +1,15 @@
+{
+    "gui": {
+        "scaling": {
+            "type": "nine_slice",
+            "width": 200,
+            "height": 20,
+            "border": {
+                "top": 2,
+                "left": 2,
+                "right": 2,
+                "bottom": 3
+            }
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/main/resources/assets/minecraft/textures/gui/sprites/widgets/button_disabled.png.mcmeta b/src/main/resources/assets/minecraft/textures/gui/sprites/widgets/button_disabled.png.mcmeta
deleted file mode 100644
index a08c3403a..000000000
--- a/src/main/resources/assets/minecraft/textures/gui/sprites/widgets/button_disabled.png.mcmeta
+++ /dev/null
@@ -1,8 +0,0 @@
-{
-    "gui": {
-        "type": "nine_slice",
-        "width": 200,
-        "height": 20,
-        "border": 1
-    }
-}
\ No newline at end of file
diff --git a/src/main/resources/assets/minecraft/textures/gui/sprites/widgets/button_highlighted.png.mcmeta b/src/main/resources/assets/minecraft/textures/gui/sprites/widgets/button_highlighted.png.mcmeta
deleted file mode 100644
index a9b84c3cb..000000000
--- a/src/main/resources/assets/minecraft/textures/gui/sprites/widgets/button_highlighted.png.mcmeta
+++ /dev/null
@@ -1,13 +0,0 @@
-{
-    "gui": {
-        "type": "nine_slice",
-        "width": 200,
-        "height": 20,
-        "border": {
-            "top": 2,
-            "left": 2,
-            "right": 2,
-            "bottom": 3
-        }
-    }
-}
\ No newline at end of file
diff --git a/src/main/resources/assets/minecraft/textures/gui/sprites/widgets/slider/slider.png b/src/main/resources/assets/minecraft/textures/gui/sprites/widgets/slider/slider.png
new file mode 100644
index 000000000..2c16bf0ad
Binary files /dev/null and b/src/main/resources/assets/minecraft/textures/gui/sprites/widgets/slider/slider.png differ
diff --git a/src/main/resources/assets/minecraft/textures/gui/sprites/widgets/slider/slider.png.mcmeta b/src/main/resources/assets/minecraft/textures/gui/sprites/widgets/slider/slider.png.mcmeta
new file mode 100644
index 000000000..54789e1bc
--- /dev/null
+++ b/src/main/resources/assets/minecraft/textures/gui/sprites/widgets/slider/slider.png.mcmeta
@@ -0,0 +1,15 @@
+{
+    "gui": {
+        "scaling": {
+            "type": "nine_slice",
+            "width": 8,
+            "height": 20,
+            "border": {
+                "top": 2,
+                "left": 2,
+                "right": 2,
+                "bottom": 3
+            }
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/main/resources/assets/minecraft/textures/gui/sprites/widgets/slider/slider_background.png b/src/main/resources/assets/minecraft/textures/gui/sprites/widgets/slider/slider_background.png
new file mode 100644
index 000000000..6745dd84c
Binary files /dev/null and b/src/main/resources/assets/minecraft/textures/gui/sprites/widgets/slider/slider_background.png differ
diff --git a/src/main/resources/assets/minecraft/textures/gui/sprites/widgets/slider/slider_background.png.mcmeta b/src/main/resources/assets/minecraft/textures/gui/sprites/widgets/slider/slider_background.png.mcmeta
new file mode 100644
index 000000000..b321e532b
--- /dev/null
+++ b/src/main/resources/assets/minecraft/textures/gui/sprites/widgets/slider/slider_background.png.mcmeta
@@ -0,0 +1,10 @@
+{
+    "gui": {
+        "scaling": {
+            "type": "nine_slice",
+            "width": 200,
+            "height": 20,
+            "border": 1
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/main/resources/assets/minecraft/textures/gui/sprites/widgets/slider/slider_disabled.png b/src/main/resources/assets/minecraft/textures/gui/sprites/widgets/slider/slider_disabled.png
new file mode 100644
index 000000000..b56fea4c0
Binary files /dev/null and b/src/main/resources/assets/minecraft/textures/gui/sprites/widgets/slider/slider_disabled.png differ
diff --git a/src/main/resources/assets/minecraft/textures/gui/sprites/widgets/slider/slider_disabled.png.mcmeta b/src/main/resources/assets/minecraft/textures/gui/sprites/widgets/slider/slider_disabled.png.mcmeta
new file mode 100644
index 000000000..9687b34ef
--- /dev/null
+++ b/src/main/resources/assets/minecraft/textures/gui/sprites/widgets/slider/slider_disabled.png.mcmeta
@@ -0,0 +1,10 @@
+{
+    "gui": {
+        "scaling": {
+            "type": "nine_slice",
+            "width": 8,
+            "height": 20,
+            "border": 1
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/main/resources/assets/minecraft/textures/gui/sprites/widgets/slider/slider_highlighted.png b/src/main/resources/assets/minecraft/textures/gui/sprites/widgets/slider/slider_highlighted.png
new file mode 100644
index 000000000..14d31d8fa
Binary files /dev/null and b/src/main/resources/assets/minecraft/textures/gui/sprites/widgets/slider/slider_highlighted.png differ
diff --git a/src/main/resources/assets/minecraft/textures/gui/sprites/widgets/slider/slider_highlighted.png.mcmeta b/src/main/resources/assets/minecraft/textures/gui/sprites/widgets/slider/slider_highlighted.png.mcmeta
new file mode 100644
index 000000000..54789e1bc
--- /dev/null
+++ b/src/main/resources/assets/minecraft/textures/gui/sprites/widgets/slider/slider_highlighted.png.mcmeta
@@ -0,0 +1,15 @@
+{
+    "gui": {
+        "scaling": {
+            "type": "nine_slice",
+            "width": 8,
+            "height": 20,
+            "border": {
+                "top": 2,
+                "left": 2,
+                "right": 2,
+                "bottom": 3
+            }
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/main/resources/assets/minecraft/textures/gui/sprites/widgets/switch/switch.png b/src/main/resources/assets/minecraft/textures/gui/sprites/widgets/switch/switch.png
new file mode 100644
index 000000000..b9b8175ec
Binary files /dev/null and b/src/main/resources/assets/minecraft/textures/gui/sprites/widgets/switch/switch.png differ
diff --git a/src/main/resources/assets/minecraft/textures/gui/sprites/widgets/switch/switch.png.mcmeta b/src/main/resources/assets/minecraft/textures/gui/sprites/widgets/switch/switch.png.mcmeta
new file mode 100644
index 000000000..6f27a3b2b
--- /dev/null
+++ b/src/main/resources/assets/minecraft/textures/gui/sprites/widgets/switch/switch.png.mcmeta
@@ -0,0 +1,15 @@
+{
+    "gui": {
+        "scaling": {
+            "type": "nine_slice",
+            "width": 200,
+            "height": 20,
+            "border": {
+                "top": 2,
+                "left": 2,
+                "right": 2,
+                "bottom": 3
+            }
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/main/resources/assets/minecraft/textures/gui/sprites/widgets/switch/switch_background.png b/src/main/resources/assets/minecraft/textures/gui/sprites/widgets/switch/switch_background.png
new file mode 100644
index 000000000..6745dd84c
Binary files /dev/null and b/src/main/resources/assets/minecraft/textures/gui/sprites/widgets/switch/switch_background.png differ
diff --git a/src/main/resources/assets/minecraft/textures/gui/sprites/widgets/switch/switch_background.png.mcmeta b/src/main/resources/assets/minecraft/textures/gui/sprites/widgets/switch/switch_background.png.mcmeta
new file mode 100644
index 000000000..b321e532b
--- /dev/null
+++ b/src/main/resources/assets/minecraft/textures/gui/sprites/widgets/switch/switch_background.png.mcmeta
@@ -0,0 +1,10 @@
+{
+    "gui": {
+        "scaling": {
+            "type": "nine_slice",
+            "width": 200,
+            "height": 20,
+            "border": 1
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/main/resources/assets/minecraft/textures/gui/sprites/widgets/switch/switch_disabled.png b/src/main/resources/assets/minecraft/textures/gui/sprites/widgets/switch/switch_disabled.png
new file mode 100644
index 000000000..6745dd84c
Binary files /dev/null and b/src/main/resources/assets/minecraft/textures/gui/sprites/widgets/switch/switch_disabled.png differ
diff --git a/src/main/resources/assets/minecraft/textures/gui/sprites/widgets/switch/switch_disabled.png.mcmeta b/src/main/resources/assets/minecraft/textures/gui/sprites/widgets/switch/switch_disabled.png.mcmeta
new file mode 100644
index 000000000..b321e532b
--- /dev/null
+++ b/src/main/resources/assets/minecraft/textures/gui/sprites/widgets/switch/switch_disabled.png.mcmeta
@@ -0,0 +1,10 @@
+{
+    "gui": {
+        "scaling": {
+            "type": "nine_slice",
+            "width": 200,
+            "height": 20,
+            "border": 1
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/main/resources/assets/minecraft/textures/gui/sprites/widgets/switch/switch_highlighted.png b/src/main/resources/assets/minecraft/textures/gui/sprites/widgets/switch/switch_highlighted.png
new file mode 100644
index 000000000..76d5a2d1a
Binary files /dev/null and b/src/main/resources/assets/minecraft/textures/gui/sprites/widgets/switch/switch_highlighted.png differ
diff --git a/src/main/resources/assets/minecraft/textures/gui/sprites/widgets/switch/switch_highlighted.png.mcmeta b/src/main/resources/assets/minecraft/textures/gui/sprites/widgets/switch/switch_highlighted.png.mcmeta
new file mode 100644
index 000000000..6f27a3b2b
--- /dev/null
+++ b/src/main/resources/assets/minecraft/textures/gui/sprites/widgets/switch/switch_highlighted.png.mcmeta
@@ -0,0 +1,15 @@
+{
+    "gui": {
+        "scaling": {
+            "type": "nine_slice",
+            "width": 200,
+            "height": 20,
+            "border": {
+                "top": 2,
+                "left": 2,
+                "right": 2,
+                "bottom": 3
+            }
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/main/resources/assets/minecraft/textures/item/door_steel.png b/src/main/resources/assets/minecraft/textures/item/door_steel.png
index d414e3939..99302c8dd 100644
Binary files a/src/main/resources/assets/minecraft/textures/item/door_steel.png and b/src/main/resources/assets/minecraft/textures/item/door_steel.png differ
