BlockEndPortal .java

net.minecraft.block.BlockEndPortal (class): members: addCollisionBoxesToList, onEntityCollidedWithBlock, randomDisplayTick, shouldSideBeRendered, getItem.

net.minecraft.blockclass109 linescommonextends BlockContainer3.1 KB

API Surface (11)

TileEntity createNewTileEntity(World worldIn, int meta)
void setBlockBoundsBasedOnState(IBlockAccess worldIn, BlockPos pos)
boolean shouldSideBeRendered(IBlockAccess worldIn, BlockPos pos, EnumFacing side)
void addCollisionBoxesToList(World worldIn, BlockPos pos, IBlockState state, AxisAlignedBB mask, List<AxisAlignedBB> list, Entity collidingEntity)
boolean isOpaqueCube()
boolean isFullCube()
int quantityDropped(Random random)
void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn)
void randomDisplayTick(World worldIn, BlockPos pos, IBlockState state, Random rand)
Item getItem(World worldIn, BlockPos pos)
MapColor getMapColor(IBlockState state)

Full Source

BlockEndPortal.java109 lines · MCP 1.8.9 · verbatimOriginal ↗
1
package net.minecraft.block;
2
3
import java.util.List;
4
import java.util.Random;
5
import net.minecraft.block.material.MapColor;
6
import net.minecraft.block.material.Material;
7
import net.minecraft.block.state.IBlockState;
8
import net.minecraft.entity.Entity;
9
import net.minecraft.item.Item;
10
import net.minecraft.tileentity.TileEntity;
11
import net.minecraft.tileentity.TileEntityEndPortal;
12
import net.minecraft.util.AxisAlignedBB;
13
import net.minecraft.util.BlockPos;
14
import net.minecraft.util.EnumFacing;
15
import net.minecraft.util.EnumParticleTypes;
16
import net.minecraft.world.IBlockAccess;
17
import net.minecraft.world.World;
18
19
public class BlockEndPortal extends BlockContainer
20
{
21
    protected BlockEndPortal(Material materialIn)
22
    {
23
        super(materialIn);
24
        this.setLightLevel(1.0F);
25
    }
26
27
    /**
28
     * Returns a new instance of a block's tile entity class. Called on placing the block.
29
     */
30
    public TileEntity createNewTileEntity(World worldIn, int meta)
31
    {
32
        return new TileEntityEndPortal();
33
    }
34
35
    public void setBlockBoundsBasedOnState(IBlockAccess worldIn, BlockPos pos)
36
    {
37
        float f = 0.0625F;
38
        this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, f, 1.0F);
39
    }
40
41
    public boolean shouldSideBeRendered(IBlockAccess worldIn, BlockPos pos, EnumFacing side)
42
    {
43
        return side == EnumFacing.DOWN ? super.shouldSideBeRendered(worldIn, pos, side) : false;
44
    }
45
46
    /**
47
     * Add all collision boxes of this Block to the list that intersect with the given mask.
48
     */
49
    public void addCollisionBoxesToList(World worldIn, BlockPos pos, IBlockState state, AxisAlignedBB mask, List<AxisAlignedBB> list, Entity collidingEntity)
50
    {
51
    }
52
53
    /**
54
     * Used to determine ambient occlusion and culling when rebuilding chunks for render
55
     */
56
    public boolean isOpaqueCube()
57
    {
58
        return false;
59
    }
60
61
    public boolean isFullCube()
62
    {
63
        return false;
64
    }
65
66
    /**
67
     * Returns the quantity of items to drop on block destruction.
68
     */
69
    public int quantityDropped(Random random)
70
    {
71
        return 0;
72
    }
73
74
    /**
75
     * Called When an Entity Collided with the Block
76
     */
77
    public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn)
78
    {
79
        if (entityIn.ridingEntity == null && entityIn.riddenByEntity == null && !worldIn.isRemote)
80
        {
81
            entityIn.travelToDimension(1);
82
        }
83
    }
84
85
    public void randomDisplayTick(World worldIn, BlockPos pos, IBlockState state, Random rand)
86
    {
87
        double d0 = (double)((float)pos.getX() + rand.nextFloat());
88
        double d1 = (double)((float)pos.getY() + 0.8F);
89
        double d2 = (double)((float)pos.getZ() + rand.nextFloat());
90
        double d3 = 0.0D;
91
        double d4 = 0.0D;
92
        double d5 = 0.0D;
93
        worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0, d1, d2, d3, d4, d5, new int[0]);
94
    }
95
96
    public Item getItem(World worldIn, BlockPos pos)
97
    {
98
        return null;
99
    }
100
101
    /**
102
     * Get the MapColor for this Block and the given BlockState
103
     */
104
    public MapColor getMapColor(IBlockState state)
105
    {
106
        return MapColor.blackColor;
107
    }
108
}
109

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