當前位置: 首頁>>代碼示例>>Java>>正文


Java Blocks.FIRE屬性代碼示例

本文整理匯總了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;
	}
}
 
開發者ID:EnderiumSmith,項目名稱:CharcoalPit,代碼行數:17,代碼來源:BlockPotteryKiln.java

示例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;
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:18,代碼來源:World.java

示例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());
        }
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:20,代碼來源:EntityEnderCrystal.java

示例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;
}
 
開發者ID:Um-Mitternacht,項目名稱:Bewitchment,代碼行數:13,代碼來源:RitualFlames.java

示例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);
			}
		}
	}
}
 
開發者ID:EnderiumSmith,項目名稱:CharcoalPit,代碼行數:36,代碼來源:PileIgnitr.java

示例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;
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:35,代碼來源:World.java

示例7: extinguishFires

private void extinguishFires(BlockPos pos)
{
    if (this.world.getBlockState(pos).getBlock() == Blocks.FIRE)
    {
        this.world.setBlockState(pos, Blocks.AIR.getDefaultState(), 2);
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:7,代碼來源:EntityPotion.java

示例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);
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:8,代碼來源:WalkNodeProcessor.java

示例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;
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:39,代碼來源:World.java

示例10: extinguishFires

private void extinguishFires(BlockPos pos)
{
    if (this.worldObj.getBlockState(pos).getBlock() == Blocks.FIRE)
    {
        this.worldObj.setBlockState(pos, Blocks.AIR.getDefaultState(), 2);
    }
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:7,代碼來源:EntityPotion.java

示例11: isApplicable

@Override
public boolean isApplicable() {
    return super.isApplicable() && getBlockState().getBlock() == Blocks.FIRE;
}
 
開發者ID:TeamPneumatic,項目名稱:pnc-repressurized,代碼行數:4,代碼來源:HeatBehaviourFireTransition.java

示例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;
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:6,代碼來源:BlockFalling.java

示例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;
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:49,代碼來源:WalkNodeProcessor.java

示例14: isBurning

@Override
public boolean isBurning()
{
    return world != null && world.getBlockState(pos.up()).getBlock() == Blocks.FIRE;
}
 
開發者ID:cubex2,項目名稱:morefurnaces,代碼行數:5,代碼來源:TileEntityNetherrackFurnace.java

示例15: isEmptyBlock

protected boolean isEmptyBlock(Block blockIn)
{
    return blockIn.blockMaterial == Material.AIR || blockIn == Blocks.FIRE || blockIn == Blocks.PORTAL;
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:4,代碼來源:BlockPortal.java


注:本文中的net.minecraft.init.Blocks.FIRE屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。