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


Java BlockPos.equals方法代碼示例

本文整理匯總了Java中net.minecraft.util.BlockPos.equals方法的典型用法代碼示例。如果您正苦於以下問題:Java BlockPos.equals方法的具體用法?Java BlockPos.equals怎麽用?Java BlockPos.equals使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.minecraft.util.BlockPos的用法示例。


在下文中一共展示了BlockPos.equals方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: func_181015_d

import net.minecraft.util.BlockPos; //導入方法依賴的package包/類
public void func_181015_d(BlockPos p_181015_1_)
{
    if (this.timeUntilPortal > 0)
    {
        this.timeUntilPortal = this.getPortalCooldown();
    }
    else
    {
        if (!this.worldObj.isRemote && !p_181015_1_.equals(this.field_181016_an))
        {
            this.field_181016_an = p_181015_1_;
            BlockPattern.PatternHelper blockpattern$patternhelper = Blocks.portal.func_181089_f(this.worldObj, p_181015_1_);
            double d0 = blockpattern$patternhelper.getFinger().getAxis() == EnumFacing.Axis.X ? (double)blockpattern$patternhelper.func_181117_a().getZ() : (double)blockpattern$patternhelper.func_181117_a().getX();
            double d1 = blockpattern$patternhelper.getFinger().getAxis() == EnumFacing.Axis.X ? this.posZ : this.posX;
            d1 = Math.abs(MathHelper.func_181160_c(d1 - (double)(blockpattern$patternhelper.getFinger().rotateY().getAxisDirection() == EnumFacing.AxisDirection.NEGATIVE ? 1 : 0), d0, d0 - (double)blockpattern$patternhelper.func_181118_d()));
            double d2 = MathHelper.func_181160_c(this.posY - 1.0D, (double)blockpattern$patternhelper.func_181117_a().getY(), (double)(blockpattern$patternhelper.func_181117_a().getY() - blockpattern$patternhelper.func_181119_e()));
            this.field_181017_ao = new Vec3(d1, d2, 0.0D);
            this.field_181018_ap = blockpattern$patternhelper.getFinger();
        }

        this.inPortal = true;
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:24,代碼來源:Entity.java

示例2: onBlockActivated

import net.minecraft.util.BlockPos; //導入方法依賴的package包/類
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ)
{
    if (this.blockMaterial == Material.iron)
    {
        return true;
    }
    else
    {
        BlockPos blockpos = state.getValue(HALF) == BlockDoor.EnumDoorHalf.LOWER ? pos : pos.down();
        IBlockState iblockstate = pos.equals(blockpos) ? state : worldIn.getBlockState(blockpos);

        if (iblockstate.getBlock() != this)
        {
            return false;
        }
        else
        {
            state = iblockstate.cycleProperty(OPEN);
            worldIn.setBlockState(blockpos, state, 2);
            worldIn.markBlockRangeForRenderUpdate(blockpos, pos);
            worldIn.playAuxSFXAtEntity(playerIn, ((Boolean)state.getValue(OPEN)).booleanValue() ? 1003 : 1006, pos, 0);
            return true;
        }
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:26,代碼來源:BlockDoor.java

示例3: RenderChunk

import net.minecraft.util.BlockPos; //導入方法依賴的package包/類
public RenderChunk(World worldIn, RenderGlobal renderGlobalIn, BlockPos blockPosIn, int indexIn)
{
    this.world = worldIn;
    this.renderGlobal = renderGlobalIn;
    this.index = indexIn;

    if (!blockPosIn.equals(this.getPosition()))
    {
        this.setPosition(blockPosIn);
    }

    if (OpenGlHelper.useVbo())
    {
        for (int i = 0; i < EnumWorldBlockLayer.values().length; ++i)
        {
            this.vertexBuffers[i] = new VertexBuffer(DefaultVertexFormats.BLOCK);
        }
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:20,代碼來源:RenderChunk.java

示例4: toggleConnectFrom

import net.minecraft.util.BlockPos; //導入方法依賴的package包/類
public boolean toggleConnectFrom(BlockPos pos)
{
	TileEntity te = this.getWorld().getTileEntity(pos);
	if(te != null && te instanceof TileLaserRelay){ //is a laser relay
		TileLaserRelay ent = (TileLaserRelay)te;
		if(!pos.equals(this.pos) && this.pos.distanceSq(pos.getX(), pos.getY(), pos.getZ()) <= FundamentalChemistry.MAX_RELAY_DISTANCE){ //prevents self linking and check distance
			if(!inputs.contains(pos)){ 
				inputs.add(pos);
				ent.outputs.add(this.pos);
			}
			else{ //break the link
				inputs.remove(pos);
				ent.outputs.remove(this.pos);
			}
		
			this.toUpdate();
			ent.toUpdate();
			
			return true;
		}
	}
	
	return false;
}
 
開發者ID:ImagicTheCat,項目名稱:FundamentalChemistry,代碼行數:25,代碼來源:TileLaserRelay.java

示例5: generateLeafNodeBases

import net.minecraft.util.BlockPos; //導入方法依賴的package包/類
/**
 * Generates additional wood blocks to fill out the bases of different leaf nodes that would otherwise degrade.
 */
void generateLeafNodeBases()
{
    for (WorldGenBigTree.FoliageCoordinates worldgenbigtree$foliagecoordinates : this.field_175948_j)
    {
        int i = worldgenbigtree$foliagecoordinates.func_177999_q();
        BlockPos blockpos = new BlockPos(this.basePos.getX(), i, this.basePos.getZ());

        if (!blockpos.equals(worldgenbigtree$foliagecoordinates) && this.leafNodeNeedsBase(i - this.basePos.getY()))
        {
            this.func_175937_a(blockpos, worldgenbigtree$foliagecoordinates, Blocks.log);
        }
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:17,代碼來源:WorldGenBigTree.java

示例6: onUpdate

import net.minecraft.util.BlockPos; //導入方法依賴的package包/類
/**
 * Called to update the entity's position/logic.
 */
public void onUpdate()
{
    super.onUpdate();

    if (!this.worldObj.isRemote && this.isEntityAlive() && this.getBlocked())
    {
        BlockPos blockpos = new BlockPos(this);

        if (blockpos.equals(this.field_174900_c))
        {
            --this.transferTicker;
        }
        else
        {
            this.setTransferTicker(0);
        }

        if (!this.canTransfer())
        {
            this.setTransferTicker(0);

            if (this.func_96112_aD())
            {
                this.setTransferTicker(4);
                this.markDirty();
            }
        }
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:33,代碼來源:EntityMinecartHopper.java

示例7: positionInList

import net.minecraft.util.BlockPos; //導入方法依賴的package包/類
private boolean positionInList(BlockPos pos)
{
    for (BlockPos blockpos : this.villagerPositionsList)
    {
        if (blockpos.equals(pos))
        {
            return true;
        }
    }

    return false;
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:13,代碼來源:VillageCollection.java

示例8: updateChunkPositions

import net.minecraft.util.BlockPos; //導入方法依賴的package包/類
public void updateChunkPositions(double viewEntityX, double viewEntityZ)
{
    int i = MathHelper.floor_double(viewEntityX) - 8;
    int j = MathHelper.floor_double(viewEntityZ) - 8;
    int k = this.countChunksX * 16;

    for (int l = 0; l < this.countChunksX; ++l)
    {
        int i1 = this.func_178157_a(i, k, l);

        for (int j1 = 0; j1 < this.countChunksZ; ++j1)
        {
            int k1 = this.func_178157_a(j, k, j1);

            for (int l1 = 0; l1 < this.countChunksY; ++l1)
            {
                int i2 = l1 * 16;
                RenderChunk renderchunk = this.renderChunks[(j1 * this.countChunksY + l1) * this.countChunksX + l];
                BlockPos blockpos = new BlockPos(i1, i2, k1);

                if (!blockpos.equals(renderchunk.getPosition()))
                {
                    renderchunk.setPosition(blockpos);
                }
            }
        }
    }
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:29,代碼來源:ViewFrustum.java

示例9: updateChunkPositions

import net.minecraft.util.BlockPos; //導入方法依賴的package包/類
public void updateChunkPositions(double viewEntityX, double viewEntityZ)
{
    int i = MathHelper.floor_double(viewEntityX) - 8;
    int j = MathHelper.floor_double(viewEntityZ) - 8;
    int k = this.countChunksX * 16;

    for (int l = 0; l < this.countChunksX; ++l)
    {
        int i1 = this.func_178157_a(i, k, l);

        for (int j1 = 0; j1 < this.countChunksZ; ++j1)
        {
            int k1 = this.func_178157_a(j, k, j1);

            for (int l1 = 0; l1 < this.countChunksY; ++l1)
            {
                int i2 = l1 * 16;
                RenderChunk renderchunk = this.renderChunks[(j1 * this.countChunksY + l1) * this.countChunksX + l];
                BlockPos blockpos = renderchunk.getPosition();

                if (blockpos.getX() != i1 || blockpos.getY() != i2 || blockpos.getZ() != k1)
                {
                    BlockPos blockpos1 = new BlockPos(i1, i2, k1);

                    if (!blockpos1.equals(renderchunk.getPosition()))
                    {
                        renderchunk.setPosition(blockpos1);
                    }
                }
            }
        }
    }
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:34,代碼來源:ViewFrustum.java

示例10: blockRemoving

import net.minecraft.util.BlockPos; //導入方法依賴的package包/類
public void blockRemoving(BlockPos pos)
{
    if (pos.equals(this.field_180240_f))
    {
        int i = this.curblockDamage - this.initialDamage;
        Block block = this.theWorld.getBlockState(pos).getBlock();

        if (block.getMaterial() != Material.air)
        {
            float f = block.getPlayerRelativeBlockHardness(this.thisPlayerMP, this.thisPlayerMP.worldObj, pos) * (float)(i + 1);

            if (f >= 0.7F)
            {
                this.isDestroyingBlock = false;
                this.theWorld.sendBlockBreakProgress(this.thisPlayerMP.getEntityId(), pos, -1);
                this.tryHarvestBlock(pos);
            }
            else if (!this.receivedFinishDiggingPacket)
            {
                this.isDestroyingBlock = false;
                this.receivedFinishDiggingPacket = true;
                this.field_180241_i = pos;
                this.initialBlockDamage = this.initialDamage;
            }
        }
    }
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:28,代碼來源:ItemInWorldManager.java

示例11: isHittingPosition

import net.minecraft.util.BlockPos; //導入方法依賴的package包/類
private boolean isHittingPosition(BlockPos pos)
{
    ItemStack itemstack = this.mc.thePlayer.getHeldItem();
    boolean flag = this.currentItemHittingBlock == null && itemstack == null;

    if (this.currentItemHittingBlock != null && itemstack != null)
    {
        flag = itemstack.getItem() == this.currentItemHittingBlock.getItem() && ItemStack.areItemStackTagsEqual(itemstack, this.currentItemHittingBlock) && (itemstack.isItemStackDamageable() || itemstack.getMetadata() == this.currentItemHittingBlock.getMetadata());
    }

    return pos.equals(this.currentBlock) && flag;
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:13,代碼來源:PlayerControllerMP.java


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