base mod created
This commit is contained in:
136
build/tmp/recompileMc/sources/net/minecraft/block/BlockSign.java
Normal file
136
build/tmp/recompileMc/sources/net/minecraft/block/BlockSign.java
Normal file
@@ -0,0 +1,136 @@
|
||||
package net.minecraft.block;
|
||||
|
||||
import java.util.Random;
|
||||
import javax.annotation.Nullable;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.BlockFaceShape;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntitySign;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockSign extends BlockContainer
|
||||
{
|
||||
protected static final AxisAlignedBB SIGN_AABB = new AxisAlignedBB(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D);
|
||||
|
||||
protected BlockSign()
|
||||
{
|
||||
super(Material.WOOD);
|
||||
}
|
||||
|
||||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos)
|
||||
{
|
||||
return SIGN_AABB;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public AxisAlignedBB getCollisionBoundingBox(IBlockState blockState, IBlockAccess worldIn, BlockPos pos)
|
||||
{
|
||||
return NULL_AABB;
|
||||
}
|
||||
|
||||
public boolean isFullCube(IBlockState state)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean hasCustomBreakingProgress(IBlockState state)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines if an entity can path through this block
|
||||
*/
|
||||
public boolean isPassable(IBlockAccess worldIn, BlockPos pos)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Used to determine ambient occlusion and culling when rebuilding chunks for render
|
||||
*/
|
||||
public boolean isOpaqueCube(IBlockState state)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if an entity can be spawned inside the block (used to get the player's bed spawn location)
|
||||
*/
|
||||
public boolean canSpawnInBlock()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new instance of a block's tile entity class. Called on placing the block.
|
||||
*/
|
||||
public TileEntity createNewTileEntity(World worldIn, int meta)
|
||||
{
|
||||
return new TileEntitySign();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Item that this Block should drop when harvested.
|
||||
*/
|
||||
public Item getItemDropped(IBlockState state, Random rand, int fortune)
|
||||
{
|
||||
return Items.SIGN;
|
||||
}
|
||||
|
||||
public ItemStack getItem(World worldIn, BlockPos pos, IBlockState state)
|
||||
{
|
||||
return new ItemStack(Items.SIGN);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when the block is right clicked by a player.
|
||||
*/
|
||||
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if (worldIn.isRemote)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
TileEntity tileentity = worldIn.getTileEntity(pos);
|
||||
return tileentity instanceof TileEntitySign ? ((TileEntitySign)tileentity).executeCommand(playerIn) : false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if this block can be placed exactly at the given position.
|
||||
*/
|
||||
public boolean canPlaceBlockAt(World worldIn, BlockPos pos)
|
||||
{
|
||||
return !this.hasInvalidNeighbor(worldIn, pos) && super.canPlaceBlockAt(worldIn, pos);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the geometry of the queried face at the given position and state. This is used to decide whether things like
|
||||
* buttons are allowed to be placed on the face, or how glass panes connect to the face, among other things.
|
||||
* <p>
|
||||
* Common values are {@code SOLID}, which is the default, and {@code UNDEFINED}, which represents something that
|
||||
* does not fit the other descriptions and will generally cause other things not to connect to the face.
|
||||
*
|
||||
* @return an approximation of the form of the given face
|
||||
*/
|
||||
public BlockFaceShape getBlockFaceShape(IBlockAccess worldIn, IBlockState state, BlockPos pos, EnumFacing face)
|
||||
{
|
||||
return BlockFaceShape.UNDEFINED;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user