You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
76 lines
2.0 KiB
Java
76 lines
2.0 KiB
Java
package net.minecraft.block;
|
|
|
|
import java.util.Random;
|
|
import net.minecraft.block.material.Material;
|
|
import net.minecraft.creativetab.CreativeTabs;
|
|
import net.minecraft.entity.Entity;
|
|
import net.minecraft.init.Items;
|
|
import net.minecraft.item.Item;
|
|
import net.minecraft.util.AxisAlignedBB;
|
|
import net.minecraft.world.World;
|
|
|
|
public class BlockWeb extends Block
|
|
{
|
|
private static final String __OBFID = "CL_00000333";
|
|
|
|
public BlockWeb()
|
|
{
|
|
super(Material.web);
|
|
this.setCreativeTab(CreativeTabs.tabDecorations);
|
|
}
|
|
|
|
/**
|
|
* Triggered whenever an entity collides with this block (enters into the block). Args: world, x, y, z, entity
|
|
*/
|
|
public void onEntityCollidedWithBlock(World worldIn, int x, int y, int z, Entity entityIn)
|
|
{
|
|
entityIn.setInWeb();
|
|
}
|
|
|
|
/**
|
|
* Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two
|
|
* adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block.
|
|
*/
|
|
public boolean isOpaqueCube()
|
|
{
|
|
return false;
|
|
}
|
|
|
|
/**
|
|
* 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)
|
|
*/
|
|
public AxisAlignedBB getCollisionBoundingBoxFromPool(World worldIn, int x, int y, int z)
|
|
{
|
|
return null;
|
|
}
|
|
|
|
/**
|
|
* The type of render function that is called for this block
|
|
*/
|
|
public int getRenderType()
|
|
{
|
|
return 1;
|
|
}
|
|
|
|
/**
|
|
* If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc)
|
|
*/
|
|
public boolean renderAsNormalBlock()
|
|
{
|
|
return false;
|
|
}
|
|
|
|
public Item getItemDropped(int meta, Random random, int fortune)
|
|
{
|
|
return Items.string;
|
|
}
|
|
|
|
/**
|
|
* Return true if a player with Silk Touch can harvest this block directly, and not its normal drops.
|
|
*/
|
|
protected boolean canSilkHarvest()
|
|
{
|
|
return true;
|
|
}
|
|
} |