当前位置: 首页>>代码示例>>Java>>正文


Java IBlockState.isFullBlock方法代码示例

本文整理汇总了Java中net.minecraft.block.state.IBlockState.isFullBlock方法的典型用法代码示例。如果您正苦于以下问题:Java IBlockState.isFullBlock方法的具体用法?Java IBlockState.isFullBlock怎么用?Java IBlockState.isFullBlock使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.block.state.IBlockState的用法示例。


在下文中一共展示了IBlockState.isFullBlock方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setDefaultFacing

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
private void setDefaultFacing(World worldIn, BlockPos pos, IBlockState state) {
    if (!worldIn.isRemote) {
        IBlockState iblockstate = worldIn.getBlockState(pos.north());
        IBlockState iblockstate1 = worldIn.getBlockState(pos.south());
        IBlockState iblockstate2 = worldIn.getBlockState(pos.west());
        IBlockState iblockstate3 = worldIn.getBlockState(pos.east());
        EnumFacing enumfacing = state.getValue(FACING);

        if (enumfacing == EnumFacing.NORTH && iblockstate.isFullBlock() && !iblockstate1.isFullBlock()) {
            enumfacing = EnumFacing.SOUTH;
        } else if (enumfacing == EnumFacing.SOUTH && iblockstate1.isFullBlock() && !iblockstate.isFullBlock()) {
            enumfacing = EnumFacing.NORTH;
        } else if (enumfacing == EnumFacing.WEST && iblockstate2.isFullBlock() && !iblockstate3.isFullBlock()) {
            enumfacing = EnumFacing.EAST;
        } else if (enumfacing == EnumFacing.EAST && iblockstate3.isFullBlock() && !iblockstate2.isFullBlock()) {
            enumfacing = EnumFacing.WEST;
        }

        worldIn.setBlockState(pos, state.withProperty(FACING, enumfacing), 2);
    }
}
 
开发者ID:Randores,项目名称:Randores2,代码行数:22,代码来源:CraftiniumForge.java

示例2: shouldRenderSides

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
public boolean shouldRenderSides(IBlockAccess blockAccess, BlockPos pos)
{
    for (int i = -1; i <= 1; ++i)
    {
        for (int j = -1; j <= 1; ++j)
        {
            IBlockState iblockstate = blockAccess.getBlockState(pos.add(i, 0, j));

            if (iblockstate.getMaterial() != this.blockMaterial && !iblockstate.isFullBlock())
            {
                return true;
            }
        }
    }

    return false;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:18,代码来源:BlockLiquid.java

示例3: shouldRenderSides

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
public boolean shouldRenderSides(IBlockAccess blockAccess, BlockPos pos)
{
    for (int i = -1; i <= 1; ++i)
    {
        for (int j = -1; j <= 1; ++j)
        {
            IBlockState iblockstate = blockAccess.getBlockState(pos.add(i, 0, j));

            if (iblockstate.getMaterial() != this.blockMaterial && !iblockstate.isFullBlock())
            {
                return true;
            }
        }
    }

    return false;
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:19,代码来源:BlockLiquid.java

示例4: setDefaultFacing

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
private void setDefaultFacing(World worldIn, BlockPos pos, IBlockState state) {
    if (!worldIn.isRemote) {
        IBlockState northState = worldIn.getBlockState(pos.north());
        IBlockState southState = worldIn.getBlockState(pos.south());
        IBlockState westState = worldIn.getBlockState(pos.west());
        IBlockState eastState = worldIn.getBlockState(pos.east());
        EnumFacing enumfacing = state.getValue(FACING);

        if (enumfacing == EnumFacing.NORTH && northState.isFullBlock() && !southState.isFullBlock())
            enumfacing = EnumFacing.SOUTH;
        else if (enumfacing == EnumFacing.SOUTH && southState.isFullBlock() && !northState.isFullBlock())
            enumfacing = EnumFacing.NORTH;
        else if (enumfacing == EnumFacing.WEST && westState.isFullBlock() && !eastState.isFullBlock())
            enumfacing = EnumFacing.EAST;
        else if (enumfacing == EnumFacing.EAST && eastState.isFullBlock() && !westState.isFullBlock())
            enumfacing = EnumFacing.WEST;

        worldIn.setBlockState(pos, state.withProperty(FACING, enumfacing), 2);
    }
}
 
开发者ID:LasmGratel,项目名称:FoodCraft-Reloaded,代码行数:21,代码来源:BlockMachine.java

示例5: setDefaultFacing

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
private void setDefaultFacing(World worldIn, BlockPos pos, IBlockState state)
{
    if (!worldIn.isRemote)
    {
        IBlockState iblockstate = worldIn.getBlockState(pos.north());
        IBlockState iblockstate1 = worldIn.getBlockState(pos.south());
        IBlockState iblockstate2 = worldIn.getBlockState(pos.west());
        IBlockState iblockstate3 = worldIn.getBlockState(pos.east());
        EnumFacing enumfacing = (EnumFacing)state.getValue(FACING);

        if (enumfacing == EnumFacing.NORTH && iblockstate.isFullBlock() && !iblockstate1.isFullBlock())
        {
            enumfacing = EnumFacing.SOUTH;
        }
        else if (enumfacing == EnumFacing.SOUTH && iblockstate1.isFullBlock() && !iblockstate.isFullBlock())
        {
            enumfacing = EnumFacing.NORTH;
        }
        else if (enumfacing == EnumFacing.WEST && iblockstate2.isFullBlock() && !iblockstate3.isFullBlock())
        {
            enumfacing = EnumFacing.EAST;
        }
        else if (enumfacing == EnumFacing.EAST && iblockstate3.isFullBlock() && !iblockstate2.isFullBlock())
        {
            enumfacing = EnumFacing.WEST;
        }

        worldIn.setBlockState(pos, state.withProperty(FACING, enumfacing), 2);
    }
}
 
开发者ID:Herobone,项目名称:HeroUtils,代码行数:31,代码来源:HeroHead.java

示例6: loadChunk

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
private void loadChunk(int id, Shader shader, ExtendedBlockStorage storage) {
	ObjectIntIdentityMap<IBlockState> map = GameData.getBlockStateIDMap();
	int[] data = new int[chunkSize*2];
	for (int y = 0; y < 16; y++) {
		for (int z = 0; z < 16; z++) {
			for (int x = 0; x < 16; x++) {
				IBlockState state = storage.get(x, y, z);
				boolean fullBlock = state.isFullBlock();
				boolean cube = state.isFullCube();
				if (fullBlock != cube) {
					Log.info(state.getBlock().getUnlocalizedName() + ": " + fullBlock);
				}
				if (fullBlock) {
					stateSet.add(state);
				}
				int stateId = map.get(state); //TODO
				data[(y<<9) + (z<<5) + (x<<1)] = Block.getIdFromBlock(storage.get(x, y, z).getBlock());
			}
		}
	}
	
	for (int y = 0; y < 16; y++) {
		for (int z = 0; z < 16; z++) {
			for (int x = 0; x < 16; x++) {
				data[(y<<9) + (z<<5) + (x<<1) + 1] = storage.getBlocklightArray().get(x, y, z);
			}
		}
	}
	
	IntBuffer buffer = BufferUtils.createIntBuffer(chunkSize*2);
	buffer.put(data);
	buffer.flip();
	GL15.glBindBuffer(GL43.GL_SHADER_STORAGE_BUFFER, shader.getChunkSsbo());
	GL15.glBufferSubData(GL43.GL_SHADER_STORAGE_BUFFER, (id-1)*chunkSize*2*4, buffer);
	GL15.glBindBuffer(GL43.GL_SHADER_STORAGE_BUFFER, 0);
}
 
开发者ID:18107,项目名称:MC-Ray-Tracer,代码行数:37,代码来源:WorldLoader.java

示例7: setDefaultFacing

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
private void setDefaultFacing (World world, BlockPos pos, IBlockState state) {
    if (!world.isRemote)
    {
        IBlockState bsNorth = world.getBlockState(pos.north());
        IBlockState bsSouth = world.getBlockState(pos.south());
        IBlockState bsWest = world.getBlockState(pos.west());
        IBlockState bsEast = world.getBlockState(pos.east());
        EnumFacing enumfacing = (EnumFacing)state.getValue(FACING);

        if (enumfacing == EnumFacing.NORTH && bsNorth.isFullBlock() && !bsSouth.isFullBlock())
        {
            enumfacing = EnumFacing.SOUTH;
        }
        else if (enumfacing == EnumFacing.SOUTH && bsSouth.isFullBlock() && !bsNorth.isFullBlock())
        {
            enumfacing = EnumFacing.NORTH;
        }
        else if (enumfacing == EnumFacing.WEST && bsWest.isFullBlock() && !bsEast.isFullBlock())
        {
            enumfacing = EnumFacing.EAST;
        }
        else if (enumfacing == EnumFacing.EAST && bsEast.isFullBlock() && !bsWest.isFullBlock())
        {
            enumfacing = EnumFacing.WEST;
        }

        world.setBlockState(pos, state.withProperty(FACING, enumfacing), 2);
    }
}
 
开发者ID:jaquadro,项目名称:GardenStuff,代码行数:30,代码来源:BlockBloomeryFurnace.java

示例8: setDefaultFacing

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
private void setDefaultFacing(World worldIn, BlockPos pos, IBlockState state)
{
	if (!worldIn.isRemote)
	{
		IBlockState iblockstate = worldIn.getBlockState(pos.north());
		IBlockState iblockstate1 = worldIn.getBlockState(pos.south());
		IBlockState iblockstate2 = worldIn.getBlockState(pos.west());
		IBlockState iblockstate3 = worldIn.getBlockState(pos.east());
		EnumFacing enumfacing = (EnumFacing)state.getValue(FACING);

		if (enumfacing == EnumFacing.NORTH && iblockstate.isFullBlock() && !iblockstate1.isFullBlock())
		{
			enumfacing = EnumFacing.SOUTH;
		}
		else if (enumfacing == EnumFacing.SOUTH && iblockstate1.isFullBlock() && !iblockstate.isFullBlock())
		{
			enumfacing = EnumFacing.NORTH;
		}
		else if (enumfacing == EnumFacing.WEST && iblockstate2.isFullBlock() && !iblockstate3.isFullBlock())
		{
			enumfacing = EnumFacing.EAST;
		}
		else if (enumfacing == EnumFacing.EAST && iblockstate3.isFullBlock() && !iblockstate2.isFullBlock())
		{
			enumfacing = EnumFacing.WEST;
		}

		worldIn.setBlockState(pos, state.withProperty(FACING, enumfacing), 2);
	}
}
 
开发者ID:Lemonszz,项目名称:Anima-Mundi,代码行数:31,代码来源:BlockDestroyer.java

示例9: isSideSolid

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
@Override
public boolean isSideSolid(IBlockState base_state, IBlockAccess world, BlockPos pos, EnumFacing side)
{
    IBlockState state = this.getActualState(base_state, world, pos);
    return base_state.isFullBlock()
           || (state.getValue(net.minecraft.block.BlockSlab.HALF) == net.minecraft.block.BlockSlab.EnumBlockHalf.TOP && side == EnumFacing.UP)
           || (state.getValue(net.minecraft.block.BlockSlab.HALF) == net.minecraft.block.BlockSlab.EnumBlockHalf.BOTTOM && side == EnumFacing.DOWN);
}
 
开发者ID:cubex2,项目名称:customstuff4,代码行数:9,代码来源:BlockSlab.java

示例10: setDefaultDirection

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
private void setDefaultDirection(World world, BlockPos pos, IBlockState state)
{
    if (!world.isRemote)
    {
        EnumFacing enumfacing = state.getValue(FACING);

        TileEntity te = world.getTileEntity(pos);
        if (te != null && te instanceof TileEntityIronFurnace)
        {
            enumfacing = EnumFacing.getFront(((TileEntityIronFurnace) te).getFacing());
        }

        IBlockState iblockstate = world.getBlockState(pos.north());
        IBlockState iblockstate1 = world.getBlockState(pos.south());
        IBlockState iblockstate2 = world.getBlockState(pos.west());
        IBlockState iblockstate3 = world.getBlockState(pos.east());


        if (enumfacing == EnumFacing.NORTH && iblockstate.isFullBlock() && !iblockstate1.isFullBlock())
        {
            enumfacing = EnumFacing.SOUTH;
        } else if (enumfacing == EnumFacing.SOUTH && iblockstate1.isFullBlock() && !iblockstate.isFullBlock())
        {
            enumfacing = EnumFacing.NORTH;
        } else if (enumfacing == EnumFacing.WEST && iblockstate2.isFullBlock() && !iblockstate3.isFullBlock())
        {
            enumfacing = EnumFacing.EAST;
        } else if (enumfacing == EnumFacing.EAST && iblockstate3.isFullBlock() && !iblockstate2.isFullBlock())
        {
            enumfacing = EnumFacing.WEST;
        }

        if (te != null && te instanceof TileEntityIronFurnace)
        {
            ((TileEntityIronFurnace) te).setFacing((byte) enumfacing.ordinal());
            world.notifyBlockUpdate(pos, state, state, 3);
        }
    }
}
 
开发者ID:cubex2,项目名称:morefurnaces,代码行数:40,代码来源:BlockMoreFurnaces.java

示例11: takeBlocksFromWorld

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
/**
 * takes blocks from the world and puts the data them into this template
 */
public void takeBlocksFromWorld(World worldIn, BlockPos actualPosition, BlockPos startPos, BlockPos endPos, boolean takeEntities, @Nullable Block toIgnore)
{
    if (endPos.getX() >= 1 && endPos.getY() >= 1 && endPos.getZ() >= 1)
    {
        BlockPos blockpos = startPos.add(endPos).add(-1, -1, -1);
        List<Template.BlockInfo> list = Lists.<Template.BlockInfo>newArrayList();
        List<Template.BlockInfo> list1 = Lists.<Template.BlockInfo>newArrayList();
        List<Template.BlockInfo> list2 = Lists.<Template.BlockInfo>newArrayList();
        BlockPos blockpos1 = new BlockPos(Math.min(startPos.getX(), blockpos.getX()), Math.min(startPos.getY(), blockpos.getY()), Math.min(startPos.getZ(), blockpos.getZ()));
        BlockPos blockpos2 = new BlockPos(Math.max(startPos.getX(), blockpos.getX()), Math.max(startPos.getY(), blockpos.getY()), Math.max(startPos.getZ(), blockpos.getZ()));
        this.size = endPos;
        this.pos = actualPosition;

        for (BlockPos.MutableBlockPos blockpos$mutableblockpos : BlockPos.getAllInBoxMutable(blockpos1, blockpos2))
        {
            BlockPos blockpos3 = blockpos$mutableblockpos.subtract(blockpos1);
            IBlockState iblockstate = worldIn.getBlockState(blockpos$mutableblockpos);

            if (toIgnore == null || toIgnore != iblockstate.getBlock())
            {
                TileEntity tileentity = worldIn.getTileEntity(blockpos$mutableblockpos);

                if (tileentity != null)
                {
                    NBTTagCompound nbttagcompound = tileentity.writeToNBT(new NBTTagCompound());
                    nbttagcompound.removeTag("x");
                    nbttagcompound.removeTag("y");
                    nbttagcompound.removeTag("z");
                    list1.add(new Template.BlockInfo(blockpos3, iblockstate, nbttagcompound));
                }
                else if (!iblockstate.isFullBlock() && !iblockstate.isFullCube())
                {
                    list2.add(new Template.BlockInfo(blockpos3, iblockstate, (NBTTagCompound)null));
                }
                else
                {
                    list.add(new Template.BlockInfo(blockpos3, iblockstate, (NBTTagCompound)null));
                }
            }
        }

        this.blocks.clear();
        this.blocks.addAll(list);
        this.blocks.addAll(list1);
        this.blocks.addAll(list2);

        if (takeEntities)
        {
            this.takeEntitiesFromWorld(worldIn, blockpos1, blockpos2.add(1, 1, 1));
        }
        else
        {
            this.entities.clear();
        }
    }
}
 
开发者ID:kenijey,项目名称:harshencastle,代码行数:60,代码来源:HarshenTemplate.java

示例12: isBlockTransparent

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
public static boolean isBlockTransparent(World world, BlockPos pos, IBlockState state){
    return state.getBlock() instanceof BlockAir || !state.getMaterial().isOpaque() || !state.isBlockNormalCube() || !state.isFullBlock() || !state.isOpaqueCube();
}
 
开发者ID:canitzp,项目名称:Metalworks,代码行数:4,代码来源:Util.java

示例13: takeBlocksFromWorld

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
/**
 * takes blocks from the world and puts the data them into this template
 */
public void takeBlocksFromWorld(World worldIn, BlockPos startPos, BlockPos endPos, boolean takeEntities, @Nullable Block toIgnore)
{
    if (endPos.getX() >= 1 && endPos.getY() >= 1 && endPos.getZ() >= 1)
    {
        BlockPos blockpos = startPos.add(endPos).add(-1, -1, -1);
        List<Template.BlockInfo> list = Lists.<Template.BlockInfo>newArrayList();
        List<Template.BlockInfo> list1 = Lists.<Template.BlockInfo>newArrayList();
        List<Template.BlockInfo> list2 = Lists.<Template.BlockInfo>newArrayList();
        BlockPos blockpos1 = new BlockPos(Math.min(startPos.getX(), blockpos.getX()), Math.min(startPos.getY(), blockpos.getY()), Math.min(startPos.getZ(), blockpos.getZ()));
        BlockPos blockpos2 = new BlockPos(Math.max(startPos.getX(), blockpos.getX()), Math.max(startPos.getY(), blockpos.getY()), Math.max(startPos.getZ(), blockpos.getZ()));
        this.size = endPos;

        for (BlockPos.MutableBlockPos blockpos$mutableblockpos : BlockPos.getAllInBoxMutable(blockpos1, blockpos2))
        {
            BlockPos blockpos3 = blockpos$mutableblockpos.subtract(blockpos1);
            IBlockState iblockstate = worldIn.getBlockState(blockpos$mutableblockpos);

            if (toIgnore == null || toIgnore != iblockstate.getBlock())
            {
                TileEntity tileentity = worldIn.getTileEntity(blockpos$mutableblockpos);

                if (tileentity != null)
                {
                    NBTTagCompound nbttagcompound = tileentity.writeToNBT(new NBTTagCompound());
                    nbttagcompound.removeTag("x");
                    nbttagcompound.removeTag("y");
                    nbttagcompound.removeTag("z");
                    list1.add(new Template.BlockInfo(blockpos3, iblockstate, nbttagcompound));
                }
                else if (!iblockstate.isFullBlock() && !iblockstate.isFullCube())
                {
                    list2.add(new Template.BlockInfo(blockpos3, iblockstate, (NBTTagCompound)null));
                }
                else
                {
                    list.add(new Template.BlockInfo(blockpos3, iblockstate, (NBTTagCompound)null));
                }
            }
        }

        this.blocks.clear();
        this.blocks.addAll(list);
        this.blocks.addAll(list1);
        this.blocks.addAll(list2);

        if (takeEntities)
        {
            this.takeEntitiesFromWorld(worldIn, blockpos1, blockpos2.add(1, 1, 1));
        }
        else
        {
            this.entities.clear();
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:59,代码来源:Template.java

示例14: canSustainBush

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
/**
 * Return true if the block can sustain a Bush
 */
protected boolean canSustainBush(IBlockState state)
{
    return state.isFullBlock();
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:8,代码来源:BlockMushroom.java

示例15: correctFacing

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
public IBlockState correctFacing(World worldIn, BlockPos pos, IBlockState state)
{
    EnumFacing enumfacing = null;

    for (EnumFacing enumfacing1 : EnumFacing.Plane.HORIZONTAL)
    {
        IBlockState iblockstate = worldIn.getBlockState(pos.offset(enumfacing1));

        if (iblockstate.getBlock() == this)
        {
            return state;
        }

        if (iblockstate.isFullBlock())
        {
            if (enumfacing != null)
            {
                enumfacing = null;
                break;
            }

            enumfacing = enumfacing1;
        }
    }

    if (enumfacing != null)
    {
        return state.withProperty(FACING, enumfacing.getOpposite());
    }
    else
    {
        EnumFacing enumfacing2 = (EnumFacing)state.getValue(FACING);

        if (worldIn.getBlockState(pos.offset(enumfacing2)).isFullBlock())
        {
            enumfacing2 = enumfacing2.getOpposite();
        }

        if (worldIn.getBlockState(pos.offset(enumfacing2)).isFullBlock())
        {
            enumfacing2 = enumfacing2.rotateY();
        }

        if (worldIn.getBlockState(pos.offset(enumfacing2)).isFullBlock())
        {
            enumfacing2 = enumfacing2.getOpposite();
        }

        return state.withProperty(FACING, enumfacing2);
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:52,代码来源:BlockChest.java


注:本文中的net.minecraft.block.state.IBlockState.isFullBlock方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。