• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java BlockVector3类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中cn.nukkit.math.BlockVector3的典型用法代码示例。如果您正苦于以下问题:Java BlockVector3类的具体用法?Java BlockVector3怎么用?Java BlockVector3使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



BlockVector3类属于cn.nukkit.math包,在下文中一共展示了BlockVector3类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: decode

import cn.nukkit.math.BlockVector3; //导入依赖的package包/类
@Override
public void decode() {
    this.isBlock = this.getBoolean();
    if (this.isBlock) {
        BlockVector3 v = this.getBlockVector3();
        this.x = v.x;
        this.y = v.y;
        this.z = v.z;
        this.commandBlockMode = (int) this.getUnsignedVarInt();
        this.isRedstoneMode = this.getBoolean();
        this.isConditional = this.getBoolean();
    } else {
        this.minecartEid = this.getEntityRuntimeId();
    }
    this.command = this.getString();
    this.lastOutput = this.getString();
    this.name = this.getString();
    this.shouldTrackOutput = this.getBoolean();
}
 
开发者ID:Rsplwe,项目名称:Nukkit-Java9,代码行数:20,代码来源:CommandBlockUpdatePacket.java


示例2: BlockEntityMovingBlock

import cn.nukkit.math.BlockVector3; //导入依赖的package包/类
public BlockEntityMovingBlock(FullChunk chunk, CompoundTag nbt) {
    super(chunk, nbt);

    if (nbt.contains("movingBlockData") && nbt.contains("movingBlockId")) {
        this.block = Block.get(nbt.getInt("movingBlockId"), nbt.getInt("movingBlockData"));
    } else {
        this.close();
    }

    if (nbt.contains("pistonPosX") && nbt.contains("pistonPosY") && nbt.contains("pistonPosZ")) {
        this.piston = new BlockVector3(nbt.getInt("pistonPosX"), nbt.getInt("pistonPosY"), nbt.getInt("pistonPosZ"));
    } else {
        this.close();
    }

    this.isMovable = nbt.getBoolean("isMovable");
}
 
开发者ID:Rsplwe,项目名称:Nukkit-Java9,代码行数:18,代码来源:BlockEntityMovingBlock.java


示例3: fall

import cn.nukkit.math.BlockVector3; //导入依赖的package包/类
public void fall(float fallDistance) {
    float damage = (float) Math.floor(fallDistance - 3 - (this.hasEffect(Effect.JUMP) ? this.getEffect(Effect.JUMP).getAmplifier() + 1 : 0));
    if (damage > 0) {
        this.attack(new EntityDamageEvent(this, DamageCause.FALL, damage));
    }

    if (fallDistance > 0.75) {
        BlockVector3 v = new BlockVector3(getFloorX(), getFloorY() - 1, getFloorZ());
        int down = this.level.getBlockIdAt(v.x, v.y, v.z);

        if (down == Item.FARMLAND) {
            if (this instanceof Player) {
                Player p = (Player) this;
                PlayerInteractEvent ev = new PlayerInteractEvent(p, p.getInventory().getItemInHand(), this.temporalVector.setComponents(v.x, v.y, v.z), null, Action.PHYSICAL);
                this.server.getPluginManager().callEvent(ev);
                if (ev.isCancelled()) {
                    return;
                }
            }
            this.level.setBlock(this.temporalVector.setComponents(v.x, v.y, v.z), new BlockDirt(), true, true);
        }
    }
}
 
开发者ID:JupiterDevelopmentTeam,项目名称:Jupiter,代码行数:24,代码来源:Entity.java


示例4: addHangingVine

import cn.nukkit.math.BlockVector3; //导入依赖的package包/类
private void addHangingVine(ChunkManager worldIn, BlockVector3 pos, int meta) {
    this.addVine(worldIn, pos, meta);
    int i = 4;

    for (pos = pos.down(); i > 0 && worldIn.getBlockIdAt(pos.x, pos.y, pos.z) == Block.AIR; --i) {
        this.addVine(worldIn, pos, meta);
        pos = pos.down();
    }
}
 
开发者ID:JupiterDevelopmentTeam,项目名称:Jupiter,代码行数:10,代码来源:NewJungleTree.java


示例5: computeRemoveBlockLight

import cn.nukkit.math.BlockVector3; //导入依赖的package包/类
private void computeRemoveBlockLight(int x, int y, int z, int currentLight, Queue<Object[]> queue,
                                     Queue<Vector3> spreadQueue, Map<BlockVector3, Boolean> visited, Map<BlockVector3, Boolean> spreadVisited) {
    int current = this.getBlockLightAt(x, y, z);
    BlockVector3 index = Level.blockHash(x, y, z);
    if (current != 0 && current < currentLight) {
        this.setBlockLightAt(x, y, z, 0);

        if (!visited.containsKey(index)) {
            visited.put(index, true);
            if (current > 1) {
                queue.add(new Object[]{new Vector3(x, y, z), current});
            }
        }
    } else if (current >= currentLight) {
        if (!spreadVisited.containsKey(index)) {
            spreadVisited.put(index, true);
            spreadQueue.add(new Vector3(x, y, z));
        }
    }
}
 
开发者ID:JupiterDevelopmentTeam,项目名称:Jupiter,代码行数:21,代码来源:Level.java


示例6: computeSpreadBlockLight

import cn.nukkit.math.BlockVector3; //导入依赖的package包/类
private void computeSpreadBlockLight(int x, int y, int z, int currentLight, Queue<Vector3> queue,
                                     Map<BlockVector3, Boolean> visited) {
    int current = this.getBlockLightAt(x, y, z);
    BlockVector3 index = Level.blockHash(x, y, z);

    if (current < currentLight) {
        this.setBlockLightAt(x, y, z, currentLight);

        if (!visited.containsKey(index)) {
            visited.put(index, true);
            if (currentLight > 1) {
                queue.add(new Vector3(x, y, z));
            }
        }
    }
}
 
开发者ID:JupiterDevelopmentTeam,项目名称:Jupiter,代码行数:17,代码来源:Level.java


示例7: decode

import cn.nukkit.math.BlockVector3; //导入依赖的package包/类
@Override
public void decode() {
    BlockVector3 v = this.getBlockCoords();
    this.x = v.x;
    this.y = v.y;
    this.z = v.z;
    this.interactBlockId = (int) this.getUnsignedVarInt();
    this.face = this.getVarInt();
    Vector3f faceVector3 = this.getVector3f();
    this.fx = faceVector3.x;
    this.fy = faceVector3.y;
    this.fz = faceVector3.z;
    Vector3f playerPos = this.getVector3f();
    this.posX = playerPos.x;
    this.posY = playerPos.y;
    this.posZ = playerPos.z;
    this.unknown = this.getByte();
    this.item = this.getSlot();
}
 
开发者ID:FrontierDevs,项目名称:Jenisys3,代码行数:20,代码来源:UseItemPacket.java


示例8: decode

import cn.nukkit.math.BlockVector3; //导入依赖的package包/类
@Override
public void decode() {
    BlockVector3 v = this.getBlockCoords();
    this.x = v.x;
    this.y = v.y;
    this.z = v.z;
    this.interactBlockId = (int) this.getUnsignedVarInt();
    this.face = this.getVarInt();
    Vector3f faceVector3 = this.getVector3f();
    this.fx = faceVector3.x;
    this.fy = faceVector3.y;
    this.fz = faceVector3.z;
    Vector3f playerPos = this.getVector3f();
    this.posX = playerPos.x;
    this.posY = playerPos.y;
    this.posZ = playerPos.z;
    this.slot = this.getByte();
    this.item = this.getSlot();
}
 
开发者ID:CoreXDevelopment,项目名称:CoreX,代码行数:20,代码来源:UseItemPacket.java


示例9: setData

import cn.nukkit.math.BlockVector3; //导入依赖的package包/类
@Override
public void setData(BlockVector3 data) {
    if (data != null) {
        this.x = data.x;
        this.y = data.y;
        this.z = data.z;
    }
}
 
开发者ID:Rsplwe,项目名称:Nukkit-Java9,代码行数:9,代码来源:IntPositionEntityData.java


示例10: decode

import cn.nukkit.math.BlockVector3; //导入依赖的package包/类
@Override
public void decode() {
    this.entityId = this.getEntityRuntimeId();
    this.action = this.getVarInt();
    BlockVector3 v = this.getBlockVector3();
    this.x = v.x;
    this.y = v.y;
    this.z = v.z;
    this.face = this.getVarInt();
}
 
开发者ID:Rsplwe,项目名称:Nukkit-Java9,代码行数:11,代码来源:PlayerActionPacket.java


示例11: decode

import cn.nukkit.math.BlockVector3; //导入依赖的package包/类
@Override
public void decode() {
    BlockVector3 v = this.getBlockVector3();
    this.z = v.z;
    this.y = v.y;
    this.x = v.x;
}
 
开发者ID:Rsplwe,项目名称:Nukkit-Java9,代码行数:8,代码来源:ItemFrameDropItemPacket.java


示例12: decode

import cn.nukkit.math.BlockVector3; //导入依赖的package包/类
@Override
public void decode() {
    this.windowId = this.getByte();
    this.type = this.getByte();
    BlockVector3 v = this.getBlockVector3();
    this.x = v.x;
    this.y = v.y;
    this.z = v.z;
    this.entityId = this.getEntityUniqueId();
}
 
开发者ID:Rsplwe,项目名称:Nukkit-Java9,代码行数:11,代码来源:ContainerOpenPacket.java


示例13: decode

import cn.nukkit.math.BlockVector3; //导入依赖的package包/类
@Override
public void decode() {
    BlockVector3 v = this.getSignedBlockPosition();
    this.x = v.x;
    this.y = v.y;
    this.z = v.z;
    this.putBoolean(this.addUserData);
    this.selectedSlot = this.getByte();
}
 
开发者ID:Rsplwe,项目名称:Nukkit-Java9,代码行数:10,代码来源:BlockPickRequestPacket.java


示例14: decode

import cn.nukkit.math.BlockVector3; //导入依赖的package包/类
@Override
public void decode() {
    BlockVector3 v = this.getBlockVector3();
    this.x = v.x;
    this.y = v.y;
    this.z = v.z;
    this.namedTag = this.get();
}
 
开发者ID:Rsplwe,项目名称:Nukkit-Java9,代码行数:9,代码来源:BlockEntityDataPacket.java


示例15: decode

import cn.nukkit.math.BlockVector3; //导入依赖的package包/类
@Override
public void decode() {
    this.entityRuntimeId = this.getEntityRuntimeId();
    this.action = this.getVarInt();
    BlockVector3 v = this.getBlockVector3();
    this.x = v.x;
    this.y = v.y;
    this.z = v.z;
    this.face = this.getVarInt();
}
 
开发者ID:JupiterDevelopmentTeam,项目名称:Jupiter,代码行数:11,代码来源:PlayerActionPacket.java


示例16: getBlock

import cn.nukkit.math.BlockVector3; //导入依赖的package包/类
public Block getBlock(Vector3 pos, boolean cached) {
    long chunkIndex = Level.chunkHash((int) pos.x >> 4, (int) pos.z >> 4);
    BlockVector3 index = Level.blockHash((int) pos.x, (int) pos.y, (int) pos.z);
    int fullState;

    Block block;
    BaseFullChunk chunk;

    if (cached && (block = (Block) this.blockCache.get(index)) != null) {
        return block;
    } else if (pos.y >= 0 && pos.y < 256 && (chunk = this.chunks.get(chunkIndex)) != null) {
        fullState = chunk.getFullBlock((int) pos.x & 0x0f, (int) pos.y & 0xff,
                (int) pos.z & 0x0f);
    } else {
        fullState = 0;
    }

    block = this.blockStates[fullState & 0xfff].clone();

    block.x = pos.x;
    block.y = pos.y;
    block.z = pos.z;
    block.level = this;

    this.blockCache.put(index, block);

    return block;
}
 
开发者ID:JupiterDevelopmentTeam,项目名称:Jupiter,代码行数:29,代码来源:Level.java


示例17: decode

import cn.nukkit.math.BlockVector3; //导入依赖的package包/类
@Override
public void decode() {
    this.entityId = this.getVarLong();
    this.action = this.getVarInt();
    BlockVector3 v = this.getBlockCoords();
    this.x = v.x;
    this.y = v.y;
    this.z = v.z;
    this.face = this.getVarInt();
}
 
开发者ID:FrontierDevs,项目名称:Jenisys3,代码行数:11,代码来源:PlayerActionPacket.java


示例18: decode

import cn.nukkit.math.BlockVector3; //导入依赖的package包/类
@Override
public void decode() {
    BlockVector3 v = this.getBlockCoords();
    this.z = v.z;
    this.y = v.y;
    this.x = v.x;
}
 
开发者ID:FrontierDevs,项目名称:Jenisys3,代码行数:8,代码来源:ItemFrameDropItemPacket.java


示例19: decode

import cn.nukkit.math.BlockVector3; //导入依赖的package包/类
@Override
public void decode() {
    this.entityUniqueId = this.getVarLong();
    this.entityRuntimeId = this.getVarLong();
    BlockVector3 v3 = this.getBlockCoords();
    this.x = v3.x;
    this.y = v3.y;
    this.z = v3.z;
    this.unknown = this.getVarInt();
}
 
开发者ID:FrontierDevs,项目名称:Jenisys3,代码行数:11,代码来源:AddHangingEntityPacket.java


示例20: decode

import cn.nukkit.math.BlockVector3; //导入依赖的package包/类
@Override
public void decode() {
    BlockVector3 v = this.getBlockCoords();
    this.x = v.x;
    this.y = v.y;
    this.z = v.z;
    this.namedTag = this.get();
}
 
开发者ID:FrontierDevs,项目名称:Jenisys3,代码行数:9,代码来源:BlockEntityDataPacket.java



注:本文中的cn.nukkit.math.BlockVector3类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java GenericMultipleBarcodeReader类代码示例发布时间:2022-05-23
下一篇:
Java DimensionType类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap