當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。