block base class cleanup
This commit is contained in:
parent
346937ba4a
commit
828d215048
161 changed files with 1832 additions and 2044 deletions
|
@ -111,7 +111,7 @@ public class EntityAIControlledByPlayer extends EntityAIBase
|
|||
|
||||
if (this.thisEntity.onGround)
|
||||
{
|
||||
f2 = this.thisEntity.worldObj.getState(new BlockPos(ExtMath.floorf((float)i), ExtMath.floorf((float)j) - 1, ExtMath.floorf((float)k))).getBlock().slipperiness * 0.91F;
|
||||
f2 = this.thisEntity.worldObj.getState(new BlockPos(ExtMath.floorf((float)i), ExtMath.floorf((float)j) - 1, ExtMath.floorf((float)k))).getBlock().getSlipperiness() * 0.91F;
|
||||
}
|
||||
|
||||
float f3 = 0.16277136F / (f2 * f2 * f2);
|
||||
|
|
|
@ -77,7 +77,7 @@ public class EntityAITakePlace extends EntityAIBase
|
|||
Block replace = world.getState(blockpos).getBlock();
|
||||
Block below = world.getState(blockpos.down()).getBlock();
|
||||
State state = PLACEABLE.get(this.entity.getHeldItem().getItem());
|
||||
if (state.getBlock().canPlaceBlockAt(world, blockpos) && replace == Blocks.air &&
|
||||
if (state.getBlock().canPlace(world, blockpos) && replace == Blocks.air &&
|
||||
below != Blocks.air && below.isFullCube())
|
||||
{
|
||||
this.entity.getLookHelper().setLookPosition((double)i + 0.5, (double)j + 0.5, (double)k + 0.5, 10.0F,
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -15,7 +15,7 @@ public final class BlockAir extends Block {
|
|||
return -1;
|
||||
}
|
||||
|
||||
public BoundingBox getCollisionBoundingBox(World world, BlockPos pos, State state) {
|
||||
public BoundingBox getCollisionBox(World world, BlockPos pos, State state) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -23,14 +23,14 @@ public final class BlockAir extends Block {
|
|||
return false;
|
||||
}
|
||||
|
||||
public boolean canCollideCheck(State state, boolean liquid) {
|
||||
public boolean canRayTrace(State state, boolean liquid) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void dropBlockAsItemWithChance(World world, BlockPos pos, State state, float chance, int fortune) {
|
||||
public void drop(World world, BlockPos pos, State state, float chance, int fortune) {
|
||||
}
|
||||
|
||||
public boolean isReplaceable(World world, BlockPos pos) {
|
||||
public boolean canReplace(World world, BlockPos pos) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -22,15 +22,15 @@ public class BlockFalling extends Block {
|
|||
super(material);
|
||||
}
|
||||
|
||||
public void onBlockAdded(AWorldServer world, BlockPos pos, State state) {
|
||||
public void onAdded(AWorldServer world, BlockPos pos, State state) {
|
||||
world.scheduleUpdate(pos, this, this.tickRate(world, pos));
|
||||
}
|
||||
|
||||
public void onNeighborBlockChange(World world, BlockPos pos, State state, Block neighbor) {
|
||||
public void onUpdate(World world, BlockPos pos, State state, Block neighbor) {
|
||||
world.scheduleUpdate(pos, this, this.tickRate(world, pos));
|
||||
}
|
||||
|
||||
public void updateTick(AWorldServer world, BlockPos pos, State state, Random rand) {
|
||||
public void tick(AWorldServer world, BlockPos pos, State state, Random rand) {
|
||||
if(Vars.blockGravity)
|
||||
this.checkFallable(world, pos);
|
||||
}
|
||||
|
|
|
@ -19,9 +19,9 @@ public class BlockTranslucent extends Block {
|
|||
return BlockLayer.TRANSLUCENT;
|
||||
}
|
||||
|
||||
public boolean shouldSideBeRendered(IWorldAccess world, BlockPos pos, Facing side) {
|
||||
public boolean canRender(IWorldAccess world, BlockPos pos, Facing side) {
|
||||
State state = world.getState(pos);
|
||||
Block block = state.getBlock();
|
||||
return block != this && super.shouldSideBeRendered(world, pos, side);
|
||||
return block != this && super.canRender(world, pos, side);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -60,7 +60,7 @@ public class BlockBed extends Block implements Rotatable {
|
|||
this.setBedBounds();
|
||||
}
|
||||
|
||||
public boolean onBlockActivated(World world, BlockPos pos, State state, EntityNPC player, Facing side,
|
||||
public boolean onUse(World world, BlockPos pos, State state, EntityNPC player, Facing side,
|
||||
float hitX, float hitY, float hitZ) {
|
||||
if(world.client)
|
||||
return true;
|
||||
|
@ -98,11 +98,11 @@ public class BlockBed extends Block implements Rotatable {
|
|||
return false;
|
||||
}
|
||||
|
||||
public void setBlockBoundsBasedOnState(IWorldAccess worldIn, BlockPos pos) {
|
||||
public void setBlockBounds(IWorldAccess worldIn, BlockPos pos) {
|
||||
this.setBedBounds();
|
||||
}
|
||||
|
||||
public void onNeighborBlockChange(World worldIn, BlockPos pos, State state, Block neighborBlock) {
|
||||
public void onUpdate(World worldIn, BlockPos pos, State state, Block neighborBlock) {
|
||||
Facing enumfacing = (Facing)state.getValue(FACING);
|
||||
if(state.getValue(PART) == BlockBed.EnumPartType.HEAD) {
|
||||
if(worldIn.getState(pos.offset(enumfacing.getOpposite())).getBlock() != this)
|
||||
|
@ -111,12 +111,12 @@ public class BlockBed extends Block implements Rotatable {
|
|||
else if(worldIn.getState(pos.offset(enumfacing)).getBlock() != this) {
|
||||
worldIn.setBlockToAir(pos);
|
||||
if(!worldIn.client)
|
||||
this.dropBlockAsItem(worldIn, pos, state, 0);
|
||||
this.drop(worldIn, pos, state, 0);
|
||||
}
|
||||
}
|
||||
|
||||
public Item getItemDropped(State state, Random rand, int fortune) {
|
||||
return state.getValue(PART) == BlockBed.EnumPartType.HEAD ? null : super.getItemDropped(state, rand, fortune);
|
||||
public Item getDrop(State state, Random rand, int fortune) {
|
||||
return state.getValue(PART) == BlockBed.EnumPartType.HEAD ? null : super.getDrop(state, rand, fortune);
|
||||
}
|
||||
|
||||
private void setBedBounds() {
|
||||
|
@ -158,9 +158,9 @@ public class BlockBed extends Block implements Rotatable {
|
|||
&& !worldIn.getState(pos.up()).getBlock().getMaterial().isSolid();
|
||||
}
|
||||
|
||||
public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, State state, float chance, int fortune) {
|
||||
public void drop(World worldIn, BlockPos pos, State state, float chance, int fortune) {
|
||||
if(state.getValue(PART) == BlockBed.EnumPartType.FOOT)
|
||||
super.dropBlockAsItemWithChance(worldIn, pos, state, chance, 0);
|
||||
super.drop(worldIn, pos, state, chance, 0);
|
||||
}
|
||||
|
||||
public int getMobilityFlag() {
|
||||
|
@ -202,7 +202,7 @@ public class BlockBed extends Block implements Rotatable {
|
|||
return this.getState().withProperty(PART, EnumPartType.HEAD).withProperty(FACING, Facing.NORTH);
|
||||
}
|
||||
|
||||
public StackSize getMaxStackSize() {
|
||||
public StackSize getMaxAmount() {
|
||||
return StackSize.S;
|
||||
}
|
||||
|
||||
|
@ -220,7 +220,7 @@ public class BlockBed extends Block implements Rotatable {
|
|||
{
|
||||
State iblockstate = worldIn.getState(pos);
|
||||
Block block = iblockstate.getBlock();
|
||||
boolean flag = block.isReplaceable(worldIn, pos);
|
||||
boolean flag = block.canReplace(worldIn, pos);
|
||||
|
||||
if (!flag)
|
||||
{
|
||||
|
@ -233,7 +233,7 @@ public class BlockBed extends Block implements Rotatable {
|
|||
|
||||
if (playerIn.canPlayerEdit(pos, side, stack) && playerIn.canPlayerEdit(blockpos, side, stack))
|
||||
{
|
||||
boolean flag1 = worldIn.getState(blockpos).getBlock().isReplaceable(worldIn, blockpos);
|
||||
boolean flag1 = worldIn.getState(blockpos).getBlock().canReplace(worldIn, blockpos);
|
||||
boolean flag2 = flag || worldIn.isAirBlock(pos);
|
||||
boolean flag3 = flag1 || worldIn.isAirBlock(blockpos);
|
||||
|
||||
|
@ -262,7 +262,7 @@ public class BlockBed extends Block implements Rotatable {
|
|||
}
|
||||
}
|
||||
|
||||
public boolean canPlace(World worldIn, BlockPos pos, Facing side, EntityNPC player, ItemStack stack)
|
||||
public boolean checkPlace(World worldIn, BlockPos pos, Facing side, EntityNPC player, ItemStack stack)
|
||||
{
|
||||
return side == Facing.UP;
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ public class BlockBookshelf extends Block
|
|||
/**
|
||||
* Returns the quantity of items to drop on block destruction.
|
||||
*/
|
||||
protected int quantityDropped(Random random)
|
||||
protected int getDropAmount(Random random)
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ public class BlockBookshelf extends Block
|
|||
/**
|
||||
* Get the Item that this Block should drop when harvested.
|
||||
*/
|
||||
public Item getItemDropped(State state, Random rand, int fortune)
|
||||
public Item getDrop(State state, Random rand, int fortune)
|
||||
{
|
||||
return Items.book;
|
||||
}
|
||||
|
|
|
@ -94,7 +94,7 @@ public class BlockCake extends Block
|
|||
// this.setTickRandomly(true);
|
||||
}
|
||||
|
||||
public void setBlockBoundsBasedOnState(IWorldAccess worldIn, BlockPos pos)
|
||||
public void setBlockBounds(IWorldAccess worldIn, BlockPos pos)
|
||||
{
|
||||
float f = 0.0625F;
|
||||
float f1 = (float)(1 + ((Integer)worldIn.getState(pos).getValue(BITES)).intValue() * 2) / 16.0F;
|
||||
|
@ -105,14 +105,14 @@ public class BlockCake extends Block
|
|||
/**
|
||||
* Sets the block's bounds for rendering it as an item
|
||||
*/
|
||||
public void setBlockBoundsForItemRender()
|
||||
public void setItemBounds()
|
||||
{
|
||||
float f = 0.0625F;
|
||||
float f1 = 0.5F;
|
||||
this.setBlockBounds(f, 0.0F, f, 1.0F - f, f1, 1.0F - f);
|
||||
}
|
||||
|
||||
public BoundingBox getCollisionBoundingBox(World worldIn, BlockPos pos, State state)
|
||||
public BoundingBox getCollisionBox(World worldIn, BlockPos pos, State state)
|
||||
{
|
||||
float f = 0.0625F;
|
||||
float f1 = (float)(1 + ((Integer)state.getValue(BITES)).intValue() * 2) / 16.0F;
|
||||
|
@ -120,9 +120,9 @@ public class BlockCake extends Block
|
|||
return new BoundingBox((double)((float)pos.getX() + f1), (double)pos.getY(), (double)((float)pos.getZ() + f), (double)((float)(pos.getX() + 1) - f), (double)((float)pos.getY() + f2), (double)((float)(pos.getZ() + 1) - f));
|
||||
}
|
||||
|
||||
public BoundingBox getSelectedBoundingBox(World worldIn, BlockPos pos)
|
||||
public BoundingBox getSelectionBox(World worldIn, BlockPos pos)
|
||||
{
|
||||
return this.getCollisionBoundingBox(worldIn, pos, worldIn.getState(pos));
|
||||
return this.getCollisionBox(worldIn, pos, worldIn.getState(pos));
|
||||
}
|
||||
|
||||
public boolean isFullCube()
|
||||
|
@ -138,13 +138,13 @@ public class BlockCake extends Block
|
|||
return false;
|
||||
}
|
||||
|
||||
public boolean onBlockActivated(World worldIn, BlockPos pos, State state, EntityNPC playerIn, Facing side, float hitX, float hitY, float hitZ)
|
||||
public boolean onUse(World worldIn, BlockPos pos, State state, EntityNPC playerIn, Facing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
this.eatCake(worldIn, pos, state, playerIn);
|
||||
return true;
|
||||
}
|
||||
|
||||
public void onBlockClicked(World worldIn, BlockPos pos, EntityNPC playerIn)
|
||||
public void onStartBreak(World worldIn, BlockPos pos, EntityNPC playerIn)
|
||||
{
|
||||
this.eatCake(worldIn, pos, worldIn.getState(pos), playerIn);
|
||||
}
|
||||
|
@ -164,15 +164,15 @@ public class BlockCake extends Block
|
|||
}
|
||||
}
|
||||
|
||||
public boolean canPlaceBlockAt(World worldIn, BlockPos pos)
|
||||
public boolean canPlace(World worldIn, BlockPos pos)
|
||||
{
|
||||
return super.canPlaceBlockAt(worldIn, pos) ? this.canBlockStay(worldIn, pos) : false;
|
||||
return super.canPlace(worldIn, pos) ? this.canBlockStay(worldIn, pos) : false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a neighboring block changes.
|
||||
*/
|
||||
public void onNeighborBlockChange(World worldIn, BlockPos pos, State state, Block neighborBlock)
|
||||
public void onUpdate(World worldIn, BlockPos pos, State state, Block neighborBlock)
|
||||
{
|
||||
if (!this.canBlockStay(worldIn, pos))
|
||||
{
|
||||
|
@ -188,7 +188,7 @@ public class BlockCake extends Block
|
|||
/**
|
||||
* Returns the quantity of items to drop on block destruction.
|
||||
*/
|
||||
protected int quantityDropped(Random random)
|
||||
protected int getDropAmount(Random random)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
@ -196,7 +196,7 @@ public class BlockCake extends Block
|
|||
/**
|
||||
* Get the Item that this Block should drop when harvested.
|
||||
*/
|
||||
public Item getItemDropped(State state, Random rand, int fortune)
|
||||
public Item getDrop(State state, Random rand, int fortune)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -54,12 +54,12 @@ public class BlockCarpet extends Block
|
|||
/**
|
||||
* Sets the block's bounds for rendering it as an item
|
||||
*/
|
||||
public void setBlockBoundsForItemRender()
|
||||
public void setItemBounds()
|
||||
{
|
||||
this.setBlockBoundsFromMeta();
|
||||
}
|
||||
|
||||
public void setBlockBoundsBasedOnState(IWorldAccess worldIn, BlockPos pos)
|
||||
public void setBlockBounds(IWorldAccess worldIn, BlockPos pos)
|
||||
{
|
||||
this.setBlockBoundsFromMeta();
|
||||
}
|
||||
|
@ -71,15 +71,15 @@ public class BlockCarpet extends Block
|
|||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, f, 1.0F);
|
||||
}
|
||||
|
||||
public boolean canPlaceBlockAt(World worldIn, BlockPos pos)
|
||||
public boolean canPlace(World worldIn, BlockPos pos)
|
||||
{
|
||||
return super.canPlaceBlockAt(worldIn, pos) && this.canBlockStay(worldIn, pos);
|
||||
return super.canPlace(worldIn, pos) && this.canBlockStay(worldIn, pos);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a neighboring block changes.
|
||||
*/
|
||||
public void onNeighborBlockChange(World worldIn, BlockPos pos, State state, Block neighborBlock)
|
||||
public void onUpdate(World worldIn, BlockPos pos, State state, Block neighborBlock)
|
||||
{
|
||||
this.checkForDrop(worldIn, pos, state);
|
||||
}
|
||||
|
@ -88,7 +88,7 @@ public class BlockCarpet extends Block
|
|||
{
|
||||
if (!this.canBlockStay(worldIn, pos))
|
||||
{
|
||||
this.dropBlockAsItem(worldIn, pos, state, 0);
|
||||
this.drop(worldIn, pos, state, 0);
|
||||
worldIn.setBlockToAir(pos);
|
||||
return false;
|
||||
}
|
||||
|
@ -103,9 +103,9 @@ public class BlockCarpet extends Block
|
|||
return !worldIn.isAirBlock(pos.down());
|
||||
}
|
||||
|
||||
public boolean shouldSideBeRendered(IWorldAccess worldIn, BlockPos pos, Facing side)
|
||||
public boolean canRender(IWorldAccess worldIn, BlockPos pos, Facing side)
|
||||
{
|
||||
return side == Facing.UP ? true : super.shouldSideBeRendered(worldIn, pos, side);
|
||||
return side == Facing.UP ? true : super.canRender(worldIn, pos, side);
|
||||
}
|
||||
|
||||
public Model getModel(ModelProvider provider, String name, State state) {
|
||||
|
|
|
@ -93,17 +93,17 @@ public class BlockDoor extends Block implements Rotatable {
|
|||
return false;
|
||||
}
|
||||
|
||||
public BoundingBox getSelectedBoundingBox(World world, BlockPos pos) {
|
||||
this.setBlockBoundsBasedOnState(world, pos);
|
||||
return super.getSelectedBoundingBox(world, pos);
|
||||
public BoundingBox getSelectionBox(World world, BlockPos pos) {
|
||||
this.setBlockBounds(world, pos);
|
||||
return super.getSelectionBox(world, pos);
|
||||
}
|
||||
|
||||
public BoundingBox getCollisionBoundingBox(World world, BlockPos pos, State state) {
|
||||
this.setBlockBoundsBasedOnState(world, pos);
|
||||
return super.getCollisionBoundingBox(world, pos, state);
|
||||
public BoundingBox getCollisionBox(World world, BlockPos pos, State state) {
|
||||
this.setBlockBounds(world, pos);
|
||||
return super.getCollisionBox(world, pos, state);
|
||||
}
|
||||
|
||||
public void setBlockBoundsBasedOnState(IWorldAccess world, BlockPos pos) {
|
||||
public void setBlockBounds(IWorldAccess world, BlockPos pos) {
|
||||
float thick = 0.1875F;
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 2.0F, 1.0F);
|
||||
State state = world.getState(pos);
|
||||
|
@ -159,7 +159,7 @@ public class BlockDoor extends Block implements Rotatable {
|
|||
}
|
||||
}
|
||||
|
||||
public boolean onBlockActivated(World world, BlockPos pos, State state, EntityNPC player, Facing side, float hitX, float hitY, float hitZ) {
|
||||
public boolean onUse(World world, BlockPos pos, State state, EntityNPC player, Facing side, float hitX, float hitY, float hitZ) {
|
||||
if(this.keyItem != null && (player.getHeldItem() == null || player.getHeldItem().getItem() != this.keyItem))
|
||||
return true;
|
||||
BlockPos lower = state.getValue(HALF) == EnumDoorHalf.LOWER ? pos : pos.down();
|
||||
|
@ -192,7 +192,7 @@ public class BlockDoor extends Block implements Rotatable {
|
|||
}
|
||||
}
|
||||
|
||||
public void onNeighborBlockChange(World world, BlockPos pos, State state, Block neighbor) {
|
||||
public void onUpdate(World world, BlockPos pos, State state, Block neighbor) {
|
||||
if(state.getValue(HALF) == EnumDoorHalf.UPPER) {
|
||||
BlockPos lower = pos.down();
|
||||
State bottom = world.getState(lower);
|
||||
|
@ -201,7 +201,7 @@ public class BlockDoor extends Block implements Rotatable {
|
|||
world.setBlockToAir(pos);
|
||||
}
|
||||
else if(neighbor != this) {
|
||||
this.onNeighborBlockChange(world, lower, bottom, neighbor);
|
||||
this.onUpdate(world, lower, bottom, neighbor);
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
@ -225,23 +225,23 @@ public class BlockDoor extends Block implements Rotatable {
|
|||
|
||||
if(wrong) {
|
||||
if(!world.client) {
|
||||
this.dropBlockAsItem(world, pos, state, 0);
|
||||
this.drop(world, pos, state, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Item getItemDropped(State state, Random rand, int fortune) {
|
||||
return state.getValue(HALF) == EnumDoorHalf.UPPER ? null : super.getItemDropped(state, rand, fortune);
|
||||
public Item getDrop(State state, Random rand, int fortune) {
|
||||
return state.getValue(HALF) == EnumDoorHalf.UPPER ? null : super.getDrop(state, rand, fortune);
|
||||
}
|
||||
|
||||
public HitPosition collisionRayTrace(World world, BlockPos pos, Vec3 start, Vec3 end) {
|
||||
this.setBlockBoundsBasedOnState(world, pos);
|
||||
return super.collisionRayTrace(world, pos, start, end);
|
||||
public HitPosition rayTrace(World world, BlockPos pos, Vec3 start, Vec3 end) {
|
||||
this.setBlockBounds(world, pos);
|
||||
return super.rayTrace(world, pos, start, end);
|
||||
}
|
||||
|
||||
public boolean canPlaceBlockAt(World world, BlockPos pos) {
|
||||
return pos.getY() < World.MAX_SIZE_Y - 1 && world.isBlockSolid(pos.down()) && super.canPlaceBlockAt(world, pos) && super.canPlaceBlockAt(world, pos.up());
|
||||
public boolean canPlace(World world, BlockPos pos) {
|
||||
return pos.getY() < World.MAX_SIZE_Y - 1 && world.isBlockSolid(pos.down()) && super.canPlace(world, pos) && super.canPlace(world, pos.up());
|
||||
}
|
||||
|
||||
public int getMobilityFlag() {
|
||||
|
@ -297,7 +297,7 @@ public class BlockDoor extends Block implements Rotatable {
|
|||
return this == Blocks.iron_door;
|
||||
}
|
||||
|
||||
public StackSize getMaxStackSize() {
|
||||
public StackSize getMaxAmount() {
|
||||
return StackSize.S;
|
||||
}
|
||||
|
||||
|
@ -312,7 +312,7 @@ public class BlockDoor extends Block implements Rotatable {
|
|||
State iblockstate = worldIn.getState(pos);
|
||||
Block block = iblockstate.getBlock();
|
||||
|
||||
if (!block.isReplaceable(worldIn, pos))
|
||||
if (!block.canReplace(worldIn, pos))
|
||||
{
|
||||
pos = pos.offset(side);
|
||||
}
|
||||
|
@ -321,7 +321,7 @@ public class BlockDoor extends Block implements Rotatable {
|
|||
{
|
||||
return false;
|
||||
}
|
||||
else if (!this.canPlaceBlockAt(worldIn, pos))
|
||||
else if (!this.canPlace(worldIn, pos))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -334,7 +334,7 @@ public class BlockDoor extends Block implements Rotatable {
|
|||
}
|
||||
}
|
||||
|
||||
public boolean canPlace(World worldIn, BlockPos pos, Facing side, EntityNPC player, ItemStack stack)
|
||||
public boolean checkPlace(World worldIn, BlockPos pos, Facing side, EntityNPC player, ItemStack stack)
|
||||
{
|
||||
return side == Facing.UP;
|
||||
}
|
||||
|
|
|
@ -85,7 +85,7 @@ public class BlockDragonEgg extends Block
|
|||
this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 1.0F, 0.9375F);
|
||||
}
|
||||
|
||||
public void onBlockAdded(AWorldServer worldIn, BlockPos pos, State state)
|
||||
public void onAdded(AWorldServer worldIn, BlockPos pos, State state)
|
||||
{
|
||||
worldIn.scheduleUpdate(pos, this, this.tickRate(worldIn, pos));
|
||||
}
|
||||
|
@ -93,12 +93,12 @@ public class BlockDragonEgg extends Block
|
|||
/**
|
||||
* Called when a neighboring block changes.
|
||||
*/
|
||||
public void onNeighborBlockChange(World worldIn, BlockPos pos, State state, Block neighborBlock)
|
||||
public void onUpdate(World worldIn, BlockPos pos, State state, Block neighborBlock)
|
||||
{
|
||||
worldIn.scheduleUpdate(pos, this, this.tickRate(worldIn, pos));
|
||||
}
|
||||
|
||||
public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
|
||||
public void tick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
|
||||
{
|
||||
if(Vars.blockGravity)
|
||||
this.checkFall(worldIn, pos);
|
||||
|
@ -128,13 +128,13 @@ public class BlockDragonEgg extends Block
|
|||
}
|
||||
}
|
||||
|
||||
public boolean onBlockActivated(World worldIn, BlockPos pos, State state, EntityNPC playerIn, Facing side, float hitX, float hitY, float hitZ)
|
||||
public boolean onUse(World worldIn, BlockPos pos, State state, EntityNPC playerIn, Facing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
this.teleport(worldIn, pos);
|
||||
return true;
|
||||
}
|
||||
|
||||
public void onBlockClicked(World worldIn, BlockPos pos, EntityNPC playerIn)
|
||||
public void onStartBreak(World worldIn, BlockPos pos, EntityNPC playerIn)
|
||||
{
|
||||
this.teleport(worldIn, pos);
|
||||
}
|
||||
|
@ -202,7 +202,7 @@ public class BlockDragonEgg extends Block
|
|||
return false;
|
||||
}
|
||||
|
||||
public boolean shouldSideBeRendered(IWorldAccess worldIn, BlockPos pos, Facing side)
|
||||
public boolean canRender(IWorldAccess worldIn, BlockPos pos, Facing side)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -53,7 +53,7 @@ public class BlockFence extends Block
|
|||
/**
|
||||
* Add all collision boxes of this Block to the list that intersect with the given mask.
|
||||
*/
|
||||
public void addCollisionBoxesToList(World worldIn, BlockPos pos, State state, BoundingBox mask, List<BoundingBox> list, Entity collidingEntity)
|
||||
public void getCollisionBoxes(World worldIn, BlockPos pos, State state, BoundingBox mask, List<BoundingBox> list, Entity collidingEntity)
|
||||
{
|
||||
boolean flag = this.canConnectTo(worldIn, pos.north());
|
||||
boolean flag1 = this.canConnectTo(worldIn, pos.south());
|
||||
|
@ -77,7 +77,7 @@ public class BlockFence extends Block
|
|||
if (flag || flag1)
|
||||
{
|
||||
this.setBlockBounds(f, 0.0F, f2, f1, 1.5F, f3);
|
||||
super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity);
|
||||
super.getCollisionBoxes(worldIn, pos, state, mask, list, collidingEntity);
|
||||
}
|
||||
|
||||
f2 = 0.375F;
|
||||
|
@ -96,7 +96,7 @@ public class BlockFence extends Block
|
|||
if (flag2 || flag3 || !flag && !flag1)
|
||||
{
|
||||
this.setBlockBounds(f, 0.0F, f2, f1, 1.5F, f3);
|
||||
super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity);
|
||||
super.getCollisionBoxes(worldIn, pos, state, mask, list, collidingEntity);
|
||||
}
|
||||
|
||||
if (flag)
|
||||
|
@ -112,7 +112,7 @@ public class BlockFence extends Block
|
|||
this.setBlockBounds(f, 0.0F, f2, f1, 1.0F, f3);
|
||||
}
|
||||
|
||||
public void setBlockBoundsBasedOnState(IWorldAccess worldIn, BlockPos pos)
|
||||
public void setBlockBounds(IWorldAccess worldIn, BlockPos pos)
|
||||
{
|
||||
boolean flag = this.canConnectTo(worldIn, pos.north());
|
||||
boolean flag1 = this.canConnectTo(worldIn, pos.south());
|
||||
|
@ -170,12 +170,12 @@ public class BlockFence extends Block
|
|||
return ((!(block instanceof BlockFence) || block.getMaterial() != this.material) && !(block instanceof BlockFenceGate) ? (block.getMaterial().isOpaque() && block.isFullCube() ? block.getMaterial() != Material.SOFT : false) : true);
|
||||
}
|
||||
|
||||
public boolean shouldSideBeRendered(IWorldAccess worldIn, BlockPos pos, Facing side)
|
||||
public boolean canRender(IWorldAccess worldIn, BlockPos pos, Facing side)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean onBlockActivated(World worldIn, BlockPos pos, State state, EntityNPC playerIn, Facing side, float hitX, float hitY, float hitZ)
|
||||
public boolean onUse(World worldIn, BlockPos pos, State state, EntityNPC playerIn, Facing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
return worldIn.client ? true : ItemLead.attachToFence(playerIn, worldIn, pos);
|
||||
}
|
||||
|
@ -184,7 +184,7 @@ public class BlockFence extends Block
|
|||
* Get the actual Block state of this Block at the given position. This applies properties not visible in the
|
||||
* metadata, such as fence connections.
|
||||
*/
|
||||
public State getActualState(State state, IWorldAccess worldIn, BlockPos pos)
|
||||
public State getState(State state, IWorldAccess worldIn, BlockPos pos)
|
||||
{
|
||||
return state.withProperty(NORTH, Boolean.valueOf(this.canConnectTo(worldIn, pos.north()))).withProperty(EAST, Boolean.valueOf(this.canConnectTo(worldIn, pos.east()))).withProperty(SOUTH, Boolean.valueOf(this.canConnectTo(worldIn, pos.south()))).withProperty(WEST, Boolean.valueOf(this.canConnectTo(worldIn, pos.west())));
|
||||
}
|
||||
|
@ -377,7 +377,7 @@ public class BlockFence extends Block
|
|||
return this.getState().withProperty(EAST, false).withProperty(WEST, false).withProperty(NORTH, true).withProperty(SOUTH, true);
|
||||
}
|
||||
|
||||
public Property[] getUnsavedProperties() {
|
||||
protected Property[] getUnsavedProperties() {
|
||||
return new Property[] {NORTH, SOUTH, WEST, EAST};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ public class BlockFenceGate extends Block implements Rotatable
|
|||
* Get the actual Block state of this Block at the given position. This applies properties not visible in the
|
||||
* metadata, such as fence connections.
|
||||
*/
|
||||
public State getActualState(State state, IWorldAccess worldIn, BlockPos pos)
|
||||
public State getState(State state, IWorldAccess worldIn, BlockPos pos)
|
||||
{
|
||||
Facing.Axis enumfacing$axis = ((Facing)state.getValue(FACING)).getAxis();
|
||||
|
||||
|
@ -53,12 +53,12 @@ public class BlockFenceGate extends Block implements Rotatable
|
|||
return state;
|
||||
}
|
||||
|
||||
public boolean canPlaceBlockAt(World worldIn, BlockPos pos)
|
||||
public boolean canPlace(World worldIn, BlockPos pos)
|
||||
{
|
||||
return worldIn.getState(pos.down()).getBlock().getMaterial().isSolid() ? super.canPlaceBlockAt(worldIn, pos) : false;
|
||||
return worldIn.getState(pos.down()).getBlock().getMaterial().isSolid() ? super.canPlace(worldIn, pos) : false;
|
||||
}
|
||||
|
||||
public BoundingBox getCollisionBoundingBox(World worldIn, BlockPos pos, State state)
|
||||
public BoundingBox getCollisionBox(World worldIn, BlockPos pos, State state)
|
||||
{
|
||||
if (((Boolean)state.getValue(OPEN)).booleanValue())
|
||||
{
|
||||
|
@ -71,7 +71,7 @@ public class BlockFenceGate extends Block implements Rotatable
|
|||
}
|
||||
}
|
||||
|
||||
public void setBlockBoundsBasedOnState(IWorldAccess worldIn, BlockPos pos)
|
||||
public void setBlockBounds(IWorldAccess worldIn, BlockPos pos)
|
||||
{
|
||||
Facing.Axis enumfacing$axis = ((Facing)worldIn.getState(pos).getValue(FACING)).getAxis();
|
||||
|
||||
|
@ -107,12 +107,12 @@ public class BlockFenceGate extends Block implements Rotatable
|
|||
* Called by ItemBlocks just before a block is actually set in the world, to allow for adjustments to the
|
||||
* IBlockstate
|
||||
*/
|
||||
public State onBlockPlaced(World worldIn, BlockPos pos, Facing facing, float hitX, float hitY, float hitZ, EntityLiving placer)
|
||||
public State getPlacedState(World worldIn, BlockPos pos, Facing facing, float hitX, float hitY, float hitZ, EntityLiving placer)
|
||||
{
|
||||
return this.getState().withProperty(FACING, placer.getHorizontalFacing()).withProperty(OPEN, Boolean.valueOf(false)).withProperty(IN_WALL, Boolean.valueOf(false));
|
||||
}
|
||||
|
||||
public boolean onBlockActivated(World worldIn, BlockPos pos, State state, EntityNPC playerIn, Facing side, float hitX, float hitY, float hitZ)
|
||||
public boolean onUse(World worldIn, BlockPos pos, State state, EntityNPC playerIn, Facing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if (((Boolean)state.getValue(OPEN)).booleanValue())
|
||||
{
|
||||
|
@ -136,7 +136,7 @@ public class BlockFenceGate extends Block implements Rotatable
|
|||
return true;
|
||||
}
|
||||
|
||||
public boolean shouldSideBeRendered(IWorldAccess worldIn, BlockPos pos, Facing side)
|
||||
public boolean canRender(IWorldAccess worldIn, BlockPos pos, Facing side)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -343,7 +343,7 @@ public class BlockFenceGate extends Block implements Rotatable
|
|||
.rotate(ModelRotation.getNorthRot(state.getValue(FACING).getOpposite()));
|
||||
}
|
||||
|
||||
public Property[] getUnsavedProperties() {
|
||||
protected Property[] getUnsavedProperties() {
|
||||
return new Property[] {IN_WALL};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ public class BlockFloorPortal extends Block
|
|||
public BlockFloorPortal(Material materialIn)
|
||||
{
|
||||
super(materialIn);
|
||||
this.setLightLevel(1.0F);
|
||||
this.setLight(1.0F);
|
||||
}
|
||||
|
||||
// /**
|
||||
|
@ -40,7 +40,7 @@ public class BlockFloorPortal extends Block
|
|||
// return new TileEntityPortal();
|
||||
// }
|
||||
|
||||
public void setBlockBoundsBasedOnState(IWorldAccess worldIn, BlockPos pos)
|
||||
public void setBlockBounds(IWorldAccess worldIn, BlockPos pos)
|
||||
{
|
||||
this.setBlockBounds(0.0F, 0.6875F, 0.0F, 1.0F, 0.75F, 1.0F);
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ public class BlockFloorPortal extends Block
|
|||
/**
|
||||
* Add all collision boxes of this Block to the list that intersect with the given mask.
|
||||
*/
|
||||
public void addCollisionBoxesToList(World worldIn, BlockPos pos, State state, BoundingBox mask, List<BoundingBox> list, Entity collidingEntity)
|
||||
public void getCollisionBoxes(World worldIn, BlockPos pos, State state, BoundingBox mask, List<BoundingBox> list, Entity collidingEntity)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -73,7 +73,7 @@ public class BlockFloorPortal extends Block
|
|||
/**
|
||||
* Returns the quantity of items to drop on block destruction.
|
||||
*/
|
||||
protected int quantityDropped(Random random)
|
||||
protected int getDropAmount(Random random)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
@ -81,17 +81,17 @@ public class BlockFloorPortal extends Block
|
|||
/**
|
||||
* Called When an Entity Collided with the Block
|
||||
*/
|
||||
public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, State state, Entity entityIn)
|
||||
public void onCollideUpdate(World worldIn, BlockPos pos, State state, Entity entityIn)
|
||||
{
|
||||
// if (entityIn.ridingEntity == null && entityIn.riddenByEntity == null && !worldIn.client && GameServer.getServer().getAllowEnd())
|
||||
// {
|
||||
// entityIn.travelToDimension(entityIn.dimension == 1 ? 0 : 1, null, 0.0f, 0.0f);
|
||||
// }
|
||||
if(entityIn.getEntityBoundingBox().intersectsWith(this.getCollisionBoundingBox(worldIn, pos, state)))
|
||||
if(entityIn.getEntityBoundingBox().intersectsWith(this.getCollisionBox(worldIn, pos, state)))
|
||||
entityIn.setFlatPortal();
|
||||
}
|
||||
|
||||
public void randomDisplayTick(AWorldClient worldIn, BlockPos pos, State state, Random rand)
|
||||
public void displayTick(AWorldClient worldIn, BlockPos pos, State state, Random rand)
|
||||
{
|
||||
double d0 = (double)((float)pos.getX() + rand.floatv());
|
||||
double d1 = (double)((float)pos.getY() + 0.8F);
|
||||
|
@ -118,7 +118,7 @@ public class BlockFloorPortal extends Block
|
|||
}
|
||||
}
|
||||
|
||||
public void onBlockDestroyedByPlayer(World worldIn, BlockPos pos, State state)
|
||||
public void onBroken(World worldIn, BlockPos pos, State state)
|
||||
{
|
||||
Set<BlockPos> positions = Sets.newHashSet();
|
||||
positions.add(pos);
|
||||
|
|
|
@ -109,14 +109,14 @@ public class BlockFlowerPot extends Block
|
|||
{
|
||||
super(Material.SMALL);
|
||||
this.content = content;
|
||||
this.setBlockBoundsForItemRender();
|
||||
this.setItemBounds();
|
||||
POTS.add(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the block's bounds for rendering it as an item
|
||||
*/
|
||||
public void setBlockBoundsForItemRender()
|
||||
public void setItemBounds()
|
||||
{
|
||||
float f = 0.375F;
|
||||
float f1 = f / 2.0F;
|
||||
|
@ -136,7 +136,7 @@ public class BlockFlowerPot extends Block
|
|||
return false;
|
||||
}
|
||||
|
||||
public boolean onBlockActivated(World worldIn, BlockPos pos, State state, EntityNPC playerIn, Facing side, float hitX, float hitY, float hitZ)
|
||||
public boolean onUse(World worldIn, BlockPos pos, State state, EntityNPC playerIn, Facing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
ItemStack itemstack = playerIn.inventory.getCurrentItem();
|
||||
|
||||
|
@ -177,34 +177,34 @@ public class BlockFlowerPot extends Block
|
|||
}
|
||||
}
|
||||
|
||||
public boolean canPlaceBlockAt(World worldIn, BlockPos pos)
|
||||
public boolean canPlace(World worldIn, BlockPos pos)
|
||||
{
|
||||
return super.canPlaceBlockAt(worldIn, pos) && worldIn.isBlockSolid(pos.down());
|
||||
return super.canPlace(worldIn, pos) && worldIn.isBlockSolid(pos.down());
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a neighboring block changes.
|
||||
*/
|
||||
public void onNeighborBlockChange(World worldIn, BlockPos pos, State state, Block neighborBlock)
|
||||
public void onUpdate(World worldIn, BlockPos pos, State state, Block neighborBlock)
|
||||
{
|
||||
if (!worldIn.isBlockSolid(pos.down()))
|
||||
{
|
||||
this.dropBlockAsItem(worldIn, pos, state, 0);
|
||||
this.drop(worldIn, pos, state, 0);
|
||||
worldIn.setBlockToAir(pos);
|
||||
}
|
||||
}
|
||||
|
||||
public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state)
|
||||
public void onRemoved(AWorldServer worldIn, BlockPos pos, State state)
|
||||
{
|
||||
if(this.content != null)
|
||||
spawnAsEntity(worldIn, pos, new ItemStack(this.content.getItem()));
|
||||
super.onBlockRemoved(worldIn, pos, state);
|
||||
dropItem(worldIn, pos, new ItemStack(this.content.getItem()));
|
||||
super.onRemoved(worldIn, pos, state);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Item that this Block should drop when harvested.
|
||||
*/
|
||||
public Item getItemDropped(State state, Random rand, int fortune)
|
||||
public Item getDrop(State state, Random rand, int fortune)
|
||||
{
|
||||
return Items.flowerpot;
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ public class BlockGlass extends Block {
|
|||
this.setTab(CheatTab.BLOCKS);
|
||||
}
|
||||
|
||||
protected int quantityDropped(Random rand) {
|
||||
protected int getDropAmount(Random rand) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -38,10 +38,10 @@ public class BlockGlass extends Block {
|
|||
return true;
|
||||
}
|
||||
|
||||
public boolean shouldSideBeRendered(IWorldAccess world, BlockPos pos, Facing side) {
|
||||
public boolean canRender(IWorldAccess world, BlockPos pos, Facing side) {
|
||||
State state = world.getState(pos);
|
||||
Block block = state.getBlock();
|
||||
return world.getState(pos.offset(side.getOpposite())) != state || (block != this && super.shouldSideBeRendered(world, pos, side));
|
||||
return world.getState(pos.offset(side.getOpposite())) != state || (block != this && super.canRender(world, pos, side));
|
||||
}
|
||||
|
||||
public boolean onShot(World world, BlockPos pos, State state, Entity projectile) {
|
||||
|
|
|
@ -26,8 +26,8 @@ public class BlockHay extends BlockRotatedPillar
|
|||
return new Property[] {AXIS};
|
||||
}
|
||||
|
||||
public State onBlockPlaced(World worldIn, BlockPos pos, Facing facing, float hitX, float hitY, float hitZ, EntityLiving placer)
|
||||
public State getPlacedState(World worldIn, BlockPos pos, Facing facing, float hitX, float hitY, float hitZ, EntityLiving placer)
|
||||
{
|
||||
return super.onBlockPlaced(worldIn, pos, facing, hitX, hitY, hitZ, placer).withProperty(AXIS, facing.getAxis());
|
||||
return super.getPlacedState(worldIn, pos, facing, hitX, hitY, hitZ, placer).withProperty(AXIS, facing.getAxis());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,22 +25,21 @@ public class BlockLadder extends Block implements Rotatable
|
|||
super(Material.SMALL);
|
||||
this.setDefaultState(this.getBaseState().withProperty(FACING, Facing.NORTH));
|
||||
this.setTab(CheatTab.WOOD);
|
||||
this.setFlatBlockTexture();
|
||||
}
|
||||
|
||||
public BoundingBox getCollisionBoundingBox(World worldIn, BlockPos pos, State state)
|
||||
public BoundingBox getCollisionBox(World worldIn, BlockPos pos, State state)
|
||||
{
|
||||
this.setBlockBoundsBasedOnState(worldIn, pos);
|
||||
return super.getCollisionBoundingBox(worldIn, pos, state);
|
||||
this.setBlockBounds(worldIn, pos);
|
||||
return super.getCollisionBox(worldIn, pos, state);
|
||||
}
|
||||
|
||||
public BoundingBox getSelectedBoundingBox(World worldIn, BlockPos pos)
|
||||
public BoundingBox getSelectionBox(World worldIn, BlockPos pos)
|
||||
{
|
||||
this.setBlockBoundsBasedOnState(worldIn, pos);
|
||||
return super.getSelectedBoundingBox(worldIn, pos);
|
||||
this.setBlockBounds(worldIn, pos);
|
||||
return super.getSelectionBox(worldIn, pos);
|
||||
}
|
||||
|
||||
public void setBlockBoundsBasedOnState(IWorldAccess worldIn, BlockPos pos)
|
||||
public void setBlockBounds(IWorldAccess worldIn, BlockPos pos)
|
||||
{
|
||||
State iblockstate = worldIn.getState(pos);
|
||||
|
||||
|
@ -82,7 +81,7 @@ public class BlockLadder extends Block implements Rotatable
|
|||
return false;
|
||||
}
|
||||
|
||||
public boolean canPlaceBlockAt(World worldIn, BlockPos pos)
|
||||
public boolean canPlace(World worldIn, BlockPos pos)
|
||||
{
|
||||
return worldIn.getState(pos.west()).getBlock().isNormalCube() ? true : (worldIn.getState(pos.east()).getBlock().isNormalCube() ? true : (worldIn.getState(pos.north()).getBlock().isNormalCube() ? true : worldIn.getState(pos.south()).getBlock().isNormalCube()));
|
||||
}
|
||||
|
@ -91,7 +90,7 @@ public class BlockLadder extends Block implements Rotatable
|
|||
* Called by ItemBlocks just before a block is actually set in the world, to allow for adjustments to the
|
||||
* IBlockstate
|
||||
*/
|
||||
public State onBlockPlaced(World worldIn, BlockPos pos, Facing facing, float hitX, float hitY, float hitZ, EntityLiving placer)
|
||||
public State getPlacedState(World worldIn, BlockPos pos, Facing facing, float hitX, float hitY, float hitZ, EntityLiving placer)
|
||||
{
|
||||
if (facing.getAxis().isHorizontal() && this.canBlockStay(worldIn, pos, facing))
|
||||
{
|
||||
|
@ -114,17 +113,17 @@ public class BlockLadder extends Block implements Rotatable
|
|||
/**
|
||||
* Called when a neighboring block changes.
|
||||
*/
|
||||
public void onNeighborBlockChange(World worldIn, BlockPos pos, State state, Block neighborBlock)
|
||||
public void onUpdate(World worldIn, BlockPos pos, State state, Block neighborBlock)
|
||||
{
|
||||
Facing enumfacing = (Facing)state.getValue(FACING);
|
||||
|
||||
if (!this.canBlockStay(worldIn, pos, enumfacing))
|
||||
{
|
||||
this.dropBlockAsItem(worldIn, pos, state, 0);
|
||||
this.drop(worldIn, pos, state, 0);
|
||||
worldIn.setBlockToAir(pos);
|
||||
}
|
||||
|
||||
super.onNeighborBlockChange(worldIn, pos, state, neighborBlock);
|
||||
super.onUpdate(worldIn, pos, state, neighborBlock);
|
||||
}
|
||||
|
||||
protected boolean canBlockStay(World worldIn, BlockPos pos, Facing facing)
|
||||
|
|
|
@ -20,8 +20,8 @@ public class BlockMetalBlock extends Block {
|
|||
public BlockMetalBlock(MetalType metal) {
|
||||
super(Material.SOLID);
|
||||
this.metal = metal;
|
||||
this.setStepSound(SoundType.STONE);
|
||||
this.setLightLevel(metal.radioactivity > 0.0F ? 0.25F : 0.0F);
|
||||
this.setSound(SoundType.STONE);
|
||||
this.setLight(metal.radioactivity > 0.0F ? 0.25F : 0.0F);
|
||||
this.setRadiation(metal.radioactivity * 2.0f);
|
||||
this.setTab(CheatTab.GEMS);
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ public class BlockMetalBlock extends Block {
|
|||
return this.metal.isMagnetic();
|
||||
}
|
||||
|
||||
public void addInformation(ItemStack stack, EntityNPC playerIn, List<String> tooltip)
|
||||
public void getTooltips(ItemStack stack, EntityNPC playerIn, List<String> tooltip)
|
||||
{
|
||||
tooltip.add(this.metal.formatSymbol());
|
||||
if(this.metal.radioactivity > 0.0f) {
|
||||
|
|
|
@ -35,14 +35,13 @@ public class BlockPane extends Block
|
|||
super(materialIn);
|
||||
this.setDefaultState(this.getBaseState().withProperty(NORTH, Boolean.valueOf(false)).withProperty(EAST, Boolean.valueOf(false)).withProperty(SOUTH, Boolean.valueOf(false)).withProperty(WEST, Boolean.valueOf(false)));
|
||||
this.setTab(CheatTab.BLOCKS);
|
||||
this.setFlatBlockTexture();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the actual Block state of this Block at the given position. This applies properties not visible in the
|
||||
* metadata, such as fence connections.
|
||||
*/
|
||||
public State getActualState(State state, IWorldAccess worldIn, BlockPos pos)
|
||||
public State getState(State state, IWorldAccess worldIn, BlockPos pos)
|
||||
{
|
||||
return state.withProperty(NORTH, Boolean.valueOf(this.canPaneConnectToBlock(worldIn.getState(pos.north()).getBlock()))).withProperty(SOUTH, Boolean.valueOf(this.canPaneConnectToBlock(worldIn.getState(pos.south()).getBlock()))).withProperty(WEST, Boolean.valueOf(this.canPaneConnectToBlock(worldIn.getState(pos.west()).getBlock()))).withProperty(EAST, Boolean.valueOf(this.canPaneConnectToBlock(worldIn.getState(pos.east()).getBlock())));
|
||||
}
|
||||
|
@ -50,9 +49,9 @@ public class BlockPane extends Block
|
|||
/**
|
||||
* Get the Item that this Block should drop when harvested.
|
||||
*/
|
||||
public Item getItemDropped(State state, Random rand, int fortune)
|
||||
public Item getDrop(State state, Random rand, int fortune)
|
||||
{
|
||||
return this.material != Material.SOLID ? null : super.getItemDropped(state, rand, fortune);
|
||||
return this.material != Material.SOLID ? null : super.getDrop(state, rand, fortune);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -68,15 +67,15 @@ public class BlockPane extends Block
|
|||
return false;
|
||||
}
|
||||
|
||||
public boolean shouldSideBeRendered(IWorldAccess worldIn, BlockPos pos, Facing side)
|
||||
public boolean canRender(IWorldAccess worldIn, BlockPos pos, Facing side)
|
||||
{
|
||||
return worldIn.getState(pos).getBlock() == this ? false : super.shouldSideBeRendered(worldIn, pos, side);
|
||||
return worldIn.getState(pos).getBlock() == this ? false : super.canRender(worldIn, pos, side);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add all collision boxes of this Block to the list that intersect with the given mask.
|
||||
*/
|
||||
public void addCollisionBoxesToList(World worldIn, BlockPos pos, State state, BoundingBox mask, List<BoundingBox> list, Entity collidingEntity)
|
||||
public void getCollisionBoxes(World worldIn, BlockPos pos, State state, BoundingBox mask, List<BoundingBox> list, Entity collidingEntity)
|
||||
{
|
||||
boolean flag = this.canPaneConnectToBlock(worldIn.getState(pos.north()).getBlock());
|
||||
boolean flag1 = this.canPaneConnectToBlock(worldIn.getState(pos.south()).getBlock());
|
||||
|
@ -88,18 +87,18 @@ public class BlockPane extends Block
|
|||
if (flag2)
|
||||
{
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.4375F, 0.5F, 1.0F, 0.5625F);
|
||||
super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity);
|
||||
super.getCollisionBoxes(worldIn, pos, state, mask, list, collidingEntity);
|
||||
}
|
||||
else if (flag3)
|
||||
{
|
||||
this.setBlockBounds(0.5F, 0.0F, 0.4375F, 1.0F, 1.0F, 0.5625F);
|
||||
super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity);
|
||||
super.getCollisionBoxes(worldIn, pos, state, mask, list, collidingEntity);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.4375F, 1.0F, 1.0F, 0.5625F);
|
||||
super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity);
|
||||
super.getCollisionBoxes(worldIn, pos, state, mask, list, collidingEntity);
|
||||
}
|
||||
|
||||
if ((!flag || !flag1) && (flag2 || flag3 || flag || flag1))
|
||||
|
@ -107,30 +106,30 @@ public class BlockPane extends Block
|
|||
if (flag)
|
||||
{
|
||||
this.setBlockBounds(0.4375F, 0.0F, 0.0F, 0.5625F, 1.0F, 0.5F);
|
||||
super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity);
|
||||
super.getCollisionBoxes(worldIn, pos, state, mask, list, collidingEntity);
|
||||
}
|
||||
else if (flag1)
|
||||
{
|
||||
this.setBlockBounds(0.4375F, 0.0F, 0.5F, 0.5625F, 1.0F, 1.0F);
|
||||
super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity);
|
||||
super.getCollisionBoxes(worldIn, pos, state, mask, list, collidingEntity);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.setBlockBounds(0.4375F, 0.0F, 0.0F, 0.5625F, 1.0F, 1.0F);
|
||||
super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity);
|
||||
super.getCollisionBoxes(worldIn, pos, state, mask, list, collidingEntity);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the block's bounds for rendering it as an item
|
||||
*/
|
||||
public void setBlockBoundsForItemRender()
|
||||
public void setItemBounds()
|
||||
{
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
|
||||
public void setBlockBoundsBasedOnState(IWorldAccess worldIn, BlockPos pos)
|
||||
public void setBlockBounds(IWorldAccess worldIn, BlockPos pos)
|
||||
{
|
||||
float f = 0.4375F;
|
||||
float f1 = 0.5625F;
|
||||
|
@ -491,7 +490,7 @@ public class BlockPane extends Block
|
|||
}
|
||||
}
|
||||
|
||||
public Property[] getUnsavedProperties() {
|
||||
protected Property[] getUnsavedProperties() {
|
||||
return new Property[] {NORTH, SOUTH, WEST, EAST};
|
||||
}
|
||||
|
||||
|
|
|
@ -64,12 +64,12 @@ public class BlockPortal extends Block
|
|||
// }
|
||||
// }
|
||||
|
||||
public BoundingBox getCollisionBoundingBox(World worldIn, BlockPos pos, State state)
|
||||
public BoundingBox getCollisionBox(World worldIn, BlockPos pos, State state)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public void setBlockBoundsBasedOnState(IWorldAccess worldIn, BlockPos pos)
|
||||
public void setBlockBounds(IWorldAccess worldIn, BlockPos pos)
|
||||
{
|
||||
Facing.Axis enumfacing$axis = (Facing.Axis)worldIn.getState(pos).getValue(AXIS);
|
||||
float f = 0.125F;
|
||||
|
@ -134,7 +134,7 @@ public class BlockPortal extends Block
|
|||
/**
|
||||
* Called when a neighboring block changes.
|
||||
*/
|
||||
public void onNeighborBlockChange(World worldIn, BlockPos pos, State state, Block neighborBlock)
|
||||
public void onUpdate(World worldIn, BlockPos pos, State state, Block neighborBlock)
|
||||
{
|
||||
Facing.Axis enumfacing$axis = (Facing.Axis)state.getValue(AXIS);
|
||||
int dim = state.getValue(DIM);
|
||||
|
@ -159,7 +159,7 @@ public class BlockPortal extends Block
|
|||
}
|
||||
}
|
||||
|
||||
public boolean shouldSideBeRendered(IWorldAccess worldIn, BlockPos pos, Facing side)
|
||||
public boolean canRender(IWorldAccess worldIn, BlockPos pos, Facing side)
|
||||
{
|
||||
Facing.Axis enumfacing$axis = null;
|
||||
State iblockstate = worldIn.getState(pos);
|
||||
|
@ -196,7 +196,7 @@ public class BlockPortal extends Block
|
|||
/**
|
||||
* Returns the quantity of items to drop on block destruction.
|
||||
*/
|
||||
protected int quantityDropped(Random random)
|
||||
protected int getDropAmount(Random random)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
@ -204,7 +204,7 @@ public class BlockPortal extends Block
|
|||
/**
|
||||
* Called When an Entity Collided with the Block
|
||||
*/
|
||||
public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, State state, Entity entityIn)
|
||||
public void onCollideUpdate(World worldIn, BlockPos pos, State state, Entity entityIn)
|
||||
{
|
||||
if (entityIn.vehicle == null && entityIn.passenger == null)
|
||||
{
|
||||
|
@ -212,7 +212,7 @@ public class BlockPortal extends Block
|
|||
}
|
||||
}
|
||||
|
||||
public void randomDisplayTick(AWorldClient worldIn, BlockPos pos, State state, Random rand)
|
||||
public void displayTick(AWorldClient worldIn, BlockPos pos, State state, Random rand)
|
||||
{
|
||||
// if (rand.chance(100))
|
||||
// {
|
||||
|
|
|
@ -46,7 +46,7 @@ public class BlockPortalFrame extends Block implements Rotatable
|
|||
/**
|
||||
* Sets the block's bounds for rendering it as an item
|
||||
*/
|
||||
public void setBlockBoundsForItemRender()
|
||||
public void setItemBounds()
|
||||
{
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.8125F, 1.0F);
|
||||
}
|
||||
|
@ -54,45 +54,45 @@ public class BlockPortalFrame extends Block implements Rotatable
|
|||
/**
|
||||
* Add all collision boxes of this Block to the list that intersect with the given mask.
|
||||
*/
|
||||
public void addCollisionBoxesToList(World worldIn, BlockPos pos, State state, BoundingBox mask, List<BoundingBox> list, Entity collidingEntity)
|
||||
public void getCollisionBoxes(World worldIn, BlockPos pos, State state, BoundingBox mask, List<BoundingBox> list, Entity collidingEntity)
|
||||
{
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.8125F, 1.0F);
|
||||
super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity);
|
||||
super.getCollisionBoxes(worldIn, pos, state, mask, list, collidingEntity);
|
||||
|
||||
if (((Boolean)worldIn.getState(pos).getValue(ORB)).booleanValue())
|
||||
{
|
||||
this.setBlockBounds(0.3125F, 0.8125F, 0.3125F, 0.6875F, 1.0F, 0.6875F);
|
||||
super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity);
|
||||
super.getCollisionBoxes(worldIn, pos, state, mask, list, collidingEntity);
|
||||
}
|
||||
|
||||
this.setBlockBoundsForItemRender();
|
||||
this.setItemBounds();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Item that this Block should drop when harvested.
|
||||
*/
|
||||
public Item getItemDropped(State state, Random rand, int fortune)
|
||||
public Item getDrop(State state, Random rand, int fortune)
|
||||
{
|
||||
return Items.obsidian;
|
||||
}
|
||||
|
||||
protected int quantityDropped(Random random)
|
||||
protected int getDropAmount(Random random)
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
|
||||
public void harvestBlock(World worldIn, EntityNPC player, BlockPos pos, State state, TileEntity te)
|
||||
public void postBroken(World worldIn, EntityNPC player, BlockPos pos, State state, TileEntity te)
|
||||
{
|
||||
super.harvestBlock(worldIn, player, pos, state, te);
|
||||
super.postBroken(worldIn, player, pos, state, te);
|
||||
if(state.getValue(ORB))
|
||||
spawnAsEntity(worldIn, pos, new ItemStack(Items.charged_orb));
|
||||
dropItem(worldIn, pos, new ItemStack(Items.charged_orb));
|
||||
}
|
||||
|
||||
/**
|
||||
* Called by ItemBlocks just before a block is actually set in the world, to allow for adjustments to the
|
||||
* IBlockstate
|
||||
*/
|
||||
public State onBlockPlaced(World worldIn, BlockPos pos, Facing facing, float hitX, float hitY, float hitZ, EntityLiving placer)
|
||||
public State getPlacedState(World worldIn, BlockPos pos, Facing facing, float hitX, float hitY, float hitZ, EntityLiving placer)
|
||||
{
|
||||
return this.getState().withProperty(FACING, placer.getHorizontalFacing().getOpposite()).withProperty(ORB, Boolean.valueOf(false));
|
||||
}
|
||||
|
@ -102,13 +102,13 @@ public class BlockPortalFrame extends Block implements Rotatable
|
|||
return new Property[] {FACING, ORB};
|
||||
}
|
||||
|
||||
public void onBlockDestroyedByPlayer(World worldIn, BlockPos pos, State state)
|
||||
public void onBroken(World worldIn, BlockPos pos, State state)
|
||||
{
|
||||
for(int n = 0; n < 4; n++) {
|
||||
BlockPos ppos = pos.offset(Facing.getHorizontal(n));
|
||||
State pstate = worldIn.getState(ppos);
|
||||
if(pstate.getBlock() == Blocks.floor_portal)
|
||||
Blocks.floor_portal.onBlockDestroyedByPlayer(worldIn, ppos, pstate);
|
||||
Blocks.floor_portal.onBroken(worldIn, ppos, pstate);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ public class BlockQuartzPillar extends BlockRotatedPillar
|
|||
return this.dark;
|
||||
}
|
||||
|
||||
public State onBlockPlaced(World worldIn, BlockPos pos, Facing facing, float hitX, float hitY, float hitZ, EntityLiving placer)
|
||||
public State getPlacedState(World worldIn, BlockPos pos, Facing facing, float hitX, float hitY, float hitZ, EntityLiving placer)
|
||||
{
|
||||
return this.getState().withProperty(AXIS, facing.getAxis());
|
||||
}
|
||||
|
|
|
@ -22,11 +22,11 @@ public class BlockSkull extends Block implements Rotatable {
|
|||
this.setBlockBounds(0.25F, 0.0F, 0.25F, 0.75F, 0.5F, 0.75F);
|
||||
}
|
||||
|
||||
public boolean canPlaceBlockAt(World world, BlockPos pos) {
|
||||
public boolean canPlace(World world, BlockPos pos) {
|
||||
return world.getState(pos).getBlock().getMaterial().isReplaceable() && world.isBlockSolid(pos.down());
|
||||
}
|
||||
|
||||
public State onBlockPlaced(World world, BlockPos pos, Facing face, float hitX, float hitY, float hitZ, EntityLiving placer) {
|
||||
public State getPlacedState(World world, BlockPos pos, Facing face, float hitX, float hitY, float hitZ, EntityLiving placer) {
|
||||
return this.getState().withProperty(FACING, placer.getHorizontalFacing().getOpposite());
|
||||
}
|
||||
|
||||
|
|
|
@ -43,12 +43,12 @@ public class BlockSlab extends Block implements Directional {
|
|||
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F);
|
||||
|
||||
this.setLightOpacity(255);
|
||||
this.setOpacity(255);
|
||||
this.base = base;
|
||||
this.baseState = base.getState();
|
||||
this.setHardness(this.base.getRawHardness());
|
||||
this.setResistance(this.base.getRawResistance() / 3.0F);
|
||||
this.setStepSound(this.base.sound);
|
||||
this.setSound(this.base.getSound());
|
||||
this.textureTop = top;
|
||||
this.textureBottom = bottom;
|
||||
SLABS.add(this);
|
||||
|
@ -58,12 +58,12 @@ public class BlockSlab extends Block implements Directional {
|
|||
return new Property[] {FACING};
|
||||
}
|
||||
|
||||
public State onBlockPlaced(World worldIn, BlockPos pos, Facing facing, float hitX, float hitY, float hitZ, EntityLiving placer) {
|
||||
public State getPlacedState(World worldIn, BlockPos pos, Facing facing, float hitX, float hitY, float hitZ, EntityLiving placer) {
|
||||
State iblockstate = this.getState().withProperty(FACING, Facing.DOWN);
|
||||
return facing != Facing.DOWN && (facing == Facing.UP || (double)hitY <= 0.5D) ? iblockstate : iblockstate.withProperty(FACING, Facing.UP);
|
||||
}
|
||||
|
||||
public void setBlockBoundsBasedOnState(IWorldAccess worldIn, BlockPos pos) {
|
||||
public void setBlockBounds(IWorldAccess worldIn, BlockPos pos) {
|
||||
State iblockstate = worldIn.getState(pos);
|
||||
|
||||
if(iblockstate.getBlock() == this) {
|
||||
|
@ -90,13 +90,13 @@ public class BlockSlab extends Block implements Directional {
|
|||
}
|
||||
}
|
||||
|
||||
public void setBlockBoundsForItemRender() {
|
||||
public void setItemBounds() {
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F);
|
||||
}
|
||||
|
||||
public void addCollisionBoxesToList(World worldIn, BlockPos pos, State state, BoundingBox mask, List<BoundingBox> list, Entity collidingEntity) {
|
||||
this.setBlockBoundsBasedOnState(worldIn, pos);
|
||||
super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity);
|
||||
public void getCollisionBoxes(World worldIn, BlockPos pos, State state, BoundingBox mask, List<BoundingBox> list, Entity collidingEntity) {
|
||||
this.setBlockBounds(worldIn, pos);
|
||||
super.getCollisionBoxes(worldIn, pos, state, mask, list, collidingEntity);
|
||||
}
|
||||
|
||||
public boolean isOpaqueCube() {
|
||||
|
@ -111,10 +111,10 @@ public class BlockSlab extends Block implements Directional {
|
|||
return blockIn instanceof BlockSlab;
|
||||
}
|
||||
|
||||
public boolean shouldSideBeRendered(IWorldAccess worldIn, BlockPos pos, Facing side) {
|
||||
public boolean canRender(IWorldAccess worldIn, BlockPos pos, Facing side) {
|
||||
State iblockstate = worldIn.getState(pos);
|
||||
if(iblockstate.getBlock() == this && iblockstate.getValue(FACING).getAxis() == Axis.Y) {
|
||||
if(side != Facing.UP && side != Facing.DOWN && !super.shouldSideBeRendered(worldIn, pos, side)) {
|
||||
if(side != Facing.UP && side != Facing.DOWN && !super.canRender(worldIn, pos, side)) {
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
|
@ -126,20 +126,20 @@ public class BlockSlab extends Block implements Directional {
|
|||
boolean flag1 = isSlab(iblockstate1.getBlock()) && iblockstate1.getValue(FACING) == Facing.UP;
|
||||
return flag1
|
||||
? (side == Facing.DOWN ? true
|
||||
: (side == Facing.UP && super.shouldSideBeRendered(worldIn, pos, side) ? true
|
||||
: (side == Facing.UP && super.canRender(worldIn, pos, side) ? true
|
||||
: !isSlab(iblockstate.getBlock()) || !flag))
|
||||
: (side == Facing.UP ? true
|
||||
: (side == Facing.DOWN && super.shouldSideBeRendered(worldIn, pos, side) ? true
|
||||
: (side == Facing.DOWN && super.canRender(worldIn, pos, side) ? true
|
||||
: !isSlab(iblockstate.getBlock()) || flag));
|
||||
}
|
||||
}
|
||||
|
||||
if(side == Facing.UP || side == Facing.DOWN) {
|
||||
return super.shouldSideBeRendered(worldIn, pos, side);
|
||||
return super.canRender(worldIn, pos, side);
|
||||
}
|
||||
else {
|
||||
return (iblockstate.getBlock() == this && iblockstate.getValue(FACING) == side.getOpposite())
|
||||
|| super.shouldSideBeRendered(worldIn, pos, side);
|
||||
|| super.canRender(worldIn, pos, side);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -164,12 +164,12 @@ public class BlockSlab extends Block implements Directional {
|
|||
if(hitY >= 0.34f && hitY <= 0.66f) {
|
||||
State state = worldIn.getState(pos);
|
||||
Block block = state.getBlock();
|
||||
if(!block.isReplaceable(worldIn, pos))
|
||||
if(!block.canReplace(worldIn, pos))
|
||||
pos = pos.offset(side);
|
||||
if(worldIn.canBlockBePlaced(this, pos, false, side, null, stack)) {
|
||||
State place = this.getState().withProperty(BlockSlab.FACING, playerIn.getHorizontalFacing());
|
||||
if(worldIn.setState(pos, place, 3)) {
|
||||
worldIn.playSound(this.sound.getPlaceSound(), (double)((float)pos.getX() + 0.5F), (double)((float)pos.getY() + 0.5F),
|
||||
worldIn.playSound(this.getSound().getPlaceSound(), (double)((float)pos.getX() + 0.5F), (double)((float)pos.getY() + 0.5F),
|
||||
(double)((float)pos.getZ() + 0.5F), 1.0F);
|
||||
stack.decrSize();
|
||||
}
|
||||
|
|
|
@ -58,14 +58,14 @@ public class BlockStairs extends Block implements Rotatable
|
|||
this.baseState = base.getState();
|
||||
this.setHardness(this.base.getRawHardness());
|
||||
this.setResistance(this.base.getRawResistance() / 3.0F);
|
||||
this.setStepSound(this.base.sound);
|
||||
this.setLightOpacity(255);
|
||||
this.setSound(this.base.getSound());
|
||||
this.setOpacity(255);
|
||||
this.setTab(base.getMaterial() == Material.WOOD ? CheatTab.WOOD : CheatTab.BLOCKS);
|
||||
this.downTex = down;
|
||||
this.upTex = up;
|
||||
}
|
||||
|
||||
public void setBlockBoundsBasedOnState(IWorldAccess worldIn, BlockPos pos)
|
||||
public void setBlockBounds(IWorldAccess worldIn, BlockPos pos)
|
||||
{
|
||||
if (this.hasRaytraced)
|
||||
{
|
||||
|
@ -546,50 +546,50 @@ public class BlockStairs extends Block implements Rotatable
|
|||
/**
|
||||
* Add all collision boxes of this Block to the list that intersect with the given mask.
|
||||
*/
|
||||
public void addCollisionBoxesToList(World worldIn, BlockPos pos, State state, BoundingBox mask, List<BoundingBox> list, Entity collidingEntity)
|
||||
public void getCollisionBoxes(World worldIn, BlockPos pos, State state, BoundingBox mask, List<BoundingBox> list, Entity collidingEntity)
|
||||
{
|
||||
this.setBaseCollisionBounds(worldIn, pos);
|
||||
super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity);
|
||||
super.getCollisionBoxes(worldIn, pos, state, mask, list, collidingEntity);
|
||||
boolean flag = this.setBaseBlockBounds(worldIn, pos);
|
||||
super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity);
|
||||
super.getCollisionBoxes(worldIn, pos, state, mask, list, collidingEntity);
|
||||
|
||||
if (flag && this.setCollisionBlockBounds(worldIn, pos))
|
||||
{
|
||||
super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity);
|
||||
super.getCollisionBoxes(worldIn, pos, state, mask, list, collidingEntity);
|
||||
}
|
||||
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
|
||||
public void randomDisplayTick(AWorldClient worldIn, BlockPos pos, State state, Random rand)
|
||||
public void displayTick(AWorldClient worldIn, BlockPos pos, State state, Random rand)
|
||||
{
|
||||
this.base.randomDisplayTick(worldIn, pos, state, rand);
|
||||
this.base.displayTick(worldIn, pos, state, rand);
|
||||
}
|
||||
|
||||
public void onBlockClicked(World worldIn, BlockPos pos, EntityNPC playerIn)
|
||||
public void onStartBreak(World worldIn, BlockPos pos, EntityNPC playerIn)
|
||||
{
|
||||
this.base.onBlockClicked(worldIn, pos, playerIn);
|
||||
this.base.onStartBreak(worldIn, pos, playerIn);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a player destroys this Block
|
||||
*/
|
||||
public void onBlockDestroyedByPlayer(World worldIn, BlockPos pos, State state)
|
||||
public void onBroken(World worldIn, BlockPos pos, State state)
|
||||
{
|
||||
this.base.onBlockDestroyedByPlayer(worldIn, pos, state);
|
||||
this.base.onBroken(worldIn, pos, state);
|
||||
}
|
||||
|
||||
public int getMixedBrightnessForBlock(IWorldAccess worldIn, BlockPos pos)
|
||||
public int getLightmapValue(IWorldAccess worldIn, BlockPos pos)
|
||||
{
|
||||
return this.base.getMixedBrightnessForBlock(worldIn, pos);
|
||||
return this.base.getLightmapValue(worldIn, pos);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns how much this block can resist explosions from the passed in entity.
|
||||
*/
|
||||
public float getExplosionResistance(Entity exploder)
|
||||
public float getResistance(Entity exploder)
|
||||
{
|
||||
return this.base.getExplosionResistance(exploder);
|
||||
return this.base.getResistance(exploder);
|
||||
}
|
||||
|
||||
public BlockLayer getBlockLayer()
|
||||
|
@ -605,69 +605,61 @@ public class BlockStairs extends Block implements Rotatable
|
|||
return this.base.tickRate(worldIn, pos);
|
||||
}
|
||||
|
||||
public BoundingBox getSelectedBoundingBox(World worldIn, BlockPos pos)
|
||||
public BoundingBox getSelectionBox(World worldIn, BlockPos pos)
|
||||
{
|
||||
return this.base.getSelectedBoundingBox(worldIn, pos);
|
||||
return this.base.getSelectionBox(worldIn, pos);
|
||||
}
|
||||
|
||||
public Vec3 modifyAcceleration(World worldIn, BlockPos pos, Entity entityIn, Vec3 motion)
|
||||
public Vec3 getAcceleration(World worldIn, BlockPos pos, Entity entityIn, Vec3 motion)
|
||||
{
|
||||
return this.base.modifyAcceleration(worldIn, pos, entityIn, motion);
|
||||
return this.base.getAcceleration(worldIn, pos, entityIn, motion);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns if this block is collidable (only used by Fire). Args: x, y, z
|
||||
*/
|
||||
public boolean isCollidable()
|
||||
public boolean canRayTrace(State state, boolean liquid)
|
||||
{
|
||||
return this.base.isCollidable();
|
||||
return this.base.canRayTrace(state, liquid);
|
||||
}
|
||||
|
||||
public boolean canCollideCheck(State state, boolean liquid)
|
||||
public boolean canPlace(World worldIn, BlockPos pos)
|
||||
{
|
||||
return this.base.canCollideCheck(state, liquid);
|
||||
return this.base.canPlace(worldIn, pos);
|
||||
}
|
||||
|
||||
public boolean canPlaceBlockAt(World worldIn, BlockPos pos)
|
||||
public void onAdded(AWorldServer worldIn, BlockPos pos, State state)
|
||||
{
|
||||
return this.base.canPlaceBlockAt(worldIn, pos);
|
||||
this.onUpdate(worldIn, pos, this.baseState, Blocks.air);
|
||||
this.base.onAdded(worldIn, pos, this.baseState);
|
||||
}
|
||||
|
||||
public void onBlockAdded(AWorldServer worldIn, BlockPos pos, State state)
|
||||
public void onRemoved(AWorldServer worldIn, BlockPos pos, State state)
|
||||
{
|
||||
this.onNeighborBlockChange(worldIn, pos, this.baseState, Blocks.air);
|
||||
this.base.onBlockAdded(worldIn, pos, this.baseState);
|
||||
}
|
||||
|
||||
public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state)
|
||||
{
|
||||
this.base.onBlockRemoved(worldIn, pos, this.baseState);
|
||||
this.base.onRemoved(worldIn, pos, this.baseState);
|
||||
}
|
||||
|
||||
/**
|
||||
* Triggered whenever an entity collides with this block (enters into the block)
|
||||
*/
|
||||
public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, Entity entityIn)
|
||||
public void onCollideMove(World worldIn, BlockPos pos, Entity entityIn)
|
||||
{
|
||||
this.base.onEntityCollidedWithBlock(worldIn, pos, entityIn);
|
||||
this.base.onCollideMove(worldIn, pos, entityIn);
|
||||
}
|
||||
|
||||
public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
|
||||
public void tick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
|
||||
{
|
||||
this.base.updateTick(worldIn, pos, state, rand);
|
||||
this.base.tick(worldIn, pos, state, rand);
|
||||
}
|
||||
|
||||
public boolean onBlockActivated(World worldIn, BlockPos pos, State state, EntityNPC playerIn, Facing side, float hitX, float hitY, float hitZ)
|
||||
public boolean onUse(World worldIn, BlockPos pos, State state, EntityNPC playerIn, Facing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
return this.base.onBlockActivated(worldIn, pos, this.baseState, playerIn, Facing.DOWN, 0.0F, 0.0F, 0.0F);
|
||||
return this.base.onUse(worldIn, pos, this.baseState, playerIn, Facing.DOWN, 0.0F, 0.0F, 0.0F);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when this Block is destroyed by an Explosion
|
||||
*/
|
||||
public void onBlockDestroyedByExplosion(World worldIn, BlockPos pos, Explosion explosionIn, State prevState)
|
||||
public void onDestroyedExplosion(World worldIn, BlockPos pos, Explosion explosionIn, State prevState)
|
||||
{
|
||||
this.base.onBlockDestroyedByExplosion(worldIn, pos, explosionIn, prevState);
|
||||
this.base.onDestroyedExplosion(worldIn, pos, explosionIn, prevState);
|
||||
}
|
||||
|
||||
// /**
|
||||
|
@ -682,9 +674,9 @@ public class BlockStairs extends Block implements Rotatable
|
|||
* Called by ItemBlocks just before a block is actually set in the world, to allow for adjustments to the
|
||||
* IBlockstate
|
||||
*/
|
||||
public State onBlockPlaced(World worldIn, BlockPos pos, Facing facing, float hitX, float hitY, float hitZ, EntityLiving placer)
|
||||
public State getPlacedState(World worldIn, BlockPos pos, Facing facing, float hitX, float hitY, float hitZ, EntityLiving placer)
|
||||
{
|
||||
State iblockstate = super.onBlockPlaced(worldIn, pos, facing, hitX, hitY, hitZ, placer);
|
||||
State iblockstate = super.getPlacedState(worldIn, pos, facing, hitX, hitY, hitZ, placer);
|
||||
iblockstate = iblockstate.withProperty(FACING, placer.getHorizontalFacing()).withProperty(SHAPE, BlockStairs.EnumShape.STRAIGHT);
|
||||
return facing != Facing.DOWN && (facing == Facing.UP || (double)hitY <= 0.5D) ? iblockstate.withProperty(HALF, BlockStairs.EnumHalf.BOTTOM) : iblockstate.withProperty(HALF, BlockStairs.EnumHalf.TOP);
|
||||
}
|
||||
|
@ -692,7 +684,7 @@ public class BlockStairs extends Block implements Rotatable
|
|||
/**
|
||||
* Ray traces through the blocks collision from start vector to end vector returning a ray trace hit.
|
||||
*/
|
||||
public HitPosition collisionRayTrace(World worldIn, BlockPos pos, Vec3 start, Vec3 end)
|
||||
public HitPosition rayTrace(World worldIn, BlockPos pos, Vec3 start, Vec3 end)
|
||||
{
|
||||
HitPosition[] amovingobjectposition = new HitPosition[8];
|
||||
State iblockstate = worldIn.getState(pos);
|
||||
|
@ -707,7 +699,7 @@ public class BlockStairs extends Block implements Rotatable
|
|||
|
||||
if (Arrays.binarySearch(aint, j) < 0)
|
||||
{
|
||||
amovingobjectposition[j] = super.collisionRayTrace(worldIn, pos, start, end);
|
||||
amovingobjectposition[j] = super.rayTrace(worldIn, pos, start, end);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -740,7 +732,7 @@ public class BlockStairs extends Block implements Rotatable
|
|||
* Get the actual Block state of this Block at the given position. This applies properties not visible in the
|
||||
* metadata, such as fence connections.
|
||||
*/
|
||||
public State getActualState(State state, IWorldAccess worldIn, BlockPos pos)
|
||||
public State getState(State state, IWorldAccess worldIn, BlockPos pos)
|
||||
{
|
||||
if (this.setBaseBlockBounds(worldIn, pos))
|
||||
{
|
||||
|
@ -806,7 +798,7 @@ public class BlockStairs extends Block implements Rotatable
|
|||
return true;
|
||||
}
|
||||
|
||||
public Property[] getUnsavedProperties() {
|
||||
protected Property[] getUnsavedProperties() {
|
||||
return new Property[] {SHAPE};
|
||||
}
|
||||
|
||||
|
|
|
@ -69,19 +69,19 @@ public class BlockTrapDoor extends Block implements Rotatable
|
|||
return !((Boolean)worldIn.getState(pos).getValue(OPEN)).booleanValue();
|
||||
}
|
||||
|
||||
public BoundingBox getSelectedBoundingBox(World worldIn, BlockPos pos)
|
||||
public BoundingBox getSelectionBox(World worldIn, BlockPos pos)
|
||||
{
|
||||
this.setBlockBoundsBasedOnState(worldIn, pos);
|
||||
return super.getSelectedBoundingBox(worldIn, pos);
|
||||
this.setBlockBounds(worldIn, pos);
|
||||
return super.getSelectionBox(worldIn, pos);
|
||||
}
|
||||
|
||||
public BoundingBox getCollisionBoundingBox(World worldIn, BlockPos pos, State state)
|
||||
public BoundingBox getCollisionBox(World worldIn, BlockPos pos, State state)
|
||||
{
|
||||
this.setBlockBoundsBasedOnState(worldIn, pos);
|
||||
return super.getCollisionBoundingBox(worldIn, pos, state);
|
||||
this.setBlockBounds(worldIn, pos);
|
||||
return super.getCollisionBox(worldIn, pos, state);
|
||||
}
|
||||
|
||||
public void setBlockBoundsBasedOnState(IWorldAccess worldIn, BlockPos pos)
|
||||
public void setBlockBounds(IWorldAccess worldIn, BlockPos pos)
|
||||
{
|
||||
this.setBounds(worldIn.getState(pos));
|
||||
}
|
||||
|
@ -89,7 +89,7 @@ public class BlockTrapDoor extends Block implements Rotatable
|
|||
/**
|
||||
* Sets the block's bounds for rendering it as an item
|
||||
*/
|
||||
public void setBlockBoundsForItemRender()
|
||||
public void setItemBounds()
|
||||
{
|
||||
float f = 0.1875F;
|
||||
this.setBlockBounds(0.0F, 0.40625F, 0.0F, 1.0F, 0.59375F, 1.0F);
|
||||
|
@ -138,7 +138,7 @@ public class BlockTrapDoor extends Block implements Rotatable
|
|||
}
|
||||
}
|
||||
|
||||
public boolean onBlockActivated(World worldIn, BlockPos pos, State state, EntityNPC player, Facing side, float hitX, float hitY, float hitZ)
|
||||
public boolean onUse(World worldIn, BlockPos pos, State state, EntityNPC player, Facing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if(this.keyItem != null && (player.getHeldItem() == null || player.getHeldItem().getItem() != this.keyItem))
|
||||
return true;
|
||||
|
@ -151,17 +151,17 @@ public class BlockTrapDoor extends Block implements Rotatable
|
|||
/**
|
||||
* Ray traces through the blocks collision from start vector to end vector returning a ray trace hit.
|
||||
*/
|
||||
public HitPosition collisionRayTrace(World worldIn, BlockPos pos, Vec3 start, Vec3 end)
|
||||
public HitPosition rayTrace(World worldIn, BlockPos pos, Vec3 start, Vec3 end)
|
||||
{
|
||||
this.setBlockBoundsBasedOnState(worldIn, pos);
|
||||
return super.collisionRayTrace(worldIn, pos, start, end);
|
||||
this.setBlockBounds(worldIn, pos);
|
||||
return super.rayTrace(worldIn, pos, start, end);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called by ItemBlocks just before a block is actually set in the world, to allow for adjustments to the
|
||||
* IBlockstate
|
||||
*/
|
||||
public State onBlockPlaced(World worldIn, BlockPos pos, Facing facing, float hitX, float hitY, float hitZ, EntityLiving placer)
|
||||
public State getPlacedState(World worldIn, BlockPos pos, Facing facing, float hitX, float hitY, float hitZ, EntityLiving placer)
|
||||
{
|
||||
State iblockstate = this.getState();
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ public class BlockWall extends Block
|
|||
this.setDefaultState(this.getBaseState().withProperty(UP, Boolean.valueOf(false)).withProperty(NORTH, Boolean.valueOf(false)).withProperty(EAST, Boolean.valueOf(false)).withProperty(SOUTH, Boolean.valueOf(false)).withProperty(WEST, Boolean.valueOf(false)));
|
||||
this.setHardness(modelBlock.getRawHardness());
|
||||
this.setResistance(modelBlock.getRawResistance() / 3.0F);
|
||||
this.setStepSound(modelBlock.sound);
|
||||
this.setSound(modelBlock.getSound());
|
||||
this.setTab(CheatTab.BLOCKS);
|
||||
WALLS.add(this);
|
||||
}
|
||||
|
@ -66,7 +66,7 @@ public class BlockWall extends Block
|
|||
return false;
|
||||
}
|
||||
|
||||
public void setBlockBoundsBasedOnState(IWorldAccess worldIn, BlockPos pos)
|
||||
public void setBlockBounds(IWorldAccess worldIn, BlockPos pos)
|
||||
{
|
||||
boolean flag = this.canConnectTo(worldIn, pos.north());
|
||||
boolean flag1 = this.canConnectTo(worldIn, pos.south());
|
||||
|
@ -114,11 +114,11 @@ public class BlockWall extends Block
|
|||
this.setBlockBounds(f, 0.0F, f2, f1, f4, f3);
|
||||
}
|
||||
|
||||
public BoundingBox getCollisionBoundingBox(World worldIn, BlockPos pos, State state)
|
||||
public BoundingBox getCollisionBox(World worldIn, BlockPos pos, State state)
|
||||
{
|
||||
this.setBlockBoundsBasedOnState(worldIn, pos);
|
||||
this.setBlockBounds(worldIn, pos);
|
||||
this.maxY = 1.5D;
|
||||
return super.getCollisionBoundingBox(worldIn, pos, state);
|
||||
return super.getCollisionBox(worldIn, pos, state);
|
||||
}
|
||||
|
||||
public boolean canConnectTo(IBlockAccess worldIn, BlockPos pos)
|
||||
|
@ -127,16 +127,16 @@ public class BlockWall extends Block
|
|||
return (block != this && !(block instanceof BlockFenceGate) ? (block.getMaterial().isOpaque() && block.isFullCube() ? block.getMaterial() != Material.SOFT : false) : true);
|
||||
}
|
||||
|
||||
public boolean shouldSideBeRendered(IWorldAccess worldIn, BlockPos pos, Facing side)
|
||||
public boolean canRender(IWorldAccess worldIn, BlockPos pos, Facing side)
|
||||
{
|
||||
return side == Facing.DOWN ? super.shouldSideBeRendered(worldIn, pos, side) : true;
|
||||
return side == Facing.DOWN ? super.canRender(worldIn, pos, side) : true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the actual Block state of this Block at the given position. This applies properties not visible in the
|
||||
* metadata, such as fence connections.
|
||||
*/
|
||||
public State getActualState(State state, IWorldAccess worldIn, BlockPos pos)
|
||||
public State getState(State state, IWorldAccess worldIn, BlockPos pos)
|
||||
{
|
||||
return state.withProperty(UP, Boolean.valueOf(worldIn.getState(pos.up()).getBlock() != Blocks.air)).withProperty(NORTH, Boolean.valueOf(this.canConnectTo(worldIn, pos.north()))).withProperty(EAST, Boolean.valueOf(this.canConnectTo(worldIn, pos.east()))).withProperty(SOUTH, Boolean.valueOf(this.canConnectTo(worldIn, pos.south()))).withProperty(WEST, Boolean.valueOf(this.canConnectTo(worldIn, pos.west())));
|
||||
}
|
||||
|
@ -295,7 +295,7 @@ public class BlockWall extends Block
|
|||
return this.getState().withProperty(UP, true).withProperty(NORTH, false).withProperty(SOUTH, false).withProperty(WEST, true).withProperty(EAST, true);
|
||||
}
|
||||
|
||||
public Property[] getUnsavedProperties() {
|
||||
protected Property[] getUnsavedProperties() {
|
||||
return new Property[] {NORTH, SOUTH, UP, WEST, EAST};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,11 +19,11 @@ public class BlockBlackenedSoil extends Block
|
|||
public BlockBlackenedSoil()
|
||||
{
|
||||
super(Material.LOOSE);
|
||||
this.setTickRandomly();
|
||||
this.setTicked();
|
||||
this.setTab(CheatTab.NATURE);
|
||||
}
|
||||
|
||||
public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
|
||||
public void tick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
|
||||
{
|
||||
if (worldIn.getLightFromNeighbors(pos.up()) < 2 && worldIn.getState(pos.up()).getBlock().getLightOpacity() > 6)
|
||||
{
|
||||
|
@ -47,9 +47,9 @@ public class BlockBlackenedSoil extends Block
|
|||
}
|
||||
}
|
||||
|
||||
public Item getItemDropped(State state, Random rand, int fortune)
|
||||
public Item getDrop(State state, Random rand, int fortune)
|
||||
{
|
||||
return Blocks.blackened_dirt.getItemDropped(Blocks.blackened_dirt.getState(), rand, fortune);
|
||||
return Blocks.blackened_dirt.getDrop(Blocks.blackened_dirt.getState(), rand, fortune);
|
||||
}
|
||||
|
||||
public Model getModel(ModelProvider provider, String name, State state) {
|
||||
|
|
|
@ -18,10 +18,10 @@ public class BlockBlueShroom extends BlockBush
|
|||
{
|
||||
float f = 0.2F;
|
||||
this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, f * 2.0F, 0.5F + f);
|
||||
this.setTickRandomly();
|
||||
this.setTicked();
|
||||
}
|
||||
|
||||
public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
|
||||
public void tick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
|
||||
{
|
||||
if (Vars.blueShroomGrowth > 0 && rand.chance(Vars.blueShroomGrowth))
|
||||
{
|
||||
|
@ -60,9 +60,9 @@ public class BlockBlueShroom extends BlockBush
|
|||
}
|
||||
}
|
||||
|
||||
public boolean canPlaceBlockAt(World worldIn, BlockPos pos)
|
||||
public boolean canPlace(World worldIn, BlockPos pos)
|
||||
{
|
||||
return super.canPlaceBlockAt(worldIn, pos) && this.canBlockStay(worldIn, pos, this.getState());
|
||||
return super.canPlace(worldIn, pos) && this.canBlockStay(worldIn, pos, this.getState());
|
||||
}
|
||||
|
||||
protected boolean canPlaceBlockOn(Block ground)
|
||||
|
|
|
@ -22,16 +22,15 @@ public class BlockBush extends Block
|
|||
public BlockBush(Material p_i46452_1_)
|
||||
{
|
||||
super(p_i46452_1_);
|
||||
this.setTickRandomly();
|
||||
this.setTicked();
|
||||
float f = 0.2F;
|
||||
this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, f * 3.0F, 0.5F + f);
|
||||
this.setTab(CheatTab.PLANTS);
|
||||
this.setFlatBlockTexture();
|
||||
}
|
||||
|
||||
public boolean canPlaceBlockAt(World worldIn, BlockPos pos)
|
||||
public boolean canPlace(World worldIn, BlockPos pos)
|
||||
{
|
||||
return super.canPlaceBlockAt(worldIn, pos) && this.canPlaceBlockOn(worldIn.getState(pos.down()).getBlock());
|
||||
return super.canPlace(worldIn, pos) && this.canPlaceBlockOn(worldIn.getState(pos.down()).getBlock());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -45,13 +44,13 @@ public class BlockBush extends Block
|
|||
/**
|
||||
* Called when a neighboring block changes.
|
||||
*/
|
||||
public void onNeighborBlockChange(World worldIn, BlockPos pos, State state, Block neighborBlock)
|
||||
public void onUpdate(World worldIn, BlockPos pos, State state, Block neighborBlock)
|
||||
{
|
||||
super.onNeighborBlockChange(worldIn, pos, state, neighborBlock);
|
||||
super.onUpdate(worldIn, pos, state, neighborBlock);
|
||||
this.checkAndDropBlock(worldIn, pos, state);
|
||||
}
|
||||
|
||||
public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
|
||||
public void tick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
|
||||
{
|
||||
this.checkAndDropBlock(worldIn, pos, state);
|
||||
}
|
||||
|
@ -60,7 +59,7 @@ public class BlockBush extends Block
|
|||
{
|
||||
if (!this.canBlockStay(worldIn, pos, state))
|
||||
{
|
||||
this.dropBlockAsItem(worldIn, pos, state, 0);
|
||||
this.drop(worldIn, pos, state, 0);
|
||||
worldIn.setState(pos, Blocks.air.getState(), 3);
|
||||
}
|
||||
}
|
||||
|
@ -70,7 +69,7 @@ public class BlockBush extends Block
|
|||
return this.canPlaceBlockOn(worldIn.getState(pos.down()).getBlock());
|
||||
}
|
||||
|
||||
public BoundingBox getCollisionBoundingBox(World worldIn, BlockPos pos, State state)
|
||||
public BoundingBox getCollisionBox(World worldIn, BlockPos pos, State state)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -40,11 +40,11 @@ public class BlockCactus extends Block
|
|||
{
|
||||
super(Material.BLOCKING);
|
||||
this.setDefaultState(this.getBaseState().withProperty(AGE, Integer.valueOf(0)));
|
||||
this.setTickRandomly();
|
||||
this.setTicked();
|
||||
this.setTab(CheatTab.PLANTS);
|
||||
}
|
||||
|
||||
public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
|
||||
public void tick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
|
||||
{
|
||||
BlockPos blockpos = pos.up();
|
||||
|
||||
|
@ -66,7 +66,7 @@ public class BlockCactus extends Block
|
|||
worldIn.setState(blockpos, this.getState());
|
||||
State iblockstate = state.withProperty(AGE, Integer.valueOf(0));
|
||||
worldIn.setState(pos, iblockstate, 4);
|
||||
this.onNeighborBlockChange(worldIn, blockpos, iblockstate, this);
|
||||
this.onUpdate(worldIn, blockpos, iblockstate, this);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -76,13 +76,13 @@ public class BlockCactus extends Block
|
|||
}
|
||||
}
|
||||
|
||||
public BoundingBox getCollisionBoundingBox(World worldIn, BlockPos pos, State state)
|
||||
public BoundingBox getCollisionBox(World worldIn, BlockPos pos, State state)
|
||||
{
|
||||
float f = 0.0625F;
|
||||
return new BoundingBox((double)((float)pos.getX() + f), (double)pos.getY(), (double)((float)pos.getZ() + f), (double)((float)(pos.getX() + 1) - f), (double)((float)(pos.getY() + 1) - f), (double)((float)(pos.getZ() + 1) - f));
|
||||
}
|
||||
|
||||
public BoundingBox getSelectedBoundingBox(World worldIn, BlockPos pos)
|
||||
public BoundingBox getSelectionBox(World worldIn, BlockPos pos)
|
||||
{
|
||||
float f = 0.0625F;
|
||||
return new BoundingBox((double)((float)pos.getX() + f), (double)pos.getY(), (double)((float)pos.getZ() + f), (double)((float)(pos.getX() + 1) - f), (double)(pos.getY() + 1), (double)((float)(pos.getZ() + 1) - f));
|
||||
|
@ -101,15 +101,15 @@ public class BlockCactus extends Block
|
|||
return false;
|
||||
}
|
||||
|
||||
public boolean canPlaceBlockAt(World worldIn, BlockPos pos)
|
||||
public boolean canPlace(World worldIn, BlockPos pos)
|
||||
{
|
||||
return super.canPlaceBlockAt(worldIn, pos) ? this.canBlockStay(worldIn, pos) : false;
|
||||
return super.canPlace(worldIn, pos) ? this.canBlockStay(worldIn, pos) : false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a neighboring block changes.
|
||||
*/
|
||||
public void onNeighborBlockChange(World worldIn, BlockPos pos, State state, Block neighborBlock)
|
||||
public void onUpdate(World worldIn, BlockPos pos, State state, Block neighborBlock)
|
||||
{
|
||||
if (!this.canBlockStay(worldIn, pos))
|
||||
{
|
||||
|
@ -134,7 +134,7 @@ public class BlockCactus extends Block
|
|||
/**
|
||||
* Called When an Entity Collided with the Block
|
||||
*/
|
||||
public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, State state, Entity entityIn)
|
||||
public void onCollideUpdate(World worldIn, BlockPos pos, State state, Entity entityIn)
|
||||
{
|
||||
if(worldIn.client || Vars.cactusDamage)
|
||||
entityIn.attackEntityFrom(DamageSource.cactus, 1);
|
||||
|
|
|
@ -27,12 +27,12 @@ public class BlockCrops extends BlockBush implements IGrowable
|
|||
public BlockCrops()
|
||||
{
|
||||
this.setDefaultState(this.getBaseState().withProperty(AGE, Integer.valueOf(0)));
|
||||
this.setTickRandomly();
|
||||
this.setTicked();
|
||||
float f = 0.5F;
|
||||
this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.25F, 0.5F + f);
|
||||
this.setTab((CheatTab)null);
|
||||
this.setHardness(0.0F);
|
||||
this.setStepSound(SoundType.GRASS);
|
||||
this.setSound(SoundType.GRASS);
|
||||
// this.disableStats();
|
||||
}
|
||||
|
||||
|
@ -44,9 +44,9 @@ public class BlockCrops extends BlockBush implements IGrowable
|
|||
return ground == Blocks.farmland;
|
||||
}
|
||||
|
||||
public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
|
||||
public void tick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
|
||||
{
|
||||
super.updateTick(worldIn, pos, state, rand);
|
||||
super.tick(worldIn, pos, state, rand);
|
||||
|
||||
if (Vars.cropGrowth > 0 && worldIn.getLightFromNeighbors(pos.up()) >= 9)
|
||||
{
|
||||
|
@ -148,9 +148,9 @@ public class BlockCrops extends BlockBush implements IGrowable
|
|||
/**
|
||||
* Spawns this Block's drops into the World as EntityItems.
|
||||
*/
|
||||
public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, State state, float chance, int fortune)
|
||||
public void drop(World worldIn, BlockPos pos, State state, float chance, int fortune)
|
||||
{
|
||||
super.dropBlockAsItemWithChance(worldIn, pos, state, chance, 0);
|
||||
super.drop(worldIn, pos, state, chance, 0);
|
||||
|
||||
if (!worldIn.client)
|
||||
{
|
||||
|
@ -164,7 +164,7 @@ public class BlockCrops extends BlockBush implements IGrowable
|
|||
{
|
||||
if (worldIn.rand.zrange(15) <= i)
|
||||
{
|
||||
spawnAsEntity(worldIn, pos, new ItemStack(this.getDropItem()));
|
||||
dropItem(worldIn, pos, new ItemStack(this.getDropItem()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -174,9 +174,9 @@ public class BlockCrops extends BlockBush implements IGrowable
|
|||
/**
|
||||
* Get the Item that this Block should drop when harvested.
|
||||
*/
|
||||
public Item getItemDropped(State state, Random rand, int fortune)
|
||||
public Item getDrop(State state, Random rand, int fortune)
|
||||
{
|
||||
return ((Integer)state.getValue(AGE)).intValue() == 7 ? this.getCrop() : super.getItemDropped(state, rand, fortune);
|
||||
return ((Integer)state.getValue(AGE)).intValue() == 7 ? this.getCrop() : super.getDrop(state, rand, fortune);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -47,7 +47,7 @@ public class BlockDeadBush extends BlockBush
|
|||
/**
|
||||
* Whether this Block can be replaced directly by other blocks (true for e.g. tall grass)
|
||||
*/
|
||||
public boolean isReplaceable(World worldIn, BlockPos pos)
|
||||
public boolean canReplace(World worldIn, BlockPos pos)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -55,21 +55,21 @@ public class BlockDeadBush extends BlockBush
|
|||
/**
|
||||
* Get the Item that this Block should drop when harvested.
|
||||
*/
|
||||
public Item getItemDropped(State state, Random rand, int fortune)
|
||||
public Item getDrop(State state, Random rand, int fortune)
|
||||
{
|
||||
return rand.chance(5) ? Items.stick : null;
|
||||
}
|
||||
|
||||
public void harvestBlock(World worldIn, EntityNPC player, BlockPos pos, State state, TileEntity te)
|
||||
public void postBroken(World worldIn, EntityNPC player, BlockPos pos, State state, TileEntity te)
|
||||
{
|
||||
if (!worldIn.client && player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() instanceof ItemShears)
|
||||
{
|
||||
// player.triggerAchievement(StatRegistry.mineBlockStatArray[BlockRegistry.getIdFromBlock(this)]);
|
||||
spawnAsEntity(worldIn, pos, new ItemStack(Items.deadbush));
|
||||
dropItem(worldIn, pos, new ItemStack(Items.deadbush));
|
||||
}
|
||||
else
|
||||
{
|
||||
super.harvestBlock(worldIn, player, pos, state, te);
|
||||
super.postBroken(worldIn, player, pos, state, te);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -45,11 +45,8 @@ public class BlockDoublePlant extends BlockBush implements IGrowable
|
|||
this.type = type;
|
||||
this.setDefaultState(this.getBaseState().withProperty(HALF, BlockDoublePlant.EnumBlockHalf.LOWER));
|
||||
this.setHardness(0.0F);
|
||||
this.setStepSound(SoundType.GRASS);
|
||||
this.setSound(SoundType.GRASS);
|
||||
this.setFlammable(60, 100);
|
||||
this.setFlatBlockTexture();
|
||||
if(this.type == BlockDoublePlant.EnumPlantType.GRASS || this.type == BlockDoublePlant.EnumPlantType.FERN)
|
||||
this.setItemColored();
|
||||
PLANTS[type.ordinal()] = this;
|
||||
}
|
||||
|
||||
|
@ -57,7 +54,7 @@ public class BlockDoublePlant extends BlockBush implements IGrowable
|
|||
return this.type;
|
||||
}
|
||||
|
||||
public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
|
||||
public void tick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
|
||||
{
|
||||
if(Vars.plantDry && worldIn.getTemperatureC(pos) >= 50.0f)
|
||||
{
|
||||
|
@ -72,23 +69,23 @@ public class BlockDoublePlant extends BlockBush implements IGrowable
|
|||
Blocks.dead_bush.getState());
|
||||
return;
|
||||
}
|
||||
super.updateTick(worldIn, pos, state, rand);
|
||||
super.tick(worldIn, pos, state, rand);
|
||||
}
|
||||
|
||||
public void setBlockBoundsBasedOnState(IWorldAccess worldIn, BlockPos pos)
|
||||
public void setBlockBounds(IWorldAccess worldIn, BlockPos pos)
|
||||
{
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
|
||||
public boolean canPlaceBlockAt(World worldIn, BlockPos pos)
|
||||
public boolean canPlace(World worldIn, BlockPos pos)
|
||||
{
|
||||
return super.canPlaceBlockAt(worldIn, pos) && worldIn.isAirBlock(pos.up());
|
||||
return super.canPlace(worldIn, pos) && worldIn.isAirBlock(pos.up());
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether this Block can be replaced directly by other blocks (true for e.g. tall grass)
|
||||
*/
|
||||
public boolean isReplaceable(World worldIn, BlockPos pos)
|
||||
public boolean canReplace(World worldIn, BlockPos pos)
|
||||
{
|
||||
State iblockstate = worldIn.getState(pos);
|
||||
|
||||
|
@ -123,7 +120,7 @@ public class BlockDoublePlant extends BlockBush implements IGrowable
|
|||
|
||||
if (!flag)
|
||||
{
|
||||
this.dropBlockAsItem(worldIn, blockpos1, state, 0);
|
||||
this.drop(worldIn, blockpos1, state, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -145,7 +142,7 @@ public class BlockDoublePlant extends BlockBush implements IGrowable
|
|||
/**
|
||||
* Get the Item that this Block should drop when harvested.
|
||||
*/
|
||||
public Item getItemDropped(State state, Random rand, int fortune)
|
||||
public Item getDrop(State state, Random rand, int fortune)
|
||||
{
|
||||
if (state.getValue(HALF) == BlockDoublePlant.EnumBlockHalf.UPPER)
|
||||
{
|
||||
|
@ -153,10 +150,14 @@ public class BlockDoublePlant extends BlockBush implements IGrowable
|
|||
}
|
||||
else
|
||||
{
|
||||
return this.type == BlockDoublePlant.EnumPlantType.FERN ? null : (this.type == BlockDoublePlant.EnumPlantType.GRASS ? (rand.chance(8) ? Items.wheat_seed : null) : super.getItemDropped(state, rand, fortune));
|
||||
return this.type == BlockDoublePlant.EnumPlantType.FERN ? null : (this.type == BlockDoublePlant.EnumPlantType.GRASS ? (rand.chance(8) ? Items.wheat_seed : null) : super.getDrop(state, rand, fortune));
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isItemColored() {
|
||||
return this.type == BlockDoublePlant.EnumPlantType.GRASS || this.type == BlockDoublePlant.EnumPlantType.FERN;
|
||||
}
|
||||
|
||||
public int getRenderColor(State state) {
|
||||
return this.type != BlockDoublePlant.EnumPlantType.GRASS && this.type != BlockDoublePlant.EnumPlantType.FERN ? 16777215 : Colorizer.getGrassColor(0.5D, 1.0D);
|
||||
}
|
||||
|
@ -175,20 +176,20 @@ public class BlockDoublePlant extends BlockBush implements IGrowable
|
|||
/**
|
||||
* Called by ItemBlocks after a block is set in the world, to allow post-place logic
|
||||
*/
|
||||
public void onBlockPlacedBy(World worldIn, BlockPos pos, State state, EntityLiving placer)
|
||||
public void onPlace(World worldIn, BlockPos pos, State state, EntityLiving placer)
|
||||
{
|
||||
worldIn.setState(pos.up(), this.getState().withProperty(HALF, BlockDoublePlant.EnumBlockHalf.UPPER), 2);
|
||||
}
|
||||
|
||||
public void harvestBlock(World worldIn, EntityNPC player, BlockPos pos, State state, TileEntity te)
|
||||
public void postBroken(World worldIn, EntityNPC player, BlockPos pos, State state, TileEntity te)
|
||||
{
|
||||
if (worldIn.client || player.getCurrentEquippedItem() == null || !(player.getCurrentEquippedItem().getItem() instanceof ItemShears) || state.getValue(HALF) != BlockDoublePlant.EnumBlockHalf.LOWER || !this.onHarvest(worldIn, pos, state, player))
|
||||
{
|
||||
super.harvestBlock(worldIn, player, pos, state, te);
|
||||
super.postBroken(worldIn, player, pos, state, te);
|
||||
}
|
||||
}
|
||||
|
||||
public void onBlockHarvested(World worldIn, BlockPos pos, State state, EntityNPC player)
|
||||
public void preBroken(World worldIn, BlockPos pos, State state, EntityNPC player)
|
||||
{
|
||||
if (state.getValue(HALF) == BlockDoublePlant.EnumBlockHalf.UPPER)
|
||||
{
|
||||
|
@ -230,7 +231,7 @@ public class BlockDoublePlant extends BlockBush implements IGrowable
|
|||
// worldIn.setState(pos.up(), Blocks.air.getState(), 2);
|
||||
// }
|
||||
|
||||
super.onBlockHarvested(worldIn, pos, state, player);
|
||||
super.preBroken(worldIn, pos, state, player);
|
||||
}
|
||||
|
||||
private boolean onHarvest(World worldIn, BlockPos pos, State state, EntityNPC player)
|
||||
|
@ -241,7 +242,7 @@ public class BlockDoublePlant extends BlockBush implements IGrowable
|
|||
}
|
||||
else
|
||||
{
|
||||
spawnAsEntity(worldIn, pos, new ItemStack(this.type == BlockDoublePlant.EnumPlantType.GRASS ? Items.tallgrass : Items.fern, 2));
|
||||
dropItem(worldIn, pos, new ItemStack(this.type == BlockDoublePlant.EnumPlantType.GRASS ? Items.tallgrass : Items.fern, 2));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -261,7 +262,7 @@ public class BlockDoublePlant extends BlockBush implements IGrowable
|
|||
|
||||
public void grow(AWorldServer worldIn, Random rand, BlockPos pos, State state)
|
||||
{
|
||||
spawnAsEntity(worldIn, pos, new ItemStack(this.getItem()));
|
||||
dropItem(worldIn, pos, new ItemStack(this.getItem()));
|
||||
}
|
||||
|
||||
protected Property[] getProperties()
|
||||
|
@ -294,7 +295,7 @@ public class BlockDoublePlant extends BlockBush implements IGrowable
|
|||
return this.getState().withProperty(HALF, EnumBlockHalf.UPPER);
|
||||
}
|
||||
|
||||
public StackSize getMaxStackSize() {
|
||||
public StackSize getMaxAmount() {
|
||||
return StackSize.S;
|
||||
}
|
||||
|
||||
|
|
|
@ -17,15 +17,15 @@ public class BlockDryLeaves extends BlockLeavesBase
|
|||
super(Material.SOFT);
|
||||
this.setTab(CheatTab.PLANTS);
|
||||
this.setHardness(0.2F);
|
||||
this.setLightOpacity(1);
|
||||
this.setStepSound(SoundType.GRASS);
|
||||
this.setOpacity(1);
|
||||
this.setSound(SoundType.GRASS);
|
||||
this.setFlammable(60, 100);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the quantity of items to drop on block destruction.
|
||||
*/
|
||||
protected int quantityDropped(Random random)
|
||||
protected int getDropAmount(Random random)
|
||||
{
|
||||
return random.chance(0, 1, 5);
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ public class BlockDryLeaves extends BlockLeavesBase
|
|||
/**
|
||||
* Get the Item that this Block should drop when harvested.
|
||||
*/
|
||||
public Item getItemDropped(State state, Random rand, int fortune)
|
||||
public Item getDrop(State state, Random rand, int fortune)
|
||||
{
|
||||
return Items.stick;
|
||||
}
|
||||
|
|
|
@ -28,12 +28,12 @@ public class BlockFarmland extends Block
|
|||
{
|
||||
super(Material.LOOSE);
|
||||
this.setDefaultState(this.getBaseState().withProperty(MOISTURE, Integer.valueOf(0)));
|
||||
this.setTickRandomly();
|
||||
this.setTicked();
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.9375F, 1.0F);
|
||||
this.setLightOpacity(255);
|
||||
this.setOpacity(255);
|
||||
}
|
||||
|
||||
public BoundingBox getCollisionBoundingBox(World worldIn, BlockPos pos, State state)
|
||||
public BoundingBox getCollisionBox(World worldIn, BlockPos pos, State state)
|
||||
{
|
||||
return new BoundingBox((double)pos.getX(), (double)pos.getY(), (double)pos.getZ(), (double)(pos.getX() + 1), (double)(pos.getY() + 1), (double)(pos.getZ() + 1));
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ public class BlockFarmland extends Block
|
|||
return false;
|
||||
}
|
||||
|
||||
public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
|
||||
public void tick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
|
||||
{
|
||||
int i = ((Integer)state.getValue(MOISTURE)).intValue();
|
||||
|
||||
|
@ -77,7 +77,7 @@ public class BlockFarmland extends Block
|
|||
/**
|
||||
* Block's chance to react to a living entity falling on it.
|
||||
*/
|
||||
public void onFallenUpon(World worldIn, BlockPos pos, Entity entityIn, float fallDistance)
|
||||
public void onLandUpdate(World worldIn, BlockPos pos, Entity entityIn, float fallDistance)
|
||||
{
|
||||
if (entityIn instanceof EntityLiving)
|
||||
{
|
||||
|
@ -87,7 +87,7 @@ public class BlockFarmland extends Block
|
|||
worldIn.setState(pos, Blocks.dirt.getState());
|
||||
}
|
||||
|
||||
super.onFallenUpon(worldIn, pos, entityIn, fallDistance);
|
||||
super.onLandUpdate(worldIn, pos, entityIn, fallDistance);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -113,9 +113,9 @@ public class BlockFarmland extends Block
|
|||
/**
|
||||
* Called when a neighboring block changes.
|
||||
*/
|
||||
public void onNeighborBlockChange(World worldIn, BlockPos pos, State state, Block neighborBlock)
|
||||
public void onUpdate(World worldIn, BlockPos pos, State state, Block neighborBlock)
|
||||
{
|
||||
super.onNeighborBlockChange(worldIn, pos, state, neighborBlock);
|
||||
super.onUpdate(worldIn, pos, state, neighborBlock);
|
||||
|
||||
if (worldIn.getState(pos.up()).getBlock().getMaterial().isSolid())
|
||||
{
|
||||
|
@ -123,7 +123,7 @@ public class BlockFarmland extends Block
|
|||
}
|
||||
}
|
||||
|
||||
public boolean shouldSideBeRendered(IWorldAccess worldIn, BlockPos pos, Facing side)
|
||||
public boolean canRender(IWorldAccess worldIn, BlockPos pos, Facing side)
|
||||
{
|
||||
switch (side)
|
||||
{
|
||||
|
@ -138,16 +138,16 @@ public class BlockFarmland extends Block
|
|||
return !block.isOpaqueCube() && block != Blocks.farmland;
|
||||
|
||||
default:
|
||||
return super.shouldSideBeRendered(worldIn, pos, side);
|
||||
return super.canRender(worldIn, pos, side);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Item that this Block should drop when harvested.
|
||||
*/
|
||||
public Item getItemDropped(State state, Random rand, int fortune)
|
||||
public Item getDrop(State state, Random rand, int fortune)
|
||||
{
|
||||
return Blocks.dirt.getItemDropped(Blocks.dirt.getState(), rand, fortune);
|
||||
return Blocks.dirt.getDrop(Blocks.dirt.getState(), rand, fortune);
|
||||
}
|
||||
|
||||
protected Property[] getProperties()
|
||||
|
|
|
@ -32,7 +32,7 @@ public class BlockFlower extends BlockBush
|
|||
return this.type;
|
||||
}
|
||||
|
||||
public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
|
||||
public void tick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
|
||||
{
|
||||
if(Vars.flowerDry && worldIn.getTemperatureC(pos) >= 50.0f)
|
||||
{
|
||||
|
@ -40,7 +40,7 @@ public class BlockFlower extends BlockBush
|
|||
Blocks.dead_bush.getState());
|
||||
return;
|
||||
}
|
||||
super.updateTick(worldIn, pos, state, rand);
|
||||
super.tick(worldIn, pos, state, rand);
|
||||
}
|
||||
|
||||
public Model getModel(ModelProvider provider, String name, State state) {
|
||||
|
|
|
@ -28,16 +28,15 @@ public class BlockGrass extends Block implements IGrowable
|
|||
{
|
||||
super(Material.LOOSE);
|
||||
this.setDefaultState(this.getBaseState().withProperty(SNOWY, Boolean.valueOf(false)));
|
||||
this.setTickRandomly();
|
||||
this.setTicked();
|
||||
this.setTab(CheatTab.NATURE);
|
||||
this.setItemColored();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the actual Block state of this Block at the given position. This applies properties not visible in the
|
||||
* metadata, such as fence connections.
|
||||
*/
|
||||
public State getActualState(State state, IWorldAccess worldIn, BlockPos pos)
|
||||
public State getState(State state, IWorldAccess worldIn, BlockPos pos)
|
||||
{
|
||||
Block block = worldIn.getState(pos.up()).getBlock();
|
||||
return state.withProperty(SNOWY, Boolean.valueOf(block == Blocks.snow || block == Blocks.snow_layer));
|
||||
|
@ -47,6 +46,10 @@ public class BlockGrass extends Block implements IGrowable
|
|||
// {
|
||||
// return ColorizerFoliage.getGrassColor(0.5D, 1.0D);
|
||||
// }
|
||||
|
||||
public boolean isItemColored() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public int getRenderColor(State state)
|
||||
{
|
||||
|
@ -59,7 +62,7 @@ public class BlockGrass extends Block implements IGrowable
|
|||
return Colorizer.getGrassColor(worldIn, pos);
|
||||
}
|
||||
|
||||
public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
|
||||
public void tick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
|
||||
{
|
||||
// if (!worldIn.client)
|
||||
// {
|
||||
|
@ -96,9 +99,9 @@ public class BlockGrass extends Block implements IGrowable
|
|||
/**
|
||||
* Get the Item that this Block should drop when harvested.
|
||||
*/
|
||||
public Item getItemDropped(State state, Random rand, int fortune)
|
||||
public Item getDrop(State state, Random rand, int fortune)
|
||||
{
|
||||
return Blocks.dirt.getItemDropped(Blocks.dirt.getState(), rand, fortune);
|
||||
return Blocks.dirt.getDrop(Blocks.dirt.getState(), rand, fortune);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -137,7 +140,7 @@ public class BlockGrass extends Block implements IGrowable
|
|||
.add().nswe("grass_side_overlay").tint();
|
||||
}
|
||||
|
||||
public Property[] getUnsavedProperties() {
|
||||
protected Property[] getUnsavedProperties() {
|
||||
return new Property[] {SNOWY};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,12 +53,12 @@ public class BlockHugeMushroom extends Block {
|
|||
this.smallBlock = smallBlock;
|
||||
}
|
||||
|
||||
protected int quantityDropped(Random random) {
|
||||
protected int getDropAmount(Random random) {
|
||||
return Math.max(0, random.range(-7, 2));
|
||||
}
|
||||
|
||||
public Item getItemDropped(State state, Random rand, int fortune) {
|
||||
return this.smallBlock.getItemDropped(state, rand, fortune);
|
||||
public Item getDrop(State state, Random rand, int fortune) {
|
||||
return this.smallBlock.getDrop(state, rand, fortune);
|
||||
}
|
||||
|
||||
protected Property[] getProperties() {
|
||||
|
|
|
@ -52,13 +52,12 @@ public class BlockLeaves extends BlockLeavesBase
|
|||
this.type = type;
|
||||
this.subType = subType;
|
||||
this.setDefaultState(this.getBaseState().withProperty(DECAY, true).withProperty(BUSH, false));
|
||||
this.setTickRandomly();
|
||||
this.setTicked();
|
||||
this.setTab(CheatTab.PLANTS);
|
||||
this.setHardness(0.2F);
|
||||
this.setLightOpacity(1);
|
||||
this.setStepSound(SoundType.GRASS);
|
||||
this.setOpacity(1);
|
||||
this.setSound(SoundType.GRASS);
|
||||
this.setFlammable(30, 60);
|
||||
this.setItemColored();
|
||||
LEAVES.add(this);
|
||||
MAPPING[type.ordinal() * LeavesType.values().length + subType.ordinal()] = this;
|
||||
}
|
||||
|
@ -67,7 +66,7 @@ public class BlockLeaves extends BlockLeavesBase
|
|||
return this.subType;
|
||||
}
|
||||
|
||||
public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state)
|
||||
public void onRemoved(AWorldServer worldIn, BlockPos pos, State state)
|
||||
{
|
||||
int i = 1;
|
||||
int j = i + 1;
|
||||
|
@ -96,7 +95,7 @@ public class BlockLeaves extends BlockLeavesBase
|
|||
}
|
||||
}
|
||||
|
||||
public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
|
||||
public void tick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
|
||||
{
|
||||
if(Vars.seasonLeaves && this.subType != worldIn.getLeavesGen(pos)) {
|
||||
worldIn.setState(pos, getLeavesBlock(this.type, worldIn.getLeavesGen(pos)).getState().withProperty(DECAY, state.getValue(DECAY)).withProperty(BUSH, state.getValue(BUSH)), 2);
|
||||
|
@ -217,14 +216,14 @@ public class BlockLeaves extends BlockLeavesBase
|
|||
|
||||
private void destroy(World worldIn, BlockPos pos)
|
||||
{
|
||||
this.dropBlockAsItem(worldIn, pos, worldIn.getState(pos), 0);
|
||||
this.drop(worldIn, pos, worldIn.getState(pos), 0);
|
||||
worldIn.setBlockToAir(pos);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the quantity of items to drop on block destruction.
|
||||
*/
|
||||
protected int quantityDropped(Random random)
|
||||
protected int getDropAmount(Random random)
|
||||
{
|
||||
return random.chance(0, 1, this.type.getSaplingChance());
|
||||
}
|
||||
|
@ -232,7 +231,7 @@ public class BlockLeaves extends BlockLeavesBase
|
|||
/**
|
||||
* Get the Item that this Block should drop when harvested.
|
||||
*/
|
||||
public Item getItemDropped(State state, Random rand, int fortune)
|
||||
public Item getDrop(State state, Random rand, int fortune)
|
||||
{
|
||||
return ItemRegistry.byName(this.type.getName() + "_sapling");
|
||||
}
|
||||
|
@ -240,7 +239,7 @@ public class BlockLeaves extends BlockLeavesBase
|
|||
/**
|
||||
* Spawns this Block's drops into the World as EntityItems.
|
||||
*/
|
||||
public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, State state, float chance, int fortune)
|
||||
public void drop(World worldIn, BlockPos pos, State state, float chance, int fortune)
|
||||
{
|
||||
if (!worldIn.client)
|
||||
{
|
||||
|
@ -258,8 +257,8 @@ public class BlockLeaves extends BlockLeavesBase
|
|||
|
||||
if (worldIn.rand.chance(i))
|
||||
{
|
||||
Item item = this.getItemDropped(state, worldIn.rand, fortune);
|
||||
spawnAsEntity(worldIn, pos, new ItemStack(item));
|
||||
Item item = this.getDrop(state, worldIn.rand, fortune);
|
||||
dropItem(worldIn, pos, new ItemStack(item));
|
||||
}
|
||||
|
||||
i = this.type.getDropChance();
|
||||
|
@ -275,9 +274,13 @@ public class BlockLeaves extends BlockLeavesBase
|
|||
}
|
||||
|
||||
if(this.type.getItem() != null && worldIn.rand.chance(i)) // np
|
||||
spawnAsEntity(worldIn, pos, new ItemStack(ItemRegistry.byName(this.type.getItem())));
|
||||
dropItem(worldIn, pos, new ItemStack(ItemRegistry.byName(this.type.getItem())));
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isItemColored() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public int getRenderColor(State state)
|
||||
{
|
||||
|
@ -296,16 +299,16 @@ public class BlockLeaves extends BlockLeavesBase
|
|||
return new Property[] {DECAY, BUSH};
|
||||
}
|
||||
|
||||
public void harvestBlock(World worldIn, EntityNPC player, BlockPos pos, State state, TileEntity te) {
|
||||
public void postBroken(World worldIn, EntityNPC player, BlockPos pos, State state, TileEntity te) {
|
||||
if(!worldIn.client && player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() instanceof ItemShears) {
|
||||
spawnAsEntity(worldIn, pos, new ItemStack(this.getItem()));
|
||||
dropItem(worldIn, pos, new ItemStack(this.getItem()));
|
||||
}
|
||||
else {
|
||||
super.harvestBlock(worldIn, player, pos, state, te);
|
||||
super.postBroken(worldIn, player, pos, state, te);
|
||||
}
|
||||
}
|
||||
|
||||
public State onBlockPlaced(World worldIn, BlockPos pos, Facing facing, float hitX, float hitY, float hitZ, EntityLiving placer) {
|
||||
public State getPlacedState(World worldIn, BlockPos pos, Facing facing, float hitX, float hitY, float hitZ, EntityLiving placer) {
|
||||
return this.getState().withProperty(DECAY, false).withProperty(BUSH, true);
|
||||
}
|
||||
|
||||
|
|
|
@ -36,19 +36,17 @@ public class BlockLilyPad extends BlockBush implements Rotatable
|
|||
this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, f1, 0.5F + f);
|
||||
this.setDefaultState(this.getBaseState().withProperty(FACING, Facing.NORTH));
|
||||
this.setTab(CheatTab.PLANTS);
|
||||
this.setFlatBlockTexture();
|
||||
this.setItemColored();
|
||||
}
|
||||
|
||||
public void addCollisionBoxesToList(World worldIn, BlockPos pos, State state, BoundingBox mask, List<BoundingBox> list, Entity collidingEntity)
|
||||
public void getCollisionBoxes(World worldIn, BlockPos pos, State state, BoundingBox mask, List<BoundingBox> list, Entity collidingEntity)
|
||||
{
|
||||
if (collidingEntity == null || !(collidingEntity instanceof EntityBoat))
|
||||
{
|
||||
super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity);
|
||||
super.getCollisionBoxes(worldIn, pos, state, mask, list, collidingEntity);
|
||||
}
|
||||
}
|
||||
|
||||
public BoundingBox getCollisionBoundingBox(World worldIn, BlockPos pos, State state)
|
||||
public BoundingBox getCollisionBox(World worldIn, BlockPos pos, State state)
|
||||
{
|
||||
return new BoundingBox((double)pos.getX() + this.minX, (double)pos.getY() + this.minY, (double)pos.getZ() + this.minZ, (double)pos.getX() + this.maxX, (double)pos.getY() + this.maxY, (double)pos.getZ() + this.maxZ);
|
||||
}
|
||||
|
@ -57,6 +55,10 @@ public class BlockLilyPad extends BlockBush implements Rotatable
|
|||
// {
|
||||
// return 7455580;
|
||||
// }
|
||||
|
||||
public boolean isItemColored() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public int getRenderColor(State state)
|
||||
{
|
||||
|
@ -92,7 +94,7 @@ public class BlockLilyPad extends BlockBush implements Rotatable
|
|||
return new Property[] {FACING};
|
||||
}
|
||||
|
||||
public State onBlockPlaced(World worldIn, BlockPos pos, Facing facing, float hitX, float hitY, float hitZ, EntityLiving placer)
|
||||
public State getPlacedState(World worldIn, BlockPos pos, Facing facing, float hitX, float hitY, float hitZ, EntityLiving placer)
|
||||
{
|
||||
return this.getState().withProperty(FACING, placer.getHorizontalFacing().getOpposite());
|
||||
}
|
||||
|
|
|
@ -23,11 +23,11 @@ public class BlockLog extends BlockRotatedPillar
|
|||
this.setDefaultState(this.getBaseState().withProperty(AXIS, Facing.Axis.Y));
|
||||
this.setTab(CheatTab.WOOD);
|
||||
this.setHardness(2.0F);
|
||||
this.setStepSound(SoundType.WOOD);
|
||||
this.setSound(SoundType.WOOD);
|
||||
this.setFlammable(5, 5);
|
||||
}
|
||||
|
||||
public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state)
|
||||
public void onRemoved(AWorldServer worldIn, BlockPos pos, State state)
|
||||
{
|
||||
int r = 4;
|
||||
int l = r + 1;
|
||||
|
@ -46,9 +46,9 @@ public class BlockLog extends BlockRotatedPillar
|
|||
}
|
||||
}
|
||||
|
||||
public State onBlockPlaced(World worldIn, BlockPos pos, Facing facing, float hitX, float hitY, float hitZ, EntityLiving placer)
|
||||
public State getPlacedState(World worldIn, BlockPos pos, Facing facing, float hitX, float hitY, float hitZ, EntityLiving placer)
|
||||
{
|
||||
return super.onBlockPlaced(worldIn, pos, facing, hitX, hitY, hitZ, placer).withProperty(AXIS, facing.getAxis());
|
||||
return super.getPlacedState(worldIn, pos, facing, hitX, hitY, hitZ, placer).withProperty(AXIS, facing.getAxis());
|
||||
}
|
||||
|
||||
public Model getModel(ModelProvider provider, String name, State state) {
|
||||
|
|
|
@ -16,16 +16,16 @@ public class BlockMelon extends Block {
|
|||
this.setTab(CheatTab.PLANTS);
|
||||
}
|
||||
|
||||
public Item getItemDropped(State state, Random rand, int fortune) {
|
||||
public Item getDrop(State state, Random rand, int fortune) {
|
||||
return Items.melon;
|
||||
}
|
||||
|
||||
protected int quantityDropped(Random random) {
|
||||
protected int getDropAmount(Random random) {
|
||||
return random.range(3, 7);
|
||||
}
|
||||
|
||||
protected int quantityDroppedWithBonus(int fortune, Random random) {
|
||||
return Math.min(9, this.quantityDropped(random) + random.zrange(1 + fortune));
|
||||
protected int getDropAmount(int fortune, Random random) {
|
||||
return Math.min(9, this.getDropAmount(random) + random.zrange(1 + fortune));
|
||||
}
|
||||
|
||||
public Model getModel(ModelProvider provider, String name, State state) {
|
||||
|
|
|
@ -19,10 +19,10 @@ public class BlockMushroom extends BlockBush implements IGrowable
|
|||
{
|
||||
float f = 0.2F;
|
||||
this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, f * 2.0F, 0.5F + f);
|
||||
this.setTickRandomly();
|
||||
this.setTicked();
|
||||
}
|
||||
|
||||
public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
|
||||
public void tick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
|
||||
{
|
||||
if (Vars.shroomGrowth > 0 && rand.chance(Vars.shroomGrowth))
|
||||
{
|
||||
|
@ -61,9 +61,9 @@ public class BlockMushroom extends BlockBush implements IGrowable
|
|||
}
|
||||
}
|
||||
|
||||
public boolean canPlaceBlockAt(World worldIn, BlockPos pos)
|
||||
public boolean canPlace(World worldIn, BlockPos pos)
|
||||
{
|
||||
return super.canPlaceBlockAt(worldIn, pos) && this.canBlockStay(worldIn, pos, this.getState());
|
||||
return super.canPlace(worldIn, pos) && this.canBlockStay(worldIn, pos, this.getState());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -26,7 +26,7 @@ public class BlockMycelium extends Block
|
|||
{
|
||||
super(Material.LOOSE);
|
||||
this.setDefaultState(this.getBaseState().withProperty(SNOWY, Boolean.valueOf(false)));
|
||||
this.setTickRandomly();
|
||||
this.setTicked();
|
||||
this.setTab(CheatTab.NATURE);
|
||||
}
|
||||
|
||||
|
@ -34,13 +34,13 @@ public class BlockMycelium extends Block
|
|||
* Get the actual Block state of this Block at the given position. This applies properties not visible in the
|
||||
* metadata, such as fence connections.
|
||||
*/
|
||||
public State getActualState(State state, IWorldAccess worldIn, BlockPos pos)
|
||||
public State getState(State state, IWorldAccess worldIn, BlockPos pos)
|
||||
{
|
||||
Block block = worldIn.getState(pos.up()).getBlock();
|
||||
return state.withProperty(SNOWY, Boolean.valueOf(block == Blocks.snow || block == Blocks.snow_layer));
|
||||
}
|
||||
|
||||
public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
|
||||
public void tick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
|
||||
{
|
||||
// if (!worldIn.client)
|
||||
// {
|
||||
|
@ -69,9 +69,9 @@ public class BlockMycelium extends Block
|
|||
// }
|
||||
}
|
||||
|
||||
public void randomDisplayTick(AWorldClient worldIn, BlockPos pos, State state, Random rand)
|
||||
public void displayTick(AWorldClient worldIn, BlockPos pos, State state, Random rand)
|
||||
{
|
||||
super.randomDisplayTick(worldIn, pos, state, rand);
|
||||
super.displayTick(worldIn, pos, state, rand);
|
||||
|
||||
if (rand.chance(10))
|
||||
{
|
||||
|
@ -82,9 +82,9 @@ public class BlockMycelium extends Block
|
|||
/**
|
||||
* Get the Item that this Block should drop when harvested.
|
||||
*/
|
||||
public Item getItemDropped(State state, Random rand, int fortune)
|
||||
public Item getDrop(State state, Random rand, int fortune)
|
||||
{
|
||||
return Blocks.dirt.getItemDropped(Blocks.dirt.getState(), rand, fortune);
|
||||
return Blocks.dirt.getDrop(Blocks.dirt.getState(), rand, fortune);
|
||||
}
|
||||
|
||||
protected Property[] getProperties()
|
||||
|
@ -99,7 +99,7 @@ public class BlockMycelium extends Block
|
|||
return provider.getModel("mycelium_side").add().nswe().d("dirt").u("mycelium_top");
|
||||
}
|
||||
|
||||
public Property[] getUnsavedProperties() {
|
||||
protected Property[] getUnsavedProperties() {
|
||||
return new Property[] {SNOWY};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,15 +26,15 @@ public class BlockPotato extends BlockCrops
|
|||
/**
|
||||
* Spawns this Block's drops into the World as EntityItems.
|
||||
*/
|
||||
public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, State state, float chance, int fortune)
|
||||
public void drop(World worldIn, BlockPos pos, State state, float chance, int fortune)
|
||||
{
|
||||
super.dropBlockAsItemWithChance(worldIn, pos, state, chance, fortune);
|
||||
super.drop(worldIn, pos, state, chance, fortune);
|
||||
|
||||
if (!worldIn.client)
|
||||
{
|
||||
if (((Integer)state.getValue(AGE)).intValue() >= 7 && worldIn.rand.chance(50))
|
||||
{
|
||||
spawnAsEntity(worldIn, pos, new ItemStack(Items.poisonous_potato));
|
||||
dropItem(worldIn, pos, new ItemStack(Items.poisonous_potato));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ public class BlockPumpkin extends Block {
|
|||
this.setTab(CheatTab.PLANTS);
|
||||
}
|
||||
|
||||
public boolean canPlaceBlockAt(World world, BlockPos pos) {
|
||||
public boolean canPlace(World world, BlockPos pos) {
|
||||
return world.getState(pos).getBlock().getMaterial().isReplaceable() && world.isBlockSolid(pos.down());
|
||||
}
|
||||
|
||||
|
|
|
@ -31,10 +31,10 @@ public class BlockReed extends Block
|
|||
this.setDefaultState(this.getBaseState().withProperty(AGE, Integer.valueOf(0)));
|
||||
float f = 0.375F;
|
||||
this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 1.0F, 0.5F + f);
|
||||
this.setTickRandomly();
|
||||
this.setTicked();
|
||||
}
|
||||
|
||||
public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
|
||||
public void tick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
|
||||
{
|
||||
if(Vars.reedDry && worldIn.getTemperatureC(pos) >= 50.0f)
|
||||
{
|
||||
|
@ -70,7 +70,7 @@ public class BlockReed extends Block
|
|||
}
|
||||
}
|
||||
|
||||
public boolean canPlaceBlockAt(World worldIn, BlockPos pos)
|
||||
public boolean canPlace(World worldIn, BlockPos pos)
|
||||
{
|
||||
Block block = worldIn.getState(pos.down()).getBlock();
|
||||
|
||||
|
@ -99,7 +99,7 @@ public class BlockReed extends Block
|
|||
/**
|
||||
* Called when a neighboring block changes.
|
||||
*/
|
||||
public void onNeighborBlockChange(World worldIn, BlockPos pos, State state, Block neighborBlock)
|
||||
public void onUpdate(World worldIn, BlockPos pos, State state, Block neighborBlock)
|
||||
{
|
||||
this.checkForDrop(worldIn, pos, state);
|
||||
}
|
||||
|
@ -112,7 +112,7 @@ public class BlockReed extends Block
|
|||
}
|
||||
else
|
||||
{
|
||||
this.dropBlockAsItem(worldIn, pos, state, 0);
|
||||
this.drop(worldIn, pos, state, 0);
|
||||
worldIn.setBlockToAir(pos);
|
||||
return false;
|
||||
}
|
||||
|
@ -120,10 +120,10 @@ public class BlockReed extends Block
|
|||
|
||||
public boolean canBlockStay(World worldIn, BlockPos pos)
|
||||
{
|
||||
return this.canPlaceBlockAt(worldIn, pos);
|
||||
return this.canPlace(worldIn, pos);
|
||||
}
|
||||
|
||||
public BoundingBox getCollisionBoundingBox(World worldIn, BlockPos pos, State state)
|
||||
public BoundingBox getCollisionBox(World worldIn, BlockPos pos, State state)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
@ -164,7 +164,7 @@ public class BlockReed extends Block
|
|||
return new Property[] {AGE};
|
||||
}
|
||||
|
||||
public StackSize getMaxStackSize() {
|
||||
public StackSize getMaxAmount() {
|
||||
return StackSize.L;
|
||||
}
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ public class BlockSapling extends BlockBush implements IGrowable
|
|||
// return I18n.translate(this.getUnlocalizedName() + "." + BlockPlanks.EnumType.OAK.getUnlocalizedName() + ".name");
|
||||
// }
|
||||
|
||||
public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
|
||||
public void tick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
|
||||
{
|
||||
if(Vars.saplingDry && worldIn.getTemperatureC(pos) >= 50.0f)
|
||||
{
|
||||
|
@ -56,7 +56,7 @@ public class BlockSapling extends BlockBush implements IGrowable
|
|||
}
|
||||
// if (!worldIn.client)
|
||||
// {
|
||||
super.updateTick(worldIn, pos, state, rand);
|
||||
super.tick(worldIn, pos, state, rand);
|
||||
|
||||
if (Vars.treeGrowth > 0 && worldIn.getLightFromNeighbors(pos.up()) >= 9 && rand.chance(Vars.treeGrowth))
|
||||
{
|
||||
|
|
|
@ -31,7 +31,7 @@ public class BlockStem extends BlockBush implements IGrowable
|
|||
{
|
||||
this.setDefaultState(this.getBaseState().withProperty(AGE, 0));
|
||||
this.crop = crop;
|
||||
this.setTickRandomly();
|
||||
this.setTicked();
|
||||
float f = 0.125F;
|
||||
this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.25F, 0.5F + f);
|
||||
this.setTab((CheatTab)null);
|
||||
|
@ -45,9 +45,9 @@ public class BlockStem extends BlockBush implements IGrowable
|
|||
return ground == Blocks.farmland;
|
||||
}
|
||||
|
||||
public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
|
||||
public void tick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
|
||||
{
|
||||
super.updateTick(worldIn, pos, state, rand);
|
||||
super.tick(worldIn, pos, state, rand);
|
||||
|
||||
if (Vars.stemGrowth > 0 && worldIn.getLightFromNeighbors(pos.up()) >= 9)
|
||||
{
|
||||
|
@ -111,13 +111,13 @@ public class BlockStem extends BlockBush implements IGrowable
|
|||
/**
|
||||
* Sets the block's bounds for rendering it as an item
|
||||
*/
|
||||
public void setBlockBoundsForItemRender()
|
||||
public void setItemBounds()
|
||||
{
|
||||
float f = 0.125F;
|
||||
this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.25F, 0.5F + f);
|
||||
}
|
||||
|
||||
public void setBlockBoundsBasedOnState(IWorldAccess worldIn, BlockPos pos)
|
||||
public void setBlockBounds(IWorldAccess worldIn, BlockPos pos)
|
||||
{
|
||||
this.maxY = (double)((float)(((Integer)worldIn.getState(pos).getValue(AGE)).intValue() * 2 + 2) / 16.0F);
|
||||
float f = 0.125F;
|
||||
|
@ -127,9 +127,9 @@ public class BlockStem extends BlockBush implements IGrowable
|
|||
/**
|
||||
* Spawns this Block's drops into the World as EntityItems.
|
||||
*/
|
||||
public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, State state, float chance, int fortune)
|
||||
public void drop(World worldIn, BlockPos pos, State state, float chance, int fortune)
|
||||
{
|
||||
super.dropBlockAsItemWithChance(worldIn, pos, state, chance, fortune);
|
||||
super.drop(worldIn, pos, state, chance, fortune);
|
||||
|
||||
if (!worldIn.client)
|
||||
{
|
||||
|
@ -139,7 +139,7 @@ public class BlockStem extends BlockBush implements IGrowable
|
|||
{
|
||||
if (worldIn.rand.zrange(15) <= i)
|
||||
{
|
||||
spawnAsEntity(worldIn, pos, new ItemStack(this == Blocks.melon_stem ? Items.melon_seed : Items.pumpkin_seed));
|
||||
dropItem(worldIn, pos, new ItemStack(this == Blocks.melon_stem ? Items.melon_seed : Items.pumpkin_seed));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,8 +38,6 @@ public class BlockTallGrass extends BlockBush implements IGrowable
|
|||
float f = 0.4F;
|
||||
this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.8F, 0.5F + f);
|
||||
this.setFlammable(60, 100);
|
||||
this.setFlatBlockTexture();
|
||||
this.setItemColored();
|
||||
BUSHES[type.ordinal()] = this;
|
||||
}
|
||||
|
||||
|
@ -47,7 +45,7 @@ public class BlockTallGrass extends BlockBush implements IGrowable
|
|||
return this.type;
|
||||
}
|
||||
|
||||
public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
|
||||
public void tick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
|
||||
{
|
||||
if(Vars.tallgrassDry && worldIn.getTemperatureC(pos) >= 50.0f && this.type != EnumType.DEAD_BUSH)
|
||||
{
|
||||
|
@ -55,7 +53,7 @@ public class BlockTallGrass extends BlockBush implements IGrowable
|
|||
Blocks.dead_bush.getState());
|
||||
return;
|
||||
}
|
||||
super.updateTick(worldIn, pos, state, rand);
|
||||
super.tick(worldIn, pos, state, rand);
|
||||
}
|
||||
|
||||
public boolean canBlockStay(World worldIn, BlockPos pos, State state)
|
||||
|
@ -66,10 +64,14 @@ public class BlockTallGrass extends BlockBush implements IGrowable
|
|||
/**
|
||||
* Whether this Block can be replaced directly by other blocks (true for e.g. tall grass)
|
||||
*/
|
||||
public boolean isReplaceable(World worldIn, BlockPos pos)
|
||||
public boolean canReplace(World worldIn, BlockPos pos)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean isItemColored() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public int getRenderColor(State state)
|
||||
{
|
||||
|
@ -91,7 +93,7 @@ public class BlockTallGrass extends BlockBush implements IGrowable
|
|||
/**
|
||||
* Get the Item that this Block should drop when harvested.
|
||||
*/
|
||||
public Item getItemDropped(State state, Random rand, int fortune)
|
||||
public Item getDrop(State state, Random rand, int fortune)
|
||||
{
|
||||
return rand.chance(8) ? Items.wheat_seed : null;
|
||||
}
|
||||
|
@ -99,20 +101,20 @@ public class BlockTallGrass extends BlockBush implements IGrowable
|
|||
/**
|
||||
* Get the quantity dropped based on the given fortune level
|
||||
*/
|
||||
protected int quantityDroppedWithBonus(int fortune, Random random)
|
||||
protected int getDropAmount(int fortune, Random random)
|
||||
{
|
||||
return random.roll(fortune * 2 + 1);
|
||||
}
|
||||
|
||||
public void harvestBlock(World worldIn, EntityNPC player, BlockPos pos, State state, TileEntity te)
|
||||
public void postBroken(World worldIn, EntityNPC player, BlockPos pos, State state, TileEntity te)
|
||||
{
|
||||
if (!worldIn.client && player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() instanceof ItemShears)
|
||||
{
|
||||
spawnAsEntity(worldIn, pos, new ItemStack(this.getItem()));
|
||||
dropItem(worldIn, pos, new ItemStack(this.getItem()));
|
||||
}
|
||||
else
|
||||
{
|
||||
super.harvestBlock(worldIn, player, pos, state, te);
|
||||
super.postBroken(worldIn, player, pos, state, te);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -138,7 +140,7 @@ public class BlockTallGrass extends BlockBush implements IGrowable
|
|||
block = Blocks.large_fern;
|
||||
}
|
||||
|
||||
if (block.canPlaceBlockAt(worldIn, pos))
|
||||
if (block.canPlace(worldIn, pos))
|
||||
{
|
||||
block.placeAt(worldIn, pos, 2);
|
||||
}
|
||||
|
|
|
@ -25,15 +25,15 @@ public class BlockTianSoil extends Block
|
|||
this.setTab(CheatTab.NATURE);
|
||||
}
|
||||
|
||||
public State getActualState(State state, IWorldAccess worldIn, BlockPos pos)
|
||||
public State getState(State state, IWorldAccess worldIn, BlockPos pos)
|
||||
{
|
||||
Block block = worldIn.getState(pos.up()).getBlock();
|
||||
return state.withProperty(SNOWY, Boolean.valueOf(block == Blocks.snow || block == Blocks.snow_layer));
|
||||
}
|
||||
|
||||
public Item getItemDropped(State state, Random rand, int fortune)
|
||||
public Item getDrop(State state, Random rand, int fortune)
|
||||
{
|
||||
return Blocks.tian.getItemDropped(Blocks.tian.getState(), rand, fortune);
|
||||
return Blocks.tian.getDrop(Blocks.tian.getState(), rand, fortune);
|
||||
}
|
||||
|
||||
protected Property[] getProperties()
|
||||
|
@ -48,7 +48,7 @@ public class BlockTianSoil extends Block
|
|||
return provider.getModel("tian_soil_side").add().nswe().d("tian").u("tian_soil_top");
|
||||
}
|
||||
|
||||
public Property[] getUnsavedProperties() {
|
||||
protected Property[] getUnsavedProperties() {
|
||||
return new Property[] {SNOWY};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,26 +42,24 @@ public class BlockVine extends Block
|
|||
{
|
||||
super(Material.BUSH);
|
||||
this.setDefaultState(this.getBaseState().withProperty(UP, Boolean.valueOf(false)).withProperty(NORTH, Boolean.valueOf(false)).withProperty(EAST, Boolean.valueOf(false)).withProperty(SOUTH, Boolean.valueOf(false)).withProperty(WEST, Boolean.valueOf(false)));
|
||||
this.setTickRandomly();
|
||||
this.setTicked();
|
||||
this.setTab(CheatTab.PLANTS);
|
||||
this.setFlammable(15, 100);
|
||||
this.setFlatBlockTexture();
|
||||
this.setItemColored();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the actual Block state of this Block at the given position. This applies properties not visible in the
|
||||
* metadata, such as fence connections.
|
||||
*/
|
||||
public State getActualState(State state, IWorldAccess worldIn, BlockPos pos)
|
||||
public State getState(State state, IWorldAccess worldIn, BlockPos pos)
|
||||
{
|
||||
return state.withProperty(UP, Boolean.valueOf(worldIn.getState(pos.up()).getBlock().isBlockNormalCube()));
|
||||
return state.withProperty(UP, Boolean.valueOf(worldIn.getState(pos.up()).getBlock().isBlockingCube()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the block's bounds for rendering it as an item
|
||||
*/
|
||||
public void setBlockBoundsForItemRender()
|
||||
public void setItemBounds()
|
||||
{
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
|
@ -82,12 +80,12 @@ public class BlockVine extends Block
|
|||
/**
|
||||
* Whether this Block can be replaced directly by other blocks (true for e.g. tall grass)
|
||||
*/
|
||||
public boolean isReplaceable(World worldIn, BlockPos pos)
|
||||
public boolean canReplace(World worldIn, BlockPos pos)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public void setBlockBoundsBasedOnState(IWorldAccess worldIn, BlockPos pos)
|
||||
public void setBlockBounds(IWorldAccess worldIn, BlockPos pos)
|
||||
{
|
||||
float f = 0.0625F;
|
||||
float f1 = 1.0F;
|
||||
|
@ -155,7 +153,7 @@ public class BlockVine extends Block
|
|||
this.setBlockBounds(f1, f2, f3, f4, f5, f6);
|
||||
}
|
||||
|
||||
public BoundingBox getCollisionBoundingBox(World worldIn, BlockPos pos, State state)
|
||||
public BoundingBox getCollisionBox(World worldIn, BlockPos pos, State state)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
@ -163,7 +161,7 @@ public class BlockVine extends Block
|
|||
/**
|
||||
* Check whether this Block can be placed on the given side
|
||||
*/
|
||||
public boolean canPlaceBlockOnSide(World worldIn, BlockPos pos, Facing side)
|
||||
public boolean canPlace(World worldIn, BlockPos pos, Facing side)
|
||||
{
|
||||
switch (side)
|
||||
{
|
||||
|
@ -224,6 +222,10 @@ public class BlockVine extends Block
|
|||
// {
|
||||
// return ColorizerFoliage.getFoliageColorBasic();
|
||||
// }
|
||||
|
||||
public boolean isItemColored() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public int getRenderColor(State state)
|
||||
{
|
||||
|
@ -238,16 +240,16 @@ public class BlockVine extends Block
|
|||
/**
|
||||
* Called when a neighboring block changes.
|
||||
*/
|
||||
public void onNeighborBlockChange(World worldIn, BlockPos pos, State state, Block neighborBlock)
|
||||
public void onUpdate(World worldIn, BlockPos pos, State state, Block neighborBlock)
|
||||
{
|
||||
if (!worldIn.client && !this.recheckGrownSides(worldIn, pos, state))
|
||||
{
|
||||
this.dropBlockAsItem(worldIn, pos, state, 0);
|
||||
this.drop(worldIn, pos, state, 0);
|
||||
worldIn.setBlockToAir(pos);
|
||||
}
|
||||
}
|
||||
|
||||
public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
|
||||
public void tick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
|
||||
{
|
||||
if(Vars.vineDry && worldIn.getTemperatureC(pos) >= 50.0f)
|
||||
{
|
||||
|
@ -403,7 +405,7 @@ public class BlockVine extends Block
|
|||
* Called by ItemBlocks just before a block is actually set in the world, to allow for adjustments to the
|
||||
* IBlockstate
|
||||
*/
|
||||
public State onBlockPlaced(World worldIn, BlockPos pos, Facing facing, float hitX, float hitY, float hitZ, EntityLiving placer)
|
||||
public State getPlacedState(World worldIn, BlockPos pos, Facing facing, float hitX, float hitY, float hitZ, EntityLiving placer)
|
||||
{
|
||||
State iblockstate = this.getState().withProperty(UP, Boolean.valueOf(false)).withProperty(NORTH, Boolean.valueOf(false)).withProperty(EAST, Boolean.valueOf(false)).withProperty(SOUTH, Boolean.valueOf(false)).withProperty(WEST, Boolean.valueOf(false));
|
||||
return facing.getAxis().isHorizontal() ? iblockstate.withProperty(getPropertyFor(facing.getOpposite()), Boolean.valueOf(true)) : iblockstate;
|
||||
|
@ -412,7 +414,7 @@ public class BlockVine extends Block
|
|||
/**
|
||||
* Get the Item that this Block should drop when harvested.
|
||||
*/
|
||||
public Item getItemDropped(State state, Random rand, int fortune)
|
||||
public Item getDrop(State state, Random rand, int fortune)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
@ -420,21 +422,21 @@ public class BlockVine extends Block
|
|||
/**
|
||||
* Returns the quantity of items to drop on block destruction.
|
||||
*/
|
||||
protected int quantityDropped(Random random)
|
||||
protected int getDropAmount(Random random)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void harvestBlock(World worldIn, EntityNPC player, BlockPos pos, State state, TileEntity te)
|
||||
public void postBroken(World worldIn, EntityNPC player, BlockPos pos, State state, TileEntity te)
|
||||
{
|
||||
if (!worldIn.client && player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() instanceof ItemShears)
|
||||
{
|
||||
// player.triggerAchievement(StatRegistry.mineBlockStatArray[BlockRegistry.getIdFromBlock(this)]);
|
||||
spawnAsEntity(worldIn, pos, new ItemStack(Items.vine));
|
||||
dropItem(worldIn, pos, new ItemStack(Items.vine));
|
||||
}
|
||||
else
|
||||
{
|
||||
super.harvestBlock(worldIn, player, pos, state, te);
|
||||
super.postBroken(worldIn, player, pos, state, te);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -562,7 +564,7 @@ public class BlockVine extends Block
|
|||
return Transform.PANE_SIDE;
|
||||
}
|
||||
|
||||
public Property[] getUnsavedProperties() {
|
||||
protected Property[] getUnsavedProperties() {
|
||||
return new Property[] {UP};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ public class BlockWart extends BlockBush
|
|||
{
|
||||
super(Material.PLANT);
|
||||
this.setDefaultState(this.getBaseState().withProperty(AGE, Integer.valueOf(0)));
|
||||
this.setTickRandomly();
|
||||
this.setTicked();
|
||||
float f = 0.5F;
|
||||
this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.25F, 0.5F + f);
|
||||
this.setTab((CheatTab)null);
|
||||
|
@ -47,7 +47,7 @@ public class BlockWart extends BlockBush
|
|||
return this.canPlaceBlockOn(worldIn.getState(pos.down()).getBlock());
|
||||
}
|
||||
|
||||
public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
|
||||
public void tick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
|
||||
{
|
||||
if(Vars.wartGrowth > 0) {
|
||||
int i = ((Integer)state.getValue(AGE)).intValue();
|
||||
|
@ -59,13 +59,13 @@ public class BlockWart extends BlockBush
|
|||
}
|
||||
}
|
||||
|
||||
super.updateTick(worldIn, pos, state, rand);
|
||||
super.tick(worldIn, pos, state, rand);
|
||||
}
|
||||
|
||||
/**
|
||||
* Spawns this Block's drops into the World as EntityItems.
|
||||
*/
|
||||
public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, State state, float chance, int fortune)
|
||||
public void drop(World worldIn, BlockPos pos, State state, float chance, int fortune)
|
||||
{
|
||||
if (!worldIn.client)
|
||||
{
|
||||
|
@ -83,7 +83,7 @@ public class BlockWart extends BlockBush
|
|||
|
||||
for (int j = 0; j < i; ++j)
|
||||
{
|
||||
spawnAsEntity(worldIn, pos, new ItemStack(Items.soul_wart));
|
||||
dropItem(worldIn, pos, new ItemStack(Items.soul_wart));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -91,7 +91,7 @@ public class BlockWart extends BlockBush
|
|||
/**
|
||||
* Returns the quantity of items to drop on block destruction.
|
||||
*/
|
||||
protected int quantityDropped(Random random)
|
||||
protected int getDropAmount(Random random)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ public class BlockDynamicLiquid extends BlockLiquid
|
|||
worldIn.setState(pos, this.staticBlock.getState().withProperty(LEVEL, currentState.getValue(LEVEL)), 2);
|
||||
}
|
||||
|
||||
public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
|
||||
public void tick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
|
||||
{
|
||||
if(!Vars.liquidPhysics)
|
||||
return;
|
||||
|
@ -189,7 +189,7 @@ public class BlockDynamicLiquid extends BlockLiquid
|
|||
}
|
||||
else
|
||||
{
|
||||
state.getBlock().dropBlockAsItem(worldIn, pos, state, 0);
|
||||
state.getBlock().drop(worldIn, pos, state, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -306,7 +306,7 @@ public class BlockDynamicLiquid extends BlockLiquid
|
|||
return (this.material == Material.LAVA || !(state.getBlock() instanceof BlockLiquid) || (state.getBlock() instanceof BlockStaticLiquid ? ((BlockStaticLiquid)state.getBlock()).getFlowingBlock() : state.getBlock()) == this) && material != this.material && material != Material.LAVA && !this.isBlocked(worldIn, pos, state);
|
||||
}
|
||||
|
||||
public void onBlockAdded(AWorldServer worldIn, BlockPos pos, State state)
|
||||
public void onAdded(AWorldServer worldIn, BlockPos pos, State state)
|
||||
{
|
||||
if (!this.checkForMixing(worldIn, pos, state))
|
||||
{
|
||||
|
|
|
@ -46,7 +46,7 @@ public abstract class BlockLiquid extends Block
|
|||
this.setDefaultState(this.getBaseState().withProperty(LEVEL, Integer.valueOf(0)));
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
if(tick)
|
||||
this.setTickRandomly();
|
||||
this.setTicked();
|
||||
this.opaque = opaque;
|
||||
this.flowRate = rate;
|
||||
this.animation = animation;
|
||||
|
@ -103,7 +103,7 @@ public abstract class BlockLiquid extends Block
|
|||
return false;
|
||||
}
|
||||
|
||||
public boolean canCollideCheck(State state, boolean liquid)
|
||||
public boolean canRayTrace(State state, boolean liquid)
|
||||
{
|
||||
return liquid && ((Integer)state.getValue(LEVEL)).intValue() == 0;
|
||||
}
|
||||
|
@ -114,9 +114,9 @@ public abstract class BlockLiquid extends Block
|
|||
return block.getMaterial() == this.material ? false : (side == Facing.UP ? true : (block != Blocks.ice && worldIn.getState(pos).getBlock().getMaterial().isSolid()));
|
||||
}
|
||||
|
||||
public boolean shouldSideBeRendered(IWorldAccess worldIn, BlockPos pos, Facing side)
|
||||
public boolean canRender(IWorldAccess worldIn, BlockPos pos, Facing side)
|
||||
{
|
||||
return worldIn.getState(pos).getBlock().getMaterial() == this.material ? false : (side == Facing.UP ? true : super.shouldSideBeRendered(worldIn, pos, side));
|
||||
return worldIn.getState(pos).getBlock().getMaterial() == this.material ? false : (side == Facing.UP ? true : super.canRender(worldIn, pos, side));
|
||||
}
|
||||
|
||||
public boolean shouldRenderSides(IBlockAccess blockAccess, BlockPos pos)
|
||||
|
@ -139,7 +139,7 @@ public abstract class BlockLiquid extends Block
|
|||
return false;
|
||||
}
|
||||
|
||||
public BoundingBox getCollisionBoundingBox(World worldIn, BlockPos pos, State state)
|
||||
public BoundingBox getCollisionBox(World worldIn, BlockPos pos, State state)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
@ -155,7 +155,7 @@ public abstract class BlockLiquid extends Block
|
|||
/**
|
||||
* Get the Item that this Block should drop when harvested.
|
||||
*/
|
||||
public Item getItemDropped(State state, Random rand, int fortune)
|
||||
public Item getDrop(State state, Random rand, int fortune)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
@ -163,7 +163,7 @@ public abstract class BlockLiquid extends Block
|
|||
/**
|
||||
* Returns the quantity of items to drop on block destruction.
|
||||
*/
|
||||
protected int quantityDropped(Random random)
|
||||
protected int getDropAmount(Random random)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
@ -215,7 +215,7 @@ public abstract class BlockLiquid extends Block
|
|||
return vec3.normalize();
|
||||
}
|
||||
|
||||
public Vec3 modifyAcceleration(World worldIn, BlockPos pos, Entity entityIn, Vec3 motion)
|
||||
public Vec3 getAcceleration(World worldIn, BlockPos pos, Entity entityIn, Vec3 motion)
|
||||
{
|
||||
return motion.add(this.getFlowVector(worldIn, pos));
|
||||
}
|
||||
|
@ -228,7 +228,7 @@ public abstract class BlockLiquid extends Block
|
|||
return this.flowRate >= 0 ? this.flowRate : (worldIn.isLavaFaster(pos) ? (-this.flowRate / 3) : (-this.flowRate));
|
||||
}
|
||||
|
||||
public int getMixedBrightnessForBlock(IWorldAccess worldIn, BlockPos pos)
|
||||
public int getLightmapValue(IWorldAccess worldIn, BlockPos pos)
|
||||
{
|
||||
int i = worldIn.getCombinedLight(pos, 0);
|
||||
int j = worldIn.getCombinedLight(pos.up(), 0);
|
||||
|
@ -244,7 +244,7 @@ public abstract class BlockLiquid extends Block
|
|||
return this.opaque ? BlockLayer.SOLID : BlockLayer.TRANSLUCENT;
|
||||
}
|
||||
|
||||
public void randomDisplayTick(AWorldClient worldIn, BlockPos pos, State state, Random rand)
|
||||
public void displayTick(AWorldClient worldIn, BlockPos pos, State state, Random rand)
|
||||
{
|
||||
double d0 = (double)pos.getX();
|
||||
double d1 = (double)pos.getY();
|
||||
|
@ -287,7 +287,7 @@ public abstract class BlockLiquid extends Block
|
|||
return vec3.xCoord == 0.0D && vec3.zCoord == 0.0D ? -1000.0D : ExtMath.atan2(vec3.zCoord, vec3.xCoord) - (Math.PI / 2D);
|
||||
}
|
||||
|
||||
public void onBlockAdded(AWorldServer worldIn, BlockPos pos, State state)
|
||||
public void onAdded(AWorldServer worldIn, BlockPos pos, State state)
|
||||
{
|
||||
this.checkForMixing(worldIn, pos, state);
|
||||
}
|
||||
|
@ -295,7 +295,7 @@ public abstract class BlockLiquid extends Block
|
|||
/**
|
||||
* Called when a neighboring block changes.
|
||||
*/
|
||||
public void onNeighborBlockChange(World worldIn, BlockPos pos, State state, Block neighborBlock)
|
||||
public void onUpdate(World worldIn, BlockPos pos, State state, Block neighborBlock)
|
||||
{
|
||||
this.checkForMixing(worldIn, pos, state);
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ public class BlockStaticLiquid extends BlockLiquid
|
|||
/**
|
||||
* Called when a neighboring block changes.
|
||||
*/
|
||||
public void onNeighborBlockChange(World worldIn, BlockPos pos, State state, Block neighborBlock)
|
||||
public void onUpdate(World worldIn, BlockPos pos, State state, Block neighborBlock)
|
||||
{
|
||||
if (!this.checkForMixing(worldIn, pos, state))
|
||||
{
|
||||
|
@ -48,7 +48,7 @@ public class BlockStaticLiquid extends BlockLiquid
|
|||
worldIn.scheduleUpdate(pos, this.dynamicBlock, this.tickRate(worldIn, pos));
|
||||
}
|
||||
|
||||
public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
|
||||
public void tick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
|
||||
{
|
||||
if (Vars.lavaFire && this.material == Material.LAVA)
|
||||
{
|
||||
|
|
|
@ -13,7 +13,7 @@ public class BlockBedrock extends Block {
|
|||
super(Material.SOLID);
|
||||
}
|
||||
|
||||
public void randomDisplayTick(AWorldClient worldIn, BlockPos pos, State state, Random rand)
|
||||
public void displayTick(AWorldClient worldIn, BlockPos pos, State state, Random rand)
|
||||
{
|
||||
if(/* worldIn.canShowVoidParticles() && */ pos.getY() <= 5 && rand.chance(8)) {
|
||||
worldIn.spawnParticle(ParticleType.DEPTH, (double)pos.getX() + rand.floatv(), (double)(pos.getY()+1) + (rand.floatv() * 0.5f),
|
||||
|
|
|
@ -16,11 +16,11 @@ public class BlockBlackenedDirt extends Block
|
|||
public BlockBlackenedDirt()
|
||||
{
|
||||
super(Material.LOOSE);
|
||||
this.setTickRandomly();
|
||||
this.setTicked();
|
||||
this.setTab(CheatTab.NATURE);
|
||||
}
|
||||
|
||||
public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
|
||||
public void tick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
|
||||
{
|
||||
if (Vars.darkDirtSpread)
|
||||
{
|
||||
|
|
|
@ -14,7 +14,7 @@ public class BlockBlackenedStone extends Block {
|
|||
this.setTab(CheatTab.ROCK);
|
||||
}
|
||||
|
||||
public Item getItemDropped(State state, Random rand, int fortune) {
|
||||
public Item getDrop(State state, Random rand, int fortune) {
|
||||
return Items.blackened_cobble;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ public class BlockClay extends Block
|
|||
/**
|
||||
* Get the Item that this Block should drop when harvested.
|
||||
*/
|
||||
public Item getItemDropped(State state, Random rand, int fortune)
|
||||
public Item getDrop(State state, Random rand, int fortune)
|
||||
{
|
||||
return Items.clay_ball;
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ public class BlockClay extends Block
|
|||
/**
|
||||
* Returns the quantity of items to drop on block destruction.
|
||||
*/
|
||||
protected int quantityDropped(Random random)
|
||||
protected int getDropAmount(Random random)
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@ public class BlockFire extends Block
|
|||
* Get the actual Block state of this Block at the given position. This applies properties not visible in the
|
||||
* metadata, such as fence connections.
|
||||
*/
|
||||
public State getActualState(State state, IWorldAccess worldIn, BlockPos pos)
|
||||
public State getState(State state, IWorldAccess worldIn, BlockPos pos)
|
||||
{
|
||||
int i = pos.getX();
|
||||
int j = pos.getY();
|
||||
|
@ -72,10 +72,10 @@ public class BlockFire extends Block
|
|||
{
|
||||
super(Material.FIRE);
|
||||
this.setDefaultState(this.getBaseState().withProperty(AGE, Integer.valueOf(0)).withProperty(FLIP, Boolean.valueOf(false)).withProperty(ALT, Boolean.valueOf(false)).withProperty(NORTH, Boolean.valueOf(false)).withProperty(EAST, Boolean.valueOf(false)).withProperty(SOUTH, Boolean.valueOf(false)).withProperty(WEST, Boolean.valueOf(false)).withProperty(UPPER, Integer.valueOf(0)));
|
||||
this.setTickRandomly();
|
||||
this.setTicked();
|
||||
}
|
||||
|
||||
public BoundingBox getCollisionBoundingBox(World worldIn, BlockPos pos, State state)
|
||||
public BoundingBox getCollisionBox(World worldIn, BlockPos pos, State state)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
@ -96,7 +96,7 @@ public class BlockFire extends Block
|
|||
/**
|
||||
* Returns the quantity of items to drop on block destruction.
|
||||
*/
|
||||
protected int quantityDropped(Random random)
|
||||
protected int getDropAmount(Random random)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
@ -109,11 +109,11 @@ public class BlockFire extends Block
|
|||
return 30;
|
||||
}
|
||||
|
||||
public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
|
||||
public void tick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
|
||||
{
|
||||
if (Vars.fire)
|
||||
{
|
||||
if (!this.canPlaceBlockAt(worldIn, pos))
|
||||
if (!this.canPlace(worldIn, pos))
|
||||
{
|
||||
worldIn.setBlockToAir(pos);
|
||||
}
|
||||
|
@ -231,7 +231,7 @@ public class BlockFire extends Block
|
|||
return world.isRaining() && (world.isRainingAt(pos, true) || world.isRainingAt(pos.west(), true) || world.isRainingAt(pos.east(), true) || world.isRainingAt(pos.north(), true) || world.isRainingAt(pos.south(), true));
|
||||
}
|
||||
|
||||
public boolean requiresUpdates()
|
||||
public boolean canTick()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -260,7 +260,7 @@ public class BlockFire extends Block
|
|||
world.setBlockToAir(pos);
|
||||
}
|
||||
|
||||
iblockstate.getBlock().onDestroyedByFire(world, pos, iblockstate);
|
||||
iblockstate.getBlock().onDestroyedFire(world, pos, iblockstate);
|
||||
// if (iblockstate.getBlock() == Blocks.tnt)
|
||||
// {
|
||||
// Blocks.tnt.onBlockDestroyedByPlayer(worldIn, pos, iblockstate.withProperty(BlockTNT.EXPLODE, Boolean.valueOf(true)));
|
||||
|
@ -300,13 +300,9 @@ public class BlockFire extends Block
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns if this block is collidable (only used by Fire). Args: x, y, z
|
||||
*/
|
||||
public boolean isCollidable()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
public boolean canRayTrace(State state, boolean liquid) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the block can be caught on fire
|
||||
|
@ -316,7 +312,7 @@ public class BlockFire extends Block
|
|||
return worldIn.getState(pos).getBlock().getEncouragement() > 0;
|
||||
}
|
||||
|
||||
public boolean canPlaceBlockAt(World worldIn, BlockPos pos)
|
||||
public boolean canPlace(World worldIn, BlockPos pos)
|
||||
{
|
||||
return worldIn.isBlockSolid(pos.down()) || this.canNeighborCatchFire(worldIn, pos);
|
||||
}
|
||||
|
@ -324,7 +320,7 @@ public class BlockFire extends Block
|
|||
/**
|
||||
* Called when a neighboring block changes.
|
||||
*/
|
||||
public void onNeighborBlockChange(World worldIn, BlockPos pos, State state, Block neighborBlock)
|
||||
public void onUpdate(World worldIn, BlockPos pos, State state, Block neighborBlock)
|
||||
{
|
||||
if (!worldIn.isBlockSolid(pos.down()) && !this.canNeighborCatchFire(worldIn, pos))
|
||||
{
|
||||
|
@ -332,7 +328,7 @@ public class BlockFire extends Block
|
|||
}
|
||||
}
|
||||
|
||||
public void onBlockAdded(AWorldServer worldIn, BlockPos pos, State state)
|
||||
public void onAdded(AWorldServer worldIn, BlockPos pos, State state)
|
||||
{
|
||||
if ( // (worldIn.dimension.getDimensionId() < -1 || worldIn.dimension.getDimensionId() > 0) ||
|
||||
!Blocks.portal.tryIgnitePortal(worldIn, pos, worldIn.rand.zrange(8)))
|
||||
|
@ -348,7 +344,7 @@ public class BlockFire extends Block
|
|||
}
|
||||
}
|
||||
|
||||
public void randomDisplayTick(AWorldClient worldIn, BlockPos pos, State state, Random rand)
|
||||
public void displayTick(AWorldClient worldIn, BlockPos pos, State state, Random rand)
|
||||
{
|
||||
if (rand.chance(24))
|
||||
{
|
||||
|
@ -1141,7 +1137,7 @@ public class BlockFire extends Block
|
|||
return false;
|
||||
}
|
||||
|
||||
public Property[] getUnsavedProperties() {
|
||||
protected Property[] getUnsavedProperties() {
|
||||
return new Property[] {NORTH, SOUTH, UPPER, FLIP, WEST, EAST, ALT};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,15 +23,15 @@ public class BlockGlowstone extends Block
|
|||
/**
|
||||
* Get the quantity dropped based on the given fortune level
|
||||
*/
|
||||
protected int quantityDroppedWithBonus(int fortune, Random random)
|
||||
protected int getDropAmount(int fortune, Random random)
|
||||
{
|
||||
return ExtMath.clampi(this.quantityDropped(random) + random.zrange(fortune + 1), 1, 4);
|
||||
return ExtMath.clampi(this.getDropAmount(random) + random.zrange(fortune + 1), 1, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the quantity of items to drop on block destruction.
|
||||
*/
|
||||
protected int quantityDropped(Random random)
|
||||
protected int getDropAmount(Random random)
|
||||
{
|
||||
return random.range(2, 4);
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ public class BlockGlowstone extends Block
|
|||
/**
|
||||
* Get the Item that this Block should drop when harvested.
|
||||
*/
|
||||
public Item getItemDropped(State state, Random rand, int fortune)
|
||||
public Item getDrop(State state, Random rand, int fortune)
|
||||
{
|
||||
return Items.glowstone_dust;
|
||||
}
|
||||
|
|
|
@ -16,15 +16,15 @@ public class BlockGravel extends BlockFalling
|
|||
this.setTab(CheatTab.NATURE);
|
||||
}
|
||||
|
||||
public Item getItemDropped(State state, Random rand, int fortune)
|
||||
public Item getDrop(State state, Random rand, int fortune)
|
||||
{
|
||||
int chance = Vars.flintChance;
|
||||
if(chance <= 0)
|
||||
return super.getItemDropped(state, rand, fortune);
|
||||
return super.getDrop(state, rand, fortune);
|
||||
fortune *= 3;
|
||||
if(fortune >= chance)
|
||||
fortune = chance - 1;
|
||||
return rand.chance(chance - fortune) ? Items.flint : super.getItemDropped(state, rand, fortune);
|
||||
return rand.chance(chance - fortune) ? Items.flint : super.getDrop(state, rand, fortune);
|
||||
}
|
||||
|
||||
// public MapColor getMapColor(IBlockState state)
|
||||
|
|
|
@ -18,38 +18,38 @@ import common.world.AWorldServer;
|
|||
public class BlockIce extends BlockTranslucent {
|
||||
public BlockIce() {
|
||||
super(Material.TRANSLUCENT);
|
||||
this.slipperiness = 0.98F;
|
||||
this.setTickRandomly();
|
||||
this.setSlipperiness(0.98F);
|
||||
this.setTicked();
|
||||
this.setTab(CheatTab.NATURE);
|
||||
}
|
||||
|
||||
public void harvestBlock(World world, EntityNPC player, BlockPos pos, State state, TileEntity tile) {
|
||||
public void postBroken(World world, EntityNPC player, BlockPos pos, State state, TileEntity tile) {
|
||||
if(this.canSilkHarvest() && EnchantmentHelper.getSilkTouchModifier(player)) {
|
||||
super.harvestBlock(world, player, pos, state, tile);
|
||||
super.postBroken(world, player, pos, state, tile);
|
||||
}
|
||||
else {
|
||||
if(world.doesWaterVaporize(pos)) {
|
||||
world.setBlockToAir(pos);
|
||||
return;
|
||||
}
|
||||
super.harvestBlock(world, player, pos, state, tile);
|
||||
super.postBroken(world, player, pos, state, tile);
|
||||
Material material = world.getState(pos.down()).getBlock().getMaterial();
|
||||
if(material.blocksMovement() || material.isLiquid())
|
||||
world.setState(pos, Blocks.flowing_water.getState());
|
||||
}
|
||||
}
|
||||
|
||||
protected int quantityDropped(Random rand) {
|
||||
protected int getDropAmount(Random rand) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void updateTick(AWorldServer world, BlockPos pos, State state, Random rand) {
|
||||
public void tick(AWorldServer world, BlockPos pos, State state, Random rand) {
|
||||
if(Vars.iceMelt && (world.getLightFor(LightType.BLOCK, pos) > 11 - this.getLightOpacity() || !world.canFreezeAt(pos))) {
|
||||
if(world.doesWaterVaporize(pos)) {
|
||||
world.setBlockToAir(pos);
|
||||
}
|
||||
else {
|
||||
this.dropBlockAsItem(world, pos, world.getState(pos), 0);
|
||||
this.drop(world, pos, world.getState(pos), 0);
|
||||
world.setState(pos, Blocks.water.getState());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,8 +16,8 @@ public class BlockMetalOre extends BlockOre {
|
|||
|
||||
public BlockMetalOre(MetalType metal) {
|
||||
this.metal = metal;
|
||||
this.setStepSound(SoundType.STONE);
|
||||
this.setLightLevel(metal.radioactivity > 0.0F ? 0.25F : 0.0F);
|
||||
this.setSound(SoundType.STONE);
|
||||
this.setLight(metal.radioactivity > 0.0F ? 0.25F : 0.0F);
|
||||
this.setRadiation(metal.radioactivity * 0.5f);
|
||||
}
|
||||
|
||||
|
@ -29,7 +29,7 @@ public class BlockMetalOre extends BlockOre {
|
|||
return this.metal.isMagnetic();
|
||||
}
|
||||
|
||||
public void addInformation(ItemStack stack, EntityNPC playerIn, List<String> tooltip)
|
||||
public void getTooltips(ItemStack stack, EntityNPC playerIn, List<String> tooltip)
|
||||
{
|
||||
tooltip.add(this.metal.formatSymbol());
|
||||
if(this.metal.radioactivity > 0.0f) {
|
||||
|
|
|
@ -19,7 +19,7 @@ public class BlockObsidian extends Block
|
|||
/**
|
||||
* Get the Item that this Block should drop when harvested.
|
||||
*/
|
||||
public Item getItemDropped(State state, Random rand, int fortune)
|
||||
public Item getDrop(State state, Random rand, int fortune)
|
||||
{
|
||||
return Items.obsidian;
|
||||
}
|
||||
|
|
|
@ -46,9 +46,9 @@ public class BlockOre extends Block
|
|||
this.smeltItem = item;
|
||||
}
|
||||
|
||||
public Item getItemDropped(State state, Random rand, int fortune)
|
||||
public Item getDrop(State state, Random rand, int fortune)
|
||||
{
|
||||
return this.dropItem == null ? super.getItemDropped(state, rand, fortune) : this.dropItem.getItem();
|
||||
return this.dropItem == null ? super.getDrop(state, rand, fortune) : this.dropItem.getItem();
|
||||
// this == Blocks.coal_ore ? Items.coal :
|
||||
// (this == Blocks.diamond_ore ? Items.diamond :
|
||||
// (this == Blocks.lapis_ore ? Items.dye :
|
||||
|
@ -57,16 +57,16 @@ public class BlockOre extends Block
|
|||
// this.getItem()))));
|
||||
}
|
||||
|
||||
protected int quantityDropped(Random random)
|
||||
protected int getDropAmount(Random random)
|
||||
{
|
||||
return this.dropItem == null ? 1 : (this.dropItem.getSize() + (this.dropChance > 0 ? random.zrange(this.dropChance + 1) : 0));
|
||||
// this == Blocks.lapis_ore ? 4 + random.nextInt(5) : 1;
|
||||
}
|
||||
|
||||
protected int quantityDroppedWithBonus(int fortune, Random random)
|
||||
protected int getDropAmount(int fortune, Random random)
|
||||
{
|
||||
if (fortune > 0 &&
|
||||
this.getItem() != this.getItemDropped(this.getState(), random, fortune))
|
||||
this.getItem() != this.getDrop(this.getState(), random, fortune))
|
||||
{
|
||||
int i = random.zrange(fortune + 2) - 1;
|
||||
|
||||
|
@ -75,27 +75,27 @@ public class BlockOre extends Block
|
|||
i = 0;
|
||||
}
|
||||
|
||||
return this.quantityDropped(random) * (i + 1);
|
||||
return this.getDropAmount(random) * (i + 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
return this.quantityDropped(random);
|
||||
return this.getDropAmount(random);
|
||||
}
|
||||
}
|
||||
|
||||
public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, State state, float chance, int fortune)
|
||||
public void drop(World worldIn, BlockPos pos, State state, float chance, int fortune)
|
||||
{
|
||||
if(!worldIn.client && this.smeltItem != null && Vars.cleanCut) {
|
||||
if (worldIn.rand.floatv() <= chance)
|
||||
{
|
||||
spawnAsEntity(worldIn, pos, this.smeltItem.copy());
|
||||
dropItem(worldIn, pos, this.smeltItem.copy());
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
super.dropBlockAsItemWithChance(worldIn, pos, state, chance, fortune);
|
||||
super.drop(worldIn, pos, state, chance, fortune);
|
||||
|
||||
if (this.getItemDropped(state, worldIn.rand, fortune) != this.getItem())
|
||||
if (this.getDrop(state, worldIn.rand, fortune) != this.getItem())
|
||||
{
|
||||
int i = worldIn.rand.range(this.minExperience, this.maxExperience);
|
||||
|
||||
|
@ -120,7 +120,7 @@ public class BlockOre extends Block
|
|||
// i = MathHelper.getRandomIntegerInRange(worldIn.rand, 2, 5);
|
||||
// }
|
||||
|
||||
this.dropXpOnBlockBreak(worldIn, pos, i);
|
||||
dropExperience(worldIn, pos, i);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -10,14 +10,14 @@ public class BlockPackedIce extends Block
|
|||
public BlockPackedIce()
|
||||
{
|
||||
super(Material.LOOSE);
|
||||
this.slipperiness = 0.98F;
|
||||
this.setSlipperiness(0.98F);
|
||||
this.setTab(CheatTab.NATURE);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the quantity of items to drop on block destruction.
|
||||
*/
|
||||
protected int quantityDropped(Random random)
|
||||
protected int getDropAmount(Random random)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ public class BlockPodzol extends Block {
|
|||
this.setTab(CheatTab.NATURE);
|
||||
}
|
||||
|
||||
public State getActualState(State state, IWorldAccess worldIn, BlockPos pos) {
|
||||
public State getState(State state, IWorldAccess worldIn, BlockPos pos) {
|
||||
Block block = worldIn.getState(pos.up()).getBlock();
|
||||
return state.withProperty(SNOWY, Boolean.valueOf(block == Blocks.snow || block == Blocks.snow_layer));
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ public class BlockPodzol extends Block {
|
|||
return new Property[] {SNOWY};
|
||||
}
|
||||
|
||||
public Item getItemDropped(State state, Random rand, int fortune) {
|
||||
public Item getDrop(State state, Random rand, int fortune) {
|
||||
return Items.dirt;
|
||||
}
|
||||
|
||||
|
@ -42,7 +42,7 @@ public class BlockPodzol extends Block {
|
|||
: provider.getModel("dirt_podzol_side").add().nswe().d("dirt").u("dirt_podzol_top");
|
||||
}
|
||||
|
||||
public Property[] getUnsavedProperties() {
|
||||
protected Property[] getUnsavedProperties() {
|
||||
return new Property[] {SNOWY};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,30 +31,30 @@ public class BlockSlime extends BlockTranslucent {
|
|||
public BlockSlime() {
|
||||
super(Material.LOOSE);
|
||||
this.setTab(CheatTab.TECHNOLOGY);
|
||||
this.slipperiness = 0.8F;
|
||||
this.setSlipperiness(0.8F);
|
||||
}
|
||||
|
||||
public void onFallenUpon(World world, BlockPos pos, Entity entity, float distance) {
|
||||
public void onLandUpdate(World world, BlockPos pos, Entity entity, float distance) {
|
||||
if(entity.isSneaking())
|
||||
super.onFallenUpon(world, pos, entity, distance);
|
||||
super.onLandUpdate(world, pos, entity, distance);
|
||||
else
|
||||
entity.fall(distance, 0.0F);
|
||||
}
|
||||
|
||||
public void onLanded(World world, Entity entity) {
|
||||
public void onLandMove(World world, Entity entity) {
|
||||
if(entity.isSneaking())
|
||||
super.onLanded(world, entity);
|
||||
super.onLandMove(world, entity);
|
||||
else if(entity.motionY < 0.0D)
|
||||
entity.motionY = -entity.motionY;
|
||||
}
|
||||
|
||||
public void onEntityCollidedWithBlock(World world, BlockPos pos, Entity entity) {
|
||||
public void onCollideMove(World world, BlockPos pos, Entity entity) {
|
||||
if(Math.abs(entity.motionY) < 0.1D && !entity.isSneaking()) {
|
||||
double friction = 0.4D + Math.abs(entity.motionY) * 0.2D;
|
||||
entity.motionX *= friction;
|
||||
entity.motionZ *= friction;
|
||||
}
|
||||
super.onEntityCollidedWithBlock(world, pos, entity);
|
||||
super.onCollideMove(world, pos, entity);
|
||||
}
|
||||
|
||||
public Model getModel(ModelProvider provider, String name, State state) {
|
||||
|
|
|
@ -35,9 +35,9 @@ public class BlockSnow extends Block
|
|||
super(Material.POWDER);
|
||||
this.setDefaultState(this.getBaseState().withProperty(LAYERS, Integer.valueOf(1)));
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.125F, 1.0F);
|
||||
this.setTickRandomly();
|
||||
this.setTicked();
|
||||
this.setTab(CheatTab.DECORATION);
|
||||
this.setBlockBoundsForItemRender();
|
||||
this.setItemBounds();
|
||||
}
|
||||
|
||||
public boolean isPassable(IBlockAccess worldIn, BlockPos pos)
|
||||
|
@ -45,7 +45,7 @@ public class BlockSnow extends Block
|
|||
return ((Integer)worldIn.getState(pos).getValue(LAYERS)).intValue() < 5;
|
||||
}
|
||||
|
||||
public BoundingBox getCollisionBoundingBox(World worldIn, BlockPos pos, State state)
|
||||
public BoundingBox getCollisionBox(World worldIn, BlockPos pos, State state)
|
||||
{
|
||||
int i = ((Integer)state.getValue(LAYERS)).intValue() - 1;
|
||||
if(i == 0)
|
||||
|
@ -70,12 +70,12 @@ public class BlockSnow extends Block
|
|||
/**
|
||||
* Sets the block's bounds for rendering it as an item
|
||||
*/
|
||||
public void setBlockBoundsForItemRender()
|
||||
public void setItemBounds()
|
||||
{
|
||||
this.getBoundsForLayers(0);
|
||||
}
|
||||
|
||||
public void setBlockBoundsBasedOnState(IWorldAccess worldIn, BlockPos pos)
|
||||
public void setBlockBounds(IWorldAccess worldIn, BlockPos pos)
|
||||
{
|
||||
State iblockstate = worldIn.getState(pos);
|
||||
this.getBoundsForLayers(((Integer)iblockstate.getValue(LAYERS)).intValue());
|
||||
|
@ -86,7 +86,7 @@ public class BlockSnow extends Block
|
|||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, (float)p_150154_1_ / 8.0F, 1.0F);
|
||||
}
|
||||
|
||||
public boolean canPlaceBlockAt(World worldIn, BlockPos pos)
|
||||
public boolean canPlace(World worldIn, BlockPos pos)
|
||||
{
|
||||
State iblockstate = worldIn.getState(pos.down());
|
||||
Block block = iblockstate.getBlock();
|
||||
|
@ -96,16 +96,16 @@ public class BlockSnow extends Block
|
|||
/**
|
||||
* Called when a neighboring block changes.
|
||||
*/
|
||||
public void onNeighborBlockChange(World worldIn, BlockPos pos, State state, Block neighborBlock)
|
||||
public void onUpdate(World worldIn, BlockPos pos, State state, Block neighborBlock)
|
||||
{
|
||||
this.checkAndDropBlock(worldIn, pos, state);
|
||||
}
|
||||
|
||||
private boolean checkAndDropBlock(World worldIn, BlockPos pos, State state)
|
||||
{
|
||||
if (!this.canPlaceBlockAt(worldIn, pos))
|
||||
if (!this.canPlace(worldIn, pos))
|
||||
{
|
||||
this.dropBlockAsItem(worldIn, pos, state, 0);
|
||||
this.drop(worldIn, pos, state, 0);
|
||||
worldIn.setBlockToAir(pos);
|
||||
return false;
|
||||
}
|
||||
|
@ -115,9 +115,9 @@ public class BlockSnow extends Block
|
|||
}
|
||||
}
|
||||
|
||||
public void harvestBlock(World worldIn, EntityNPC player, BlockPos pos, State state, TileEntity te)
|
||||
public void postBroken(World worldIn, EntityNPC player, BlockPos pos, State state, TileEntity te)
|
||||
{
|
||||
spawnAsEntity(worldIn, pos, new ItemStack(Items.snowball, ((Integer)state.getValue(LAYERS)).intValue() + 1));
|
||||
dropItem(worldIn, pos, new ItemStack(Items.snowball, ((Integer)state.getValue(LAYERS)).intValue() + 1));
|
||||
worldIn.setBlockToAir(pos);
|
||||
// player.triggerAchievement(StatRegistry.mineBlockStatArray[BlockRegistry.getIdFromBlock(this)]);
|
||||
}
|
||||
|
@ -125,7 +125,7 @@ public class BlockSnow extends Block
|
|||
/**
|
||||
* Get the Item that this Block should drop when harvested.
|
||||
*/
|
||||
public Item getItemDropped(State state, Random rand, int fortune)
|
||||
public Item getDrop(State state, Random rand, int fortune)
|
||||
{
|
||||
return Items.snowball;
|
||||
}
|
||||
|
@ -133,29 +133,29 @@ public class BlockSnow extends Block
|
|||
/**
|
||||
* Returns the quantity of items to drop on block destruction.
|
||||
*/
|
||||
protected int quantityDropped(Random random)
|
||||
protected int getDropAmount(Random random)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
|
||||
public void tick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
|
||||
{
|
||||
if (Vars.snowMelt && (worldIn.getLightFor(LightType.BLOCK, pos) > 11 || !worldIn.canFreezeAt(pos)))
|
||||
{
|
||||
this.dropBlockAsItem(worldIn, pos, worldIn.getState(pos), 0);
|
||||
this.drop(worldIn, pos, worldIn.getState(pos), 0);
|
||||
worldIn.setBlockToAir(pos);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean shouldSideBeRendered(IWorldAccess worldIn, BlockPos pos, Facing side)
|
||||
public boolean canRender(IWorldAccess worldIn, BlockPos pos, Facing side)
|
||||
{
|
||||
return side == Facing.UP ? true : super.shouldSideBeRendered(worldIn, pos, side);
|
||||
return side == Facing.UP ? true : super.canRender(worldIn, pos, side);
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether this Block can be replaced directly by other blocks (true for e.g. tall grass)
|
||||
*/
|
||||
public boolean isReplaceable(World worldIn, BlockPos pos)
|
||||
public boolean canReplace(World worldIn, BlockPos pos)
|
||||
{
|
||||
return ((Integer)worldIn.getState(pos).getValue(LAYERS)).intValue() == 1;
|
||||
}
|
||||
|
@ -187,7 +187,7 @@ public class BlockSnow extends Block
|
|||
Block block = iblockstate.getBlock();
|
||||
BlockPos blockpos = pos;
|
||||
|
||||
if ((side != Facing.UP || block != this) && !block.isReplaceable(worldIn, pos))
|
||||
if ((side != Facing.UP || block != this) && !block.canReplace(worldIn, pos))
|
||||
{
|
||||
blockpos = pos.offset(side);
|
||||
iblockstate = worldIn.getState(blockpos);
|
||||
|
@ -201,11 +201,11 @@ public class BlockSnow extends Block
|
|||
if (i <= 7)
|
||||
{
|
||||
State iblockstate1 = iblockstate.withProperty(BlockSnow.LAYERS, Integer.valueOf(i + 1));
|
||||
BoundingBox axisalignedbb = this.getCollisionBoundingBox(worldIn, blockpos, iblockstate1);
|
||||
BoundingBox axisalignedbb = this.getCollisionBox(worldIn, blockpos, iblockstate1);
|
||||
|
||||
if (axisalignedbb != null && worldIn.checkNoEntityCollision(axisalignedbb) && worldIn.setState(blockpos, iblockstate1, 2))
|
||||
{
|
||||
worldIn.playSound(this.sound.getPlaceSound(), (double)((float)blockpos.getX() + 0.5F), (double)((float)blockpos.getY() + 0.5F), (double)((float)blockpos.getZ() + 0.5F), 1.0F);
|
||||
worldIn.playSound(this.getSound().getPlaceSound(), (double)((float)blockpos.getX() + 0.5F), (double)((float)blockpos.getY() + 0.5F), (double)((float)blockpos.getZ() + 0.5F), 1.0F);
|
||||
stack.decrSize();
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -15,21 +15,21 @@ import common.world.AWorldServer;
|
|||
public class BlockSnowBlock extends Block {
|
||||
public BlockSnowBlock() {
|
||||
super(Material.DIGGABLE);
|
||||
this.setTickRandomly();
|
||||
this.setTicked();
|
||||
this.setTab(CheatTab.NATURE);
|
||||
}
|
||||
|
||||
public Item getItemDropped(State state, Random rand, int fortune) {
|
||||
public Item getDrop(State state, Random rand, int fortune) {
|
||||
return Items.snowball;
|
||||
}
|
||||
|
||||
protected int quantityDropped(Random rand) {
|
||||
protected int getDropAmount(Random rand) {
|
||||
return rand.range(2, 4);
|
||||
}
|
||||
|
||||
public void updateTick(AWorldServer world, BlockPos pos, State state, Random rand) {
|
||||
public void tick(AWorldServer world, BlockPos pos, State state, Random rand) {
|
||||
if(Vars.snowFullMelt && (world.getLightFor(LightType.BLOCK, pos) > 11 || !world.canFreezeAt(pos))) {
|
||||
this.dropBlockAsItem(world, pos, world.getState(pos), 0);
|
||||
this.drop(world, pos, world.getState(pos), 0);
|
||||
world.setBlockToAir(pos);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@ public class BlockSoulSand extends Block
|
|||
this.setTab(CheatTab.NATURE);
|
||||
}
|
||||
|
||||
public BoundingBox getCollisionBoundingBox(World worldIn, BlockPos pos, State state)
|
||||
public BoundingBox getCollisionBox(World worldIn, BlockPos pos, State state)
|
||||
{
|
||||
float f = 0.125F;
|
||||
return new BoundingBox((double)pos.getX(), (double)pos.getY(), (double)pos.getZ(), (double)(pos.getX() + 1), (double)((float)(pos.getY() + 1) - f), (double)(pos.getZ() + 1));
|
||||
|
@ -26,7 +26,7 @@ public class BlockSoulSand extends Block
|
|||
/**
|
||||
* Called When an Entity Collided with the Block
|
||||
*/
|
||||
public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, State state, Entity entityIn)
|
||||
public void onCollideUpdate(World worldIn, BlockPos pos, State state, Entity entityIn)
|
||||
{
|
||||
entityIn.motionX *= 0.4D;
|
||||
entityIn.motionZ *= 0.4D;
|
||||
|
|
|
@ -14,7 +14,7 @@ public class BlockStone extends Block {
|
|||
this.setTab(CheatTab.ROCK);
|
||||
}
|
||||
|
||||
public Item getItemDropped(State state, Random rand, int fortune) {
|
||||
public Item getDrop(State state, Random rand, int fortune) {
|
||||
return Items.cobblestone;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,13 +22,12 @@ public class BlockWeb extends Block
|
|||
{
|
||||
super(Material.FLUFF);
|
||||
this.setTab(CheatTab.DECORATION);
|
||||
this.setFlatBlockTexture();
|
||||
}
|
||||
|
||||
/**
|
||||
* Called When an Entity Collided with the Block
|
||||
*/
|
||||
public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, State state, Entity entityIn)
|
||||
public void onCollideUpdate(World worldIn, BlockPos pos, State state, Entity entityIn)
|
||||
{
|
||||
entityIn.setInWeb();
|
||||
}
|
||||
|
@ -41,7 +40,7 @@ public class BlockWeb extends Block
|
|||
return false;
|
||||
}
|
||||
|
||||
public BoundingBox getCollisionBoundingBox(World worldIn, BlockPos pos, State state)
|
||||
public BoundingBox getCollisionBox(World worldIn, BlockPos pos, State state)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
@ -54,7 +53,7 @@ public class BlockWeb extends Block
|
|||
/**
|
||||
* Get the Item that this Block should drop when harvested.
|
||||
*/
|
||||
public Item getItemDropped(State state, Random rand, int fortune)
|
||||
public Item getDrop(State state, Random rand, int fortune)
|
||||
{
|
||||
return Items.string;
|
||||
}
|
||||
|
|
|
@ -19,13 +19,13 @@ public class BlockActiveDisplay extends BlockDisplay implements ITileEntityProvi
|
|||
|
||||
public BlockActiveDisplay(BlockInactiveDisplay inactive) {
|
||||
super(inactive.getDensity());
|
||||
this.setLightLevel(1.0f);
|
||||
this.setLight(1.0f);
|
||||
this.inactive = inactive;
|
||||
inactive.setActive(this);
|
||||
}
|
||||
|
||||
public void onBlockRemoved(AWorldServer world, BlockPos pos, State state) {
|
||||
super.onBlockRemoved(world, pos, state);
|
||||
public void onRemoved(AWorldServer world, BlockPos pos, State state) {
|
||||
super.onRemoved(world, pos, state);
|
||||
Pair<BlockPos, BlockPos> span = removing ? null : this.getSpan(world, pos, state.getValue(FACING));
|
||||
if(span != null) {
|
||||
world.removeTileEntity(pos);
|
||||
|
@ -46,7 +46,7 @@ public class BlockActiveDisplay extends BlockDisplay implements ITileEntityProvi
|
|||
return false;
|
||||
}
|
||||
|
||||
public boolean onBlockActivated(World worldIn, BlockPos pos, State state, EntityNPC playerIn, Facing side, float hitX, float hitY, float hitZ) {
|
||||
public boolean onUse(World worldIn, BlockPos pos, State state, EntityNPC playerIn, Facing side, float hitX, float hitY, float hitZ) {
|
||||
if(!worldIn.client) {
|
||||
Pair<BlockPos, BlockPos> span = this.getSpan(worldIn, pos, state.getValue(FACING));
|
||||
if(span == null)
|
||||
|
|
|
@ -38,7 +38,7 @@ public class BlockAnvil extends BlockFalling implements Rotatable
|
|||
super(Material.HEAVY);
|
||||
this.damage = damage;
|
||||
this.setDefaultState(this.getBaseState().withProperty(FACING, Facing.NORTH));
|
||||
this.setLightOpacity(0);
|
||||
this.setOpacity(0);
|
||||
this.setTab(CheatTab.TECHNOLOGY);
|
||||
ANVILS[damage] = this;
|
||||
}
|
||||
|
@ -68,13 +68,13 @@ public class BlockAnvil extends BlockFalling implements Rotatable
|
|||
* Called by ItemBlocks just before a block is actually set in the world, to allow for adjustments to the
|
||||
* IBlockstate
|
||||
*/
|
||||
public State onBlockPlaced(World worldIn, BlockPos pos, Facing facing, float hitX, float hitY, float hitZ, EntityLiving placer)
|
||||
public State getPlacedState(World worldIn, BlockPos pos, Facing facing, float hitX, float hitY, float hitZ, EntityLiving placer)
|
||||
{
|
||||
Facing enumfacing = placer.getHorizontalFacing().rotateY();
|
||||
return super.onBlockPlaced(worldIn, pos, facing, hitX, hitY, hitZ, placer).withProperty(FACING, enumfacing);
|
||||
return super.getPlacedState(worldIn, pos, facing, hitX, hitY, hitZ, placer).withProperty(FACING, enumfacing);
|
||||
}
|
||||
|
||||
public boolean onBlockActivated(World worldIn, BlockPos pos, State state, EntityNPC playerIn, Facing side, float hitX, float hitY, float hitZ)
|
||||
public boolean onUse(World worldIn, BlockPos pos, State state, EntityNPC playerIn, Facing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if (!worldIn.client)
|
||||
{
|
||||
|
@ -84,7 +84,7 @@ public class BlockAnvil extends BlockFalling implements Rotatable
|
|||
return true;
|
||||
}
|
||||
|
||||
public void setBlockBoundsBasedOnState(IWorldAccess worldIn, BlockPos pos)
|
||||
public void setBlockBounds(IWorldAccess worldIn, BlockPos pos)
|
||||
{
|
||||
Facing enumfacing = (Facing)worldIn.getState(pos).getValue(FACING);
|
||||
|
||||
|
@ -108,7 +108,7 @@ public class BlockAnvil extends BlockFalling implements Rotatable
|
|||
worldIn.playAuxSFX(1022, pos, 0);
|
||||
}
|
||||
|
||||
public boolean shouldSideBeRendered(IWorldAccess worldIn, BlockPos pos, Facing side)
|
||||
public boolean canRender(IWorldAccess worldIn, BlockPos pos, Facing side)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -116,7 +116,7 @@ public class BlockAnvil extends BlockFalling implements Rotatable
|
|||
/**
|
||||
* Possibly modify the given BlockState before rendering it on an Entity (Minecarts, Endermen, ...)
|
||||
*/
|
||||
public State getStateForEntityRender(State state)
|
||||
public State getEntityState(State state)
|
||||
{
|
||||
return this.getState().withProperty(FACING, Facing.SOUTH);
|
||||
}
|
||||
|
|
|
@ -25,10 +25,9 @@ public abstract class BlockBasePressurePlate extends Block
|
|||
{
|
||||
super(p_i46401_1_);
|
||||
this.setTab(CheatTab.TECHNOLOGY);
|
||||
// this.setTickRandomly(true);
|
||||
}
|
||||
|
||||
public void setBlockBoundsBasedOnState(IWorldAccess worldIn, BlockPos pos)
|
||||
public void setBlockBounds(IWorldAccess worldIn, BlockPos pos)
|
||||
{
|
||||
this.setBlockBoundsBasedOnState0(worldIn.getState(pos));
|
||||
}
|
||||
|
@ -56,7 +55,7 @@ public abstract class BlockBasePressurePlate extends Block
|
|||
return 20;
|
||||
}
|
||||
|
||||
public BoundingBox getCollisionBoundingBox(World worldIn, BlockPos pos, State state)
|
||||
public BoundingBox getCollisionBox(World worldIn, BlockPos pos, State state)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
@ -87,7 +86,7 @@ public abstract class BlockBasePressurePlate extends Block
|
|||
return true;
|
||||
}
|
||||
|
||||
public boolean canPlaceBlockAt(World worldIn, BlockPos pos)
|
||||
public boolean canPlace(World worldIn, BlockPos pos)
|
||||
{
|
||||
return this.canBePlacedOn(worldIn, pos.down());
|
||||
}
|
||||
|
@ -95,11 +94,11 @@ public abstract class BlockBasePressurePlate extends Block
|
|||
/**
|
||||
* Called when a neighboring block changes.
|
||||
*/
|
||||
public void onNeighborBlockChange(World worldIn, BlockPos pos, State state, Block neighborBlock)
|
||||
public void onUpdate(World worldIn, BlockPos pos, State state, Block neighborBlock)
|
||||
{
|
||||
if (!this.canBePlacedOn(worldIn, pos.down()))
|
||||
{
|
||||
this.dropBlockAsItem(worldIn, pos, state, 0);
|
||||
this.drop(worldIn, pos, state, 0);
|
||||
worldIn.setBlockToAir(pos);
|
||||
}
|
||||
}
|
||||
|
@ -109,14 +108,7 @@ public abstract class BlockBasePressurePlate extends Block
|
|||
return worldIn.isBlockSolid(pos) || worldIn.getState(pos).getBlock() instanceof BlockFence;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called randomly when setTickRandomly is set to true (used by e.g. crops to grow, etc.)
|
||||
*/
|
||||
public void randomTick(AWorldServer worldIn, BlockPos pos, State state, Random random)
|
||||
{
|
||||
}
|
||||
|
||||
public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
|
||||
public void tick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
|
||||
{
|
||||
// if (!worldIn.client)
|
||||
// {
|
||||
|
@ -132,7 +124,7 @@ public abstract class BlockBasePressurePlate extends Block
|
|||
/**
|
||||
* Called When an Entity Collided with the Block
|
||||
*/
|
||||
public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, State state, Entity entityIn)
|
||||
public void onCollideUpdate(World worldIn, BlockPos pos, State state, Entity entityIn)
|
||||
{
|
||||
if (!worldIn.client)
|
||||
{
|
||||
|
@ -186,14 +178,14 @@ public abstract class BlockBasePressurePlate extends Block
|
|||
return new BoundingBox((double)((float)pos.getX() + 0.125F), (double)pos.getY(), (double)((float)pos.getZ() + 0.125F), (double)((float)(pos.getX() + 1) - 0.125F), (double)pos.getY() + 0.25D, (double)((float)(pos.getZ() + 1) - 0.125F));
|
||||
}
|
||||
|
||||
public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state)
|
||||
public void onRemoved(AWorldServer worldIn, BlockPos pos, State state)
|
||||
{
|
||||
if (this.getSignalStrength(state) > 0)
|
||||
{
|
||||
this.updateNeighbors(worldIn, pos);
|
||||
}
|
||||
|
||||
super.onBlockRemoved(worldIn, pos, state);
|
||||
super.onRemoved(worldIn, pos, state);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -216,7 +208,7 @@ public abstract class BlockBasePressurePlate extends Block
|
|||
/**
|
||||
* Sets the block's bounds for rendering it as an item
|
||||
*/
|
||||
public void setBlockBoundsForItemRender()
|
||||
public void setItemBounds()
|
||||
{
|
||||
float f = 0.5F;
|
||||
float f1 = 0.125F;
|
||||
|
|
|
@ -387,23 +387,23 @@ public class BlockBrewingStand extends Block implements ITileEntityProvider
|
|||
/**
|
||||
* Add all collision boxes of this Block to the list that intersect with the given mask.
|
||||
*/
|
||||
public void addCollisionBoxesToList(World worldIn, BlockPos pos, State state, BoundingBox mask, List<BoundingBox> list, Entity collidingEntity)
|
||||
public void getCollisionBoxes(World worldIn, BlockPos pos, State state, BoundingBox mask, List<BoundingBox> list, Entity collidingEntity)
|
||||
{
|
||||
this.setBlockBounds(0.4375F, 0.0F, 0.4375F, 0.5625F, 0.875F, 0.5625F);
|
||||
super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity);
|
||||
this.setBlockBoundsForItemRender();
|
||||
super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity);
|
||||
super.getCollisionBoxes(worldIn, pos, state, mask, list, collidingEntity);
|
||||
this.setItemBounds();
|
||||
super.getCollisionBoxes(worldIn, pos, state, mask, list, collidingEntity);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the block's bounds for rendering it as an item
|
||||
*/
|
||||
public void setBlockBoundsForItemRender()
|
||||
public void setItemBounds()
|
||||
{
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.125F, 1.0F);
|
||||
}
|
||||
|
||||
public boolean onBlockActivated(World worldIn, BlockPos pos, State state, EntityNPC playerIn, Facing side, float hitX, float hitY, float hitZ)
|
||||
public boolean onUse(World worldIn, BlockPos pos, State state, EntityNPC playerIn, Facing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if (worldIn.client)
|
||||
{
|
||||
|
@ -423,7 +423,7 @@ public class BlockBrewingStand extends Block implements ITileEntityProvider
|
|||
}
|
||||
}
|
||||
|
||||
public void randomDisplayTick(AWorldClient worldIn, BlockPos pos, State state, Random rand)
|
||||
public void displayTick(AWorldClient worldIn, BlockPos pos, State state, Random rand)
|
||||
{
|
||||
double d0 = (double)((float)pos.getX() + 0.4F + rand.floatv() * 0.2F);
|
||||
double d1 = (double)((float)pos.getY() + 0.7F + rand.floatv() * 0.3F);
|
||||
|
@ -431,7 +431,7 @@ public class BlockBrewingStand extends Block implements ITileEntityProvider
|
|||
worldIn.spawnParticle(ParticleType.SMOKE, d0, d1, d2);
|
||||
}
|
||||
|
||||
public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state)
|
||||
public void onRemoved(AWorldServer worldIn, BlockPos pos, State state)
|
||||
{
|
||||
TileEntity tileentity = worldIn.getTileEntity(pos);
|
||||
|
||||
|
@ -440,7 +440,7 @@ public class BlockBrewingStand extends Block implements ITileEntityProvider
|
|||
InventoryHelper.dropInventoryItems(worldIn, pos, (TileEntityBrewingStand)tileentity);
|
||||
}
|
||||
|
||||
super.onBlockRemoved(worldIn, pos, state);
|
||||
super.onRemoved(worldIn, pos, state);
|
||||
}
|
||||
|
||||
public BlockLayer getBlockLayer()
|
||||
|
|
|
@ -41,7 +41,6 @@ public class BlockButton extends Block implements Directional
|
|||
{
|
||||
super(Material.SMALL);
|
||||
this.setDefaultState(this.getBaseState().withProperty(FACING, Facing.NORTH).withProperty(POWERED, Boolean.valueOf(false)));
|
||||
// this.setTickRandomly(true);
|
||||
this.setTab(CheatTab.TECHNOLOGY);
|
||||
this.checkArrows = arrows;
|
||||
this.onTime = onTime;
|
||||
|
@ -49,7 +48,7 @@ public class BlockButton extends Block implements Directional
|
|||
BUTTONS.add(this);
|
||||
}
|
||||
|
||||
public BoundingBox getCollisionBoundingBox(World worldIn, BlockPos pos, State state)
|
||||
public BoundingBox getCollisionBox(World worldIn, BlockPos pos, State state)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
@ -78,12 +77,12 @@ public class BlockButton extends Block implements Directional
|
|||
/**
|
||||
* Check whether this Block can be placed on the given side
|
||||
*/
|
||||
public boolean canPlaceBlockOnSide(World worldIn, BlockPos pos, Facing side)
|
||||
public boolean canPlace(World worldIn, BlockPos pos, Facing side)
|
||||
{
|
||||
return canPlaceButtonOn(worldIn, pos, side.getOpposite());
|
||||
}
|
||||
|
||||
public boolean canPlaceBlockAt(World worldIn, BlockPos pos)
|
||||
public boolean canPlace(World worldIn, BlockPos pos)
|
||||
{
|
||||
for (Facing enumfacing : Facing.values())
|
||||
{
|
||||
|
@ -106,7 +105,7 @@ public class BlockButton extends Block implements Directional
|
|||
* Called by ItemBlocks just before a block is actually set in the world, to allow for adjustments to the
|
||||
* IBlockstate
|
||||
*/
|
||||
public State onBlockPlaced(World worldIn, BlockPos pos, Facing facing, float hitX, float hitY, float hitZ, EntityLiving placer)
|
||||
public State getPlacedState(World worldIn, BlockPos pos, Facing facing, float hitX, float hitY, float hitZ, EntityLiving placer)
|
||||
{
|
||||
return canPlaceButtonOn(worldIn, pos, facing.getOpposite()) ? this.getState().withProperty(FACING, facing).withProperty(POWERED, Boolean.valueOf(false)) : this.getState().withProperty(FACING, Facing.DOWN).withProperty(POWERED, Boolean.valueOf(false));
|
||||
}
|
||||
|
@ -114,30 +113,30 @@ public class BlockButton extends Block implements Directional
|
|||
/**
|
||||
* Called when a neighboring block changes.
|
||||
*/
|
||||
public void onNeighborBlockChange(World worldIn, BlockPos pos, State state, Block neighborBlock)
|
||||
public void onUpdate(World worldIn, BlockPos pos, State state, Block neighborBlock)
|
||||
{
|
||||
if (this.checkForDrop(worldIn, pos, state) && !canPlaceButtonOn(worldIn, pos, ((Facing)state.getValue(FACING)).getOpposite()))
|
||||
{
|
||||
this.dropBlockAsItem(worldIn, pos, state, 0);
|
||||
this.drop(worldIn, pos, state, 0);
|
||||
worldIn.setBlockToAir(pos);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean checkForDrop(World worldIn, BlockPos pos, State state)
|
||||
{
|
||||
if (this.canPlaceBlockAt(worldIn, pos))
|
||||
if (this.canPlace(worldIn, pos))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.dropBlockAsItem(worldIn, pos, state, 0);
|
||||
this.drop(worldIn, pos, state, 0);
|
||||
worldIn.setBlockToAir(pos);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public void setBlockBoundsBasedOnState(IWorldAccess worldIn, BlockPos pos)
|
||||
public void setBlockBounds(IWorldAccess worldIn, BlockPos pos)
|
||||
{
|
||||
this.updateBlockBounds(worldIn.getState(pos));
|
||||
}
|
||||
|
@ -179,7 +178,7 @@ public class BlockButton extends Block implements Directional
|
|||
}
|
||||
}
|
||||
|
||||
public boolean onBlockActivated(World worldIn, BlockPos pos, State state, EntityNPC playerIn, Facing side, float hitX, float hitY, float hitZ)
|
||||
public boolean onUse(World worldIn, BlockPos pos, State state, EntityNPC playerIn, Facing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if (((Boolean)state.getValue(POWERED)).booleanValue())
|
||||
{
|
||||
|
@ -196,14 +195,14 @@ public class BlockButton extends Block implements Directional
|
|||
}
|
||||
}
|
||||
|
||||
public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state)
|
||||
public void onRemoved(AWorldServer worldIn, BlockPos pos, State state)
|
||||
{
|
||||
if (((Boolean)state.getValue(POWERED)).booleanValue())
|
||||
{
|
||||
this.notifyNeighbors(worldIn, pos, (Facing)state.getValue(FACING));
|
||||
}
|
||||
|
||||
super.onBlockRemoved(worldIn, pos, state);
|
||||
super.onRemoved(worldIn, pos, state);
|
||||
}
|
||||
|
||||
public double getResistance(World worldIn, BlockPos pos, State state) {
|
||||
|
@ -218,14 +217,7 @@ public class BlockButton extends Block implements Directional
|
|||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called randomly when setTickRandomly is set to true (used by e.g. crops to grow, etc.)
|
||||
*/
|
||||
public void randomTick(AWorldServer worldIn, BlockPos pos, State state, Random random)
|
||||
{
|
||||
}
|
||||
|
||||
public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
|
||||
public void tick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
|
||||
{
|
||||
// if (!worldIn.client)
|
||||
// {
|
||||
|
@ -249,7 +241,7 @@ public class BlockButton extends Block implements Directional
|
|||
/**
|
||||
* Sets the block's bounds for rendering it as an item
|
||||
*/
|
||||
public void setBlockBoundsForItemRender()
|
||||
public void setItemBounds()
|
||||
{
|
||||
float f = 0.1875F;
|
||||
float f1 = 0.125F;
|
||||
|
@ -260,7 +252,7 @@ public class BlockButton extends Block implements Directional
|
|||
/**
|
||||
* Called When an Entity Collided with the Block
|
||||
*/
|
||||
public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, State state, Entity entityIn)
|
||||
public void onCollideUpdate(World worldIn, BlockPos pos, State state, Entity entityIn)
|
||||
{
|
||||
if (!worldIn.client)
|
||||
{
|
||||
|
|
|
@ -417,26 +417,26 @@ public class BlockCauldron extends Block
|
|||
/**
|
||||
* Add all collision boxes of this Block to the list that intersect with the given mask.
|
||||
*/
|
||||
public void addCollisionBoxesToList(World worldIn, BlockPos pos, State state, BoundingBox mask, List<BoundingBox> list, Entity collidingEntity)
|
||||
public void getCollisionBoxes(World worldIn, BlockPos pos, State state, BoundingBox mask, List<BoundingBox> list, Entity collidingEntity)
|
||||
{
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.3125F, 1.0F);
|
||||
super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity);
|
||||
super.getCollisionBoxes(worldIn, pos, state, mask, list, collidingEntity);
|
||||
float f = 0.125F;
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F);
|
||||
super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity);
|
||||
super.getCollisionBoxes(worldIn, pos, state, mask, list, collidingEntity);
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f);
|
||||
super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity);
|
||||
super.getCollisionBoxes(worldIn, pos, state, mask, list, collidingEntity);
|
||||
this.setBlockBounds(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity);
|
||||
super.getCollisionBoxes(worldIn, pos, state, mask, list, collidingEntity);
|
||||
this.setBlockBounds(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F);
|
||||
super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity);
|
||||
this.setBlockBoundsForItemRender();
|
||||
super.getCollisionBoxes(worldIn, pos, state, mask, list, collidingEntity);
|
||||
this.setItemBounds();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the block's bounds for rendering it as an item
|
||||
*/
|
||||
public void setBlockBoundsForItemRender()
|
||||
public void setItemBounds()
|
||||
{
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
|
@ -457,7 +457,7 @@ public class BlockCauldron extends Block
|
|||
/**
|
||||
* Called When an Entity Collided with the Block
|
||||
*/
|
||||
public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, State state, Entity entityIn)
|
||||
public void onCollideUpdate(World worldIn, BlockPos pos, State state, Entity entityIn)
|
||||
{
|
||||
int i = ((Integer)state.getValue(LEVEL)).intValue();
|
||||
float f = (float)pos.getY() + (6.0F + (float)(3 * i)) / 16.0F;
|
||||
|
@ -469,7 +469,7 @@ public class BlockCauldron extends Block
|
|||
}
|
||||
}
|
||||
|
||||
public boolean onBlockActivated(World worldIn, BlockPos pos, State state, EntityNPC playerIn, Facing side, float hitX, float hitY, float hitZ)
|
||||
public boolean onUse(World worldIn, BlockPos pos, State state, EntityNPC playerIn, Facing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if (worldIn.client)
|
||||
{
|
||||
|
@ -554,10 +554,7 @@ public class BlockCauldron extends Block
|
|||
worldIn.setState(pos, state.withProperty(LEVEL, Integer.valueOf(ExtMath.clampi(level, 0, 3))), 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called similar to random ticks, but only when it is raining.
|
||||
*/
|
||||
public void fillWithRain(World worldIn, BlockPos pos)
|
||||
public void onRain(World worldIn, BlockPos pos)
|
||||
{
|
||||
if (worldIn.rand.chance(20)) // == 1
|
||||
{
|
||||
|
|
|
@ -52,7 +52,7 @@ public class BlockChest extends Block implements ITileEntityProvider, Rotatable
|
|||
this.setTab(CheatTab.TECHNOLOGY);
|
||||
this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 0.875F, 0.9375F);
|
||||
this.setHardness(2.5F);
|
||||
this.setStepSound(SoundType.WOOD);
|
||||
this.setSound(SoundType.WOOD);
|
||||
CHESTS.put(this.width * this.height, this);
|
||||
}
|
||||
|
||||
|
@ -76,10 +76,10 @@ public class BlockChest extends Block implements ITileEntityProvider, Rotatable
|
|||
|
||||
public int getRenderType()
|
||||
{
|
||||
return 2;
|
||||
return -1;
|
||||
}
|
||||
|
||||
public State onBlockPlaced(World worldIn, BlockPos pos, Facing facing, float hitX, float hitY, float hitZ, EntityLiving placer)
|
||||
public State getPlacedState(World worldIn, BlockPos pos, Facing facing, float hitX, float hitY, float hitZ, EntityLiving placer)
|
||||
{
|
||||
return this.getState().withProperty(FACING, placer.getHorizontalFacing().getOpposite());
|
||||
}
|
||||
|
@ -136,7 +136,7 @@ public class BlockChest extends Block implements ITileEntityProvider, Rotatable
|
|||
}
|
||||
}
|
||||
|
||||
public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state)
|
||||
public void onRemoved(AWorldServer worldIn, BlockPos pos, State state)
|
||||
{
|
||||
TileEntity tileentity = worldIn.getTileEntity(pos);
|
||||
|
||||
|
@ -145,10 +145,10 @@ public class BlockChest extends Block implements ITileEntityProvider, Rotatable
|
|||
InventoryHelper.dropInventoryItems(worldIn, pos, (IInventory)tileentity);
|
||||
}
|
||||
|
||||
super.onBlockRemoved(worldIn, pos, state);
|
||||
super.onRemoved(worldIn, pos, state);
|
||||
}
|
||||
|
||||
public boolean onBlockActivated(World worldIn, BlockPos pos, State state, EntityNPC playerIn, Facing side, float hitX, float hitY, float hitZ)
|
||||
public boolean onUse(World worldIn, BlockPos pos, State state, EntityNPC playerIn, Facing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if (worldIn.client)
|
||||
{
|
||||
|
|
|
@ -14,13 +14,13 @@ public class BlockCore extends Block {
|
|||
this.setTab(CheatTab.TECHNOLOGY);
|
||||
}
|
||||
|
||||
public void onBlockRemoved(AWorldServer world, BlockPos pos, State state)
|
||||
public void onRemoved(AWorldServer world, BlockPos pos, State state)
|
||||
{
|
||||
if(Vars.loaders)
|
||||
world.removeLoader(pos);
|
||||
}
|
||||
|
||||
public void onBlockAdded(AWorldServer world, BlockPos pos, State state)
|
||||
public void onAdded(AWorldServer world, BlockPos pos, State state)
|
||||
{
|
||||
if(Vars.loaders)
|
||||
world.addLoader(pos);
|
||||
|
|
|
@ -53,9 +53,9 @@ public class BlockDispenser extends Block implements ITileEntityProvider, Direct
|
|||
return 4;
|
||||
}
|
||||
|
||||
public void onBlockAdded(AWorldServer worldIn, BlockPos pos, State state)
|
||||
public void onAdded(AWorldServer worldIn, BlockPos pos, State state)
|
||||
{
|
||||
super.onBlockAdded(worldIn, pos, state);
|
||||
super.onAdded(worldIn, pos, state);
|
||||
this.setDefaultDirection(worldIn, pos, state);
|
||||
}
|
||||
|
||||
|
@ -94,7 +94,7 @@ public class BlockDispenser extends Block implements ITileEntityProvider, Direct
|
|||
}
|
||||
}
|
||||
|
||||
public boolean onBlockActivated(World worldIn, BlockPos pos, State state, EntityNPC playerIn, Facing side, float hitX, float hitY, float hitZ)
|
||||
public boolean onUse(World worldIn, BlockPos pos, State state, EntityNPC playerIn, Facing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if (worldIn.client)
|
||||
{
|
||||
|
@ -134,12 +134,12 @@ public class BlockDispenser extends Block implements ITileEntityProvider, Direct
|
|||
* Called by ItemBlocks just before a block is actually set in the world, to allow for adjustments to the
|
||||
* IBlockstate
|
||||
*/
|
||||
public State onBlockPlaced(World worldIn, BlockPos pos, Facing facing, float hitX, float hitY, float hitZ, EntityLiving placer)
|
||||
public State getPlacedState(World worldIn, BlockPos pos, Facing facing, float hitX, float hitY, float hitZ, EntityLiving placer)
|
||||
{
|
||||
return this.getState().withProperty(FACING, BlockPistonBase.getFacingFromEntity(worldIn, pos, placer));
|
||||
}
|
||||
|
||||
public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state)
|
||||
public void onRemoved(AWorldServer worldIn, BlockPos pos, State state)
|
||||
{
|
||||
TileEntity tileentity = worldIn.getTileEntity(pos);
|
||||
|
||||
|
@ -148,7 +148,7 @@ public class BlockDispenser extends Block implements ITileEntityProvider, Direct
|
|||
InventoryHelper.dropInventoryItems(worldIn, pos, (TileEntityDispenser)tileentity);
|
||||
}
|
||||
|
||||
super.onBlockRemoved(worldIn, pos, state);
|
||||
super.onRemoved(worldIn, pos, state);
|
||||
}
|
||||
|
||||
public static Vec3 getDispensePosition(BlockPos pos, Facing facing)
|
||||
|
@ -162,7 +162,7 @@ public class BlockDispenser extends Block implements ITileEntityProvider, Direct
|
|||
/**
|
||||
* Possibly modify the given BlockState before rendering it on an Entity (Minecarts, Endermen, ...)
|
||||
*/
|
||||
public State getStateForEntityRender(State state)
|
||||
public State getEntityState(State state)
|
||||
{
|
||||
return this.getState().withProperty(FACING, Facing.SOUTH);
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ public abstract class BlockDisplay extends Block implements Rotatable
|
|||
return this.density;
|
||||
}
|
||||
|
||||
public void setBlockBoundsBasedOnState(IWorldAccess worldIn, BlockPos pos)
|
||||
public void setBlockBounds(IWorldAccess worldIn, BlockPos pos)
|
||||
{
|
||||
State iblockstate = worldIn.getState(pos);
|
||||
|
||||
|
@ -74,16 +74,16 @@ public abstract class BlockDisplay extends Block implements Rotatable
|
|||
return new Property[] {FACING};
|
||||
}
|
||||
|
||||
public BoundingBox getCollisionBoundingBox(World worldIn, BlockPos pos, State state)
|
||||
public BoundingBox getCollisionBox(World worldIn, BlockPos pos, State state)
|
||||
{
|
||||
this.setBlockBoundsBasedOnState(worldIn, pos);
|
||||
return super.getCollisionBoundingBox(worldIn, pos, state);
|
||||
this.setBlockBounds(worldIn, pos);
|
||||
return super.getCollisionBox(worldIn, pos, state);
|
||||
}
|
||||
|
||||
public BoundingBox getSelectedBoundingBox(World worldIn, BlockPos pos)
|
||||
public BoundingBox getSelectionBox(World worldIn, BlockPos pos)
|
||||
{
|
||||
this.setBlockBoundsBasedOnState(worldIn, pos);
|
||||
return super.getSelectedBoundingBox(worldIn, pos);
|
||||
this.setBlockBounds(worldIn, pos);
|
||||
return super.getSelectionBox(worldIn, pos);
|
||||
}
|
||||
|
||||
public boolean isFullCube()
|
||||
|
@ -106,11 +106,11 @@ public abstract class BlockDisplay extends Block implements Rotatable
|
|||
return true;
|
||||
}
|
||||
|
||||
public State onBlockPlaced(World worldIn, BlockPos pos, Facing facing, float hitX, float hitY, float hitZ, EntityLiving placer) {
|
||||
public State getPlacedState(World worldIn, BlockPos pos, Facing facing, float hitX, float hitY, float hitZ, EntityLiving placer) {
|
||||
return this.getState().withProperty(FACING, facing.getAxis().isVertical() ? placer.getHorizontalFacing().getOpposite() : facing);
|
||||
}
|
||||
|
||||
public boolean shouldSideBeRendered(IWorldAccess worldIn, BlockPos pos, Facing side)
|
||||
public boolean canRender(IWorldAccess worldIn, BlockPos pos, Facing side)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ public class BlockEnchantmentTable extends Block
|
|||
{
|
||||
super(Material.SOLID);
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.75F, 1.0F);
|
||||
this.setLightOpacity(0);
|
||||
this.setOpacity(0);
|
||||
this.setTab(CheatTab.TECHNOLOGY);
|
||||
}
|
||||
|
||||
|
@ -44,7 +44,7 @@ public class BlockEnchantmentTable extends Block
|
|||
return false;
|
||||
}
|
||||
|
||||
public boolean onBlockActivated(World worldIn, BlockPos pos, State state, EntityNPC playerIn, Facing side, float hitX, float hitY, float hitZ)
|
||||
public boolean onUse(World worldIn, BlockPos pos, State state, EntityNPC playerIn, Facing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if (worldIn.client)
|
||||
{
|
||||
|
|
|
@ -37,7 +37,7 @@ public class BlockFurnace extends Block implements ITileEntityProvider, Rotatabl
|
|||
this.isBurning = isBurning;
|
||||
}
|
||||
|
||||
public void onBlockAdded(AWorldServer worldIn, BlockPos pos, State state)
|
||||
public void onAdded(AWorldServer worldIn, BlockPos pos, State state)
|
||||
{
|
||||
this.setDefaultFacing(worldIn, pos, state);
|
||||
}
|
||||
|
@ -74,7 +74,7 @@ public class BlockFurnace extends Block implements ITileEntityProvider, Rotatabl
|
|||
}
|
||||
|
||||
|
||||
public void randomDisplayTick(AWorldClient worldIn, BlockPos pos, State state, Random rand)
|
||||
public void displayTick(AWorldClient worldIn, BlockPos pos, State state, Random rand)
|
||||
{
|
||||
if (this.isBurning)
|
||||
{
|
||||
|
@ -109,7 +109,7 @@ public class BlockFurnace extends Block implements ITileEntityProvider, Rotatabl
|
|||
}
|
||||
}
|
||||
|
||||
public boolean onBlockActivated(World worldIn, BlockPos pos, State state, EntityNPC playerIn, Facing side, float hitX, float hitY, float hitZ)
|
||||
public boolean onUse(World worldIn, BlockPos pos, State state, EntityNPC playerIn, Facing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if (worldIn.client)
|
||||
{
|
||||
|
@ -167,12 +167,12 @@ public class BlockFurnace extends Block implements ITileEntityProvider, Rotatabl
|
|||
* Called by ItemBlocks just before a block is actually set in the world, to allow for adjustments to the
|
||||
* IBlockstate
|
||||
*/
|
||||
public State onBlockPlaced(World worldIn, BlockPos pos, Facing facing, float hitX, float hitY, float hitZ, EntityLiving placer)
|
||||
public State getPlacedState(World worldIn, BlockPos pos, Facing facing, float hitX, float hitY, float hitZ, EntityLiving placer)
|
||||
{
|
||||
return this.getState().withProperty(FACING, placer.getHorizontalFacing().getOpposite());
|
||||
}
|
||||
|
||||
public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state)
|
||||
public void onRemoved(AWorldServer worldIn, BlockPos pos, State state)
|
||||
{
|
||||
if (!keepInventory)
|
||||
{
|
||||
|
@ -184,7 +184,7 @@ public class BlockFurnace extends Block implements ITileEntityProvider, Rotatabl
|
|||
}
|
||||
}
|
||||
|
||||
super.onBlockRemoved(worldIn, pos, state);
|
||||
super.onRemoved(worldIn, pos, state);
|
||||
}
|
||||
|
||||
public Item getItem()
|
||||
|
@ -195,7 +195,7 @@ public class BlockFurnace extends Block implements ITileEntityProvider, Rotatabl
|
|||
/**
|
||||
* Possibly modify the given BlockState before rendering it on an Entity (Minecarts, Endermen, ...)
|
||||
*/
|
||||
public State getStateForEntityRender(State state)
|
||||
public State getEntityState(State state)
|
||||
{
|
||||
return this.getState().withProperty(FACING, Facing.SOUTH);
|
||||
}
|
||||
|
|
|
@ -89,7 +89,7 @@ public class BlockHopper extends Block implements ITileEntityProvider, Direction
|
|||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
|
||||
public void setBlockBoundsBasedOnState(IWorldAccess worldIn, BlockPos pos)
|
||||
public void setBlockBounds(IWorldAccess worldIn, BlockPos pos)
|
||||
{
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
|
@ -97,20 +97,20 @@ public class BlockHopper extends Block implements ITileEntityProvider, Direction
|
|||
/**
|
||||
* Add all collision boxes of this Block to the list that intersect with the given mask.
|
||||
*/
|
||||
public void addCollisionBoxesToList(World worldIn, BlockPos pos, State state, BoundingBox mask, List<BoundingBox> list, Entity collidingEntity)
|
||||
public void getCollisionBoxes(World worldIn, BlockPos pos, State state, BoundingBox mask, List<BoundingBox> list, Entity collidingEntity)
|
||||
{
|
||||
boolean flip = state.getBlock() == this && state.getValue(FACING) == Facing.UP;
|
||||
this.setBlockBounds(0.0F, flip ? 0.375f : 0.0F, 0.0F, 1.0F, flip ? 1.0f : 0.625F, 1.0F);
|
||||
super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity);
|
||||
super.getCollisionBoxes(worldIn, pos, state, mask, list, collidingEntity);
|
||||
float f = 0.125F;
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F);
|
||||
super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity);
|
||||
super.getCollisionBoxes(worldIn, pos, state, mask, list, collidingEntity);
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f);
|
||||
super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity);
|
||||
super.getCollisionBoxes(worldIn, pos, state, mask, list, collidingEntity);
|
||||
this.setBlockBounds(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity);
|
||||
super.getCollisionBoxes(worldIn, pos, state, mask, list, collidingEntity);
|
||||
this.setBlockBounds(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F);
|
||||
super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity);
|
||||
super.getCollisionBoxes(worldIn, pos, state, mask, list, collidingEntity);
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
|
||||
|
@ -118,7 +118,7 @@ public class BlockHopper extends Block implements ITileEntityProvider, Direction
|
|||
* Called by ItemBlocks just before a block is actually set in the world, to allow for adjustments to the
|
||||
* IBlockstate
|
||||
*/
|
||||
public State onBlockPlaced(World worldIn, BlockPos pos, Facing facing, float hitX, float hitY, float hitZ, EntityLiving placer)
|
||||
public State getPlacedState(World worldIn, BlockPos pos, Facing facing, float hitX, float hitY, float hitZ, EntityLiving placer)
|
||||
{
|
||||
return this.getState().withProperty(FACING, facing.getOpposite());
|
||||
}
|
||||
|
@ -131,7 +131,7 @@ public class BlockHopper extends Block implements ITileEntityProvider, Direction
|
|||
return new TileEntityHopper();
|
||||
}
|
||||
|
||||
public boolean onBlockActivated(World worldIn, BlockPos pos, State state, EntityNPC playerIn, Facing side, float hitX, float hitY, float hitZ)
|
||||
public boolean onUse(World worldIn, BlockPos pos, State state, EntityNPC playerIn, Facing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if (worldIn.client)
|
||||
{
|
||||
|
@ -150,7 +150,7 @@ public class BlockHopper extends Block implements ITileEntityProvider, Direction
|
|||
}
|
||||
}
|
||||
|
||||
public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state)
|
||||
public void onRemoved(AWorldServer worldIn, BlockPos pos, State state)
|
||||
{
|
||||
TileEntity tileentity = worldIn.getTileEntity(pos);
|
||||
|
||||
|
@ -159,7 +159,7 @@ public class BlockHopper extends Block implements ITileEntityProvider, Direction
|
|||
InventoryHelper.dropInventoryItems(worldIn, pos, (TileEntityHopper)tileentity);
|
||||
}
|
||||
|
||||
super.onBlockRemoved(worldIn, pos, state);
|
||||
super.onRemoved(worldIn, pos, state);
|
||||
}
|
||||
|
||||
public boolean isFullCube()
|
||||
|
@ -175,7 +175,7 @@ public class BlockHopper extends Block implements ITileEntityProvider, Direction
|
|||
return false;
|
||||
}
|
||||
|
||||
public boolean shouldSideBeRendered(IWorldAccess worldIn, BlockPos pos, Facing side)
|
||||
public boolean canRender(IWorldAccess worldIn, BlockPos pos, Facing side)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ public class BlockInactiveDisplay extends BlockDisplay {
|
|||
this.active = active;
|
||||
}
|
||||
|
||||
public boolean onBlockActivated(World worldIn, BlockPos pos, State state, EntityNPC playerIn, Facing side, float hitX, float hitY, float hitZ) {
|
||||
public boolean onUse(World worldIn, BlockPos pos, State state, EntityNPC playerIn, Facing side, float hitX, float hitY, float hitZ) {
|
||||
if(!worldIn.client) {
|
||||
Pair<BlockPos, BlockPos> span = this.getSpan(worldIn, pos, state.getValue(FACING));
|
||||
if(span == null)
|
||||
|
|
|
@ -34,10 +34,9 @@ public class BlockLever extends Block
|
|||
super(Material.SMALL);
|
||||
this.setDefaultState(this.getBaseState().withProperty(FACING, BlockLever.EnumOrientation.NORTH).withProperty(POWERED, Boolean.valueOf(false)));
|
||||
this.setTab(CheatTab.TECHNOLOGY);
|
||||
this.setFlatBlockTexture();
|
||||
}
|
||||
|
||||
public BoundingBox getCollisionBoundingBox(World worldIn, BlockPos pos, State state)
|
||||
public BoundingBox getCollisionBox(World worldIn, BlockPos pos, State state)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
@ -58,12 +57,12 @@ public class BlockLever extends Block
|
|||
/**
|
||||
* Check whether this Block can be placed on the given side
|
||||
*/
|
||||
public boolean canPlaceBlockOnSide(World worldIn, BlockPos pos, Facing side)
|
||||
public boolean canPlace(World worldIn, BlockPos pos, Facing side)
|
||||
{
|
||||
return canPlaceLeverOn(worldIn, pos, side.getOpposite());
|
||||
}
|
||||
|
||||
public boolean canPlaceBlockAt(World worldIn, BlockPos pos)
|
||||
public boolean canPlace(World worldIn, BlockPos pos)
|
||||
{
|
||||
for (Facing enumfacing : Facing.values())
|
||||
{
|
||||
|
@ -85,7 +84,7 @@ public class BlockLever extends Block
|
|||
* Called by ItemBlocks just before a block is actually set in the world, to allow for adjustments to the
|
||||
* IBlockstate
|
||||
*/
|
||||
public State onBlockPlaced(World worldIn, BlockPos pos, Facing facing, float hitX, float hitY, float hitZ, EntityLiving placer)
|
||||
public State getPlacedState(World worldIn, BlockPos pos, Facing facing, float hitX, float hitY, float hitZ, EntityLiving placer)
|
||||
{
|
||||
State iblockstate = this.getState().withProperty(POWERED, Boolean.valueOf(false));
|
||||
|
||||
|
@ -144,30 +143,30 @@ public class BlockLever extends Block
|
|||
/**
|
||||
* Called when a neighboring block changes.
|
||||
*/
|
||||
public void onNeighborBlockChange(World worldIn, BlockPos pos, State state, Block neighborBlock)
|
||||
public void onUpdate(World worldIn, BlockPos pos, State state, Block neighborBlock)
|
||||
{
|
||||
if (this.checkDrop(worldIn, pos, state) && !canPlaceLeverOn(worldIn, pos, ((BlockLever.EnumOrientation)state.getValue(FACING)).getFacing().getOpposite()))
|
||||
{
|
||||
this.dropBlockAsItem(worldIn, pos, state, 0);
|
||||
this.drop(worldIn, pos, state, 0);
|
||||
worldIn.setBlockToAir(pos);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean checkDrop(World worldIn, BlockPos pos, State state)
|
||||
{
|
||||
if (this.canPlaceBlockAt(worldIn, pos))
|
||||
if (this.canPlace(worldIn, pos))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.dropBlockAsItem(worldIn, pos, state, 0);
|
||||
this.drop(worldIn, pos, state, 0);
|
||||
worldIn.setBlockToAir(pos);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public void setBlockBoundsBasedOnState(IWorldAccess worldIn, BlockPos pos)
|
||||
public void setBlockBounds(IWorldAccess worldIn, BlockPos pos)
|
||||
{
|
||||
float f = 0.1875F;
|
||||
|
||||
|
@ -202,7 +201,7 @@ public class BlockLever extends Block
|
|||
}
|
||||
}
|
||||
|
||||
public boolean onBlockActivated(World worldIn, BlockPos pos, State state, EntityNPC playerIn, Facing side, float hitX, float hitY, float hitZ)
|
||||
public boolean onUse(World worldIn, BlockPos pos, State state, EntityNPC playerIn, Facing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if (worldIn.client)
|
||||
{
|
||||
|
@ -220,7 +219,7 @@ public class BlockLever extends Block
|
|||
}
|
||||
}
|
||||
|
||||
public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state)
|
||||
public void onRemoved(AWorldServer worldIn, BlockPos pos, State state)
|
||||
{
|
||||
if (((Boolean)state.getValue(POWERED)).booleanValue())
|
||||
{
|
||||
|
@ -229,7 +228,7 @@ public class BlockLever extends Block
|
|||
worldIn.notifyNeighborsOfStateChange(pos.offset(enumfacing.getOpposite()), this);
|
||||
}
|
||||
|
||||
super.onBlockRemoved(worldIn, pos, state);
|
||||
super.onRemoved(worldIn, pos, state);
|
||||
}
|
||||
|
||||
public double getResistance(World worldIn, BlockPos pos, State state) {
|
||||
|
|
|
@ -27,7 +27,7 @@ public class BlockLitTorch extends BlockTorch {
|
|||
unlit.setLitTorch(this);
|
||||
this.setTab(CheatTab.TECHNOLOGY);
|
||||
this.setDefaultState(this.getBaseState().withProperty(FACING, Facing.UP).withProperty(FUEL, 7));
|
||||
this.setTickRandomly();
|
||||
this.setTicked();
|
||||
}
|
||||
|
||||
public void extinguish(AWorldServer worldIn, BlockPos pos, State state, Random rand) {
|
||||
|
@ -42,7 +42,7 @@ public class BlockLitTorch extends BlockTorch {
|
|||
}
|
||||
}
|
||||
|
||||
public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand) {
|
||||
public void tick(AWorldServer worldIn, BlockPos pos, State state, Random rand) {
|
||||
if(Vars.torchBurnout > 0 && rand.chance(Vars.torchBurnout)) {
|
||||
int fuel = state.getValue(FUEL);
|
||||
if(fuel <= 0) {
|
||||
|
@ -54,7 +54,7 @@ public class BlockLitTorch extends BlockTorch {
|
|||
}
|
||||
}
|
||||
|
||||
public void randomDisplayTick(AWorldClient worldIn, BlockPos pos, State state, Random rand) {
|
||||
public void displayTick(AWorldClient worldIn, BlockPos pos, State state, Random rand) {
|
||||
if(this.unlit.getParticleColor() == 0xffffffff) {
|
||||
Facing enumfacing = (Facing)state.getValue(FACING);
|
||||
double d0 = (double)pos.getX() + 0.5D;
|
||||
|
@ -93,7 +93,7 @@ public class BlockLitTorch extends BlockTorch {
|
|||
}
|
||||
}
|
||||
|
||||
public boolean onBlockActivated(World worldIn, BlockPos pos, State state, EntityNPC playerIn, Facing side, float hitX, float hitY, float hitZ) {
|
||||
public boolean onUse(World worldIn, BlockPos pos, State state, EntityNPC playerIn, Facing side, float hitX, float hitY, float hitZ) {
|
||||
if(!worldIn.client)
|
||||
this.extinguish((AWorldServer)worldIn, pos, state, worldIn.rand);
|
||||
return true;
|
||||
|
|
|
@ -30,11 +30,11 @@ public abstract class BlockMachine extends Block implements Rotatable, ITileEnti
|
|||
|
||||
public abstract TileEntity createNewTileEntity();
|
||||
|
||||
public void onBlockAdded(AWorldServer worldIn, BlockPos pos, State state) {
|
||||
public void onAdded(AWorldServer worldIn, BlockPos pos, State state) {
|
||||
this.updateState(worldIn, pos, state);
|
||||
}
|
||||
|
||||
public boolean onBlockActivated(World worldIn, BlockPos pos, State state, EntityNPC playerIn, Facing side, float hitX, float hitY,
|
||||
public boolean onUse(World worldIn, BlockPos pos, State state, EntityNPC playerIn, Facing side, float hitX, float hitY,
|
||||
float hitZ) {
|
||||
if(worldIn.client)
|
||||
return true;
|
||||
|
@ -44,22 +44,22 @@ public abstract class BlockMachine extends Block implements Rotatable, ITileEnti
|
|||
return true;
|
||||
}
|
||||
|
||||
public void onNeighborBlockChange(World worldIn, BlockPos pos, State state, Block neighborBlock) {
|
||||
public void onUpdate(World worldIn, BlockPos pos, State state, Block neighborBlock) {
|
||||
this.updateState(worldIn, pos, state);
|
||||
}
|
||||
|
||||
private void updateState(World worldIn, BlockPos pos, State state) {
|
||||
}
|
||||
|
||||
public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state) {
|
||||
public void onRemoved(AWorldServer worldIn, BlockPos pos, State state) {
|
||||
TileEntity tileentity = worldIn.getTileEntity(pos);
|
||||
if(tileentity instanceof Device) {
|
||||
InventoryHelper.dropInventoryItems(worldIn, pos, (Device)tileentity);
|
||||
}
|
||||
super.onBlockRemoved(worldIn, pos, state);
|
||||
super.onRemoved(worldIn, pos, state);
|
||||
}
|
||||
|
||||
public State onBlockPlaced(World worldIn, BlockPos pos, Facing facing, float hitX, float hitY, float hitZ, EntityLiving placer) {
|
||||
public State getPlacedState(World worldIn, BlockPos pos, Facing facing, float hitX, float hitY, float hitZ, EntityLiving placer) {
|
||||
return this.getState().withProperty(FACING, placer.getHorizontalFacing());
|
||||
}
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ public class BlockNuke extends Block
|
|||
this.setTab(CheatTab.TECHNOLOGY);
|
||||
}
|
||||
|
||||
public void onBlockDestroyedByExplosion(World worldIn, BlockPos pos, Explosion explosionIn, State prevState)
|
||||
public void onDestroyedExplosion(World worldIn, BlockPos pos, Explosion explosionIn, State prevState)
|
||||
{
|
||||
if (!worldIn.client)
|
||||
{
|
||||
|
@ -41,7 +41,7 @@ public class BlockNuke extends Block
|
|||
}
|
||||
}
|
||||
|
||||
public boolean canDropFromExplosion(Explosion explosionIn)
|
||||
public boolean canDrop(Explosion explosionIn)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -255,7 +255,7 @@ public class BlockPistonBase extends Block implements Directional
|
|||
super(Material.PISTON);
|
||||
this.setDefaultState(this.getBaseState().withProperty(FACING, Facing.NORTH).withProperty(EXTENDED, Boolean.valueOf(false)));
|
||||
this.isSticky = isSticky;
|
||||
this.setStepSound(SoundType.STONE);
|
||||
this.setSound(SoundType.STONE);
|
||||
this.setHardness(0.5F);
|
||||
this.setTab(CheatTab.TECHNOLOGY);
|
||||
}
|
||||
|
@ -271,7 +271,7 @@ public class BlockPistonBase extends Block implements Directional
|
|||
/**
|
||||
* Called by ItemBlocks after a block is set in the world, to allow post-place logic
|
||||
*/
|
||||
public void onBlockPlacedBy(World worldIn, BlockPos pos, State state, EntityLiving placer)
|
||||
public void onPlace(World worldIn, BlockPos pos, State state, EntityLiving placer)
|
||||
{
|
||||
worldIn.setState(pos, state.withProperty(FACING, getFacingFromEntity(worldIn, pos, placer)), 2);
|
||||
|
||||
|
@ -284,7 +284,7 @@ public class BlockPistonBase extends Block implements Directional
|
|||
/**
|
||||
* Called when a neighboring block changes.
|
||||
*/
|
||||
public void onNeighborBlockChange(World worldIn, BlockPos pos, State state, Block neighborBlock)
|
||||
public void onUpdate(World worldIn, BlockPos pos, State state, Block neighborBlock)
|
||||
{
|
||||
if (!worldIn.client)
|
||||
{
|
||||
|
@ -292,7 +292,7 @@ public class BlockPistonBase extends Block implements Directional
|
|||
}
|
||||
}
|
||||
|
||||
public void onBlockAdded(AWorldServer worldIn, BlockPos pos, State state)
|
||||
public void onAdded(AWorldServer worldIn, BlockPos pos, State state)
|
||||
{
|
||||
if (!worldIn.client && worldIn.getTileEntity(pos) == null)
|
||||
{
|
||||
|
@ -304,7 +304,7 @@ public class BlockPistonBase extends Block implements Directional
|
|||
* Called by ItemBlocks just before a block is actually set in the world, to allow for adjustments to the
|
||||
* IBlockstate
|
||||
*/
|
||||
public State onBlockPlaced(World worldIn, BlockPos pos, Facing facing, float hitX, float hitY, float hitZ, EntityLiving placer)
|
||||
public State getPlacedState(World worldIn, BlockPos pos, Facing facing, float hitX, float hitY, float hitZ, EntityLiving placer)
|
||||
{
|
||||
return this.getState().withProperty(FACING, getFacingFromEntity(worldIn, pos, placer)).withProperty(EXTENDED, Boolean.valueOf(false));
|
||||
}
|
||||
|
@ -379,7 +379,7 @@ public class BlockPistonBase extends Block implements Directional
|
|||
// }
|
||||
}
|
||||
|
||||
public void setBlockBoundsBasedOnState(IWorldAccess worldIn, BlockPos pos)
|
||||
public void setBlockBounds(IWorldAccess worldIn, BlockPos pos)
|
||||
{
|
||||
State iblockstate = worldIn.getState(pos);
|
||||
|
||||
|
@ -426,7 +426,7 @@ public class BlockPistonBase extends Block implements Directional
|
|||
/**
|
||||
* Sets the block's bounds for rendering it as an item
|
||||
*/
|
||||
public void setBlockBoundsForItemRender()
|
||||
public void setItemBounds()
|
||||
{
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
|
@ -434,16 +434,16 @@ public class BlockPistonBase extends Block implements Directional
|
|||
/**
|
||||
* Add all collision boxes of this Block to the list that intersect with the given mask.
|
||||
*/
|
||||
public void addCollisionBoxesToList(World worldIn, BlockPos pos, State state, BoundingBox mask, List<BoundingBox> list, Entity collidingEntity)
|
||||
public void getCollisionBoxes(World worldIn, BlockPos pos, State state, BoundingBox mask, List<BoundingBox> list, Entity collidingEntity)
|
||||
{
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity);
|
||||
super.getCollisionBoxes(worldIn, pos, state, mask, list, collidingEntity);
|
||||
}
|
||||
|
||||
public BoundingBox getCollisionBoundingBox(World worldIn, BlockPos pos, State state)
|
||||
public BoundingBox getCollisionBox(World worldIn, BlockPos pos, State state)
|
||||
{
|
||||
this.setBlockBoundsBasedOnState(worldIn, pos);
|
||||
return super.getCollisionBoundingBox(worldIn, pos, state);
|
||||
this.setBlockBounds(worldIn, pos);
|
||||
return super.getCollisionBox(worldIn, pos, state);
|
||||
}
|
||||
|
||||
public boolean isFullCube()
|
||||
|
@ -493,7 +493,7 @@ public class BlockPistonBase extends Block implements Directional
|
|||
{
|
||||
if (blockIn != Blocks.piston && blockIn != Blocks.sticky_piston)
|
||||
{
|
||||
if (blockIn.getBlockHardness(worldIn, pos) == -1.0F)
|
||||
if (blockIn.getHardness(worldIn, pos) == -1.0F)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -556,7 +556,7 @@ public class BlockPistonBase extends Block implements Directional
|
|||
{
|
||||
BlockPos blockpos = (BlockPos)list1.get(j);
|
||||
Block block = worldIn.getState(blockpos).getBlock();
|
||||
block.dropBlockAsItem(worldIn, blockpos, worldIn.getState(blockpos), 0);
|
||||
block.drop(worldIn, blockpos, worldIn.getState(blockpos), 0);
|
||||
worldIn.setBlockToAir(blockpos);
|
||||
--i;
|
||||
ablock[i] = block;
|
||||
|
@ -607,7 +607,7 @@ public class BlockPistonBase extends Block implements Directional
|
|||
float step = 0.25f;
|
||||
|
||||
State state = world.getState(pos);
|
||||
BoundingBox axisalignedbb = state.getBlock().getCollisionBoundingBox(world, pos, state);
|
||||
BoundingBox axisalignedbb = state.getBlock().getCollisionBox(world, pos, state);
|
||||
|
||||
if (axisalignedbb != null)
|
||||
{
|
||||
|
@ -649,7 +649,7 @@ public class BlockPistonBase extends Block implements Directional
|
|||
/**
|
||||
* Possibly modify the given BlockState before rendering it on an Entity (Minecarts, Endermen, ...)
|
||||
*/
|
||||
public State getStateForEntityRender(State state)
|
||||
public State getEntityState(State state)
|
||||
{
|
||||
return this.getState().withProperty(FACING, Facing.UP);
|
||||
}
|
||||
|
|
|
@ -31,21 +31,21 @@ public class BlockPistonHead extends Block implements Directional
|
|||
{
|
||||
super(Material.PISTON);
|
||||
this.setDefaultState(this.getBaseState().withProperty(FACING, Facing.NORTH));
|
||||
this.setStepSound(SoundType.STONE);
|
||||
this.setSound(SoundType.STONE);
|
||||
this.setHardness(0.5F);
|
||||
this.sticky = sticky;
|
||||
}
|
||||
|
||||
public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state)
|
||||
public void onRemoved(AWorldServer worldIn, BlockPos pos, State state)
|
||||
{
|
||||
super.onBlockRemoved(worldIn, pos, state);
|
||||
super.onRemoved(worldIn, pos, state);
|
||||
Facing enumfacing = ((Facing)state.getValue(FACING)).getOpposite();
|
||||
pos = pos.offset(enumfacing);
|
||||
State iblockstate = worldIn.getState(pos);
|
||||
|
||||
if ((iblockstate.getBlock() == Blocks.piston || iblockstate.getBlock() == Blocks.sticky_piston) && ((Boolean)iblockstate.getValue(BlockPistonBase.EXTENDED)).booleanValue())
|
||||
{
|
||||
iblockstate.getBlock().dropBlockAsItem(worldIn, pos, iblockstate, 0);
|
||||
iblockstate.getBlock().drop(worldIn, pos, iblockstate, 0);
|
||||
worldIn.setBlockToAir(pos);
|
||||
}
|
||||
}
|
||||
|
@ -63,7 +63,7 @@ public class BlockPistonHead extends Block implements Directional
|
|||
return false;
|
||||
}
|
||||
|
||||
public boolean canPlaceBlockAt(World worldIn, BlockPos pos)
|
||||
public boolean canPlace(World worldIn, BlockPos pos)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -71,7 +71,7 @@ public class BlockPistonHead extends Block implements Directional
|
|||
/**
|
||||
* Check whether this Block can be placed on the given side
|
||||
*/
|
||||
public boolean canPlaceBlockOnSide(World worldIn, BlockPos pos, Facing side)
|
||||
public boolean canPlace(World worldIn, BlockPos pos, Facing side)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -79,7 +79,7 @@ public class BlockPistonHead extends Block implements Directional
|
|||
/**
|
||||
* Returns the quantity of items to drop on block destruction.
|
||||
*/
|
||||
protected int quantityDropped(Random random)
|
||||
protected int getDropAmount(Random random)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
@ -87,12 +87,12 @@ public class BlockPistonHead extends Block implements Directional
|
|||
/**
|
||||
* Add all collision boxes of this Block to the list that intersect with the given mask.
|
||||
*/
|
||||
public void addCollisionBoxesToList(World worldIn, BlockPos pos, State state, BoundingBox mask, List<BoundingBox> list, Entity collidingEntity)
|
||||
public void getCollisionBoxes(World worldIn, BlockPos pos, State state, BoundingBox mask, List<BoundingBox> list, Entity collidingEntity)
|
||||
{
|
||||
this.applyHeadBounds(state);
|
||||
super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity);
|
||||
super.getCollisionBoxes(worldIn, pos, state, mask, list, collidingEntity);
|
||||
this.applyCoreBounds(state);
|
||||
super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity);
|
||||
super.getCollisionBoxes(worldIn, pos, state, mask, list, collidingEntity);
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
|
||||
|
@ -131,7 +131,7 @@ public class BlockPistonHead extends Block implements Directional
|
|||
}
|
||||
}
|
||||
|
||||
public void setBlockBoundsBasedOnState(IWorldAccess worldIn, BlockPos pos)
|
||||
public void setBlockBounds(IWorldAccess worldIn, BlockPos pos)
|
||||
{
|
||||
this.applyHeadBounds(worldIn.getState(pos));
|
||||
}
|
||||
|
@ -174,7 +174,7 @@ public class BlockPistonHead extends Block implements Directional
|
|||
/**
|
||||
* Called when a neighboring block changes.
|
||||
*/
|
||||
public void onNeighborBlockChange(World worldIn, BlockPos pos, State state, Block neighborBlock)
|
||||
public void onUpdate(World worldIn, BlockPos pos, State state, Block neighborBlock)
|
||||
{
|
||||
Facing enumfacing = (Facing)state.getValue(FACING);
|
||||
BlockPos blockpos = pos.offset(enumfacing.getOpposite());
|
||||
|
@ -186,11 +186,11 @@ public class BlockPistonHead extends Block implements Directional
|
|||
}
|
||||
else
|
||||
{
|
||||
iblockstate.getBlock().onNeighborBlockChange(worldIn, blockpos, iblockstate, neighborBlock);
|
||||
iblockstate.getBlock().onUpdate(worldIn, blockpos, iblockstate, neighborBlock);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean shouldSideBeRendered(IWorldAccess worldIn, BlockPos pos, Facing side)
|
||||
public boolean canRender(IWorldAccess worldIn, BlockPos pos, Facing side)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -46,11 +46,10 @@ public class BlockRail extends Block
|
|||
super(Material.SMALL);
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.125F, 1.0F);
|
||||
this.setTab(CheatTab.TECHNOLOGY);
|
||||
this.setFlatBlockTexture();
|
||||
this.setDefaultState(this.getBaseState().withProperty(SHAPE, BlockRail.EnumRailDirection.NORTH_SOUTH));
|
||||
}
|
||||
|
||||
public BoundingBox getCollisionBoundingBox(World worldIn, BlockPos pos, State state)
|
||||
public BoundingBox getCollisionBox(World worldIn, BlockPos pos, State state)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
@ -66,13 +65,13 @@ public class BlockRail extends Block
|
|||
/**
|
||||
* Ray traces through the blocks collision from start vector to end vector returning a ray trace hit.
|
||||
*/
|
||||
public HitPosition collisionRayTrace(World worldIn, BlockPos pos, Vec3 start, Vec3 end)
|
||||
public HitPosition rayTrace(World worldIn, BlockPos pos, Vec3 start, Vec3 end)
|
||||
{
|
||||
this.setBlockBoundsBasedOnState(worldIn, pos);
|
||||
return super.collisionRayTrace(worldIn, pos, start, end);
|
||||
this.setBlockBounds(worldIn, pos);
|
||||
return super.rayTrace(worldIn, pos, start, end);
|
||||
}
|
||||
|
||||
public void setBlockBoundsBasedOnState(IWorldAccess worldIn, BlockPos pos)
|
||||
public void setBlockBounds(IWorldAccess worldIn, BlockPos pos)
|
||||
{
|
||||
State iblockstate = worldIn.getState(pos);
|
||||
BlockRail.EnumRailDirection blockrailbase$enumraildirection = iblockstate.getBlock() == this ? (BlockRail.EnumRailDirection)iblockstate.getValue(SHAPE) : null;
|
||||
|
@ -92,12 +91,12 @@ public class BlockRail extends Block
|
|||
return false;
|
||||
}
|
||||
|
||||
public boolean canPlaceBlockAt(World worldIn, BlockPos pos)
|
||||
public boolean canPlace(World worldIn, BlockPos pos)
|
||||
{
|
||||
return worldIn.isBlockSolid(pos.down());
|
||||
}
|
||||
|
||||
public void onBlockAdded(AWorldServer worldIn, BlockPos pos, State state)
|
||||
public void onAdded(AWorldServer worldIn, BlockPos pos, State state)
|
||||
{
|
||||
if (!worldIn.client)
|
||||
{
|
||||
|
@ -108,7 +107,7 @@ public class BlockRail extends Block
|
|||
/**
|
||||
* Called when a neighboring block changes.
|
||||
*/
|
||||
public void onNeighborBlockChange(World worldIn, BlockPos pos, State state, Block neighborBlock)
|
||||
public void onUpdate(World worldIn, BlockPos pos, State state, Block neighborBlock)
|
||||
{
|
||||
if (!worldIn.client)
|
||||
{
|
||||
|
@ -139,7 +138,7 @@ public class BlockRail extends Block
|
|||
|
||||
if (flag)
|
||||
{
|
||||
this.dropBlockAsItem(worldIn, pos, state, 0);
|
||||
this.drop(worldIn, pos, state, 0);
|
||||
worldIn.setBlockToAir(pos);
|
||||
}
|
||||
else
|
||||
|
@ -164,9 +163,9 @@ public class BlockRail extends Block
|
|||
return BlockLayer.CUTOUT;
|
||||
}
|
||||
|
||||
public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state)
|
||||
public void onRemoved(AWorldServer worldIn, BlockPos pos, State state)
|
||||
{
|
||||
super.onBlockRemoved(worldIn, pos, state);
|
||||
super.onRemoved(worldIn, pos, state);
|
||||
|
||||
if (((BlockRail.EnumRailDirection)state.getValue(SHAPE)).isAscending())
|
||||
{
|
||||
|
|
|
@ -55,7 +55,7 @@ public class BlockTNT extends Block
|
|||
/**
|
||||
* Called when this Block is destroyed by an Explosion
|
||||
*/
|
||||
public void onBlockDestroyedByExplosion(World worldIn, BlockPos pos, Explosion explosionIn, State prevState)
|
||||
public void onDestroyedExplosion(World worldIn, BlockPos pos, Explosion explosionIn, State prevState)
|
||||
{
|
||||
if (!worldIn.client)
|
||||
{
|
||||
|
@ -68,7 +68,7 @@ public class BlockTNT extends Block
|
|||
/**
|
||||
* Called when a player destroys this Block
|
||||
*/
|
||||
public void onBlockDestroyedByPlayer(World worldIn, BlockPos pos, State state)
|
||||
public void onBroken(World worldIn, BlockPos pos, State state)
|
||||
{
|
||||
this.explode(worldIn, pos, state, (EntityLiving)null);
|
||||
}
|
||||
|
@ -86,7 +86,7 @@ public class BlockTNT extends Block
|
|||
}
|
||||
}
|
||||
|
||||
public boolean onBlockActivated(World worldIn, BlockPos pos, State state, EntityNPC playerIn, Facing side, float hitX, float hitY, float hitZ)
|
||||
public boolean onUse(World worldIn, BlockPos pos, State state, EntityNPC playerIn, Facing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if (playerIn.getCurrentEquippedItem() != null)
|
||||
{
|
||||
|
@ -110,13 +110,13 @@ public class BlockTNT extends Block
|
|||
}
|
||||
}
|
||||
|
||||
return super.onBlockActivated(worldIn, pos, state, playerIn, side, hitX, hitY, hitZ);
|
||||
return super.onUse(worldIn, pos, state, playerIn, side, hitX, hitY, hitZ);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called When an Entity Collided with the Block
|
||||
*/
|
||||
public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, State state, Entity entityIn)
|
||||
public void onCollideUpdate(World worldIn, BlockPos pos, State state, Entity entityIn)
|
||||
{
|
||||
if (!worldIn.client && entityIn instanceof EntityArrow)
|
||||
{
|
||||
|
@ -133,7 +133,7 @@ public class BlockTNT extends Block
|
|||
/**
|
||||
* Return whether this block can drop from an explosion.
|
||||
*/
|
||||
public boolean canDropFromExplosion(Explosion explosionIn)
|
||||
public boolean canDrop(Explosion explosionIn)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -157,8 +157,8 @@ public class BlockTNT extends Block
|
|||
return new Property[] {EXPLODE};
|
||||
}
|
||||
|
||||
public void onDestroyedByFire(World world, BlockPos pos, State state) {
|
||||
this.onBlockDestroyedByPlayer(world, pos, state.withProperty(BlockTNT.EXPLODE, Boolean.valueOf(true)));
|
||||
public void onDestroyedFire(World world, BlockPos pos, State state) {
|
||||
this.onBroken(world, pos, state.withProperty(BlockTNT.EXPLODE, Boolean.valueOf(true)));
|
||||
}
|
||||
|
||||
public TextColor getItemColor() {
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue