@Override public void onPlacedBy( EntityPlayer player, ItemStack is, EnumFacing side, float hitX, float hitY, float hitZ) { super.onPlacedBy(player, is, side, hitX, hitY, hitZ); NBTTagCompound tag = null; if (is.hasTagCompound()) { tag = is.getTagCompound(); try { putData(new DataInNBT(tag)); } catch (IOException e) { e.printStackTrace(); } } else { addLump(); } EnumFacing placement = SpaceUtil.determineFlatOrientation(player); if (tag == null || !tag.hasKey("front")) { front = placement; setRotation((byte) 0); } else if (placement.getDirectionVec().getY() == 0 && placement != null) { front = SpaceUtil.getOrientation(tag.getByte("front")); if (front == null || front.getDirectionVec().getY() != 0) { setRotation((byte) 0); front = placement; } else { EnumFacing f = placement; byte r = 0; for (byte i = 0; i < 4; i++) { if (f == front) { r = i; break; } f = SpaceUtil.rotate(f, EnumFacing.UP); } setRotation(r); } } }