BlockWeb .java

net.minecraft.block.BlockWeb (class, 67 lines): members: canSilkHarvest, onEntityCollidedWithBlock, getBlockLayer, getCollisionBoundingBox, getItemDropped.

net.minecraft.blockclass67 linescommonextends Block1.5 KB

API Surface (7)

void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn)
boolean isOpaqueCube()
AxisAlignedBB getCollisionBoundingBox(World worldIn, BlockPos pos, IBlockState state)
boolean isFullCube()
Item getItemDropped(IBlockState state, Random rand, int fortune)
boolean canSilkHarvest()
EnumWorldBlockLayer getBlockLayer()

Full Source

BlockWeb.java67 lines · MCP 1.8.9 · verbatimOriginal ↗
1
package net.minecraft.block;
2
3
import java.util.Random;
4
import net.minecraft.block.material.Material;
5
import net.minecraft.block.state.IBlockState;
6
import net.minecraft.creativetab.CreativeTabs;
7
import net.minecraft.entity.Entity;
8
import net.minecraft.init.Items;
9
import net.minecraft.item.Item;
10
import net.minecraft.util.AxisAlignedBB;
11
import net.minecraft.util.BlockPos;
12
import net.minecraft.util.EnumWorldBlockLayer;
13
import net.minecraft.world.World;
14
15
public class BlockWeb extends Block
16
{
17
    public BlockWeb()
18
    {
19
        super(Material.web);
20
        this.setCreativeTab(CreativeTabs.tabDecorations);
21
    }
22
23
    /**
24
     * Called When an Entity Collided with the Block
25
     */
26
    public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn)
27
    {
28
        entityIn.setInWeb();
29
    }
30
31
    /**
32
     * Used to determine ambient occlusion and culling when rebuilding chunks for render
33
     */
34
    public boolean isOpaqueCube()
35
    {
36
        return false;
37
    }
38
39
    public AxisAlignedBB getCollisionBoundingBox(World worldIn, BlockPos pos, IBlockState state)
40
    {
41
        return null;
42
    }
43
44
    public boolean isFullCube()
45
    {
46
        return false;
47
    }
48
49
    /**
50
     * Get the Item that this Block should drop when harvested.
51
     */
52
    public Item getItemDropped(IBlockState state, Random rand, int fortune)
53
    {
54
        return Items.string;
55
    }
56
57
    protected boolean canSilkHarvest()
58
    {
59
        return true;
60
    }
61
62
    public EnumWorldBlockLayer getBlockLayer()
63
    {
64
        return EnumWorldBlockLayer.CUTOUT;
65
    }
66
}
67

Deobfuscated MCP 1.8.9 source of BlockWeb from Marcelektro/MavenMCP-1.8.9 (net/minecraft/block/BlockWeb.java), stored verbatim.