package ganymedes01.etfuturum.blocks;

import ganymedes01.etfuturum.EtFuturum;
import ganymedes01.etfuturum.IConfigurable;
import ganymedes01.etfuturum.core.utils.Utils;
import ganymedes01.etfuturum.lib.ModSounds;
import ganymedes01.etfuturum.lib.RenderIDs;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.entity.Entity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

public class SlimeBlock extends Block implements IConfigurable {

	public SlimeBlock() {
		super(Material.clay);
		setHardness(0.0F);
		slipperiness = 0.0F;
		setBlockTextureName("slime");
		setStepSound(ModSounds.soundSlime);
		setBlockName(Utils.getUnlocalisedName("slime"));
		setCreativeTab(EtFuturum.enableSlimeBlock ? EtFuturum.creativeTab : null);
	}

	@Override
	public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity) {
		if (!entity.isSneaking()) {
			entity.fallDistance = 0.0F;
			entity.motionY = 1.0F;
		}
	}

	@Override
	public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) {
		return AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y + 0.875F, z + 1);
	}

	@Override
	public boolean isOpaqueCube() {
		return false;
	}

	@Override
	public boolean renderAsNormalBlock() {
		return false;
	}

	@Override
	@SideOnly(Side.CLIENT)
	public int getRenderBlockPass() {
		return 1;
	}

	@Override
	public int getRenderType() {
		return RenderIDs.SLIME_BLOCK;
	}

	@Override
	public boolean isEnabled() {
		return EtFuturum.enableSlimeBlock;
	}
}
@@ -207,16 +207,60 @@
 Sounds;%0A
+import ganymedes01.etfuturum.lib.Reference;%0A
 import g
@@ -411,16 +411,57 @@
 Entity;%0A
+import net.minecraft.nbt.NBTTagCompound;%0A
 import n
@@ -988,38 +988,229 @@
 lic 
-void onEntityCollidedWithBlock
+AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) %7B%0A%09%09final float f = 0.125F;%0A%09%09return AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y + 1 - f, z + 1);%0A%09%7D%0A%0A%09@Override%0A%09public void onFallenUpon
 (Wor
@@ -1253,16 +1253,36 @@
 y entity
+, float fallDistance
 ) %7B%0A%09%09if
@@ -1337,16 +1337,17 @@
  = 0
-.0F
 ;%0A%09%09%09
+if (
 enti
@@ -1361,198 +1361,589 @@
 onY 
-= 1.0F;%0A%09%09%7D%0A%09%7D%0A%0A%09@Override%0A%09public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) %7B%0A%09%09return AxisAlignedBB
+%3C 0)%0A%09%09%09%09entity.getEntityData().setDouble(Reference.MOD_ID + %22:slime%22, -entity.motionY);%0A%09%09%7D%0A%09%7D%0A%0A%09@Override%0A%09public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity) %7B%0A%09%09NBTTagCompound data = entity.getEntityData();%0A%09%09if (data.hasKey(Reference.MOD_ID + %22:slime%22)) %7B%0A%09%09%09entity.motionY = data
 .get
-BoundingBox(x, y, z, x + 1, y + 0.875F, z + 1);
+Double(Reference.MOD_ID + %22:slime%22);%0A%09%09%09data.removeTag(Reference.MOD_ID + %22:slime%22);%0A%09%09%7D%0A%0A%09%09if (Math.abs(entity.motionY) %3C 0.1 && !entity.isSneaking()) %7B%0A%09%09%09double d = 0.4 + Math.abs(entity.motionY) * 0.2;%0A%09%09%09entity.motionX *= d;%0A%09%09%09entity.motionZ *= d;%0A%09%09%7D
 %0A%09%7D%0A

Fix slime blocks destroying the world and everything you love. Closes #7