本文整理汇总了Java中net.minecraft.init.Blocks.FIRE属性的典型用法代码示例。如果您正苦于以下问题:Java Blocks.FIRE属性的具体用法?Java Blocks.FIRE怎么用?Java Blocks.FIRE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类net.minecraft.init.Blocks
的用法示例。
在下文中一共展示了Blocks.FIRE属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: neighborChanged
@Override
public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn, BlockPos fromPos) {
if(pos.offset(EnumFacing.DOWN).equals(fromPos)&&
!worldIn.getBlockState(fromPos).isSideSolid(worldIn, fromPos, EnumFacing.UP)){
worldIn.destroyBlock(pos, true);
return;
}
if(state.getValue(TYPE)==EnumKilnTypes.ACTIVE){
if(pos.offset(EnumFacing.UP).equals(fromPos)){
IBlockState fromState=worldIn.getBlockState(fromPos);
if(fromState.getBlock()==Blocks.FIRE)
return;
((TilePotteryKiln)worldIn.getTileEntity(pos)).isValid=false;
}
((TilePotteryKiln)worldIn.getTileEntity(pos)).isValid=false;
}
}
示例2: extinguishFire
/**
* Attempts to extinguish a fire
*/
public boolean extinguishFire(@Nullable EntityPlayer player, BlockPos pos, EnumFacing side)
{
pos = pos.offset(side);
if (this.getBlockState(pos).getBlock() == Blocks.FIRE)
{
this.playEvent(player, 1009, pos, 0);
this.setBlockToAir(pos);
return true;
}
else
{
return false;
}
}
示例3: onUpdate
/**
* Called to update the entity's position/logic.
*/
public void onUpdate()
{
this.prevPosX = this.posX;
this.prevPosY = this.posY;
this.prevPosZ = this.posZ;
++this.innerRotation;
if (!this.world.isRemote)
{
BlockPos blockpos = new BlockPos(this);
if (this.world.provider instanceof WorldProviderEnd && this.world.getBlockState(blockpos).getBlock() != Blocks.FIRE)
{
this.world.setBlockState(blockpos, Blocks.FIRE.getDefaultState());
}
}
}
示例4: canBurn
private boolean canBurn(World world, BlockPos pos) {
if (!world.isAirBlock(pos))
return false;
for (EnumFacing side : EnumFacing.VALUES) {
BlockPos offset = pos.offset(side);
if (!world.isAirBlock(pos.offset(side))) {
Block block = world.getBlockState(offset).getBlock();
if (block != Blocks.FIRE)
return true;
}
}
return false;
}
示例5: checkIgnition
@SubscribeEvent(priority=EventPriority.LOWEST)
public void checkIgnition(NeighborNotifyEvent event){
if(!event.isCanceled()&&
event.getWorld().getBlockState(event.getPos()).getBlock()==Blocks.FIRE){
for(EnumFacing facing:event.getNotifiedSides()){
BlockPos pos=event.getPos().offset(facing);
if(event.getWorld().getBlockState(pos).getBlock()==BlocksRegistry.logPile){
//found log pile to ignite
igniteLogs(event.getWorld(),pos);
}else if(event.getWorld().getBlockState(pos).getBlock()==Blocks.COAL_BLOCK){
boolean shouldIgnite=false;
for(int x=-1;x<=1;x++){
for(int y=-1;y<=1;y++){
for(int z=-1;z<=1&&!shouldIgnite;z++){
BlockPos newpos=pos.add(x, y, z);
for(String name:Config.CokeBlocks){
if(event.getWorld().getBlockState(newpos).getBlock().getRegistryName().toString().equals(name)){
shouldIgnite=true;
break;
}
}
}
}
}
if(shouldIgnite){
//found coal pile to ignite
igniteCoal(event.getWorld(),pos);
}
}else if(facing==EnumFacing.DOWN&&event.getWorld().getBlockState(pos).getBlock()==BlocksRegistry.potteryKiln){
//found pottery kiln to ignite
ignitePottery(event.getWorld(), pos);
}
}
}
}
示例6: isFlammableWithin
public boolean isFlammableWithin(AxisAlignedBB bb)
{
int i = MathHelper.floor(bb.minX);
int j = MathHelper.ceil(bb.maxX);
int k = MathHelper.floor(bb.minY);
int l = MathHelper.ceil(bb.maxY);
int i1 = MathHelper.floor(bb.minZ);
int j1 = MathHelper.ceil(bb.maxZ);
if (this.isAreaLoaded(i, k, i1, j, l, j1, true))
{
BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.retain();
for (int k1 = i; k1 < j; ++k1)
{
for (int l1 = k; l1 < l; ++l1)
{
for (int i2 = i1; i2 < j1; ++i2)
{
Block block = this.getBlockState(blockpos$pooledmutableblockpos.setPos(k1, l1, i2)).getBlock();
if (block == Blocks.FIRE || block == Blocks.FLOWING_LAVA || block == Blocks.LAVA)
{
blockpos$pooledmutableblockpos.release();
return true;
}
}
}
}
blockpos$pooledmutableblockpos.release();
}
return false;
}
示例7: extinguishFires
private void extinguishFires(BlockPos pos)
{
if (this.world.getBlockState(pos).getBlock() == Blocks.FIRE)
{
this.world.setBlockState(pos, Blocks.AIR.getDefaultState(), 2);
}
}
示例8: getPathNodeTypeRaw
private PathNodeType getPathNodeTypeRaw(IBlockAccess p_189553_1_, int p_189553_2_, int p_189553_3_, int p_189553_4_)
{
BlockPos blockpos = new BlockPos(p_189553_2_, p_189553_3_, p_189553_4_);
IBlockState iblockstate = p_189553_1_.getBlockState(blockpos);
Block block = iblockstate.getBlock();
Material material = iblockstate.getMaterial();
return material == Material.AIR ? PathNodeType.OPEN : (block != Blocks.TRAPDOOR && block != Blocks.IRON_TRAPDOOR && block != Blocks.WATERLILY ? (block == Blocks.FIRE ? PathNodeType.DAMAGE_FIRE : (block == Blocks.CACTUS ? PathNodeType.DAMAGE_CACTUS : (block instanceof BlockDoor && material == Material.WOOD && !((Boolean)iblockstate.getValue(BlockDoor.OPEN)).booleanValue() ? PathNodeType.DOOR_WOOD_CLOSED : (block instanceof BlockDoor && material == Material.IRON && !((Boolean)iblockstate.getValue(BlockDoor.OPEN)).booleanValue() ? PathNodeType.DOOR_IRON_CLOSED : (block instanceof BlockDoor && ((Boolean)iblockstate.getValue(BlockDoor.OPEN)).booleanValue() ? PathNodeType.DOOR_OPEN : (block instanceof BlockRailBase ? PathNodeType.RAIL : (!(block instanceof BlockFence) && !(block instanceof BlockWall) && (!(block instanceof BlockFenceGate) || ((Boolean)iblockstate.getValue(BlockFenceGate.OPEN)).booleanValue()) ? (material == Material.WATER ? PathNodeType.WATER : (material == Material.LAVA ? PathNodeType.LAVA : (block.isPassable(p_189553_1_, blockpos) ? PathNodeType.OPEN : PathNodeType.BLOCKED))) : PathNodeType.FENCE))))))) : PathNodeType.TRAPDOOR);
}
示例9: isFlammableWithin
public boolean isFlammableWithin(AxisAlignedBB bb)
{
int i = MathHelper.floor_double(bb.minX);
int j = MathHelper.ceiling_double_int(bb.maxX);
int k = MathHelper.floor_double(bb.minY);
int l = MathHelper.ceiling_double_int(bb.maxY);
int i1 = MathHelper.floor_double(bb.minZ);
int j1 = MathHelper.ceiling_double_int(bb.maxZ);
if (this.isAreaLoaded(i, k, i1, j, l, j1, true))
{
BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.retain();
for (int k1 = i; k1 < j; ++k1)
{
for (int l1 = k; l1 < l; ++l1)
{
for (int i2 = i1; i2 < j1; ++i2)
{
Block block = this.getBlockState(blockpos$pooledmutableblockpos.setPos(k1, l1, i2)).getBlock();
if (block == Blocks.FIRE || block == Blocks.FLOWING_LAVA || block == Blocks.LAVA)
{
blockpos$pooledmutableblockpos.release();
return true;
}
else if (block.isBurning(this, new BlockPos(k1, l1, i2)))
{
return true;
}
}
}
}
blockpos$pooledmutableblockpos.release();
}
return false;
}
示例10: extinguishFires
private void extinguishFires(BlockPos pos)
{
if (this.worldObj.getBlockState(pos).getBlock() == Blocks.FIRE)
{
this.worldObj.setBlockState(pos, Blocks.AIR.getDefaultState(), 2);
}
}
示例11: isApplicable
@Override
public boolean isApplicable() {
return super.isApplicable() && getBlockState().getBlock() == Blocks.FIRE;
}
示例12: canFallThrough
public static boolean canFallThrough(IBlockState state)
{
Block block = state.getBlock();
Material material = state.getMaterial();
return block == Blocks.FIRE || material == Material.AIR || material == Material.WATER || material == Material.LAVA;
}
示例13: getPathNodeType
public PathNodeType getPathNodeType(IBlockAccess blockaccessIn, int x, int y, int z)
{
PathNodeType pathnodetype = this.getPathNodeTypeRaw(blockaccessIn, x, y, z);
if (pathnodetype == PathNodeType.OPEN && y >= 1)
{
Block block = blockaccessIn.getBlockState(new BlockPos(x, y - 1, z)).getBlock();
PathNodeType pathnodetype1 = this.getPathNodeTypeRaw(blockaccessIn, x, y - 1, z);
pathnodetype = pathnodetype1 != PathNodeType.WALKABLE && pathnodetype1 != PathNodeType.OPEN && pathnodetype1 != PathNodeType.WATER && pathnodetype1 != PathNodeType.LAVA ? PathNodeType.WALKABLE : PathNodeType.OPEN;
if (pathnodetype1 == PathNodeType.DAMAGE_FIRE || block == Blocks.MAGMA)
{
pathnodetype = PathNodeType.DAMAGE_FIRE;
}
if (pathnodetype1 == PathNodeType.DAMAGE_CACTUS)
{
pathnodetype = PathNodeType.DAMAGE_CACTUS;
}
}
BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.retain();
if (pathnodetype == PathNodeType.WALKABLE)
{
for (int j = -1; j <= 1; ++j)
{
for (int i = -1; i <= 1; ++i)
{
if (j != 0 || i != 0)
{
Block block1 = blockaccessIn.getBlockState(blockpos$pooledmutableblockpos.setPos(j + x, y, i + z)).getBlock();
if (block1 == Blocks.CACTUS)
{
pathnodetype = PathNodeType.DANGER_CACTUS;
}
else if (block1 == Blocks.FIRE)
{
pathnodetype = PathNodeType.DANGER_FIRE;
}
}
}
}
}
blockpos$pooledmutableblockpos.release();
return pathnodetype;
}
示例14: isBurning
@Override
public boolean isBurning()
{
return world != null && world.getBlockState(pos.up()).getBlock() == Blocks.FIRE;
}
示例15: isEmptyBlock
protected boolean isEmptyBlock(Block blockIn)
{
return blockIn.blockMaterial == Material.AIR || blockIn == Blocks.FIRE || blockIn == Blocks.PORTAL;
}