Files
Chisel/src/main/java/info/jbcs/minecraft/chisel/block/BlockCloud.java
T

68 lines
1.7 KiB
Java
Raw Normal View History

package info.jbcs.minecraft.chisel.block;
2014-07-17 22:05:29 +01:00
import info.jbcs.minecraft.chisel.Configurations;
import net.minecraft.block.material.Material;
import net.minecraft.entity.Entity;
import net.minecraft.item.Item;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
2014-07-17 22:05:29 +01:00
import java.util.Random;
2014-11-30 18:10:51 -05:00
public class BlockCloud extends BlockCarvable {
2014-11-30 18:10:51 -05:00
public BlockCloud() {
super(Material.ice);
useNeighborBrightness = true;
}
@Override
2014-11-30 18:10:51 -05:00
public void onEntityCollidedWithBlock(World world, int i, int j, int k, Entity entity) {
entity.fallDistance = 0.0F;
2014-11-30 18:10:51 -05:00
if (entity.motionY < 0.0D) {
entity.motionY *= 0.0050000000000000001D;
2014-11-30 18:10:51 -05:00
} else if (entity.motionY > 0) {
entity.motionY += 0.0285;
}
}
@Override
2014-11-30 18:10:51 -05:00
public boolean isOpaqueCube() {
return false;
}
@Override
2014-11-30 18:10:51 -05:00
public int getRenderBlockPass() {
2014-07-17 22:05:29 +01:00
return Configurations.ghostCloud ? 1 : 0;
}
@Override
2014-11-30 18:10:51 -05:00
public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l) {
return super.shouldSideBeRendered(iblockaccess, i, j, k, 1 - l);
}
@Override
2014-11-30 18:10:51 -05:00
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int i, int j, int k) {
return AxisAlignedBB.getBoundingBox(i + 0.2, j, k + 0.2, i + 0.8, j + 0.2, k + 0.8);
}
@Override
2014-11-30 18:10:51 -05:00
public Item getItemDropped(int par1, Random rand, int par3) {
return Item.getItemFromBlock(this);
}
@Override
2014-11-30 18:10:51 -05:00
public int quantityDropped(Random rand) {
return 0;
}
@Override
2014-11-30 18:10:51 -05:00
public int damageDropped(int meta) {
return 0;
}
}