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


Java IBlockState.isFullCube方法代码示例

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


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

示例1: canConnectTo

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
public boolean canConnectTo (IBlockAccess world, BlockPos pos) {
    IBlockState state = world.getBlockState(pos);
    Block block = state.getBlock();

    if (block instanceof BlockFence)
        return true;
    if (block == Blocks.BARRIER)
        return false;

    Material material = block.getMaterial(state);
    if (!material.isOpaque())
        return false;
    if (!state.isFullCube())
        return false;

    return material != Material.GOURD;
}
 
开发者ID:jaquadro,项目名称:GardenStuff,代码行数:18,代码来源:BlockFence.java

示例2: isBlockNormalCube

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
/**
 * Checks if a block's material is opaque, and that it takes up a full cube
 */
public boolean isBlockNormalCube(BlockPos pos, boolean _default)
{
    if (this.isOutsideBuildHeight(pos))
    {
        return false;
    }
    else
    {
        Chunk chunk = this.chunkProvider.getLoadedChunk(pos.getX() >> 4, pos.getZ() >> 4);

        if (chunk != null && !chunk.isEmpty())
        {
            IBlockState iblockstate = this.getBlockState(pos);
            return iblockstate.getMaterial().isOpaque() && iblockstate.isFullCube();
        }
        else
        {
            return _default;
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:25,代码来源:World.java

示例3: 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

示例4: isNeighborHardConnection

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
private boolean isNeighborHardConnection (IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing facing) {
    if (state.getMaterial().isOpaque() && state.isFullCube())
        return true;

    if (state.isSideSolid(world, pos, facing.getOpposite()))
        return true;

    if (facing == EnumFacing.DOWN) {
        Block block = state.getBlock();
        if (block instanceof BlockFence || block instanceof net.minecraft.block.BlockFence)
            return true;
    }

    return false;
}
 
开发者ID:jaquadro,项目名称:GardenStuff,代码行数:16,代码来源:BlockLattice.java

示例5: isFullyOpaque

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
@Deprecated

    /**
     * Checks if an IBlockState represents a block that is opaque and a full cube.
     */
    public boolean isFullyOpaque(IBlockState state)
    {
        return state.getMaterial().isOpaque() && state.isFullCube();
    }
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:10,代码来源:Block.java

示例6: isBlockNormalCube

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
@Deprecated

    /**
     * Indicate if a material is a normal solid opaque cube
     */
    public boolean isBlockNormalCube(IBlockState state)
    {
        return state.getMaterial().blocksMovement() && state.isFullCube();
    }
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:10,代码来源:Block.java

示例7: 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

示例8: isBlockNormalCube

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
/**
 * Indicate if a material is a normal solid opaque cube
 */
@Deprecated
public boolean isBlockNormalCube(IBlockState state)
{
    return state.getMaterial().blocksMovement() && state.isFullCube();
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:9,代码来源:Block.java

示例9: canPlaceBlock

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
private boolean canPlaceBlock(World p_188518_1_, BlockPos p_188518_2_, Block p_188518_3_, IBlockState p_188518_4_, IBlockState p_188518_5_) {
	return p_188518_5_.getMaterial() == Material.AIR ? false : p_188518_4_.getMaterial() != Material.AIR ? false : !p_188518_3_.canPlaceBlockAt(p_188518_1_, p_188518_2_) ? false : p_188518_5_.isFullCube();
}
 
开发者ID:p455w0rd,项目名称:EndermanEvolution,代码行数:4,代码来源:EntityEvolvedEnderman.java

示例10: isEmptyBlock

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
private boolean isEmptyBlock(BlockPos pos) {
	IBlockState iblockstate = theWorld.getBlockState(pos);
	return iblockstate.getMaterial() == Material.AIR ? true : !iblockstate.isFullCube();
}
 
开发者ID:p455w0rd,项目名称:EndermanEvolution,代码行数:5,代码来源:EntityFrienderman.java

示例11: isNormalCube

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
/**
 * Used for nearly all game logic (non-rendering) purposes. Use Forge-provided isNormalCube(IBlockAccess, BlockPos)
 * instead.
 */
@Deprecated
public boolean isNormalCube(IBlockState state)
{
    return state.getMaterial().isOpaque() && state.isFullCube() && !state.canProvidePower();
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:10,代码来源:Block.java

示例12: isEmptyBlock

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
private boolean isEmptyBlock(BlockPos pos)
{
    IBlockState iblockstate = this.theWorld.getBlockState(pos);
    return iblockstate.getMaterial() == Material.AIR ? true : !iblockstate.isFullCube();
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:6,代码来源:EntityAIFollowOwner.java

示例13: canPlaceBlock

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
private boolean canPlaceBlock(World p_188518_1_, BlockPos p_188518_2_, Block p_188518_3_, IBlockState p_188518_4_, IBlockState p_188518_5_)
{
    return !p_188518_3_.canPlaceBlockAt(p_188518_1_, p_188518_2_) ? false : (p_188518_4_.getMaterial() != Material.AIR ? false : (p_188518_5_.getMaterial() == Material.AIR ? false : p_188518_5_.isFullCube()));
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:5,代码来源:EntityEnderman.java

示例14: canConnectTo

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
public boolean canConnectTo(IBlockAccess worldIn, BlockPos pos)
{
    IBlockState iblockstate = worldIn.getBlockState(pos);
    Block block = iblockstate.getBlock();
    return block == Blocks.BARRIER ? false : ((!(block instanceof BlockFence) || block.blockMaterial != this.blockMaterial) && !(block instanceof BlockFenceGate) ? (block.blockMaterial.isOpaque() && iblockstate.isFullCube() ? block.blockMaterial != Material.GOURD : false) : true);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:7,代码来源:BlockFence.java

示例15: isFullyOpaque

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
/**
 * Checks if an IBlockState represents a block that is opaque and a full cube.
 */
@Deprecated
public boolean isFullyOpaque(IBlockState state)
{
    return state.getMaterial().isOpaque() && state.isFullCube();
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:9,代码来源:Block.java


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