Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class BloodySlimeBlock extends BlockBase {
- public BloodySlimeBlock(String name, Material material)
- {
- super(name, material);
- setHardness(1.0f);
- setLightLevel(0.0f);
- setSoundType(SoundType.SLIME);
- setDefaultSlipperiness(0.8f);
- }
- @SideOnly(Side.CLIENT)
- // Thx Mojang for the code below (:
- public BlockRenderLayer getBlockLayer()
- {
- return BlockRenderLayer.TRANSLUCENT;
- }
- public void onFallenUpon(World worldIn, BlockPos pos, Entity entityIn, float fallDistance)
- {
- if (entityIn.isSneaking())
- {
- super.onFallenUpon(worldIn, pos, entityIn, fallDistance);
- }
- else
- {
- entityIn.fall(fallDistance, 0.0F);
- }
- }
- public void onLanded(World worldIn, Entity entityIn)
- {
- if (entityIn.isSneaking())
- {
- super.onLanded(worldIn, entityIn);
- }
- else if (entityIn.motionY < 0.0D)
- {
- entityIn.motionY = -entityIn.motionY;
- if (!(entityIn instanceof EntityLivingBase))
- {
- entityIn.motionY *= 0.8D;
- }
- }
- }
- public void onEntityWalk(World worldIn, BlockPos pos, Entity entityIn)
- {
- if (Math.abs(entityIn.motionY) < 0.1D && !entityIn.isSneaking())
- {
- double d0 = 0.4D + Math.abs(entityIn.motionY) * 0.2D;
- entityIn.motionX *= d0;
- entityIn.motionZ *= d0;
- }
- super.onEntityWalk(worldIn, pos, entityIn);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement