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


Java BlockPosition类代码示例

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


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

示例1: a

import net.minecraft.server.BlockPosition; //导入依赖的package包/类
@Override
public PacketTracer a(BlockPosition pos) {
    value("BlockPosition", pos);
    try {
        mute = true;
        super.a(pos);
    } finally {
        mute = false;
    }
    return this;
}
 
开发者ID:OvercastNetwork,项目名称:ProjectAres,代码行数:12,代码来源:PacketTracer.java

示例2: update

import net.minecraft.server.BlockPosition; //导入依赖的package包/类
private void update() {
    EntityItemFrame old = this.getHandle();

    WorldServer world = ((CraftWorld) getWorld()).getHandle();
    BlockPosition position = old.getBlockPosition();
    EnumDirection direction = old.getDirection();
    ItemStack item = old.getItem() != null ? old.getItem().cloneItemStack() : null;

    old.die();

    EntityItemFrame frame = new EntityItemFrame(world,position,direction);
    frame.setItem(item);
    world.addEntity(frame);
    this.entity = frame;
}
 
开发者ID:tgnmc,项目名称:Craftbukkit,代码行数:16,代码来源:CraftItemFrame.java

示例3: getBiteChance

import net.minecraft.server.BlockPosition; //导入依赖的package包/类
public double getBiteChance() {
    EntityFishingHook hook = getHandle();

    if (this.biteChance == -1) {
        if (hook.world.isRainingAt(new BlockPosition(MathHelper.floor(hook.locX), MathHelper.floor(hook.locY) + 1, MathHelper.floor(hook.locZ)))) {
            return 1/300.0;
        }
        return 1/500.0;
    }
    return this.biteChance;
}
 
开发者ID:tgnmc,项目名称:Craftbukkit,代码行数:12,代码来源:CraftFish.java

示例4: update

import net.minecraft.server.BlockPosition; //导入依赖的package包/类
public boolean update(boolean force, boolean applyPhysics) {
    requirePlaced();
    Block block = getBlock();

    if (block.getType() != getType()) {
        if (!force) {
            return false;
        }
    }

    block.setTypeIdAndData(getTypeId(), getRawData(), applyPhysics);
    world.getHandle().notify(new BlockPosition(x, y, z));

    return true;
}
 
开发者ID:tgnmc,项目名称:Craftbukkit,代码行数:16,代码来源:CraftBlockState.java

示例5: play

import net.minecraft.server.BlockPosition; //导入依赖的package包/类
public boolean play() {
    Block block = getBlock();

    if (block.getType() == Material.NOTE_BLOCK) {
        note.play(world.getHandle(), new BlockPosition(getX(), getY(), getZ()));
        return true;
    } else {
        return false;
    }
}
 
开发者ID:tgnmc,项目名称:Craftbukkit,代码行数:11,代码来源:CraftNoteBlock.java

示例6: setBeamTarget

import net.minecraft.server.BlockPosition; //导入依赖的package包/类
@Override
public void setBeamTarget(Location location) {
    if (location == null) {
        getHandle().setBeamTarget((BlockPosition) null);
    } else if (location.getWorld() != getWorld()) {
        throw new IllegalArgumentException("Cannot set beam target location to different world");
    } else {
        getHandle().setBeamTarget(new BlockPosition(location.getBlockX(), location.getBlockY(), location.getBlockZ()));
    }
}
 
开发者ID:bergerkiller,项目名称:SpigotSource,代码行数:11,代码来源:CraftEnderCrystal.java

示例7: setExitLocation

import net.minecraft.server.BlockPosition; //导入依赖的package包/类
@Override
public void setExitLocation(Location location) {
    if (location == null) {
        gateway.exitPortal = null;
    } else if (location.getWorld() != world) {
        throw new IllegalArgumentException("Cannot set exit location to different world");
    } else {
        gateway.exitPortal = new BlockPosition(location.getBlockX(), location.getBlockY(), location.getBlockZ());
    }
}
 
开发者ID:bergerkiller,项目名称:SpigotSource,代码行数:11,代码来源:CraftEndGateway.java

示例8: update

import net.minecraft.server.BlockPosition; //导入依赖的package包/类
public boolean update(boolean force, boolean applyPhysics) {
    requirePlaced();
    Block block = getBlock();

    if (block.getType() != getType()) {
        if (!force) {
            return false;
        }
    }

    BlockPosition pos = new BlockPosition(x, y, z);
    IBlockData newBlock = CraftMagicNumbers.getBlock(getType()).fromLegacyData(getRawData());
    block.setTypeIdAndData(getTypeId(), getRawData(), applyPhysics);
    world.getHandle().notify(
            pos,
            CraftMagicNumbers.getBlock(block).fromLegacyData(block.getData()),
            newBlock,
            3
    );

    // Update levers etc
    if (applyPhysics && getData() instanceof Attachable) {
        world.getHandle().applyPhysics(pos.shift(CraftBlock.blockFaceToNotch(((Attachable) getData()).getAttachedFace())), newBlock.getBlock());
    }

    return true;
}
 
开发者ID:bergerkiller,项目名称:SpigotSource,代码行数:28,代码来源:CraftBlockState.java

示例9: playEffect

import net.minecraft.server.BlockPosition; //导入依赖的package包/类
public static void playEffect(World bukkitWorld, Vector pos, int effectId, int data) {
    WorldServer world = ((CraftWorld) bukkitWorld).getHandle();
    world.triggerEffect(effectId, new BlockPosition(pos.getBlockX(), pos.getBlockY(), pos.getBlockZ()), data);
}
 
开发者ID:OvercastNetwork,项目名称:ProjectAres,代码行数:5,代码来源:NMSHacks.java

示例10: findPortal

import net.minecraft.server.BlockPosition; //导入依赖的package包/类
@Override
public Location findPortal(Location location) {
    PortalTravelAgent pta = ((CraftWorld) location.getWorld()).getHandle().getTravelAgent();
    BlockPosition found = pta.findPortal(location.getX(), location.getY(), location.getZ(), this.getSearchRadius());
    return found != null ? new Location(location.getWorld(), found.getX(), found.getY(), found.getZ(), location.getYaw(), location.getPitch()) : null;
}
 
开发者ID:tgnmc,项目名称:Craftbukkit,代码行数:7,代码来源:CraftTravelAgent.java

示例11: getBeamTarget

import net.minecraft.server.BlockPosition; //导入依赖的package包/类
@Override
public Location getBeamTarget() {
    BlockPosition pos = getHandle().getBeamTarget();
    return pos == null ? null : new Location(getWorld(), pos.getX(), pos.getY(), pos.getZ());
}
 
开发者ID:bergerkiller,项目名称:SpigotSource,代码行数:6,代码来源:CraftEnderCrystal.java

示例12: getExitLocation

import net.minecraft.server.BlockPosition; //导入依赖的package包/类
@Override
public Location getExitLocation() {
    BlockPosition pos = gateway.exitPortal;
    return pos == null ? null : new Location(world, pos.getX(), pos.getY(), pos.getZ());
}
 
开发者ID:bergerkiller,项目名称:SpigotSource,代码行数:6,代码来源:CraftEndGateway.java

示例13: setTypeUpdate

import net.minecraft.server.BlockPosition; //导入依赖的package包/类
public void setTypeUpdate(BlockPosition position, IBlockData data) { 
    setTypeAndData(position.getX(), position.getY(), position.getZ(), data.getBlock(), data.getBlock().toLegacyData(data), 0);
    
}
 
开发者ID:tgnmc,项目名称:Craftbukkit,代码行数:5,代码来源:BlockStateListPopulator.java


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