2013-05-10 20:28:30 +00:00
|
|
|
package biomesoplenty.blocks;
|
|
|
|
|
|
|
|
import net.minecraft.block.Block;
|
|
|
|
import net.minecraft.block.material.Material;
|
|
|
|
import net.minecraft.client.renderer.texture.IconRegister;
|
2013-05-11 11:25:43 +00:00
|
|
|
import net.minecraft.entity.Entity;
|
2013-09-14 03:26:42 +00:00
|
|
|
import net.minecraft.entity.player.EntityPlayer;
|
|
|
|
import net.minecraft.entity.player.InventoryPlayer;
|
2013-05-11 11:25:43 +00:00
|
|
|
import net.minecraft.util.AxisAlignedBB;
|
2013-05-10 20:28:30 +00:00
|
|
|
import net.minecraft.world.IBlockAccess;
|
2013-05-29 01:05:27 +00:00
|
|
|
import net.minecraft.world.World;
|
2013-05-11 07:48:02 +00:00
|
|
|
import biomesoplenty.BiomesOPlenty;
|
2013-09-14 03:26:42 +00:00
|
|
|
import biomesoplenty.api.Items;
|
2013-05-11 07:48:02 +00:00
|
|
|
import cpw.mods.fml.relauncher.Side;
|
|
|
|
import cpw.mods.fml.relauncher.SideOnly;
|
2013-05-10 20:28:30 +00:00
|
|
|
|
|
|
|
public class BlockCloud extends Block
|
|
|
|
{
|
2013-05-31 10:34:02 +00:00
|
|
|
public BlockCloud(int par1)
|
|
|
|
{
|
|
|
|
super(par1, Material.sponge);
|
|
|
|
this.setCreativeTab(BiomesOPlenty.tabBiomesOPlenty);
|
|
|
|
}
|
|
|
|
|
2013-05-10 20:28:30 +00:00
|
|
|
@Override
|
|
|
|
public void registerIcons(IconRegister par1IconRegister)
|
|
|
|
{
|
2013-07-03 06:01:28 +00:00
|
|
|
blockIcon = par1IconRegister.registerIcon("biomesoplenty:cloud");
|
2013-05-10 20:28:30 +00:00
|
|
|
}
|
2013-05-31 10:34:02 +00:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been
|
|
|
|
* cleared to be reused)
|
|
|
|
*/
|
2013-05-10 20:28:30 +00:00
|
|
|
@Override
|
2013-05-31 10:34:02 +00:00
|
|
|
public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
|
|
|
|
{
|
|
|
|
float var5 = 0.25F;
|
|
|
|
return AxisAlignedBB.getAABBPool().getAABB(par2, par3, par4, par2 + 1, par3 + 1 - var5, par4 + 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Triggered whenever an entity collides with this block (enters into the block). Args: world, x, y, z, entity
|
|
|
|
*/
|
|
|
|
@Override
|
|
|
|
public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity)
|
|
|
|
{
|
|
|
|
par5Entity.fallDistance = 0.0F;
|
2013-09-14 03:26:42 +00:00
|
|
|
|
|
|
|
if (par5Entity instanceof EntityPlayer)
|
|
|
|
{
|
|
|
|
InventoryPlayer inventory = ((EntityPlayer)par5Entity).inventory;
|
|
|
|
|
|
|
|
if (inventory.armorInventory[0] != null && inventory.armorInventory[0].itemID == Items.wadingBoots.get().itemID)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-05-31 10:34:02 +00:00
|
|
|
par5Entity.motionX *= 0.8D;
|
|
|
|
par5Entity.motionZ *= 0.8D;
|
|
|
|
}
|
2013-05-10 20:28:30 +00:00
|
|
|
|
2013-05-31 10:34:02 +00:00
|
|
|
@Override
|
|
|
|
@SideOnly(Side.CLIENT)
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns which pass should this block be rendered on. 0 for solids and 1 for alpha
|
|
|
|
*/
|
|
|
|
public int getRenderBlockPass()
|
|
|
|
{
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2013-05-11 07:48:02 +00:00
|
|
|
public boolean isOpaqueCube()
|
2013-05-31 10:34:02 +00:00
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
2013-05-10 20:28:30 +00:00
|
|
|
|
|
|
|
@Override
|
2013-05-31 10:34:02 +00:00
|
|
|
@SideOnly(Side.CLIENT)
|
2013-05-10 20:28:30 +00:00
|
|
|
|
2013-05-31 10:34:02 +00:00
|
|
|
/**
|
|
|
|
* Returns true if the given side of this block type should be rendered, if the adjacent block is at the given
|
|
|
|
* coordinates. Args: blockAccess, x, y, z, side
|
|
|
|
*/
|
|
|
|
public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
|
|
|
|
{
|
|
|
|
return true;//super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, 1 - par5);
|
|
|
|
}
|
2013-05-10 20:28:30 +00:00
|
|
|
}
|