BlockSeaLantern .java

net.minecraft.block.BlockSeaLantern (class, 57 lines): members: quantityDroppedWithBonus, canSilkHarvest, quantityDropped, getMapColor, getItemDropped.

net.minecraft.blockclass57 linescommonextends Block1.4 KB

API Surface (5)

int quantityDropped(Random random)
int quantityDroppedWithBonus(int fortune, Random random)
Item getItemDropped(IBlockState state, Random rand, int fortune)
MapColor getMapColor(IBlockState state)
boolean canSilkHarvest()

Code Graph: Dependencies (8)

Edges (calls / imports / inherits / references) resolved by graphify from the AST. Every chip opens the class source.

Full Source

BlockSeaLantern.java57 lines · MCP 1.8.9 · verbatimOriginal ↗
1
package net.minecraft.block;
2
3
import java.util.Random;
4
import net.minecraft.block.material.MapColor;
5
import net.minecraft.block.material.Material;
6
import net.minecraft.block.state.IBlockState;
7
import net.minecraft.creativetab.CreativeTabs;
8
import net.minecraft.init.Items;
9
import net.minecraft.item.Item;
10
import net.minecraft.util.MathHelper;
11
12
public class BlockSeaLantern extends Block
13
{
14
    public BlockSeaLantern(Material materialIn)
15
    {
16
        super(materialIn);
17
        this.setCreativeTab(CreativeTabs.tabBlock);
18
    }
19
20
    /**
21
     * Returns the quantity of items to drop on block destruction.
22
     */
23
    public int quantityDropped(Random random)
24
    {
25
        return 2 + random.nextInt(2);
26
    }
27
28
    /**
29
     * Get the quantity dropped based on the given fortune level
30
     */
31
    public int quantityDroppedWithBonus(int fortune, Random random)
32
    {
33
        return MathHelper.clamp_int(this.quantityDropped(random) + random.nextInt(fortune + 1), 1, 5);
34
    }
35
36
    /**
37
     * Get the Item that this Block should drop when harvested.
38
     */
39
    public Item getItemDropped(IBlockState state, Random rand, int fortune)
40
    {
41
        return Items.prismarine_crystals;
42
    }
43
44
    /**
45
     * Get the MapColor for this Block and the given BlockState
46
     */
47
    public MapColor getMapColor(IBlockState state)
48
    {
49
        return MapColor.quartzColor;
50
    }
51
52
    protected boolean canSilkHarvest()
53
    {
54
        return true;
55
    }
56
}
57

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