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


Java BlockPos.fromLong方法代码示例

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


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

示例1: readFromNBT

import net.minecraft.util.math.BlockPos; //导入方法依赖的package包/类
@Override
public void readFromNBT(NBTTagCompound compound) {
    super.readFromNBT(compound);
    timeout = compound.getInteger("timeout");
    portalSide = EnumFacing.VALUES[compound.getByte("portalSide")];
    BlockPos pos = BlockPos.fromLong(compound.getLong("pos"));
    int dim = compound.getInteger("dim");
    EnumFacing side = EnumFacing.VALUES[compound.getByte("side")];
    other = new TeleportDestination("", dim, pos, side);
    NBTTagList list = compound.getTagList("bl", Constants.NBT.TAG_COMPOUND);
    blackListed.clear();
    for (int i = 0 ; i < list.tagCount() ; i++) {
        NBTTagCompound tc = list.getCompoundTagAt(i);
        UUID uuid = new UUID(tc.getLong("m"), tc.getLong("l"));
        blackListed.add(uuid);
    }
}
 
开发者ID:McJty,项目名称:MeeCreeps,代码行数:18,代码来源:PortalTileEntity.java

示例2: readFromNBT

import net.minecraft.util.math.BlockPos; //导入方法依赖的package包/类
@Override
public void readFromNBT(NBTTagCompound tag) {
    NBTTagList list = tag.getTagList("blocks", Constants.NBT.TAG_LONG);
    blocks.clear();
    for (int i = 0; i < list.tagCount(); i++) {
        blocks.add(BlockPos.fromLong(((NBTTagLong) list.get(i)).getLong()));
    }
    list = tag.getTagList("leaves", Constants.NBT.TAG_COMPOUND);
    leavesToTick.clear();
    for (int i = 0; i < list.tagCount(); i++) {
        NBTTagCompound tc = list.getCompoundTagAt(i);
        BlockPos pos = BlockPos.fromLong(tc.getLong("p"));
        int counter = tc.getInteger("c");
        leavesToTick.put(pos, counter);
    }
}
 
开发者ID:McJty,项目名称:MeeCreeps,代码行数:17,代码来源:ChopTreeActionWorker.java

示例3: fromBytes

import net.minecraft.util.math.BlockPos; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf) {
	int dim = buf.readInt();
	BlockPos pos = BlockPos.fromLong(buf.readLong());
	
	World world = SimpleTubes.proxy.getWorld(dim);
	this.tile = world.getTileEntity(pos);

	this.id = buf.readInt();
}
 
开发者ID:oMilkyy,项目名称:SimpleTubes,代码行数:11,代码来源:PacketItemRemove.java

示例4: fromBytes

import net.minecraft.util.math.BlockPos; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf) {
	int dim = buf.readInt();
	BlockPos pos = BlockPos.fromLong(buf.readLong());

	World world = SimpleTubes.proxy.getWorld(dim);
	if(world != null)
	this.tile = world.getTileEntity(pos);

	this.id = buf.readInt();
	this.progress = buf.readFloat();
	this.direction = buf.readByte();
	this.color = buf.readInt();
}
 
开发者ID:oMilkyy,项目名称:SimpleTubes,代码行数:15,代码来源:PacketItemSync.java

示例5: isValid

import net.minecraft.util.math.BlockPos; //导入方法依赖的package包/类
public boolean isValid(World world, long pos) {
    if (pos == -1L) {
        return false;
    }
    BlockPos p = BlockPos.fromLong(pos);
    IBlockState state = world.getBlockState(p);
    Block block = state.getBlock();

    if (Config.getBlocksBlocking().contains(block.getRegistryName())) {
        // Special case for doors
        if (block instanceof BlockDoor) {
            return state.getValue(BlockDoor.OPEN);
        }
        if (block instanceof BlockTrapDoor) {
            return state.getValue(BlockTrapDoor.OPEN);
        }

        return false;
    }
    if (Config.getBlocksNonBlocking().contains(block.getRegistryName())) {
        return true;
    }

    if (block.isAir(state, world, p)) {
        return true;
    } else {
        AxisAlignedBB box = state.getCollisionBoundingBox(world, p);
        if (box == null) {
            return true;
        }
        return !block.isOpaqueCube(state);
    }
}
 
开发者ID:McJty,项目名称:needtobreath,代码行数:34,代码来源:DimensionData.java

示例6: fromBytes

import net.minecraft.util.math.BlockPos; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf) {
	int dim = buf.readInt();
	BlockPos pos = BlockPos.fromLong(buf.readLong());

	World world = SimpleTubes.proxy.getWorld(dim);
	this.tile = world.getTileEntity(pos);

	this.id = buf.readInt();
	this.stack = ByteBufUtils.readItemStack(buf);
	this.progress = buf.readFloat();
	this.direction = buf.readByte();
	this.color = buf.readInt();
}
 
开发者ID:oMilkyy,项目名称:SimpleTubes,代码行数:15,代码来源:PacketItemAdd.java

示例7: fromBytes

import net.minecraft.util.math.BlockPos; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf) {
    selectedBlock = BlockPos.fromLong(buf.readLong());
    selectedSide = EnumFacing.VALUES[buf.readByte()];
    destination = new TeleportDestination(NetworkTools.readStringUTF8(buf), buf.readInt(), BlockPos.fromLong(buf.readLong()),
            EnumFacing.VALUES[buf.readByte()]);
}
 
开发者ID:McJty,项目名称:MeeCreeps,代码行数:8,代码来源:PacketMakePortals.java

示例8: fromBytes

import net.minecraft.util.math.BlockPos; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf) {
    destination = new TeleportDestination(NetworkTools.readStringUTF8(buf), buf.readInt(),
            BlockPos.fromLong(buf.readLong()),
            EnumFacing.VALUES[buf.readByte()]);
    destinationIndex = buf.readInt();
}
 
开发者ID:McJty,项目名称:MeeCreeps,代码行数:8,代码来源:PacketSetDestination.java

示例9: fromBytes

import net.minecraft.util.math.BlockPos; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf) {
	int dim = buf.readInt();
	BlockPos pos = BlockPos.fromLong(buf.readLong());

	World world = SimpleTubes.proxy.getWorld(dim);
	this.tile = world.getTileEntity(pos);

	this.mode = buf.readInt();
}
 
开发者ID:oMilkyy,项目名称:SimpleTubes,代码行数:11,代码来源:PacketDisplacerGuiMode.java

示例10: removePreviousProbe

import net.minecraft.util.math.BlockPos; //导入方法依赖的package包/类
private void removePreviousProbe(NBTTagCompound data, MessageUsingProbe message, EntityPlayerMP player) {
  if (data.hasKey(NBT_KEY)) {
    BlockPos pos = BlockPos.fromLong(data.getLong(NBT_KEY));
    if (!pos.equals(message.target)) {
      removeProbe(player.world, pos);
    }
  }
}
 
开发者ID:ToroCraft,项目名称:PowerProbe,代码行数:9,代码来源:MessageUsingProbe.java

示例11: fromBytes

import net.minecraft.util.math.BlockPos; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf) {
  pos = BlockPos.fromLong(buf.readLong());
  enable = buf.readBoolean();
}
 
开发者ID:ToroCraft,项目名称:Minecoprocessors,代码行数:6,代码来源:MessageEnableGuiUpdates.java

示例12: readCustomNBT

import net.minecraft.util.math.BlockPos; //导入方法依赖的package包/类
@Override
public void readCustomNBT(NBTTagCompound tag) {
	
	this.core = BlockPos.fromLong(tag.getLong("Core"));
	inv.deserializeNBT(tag.getCompoundTag("inventory"));
}
 
开发者ID:bafomdad,项目名称:uniquecrops,代码行数:7,代码来源:TileArtisia.java

示例13: fromBytes

import net.minecraft.util.math.BlockPos; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf)
{
	pos = BlockPos.fromLong(buf.readLong());
	storedXP = buf.readInt();
}
 
开发者ID:bl4ckscor3,项目名称:GlobalXP,代码行数:7,代码来源:SPacketUpdateXPBlock.java

示例14: readFromNBT

import net.minecraft.util.math.BlockPos; //导入方法依赖的package包/类
@Override
public void readFromNBT(NBTTagCompound compound) {
	super.readFromNBT(compound);
	isCooking = compound.getBoolean("cooking");
	parentRange = BlockPos.fromLong(compound.getLong("parent"));
}
 
开发者ID:ArtixAllMighty,项目名称:ExSartagine,代码行数:7,代码来源:TileEntityRangeExtension.java

示例15: renderHighlightedBlocks

import net.minecraft.util.math.BlockPos; //导入方法依赖的package包/类
private static void renderHighlightedBlocks(RenderWorldLastEvent evt, EntityPlayerSP p, Map<Long, Byte> cleanAir) {
    double doubleX = p.lastTickPosX + (p.posX - p.lastTickPosX) * evt.getPartialTicks();
    double doubleY = p.lastTickPosY + (p.posY - p.lastTickPosY) * evt.getPartialTicks();
    double doubleZ = p.lastTickPosZ + (p.posZ - p.lastTickPosZ) * evt.getPartialTicks();

    GlStateManager.pushMatrix();
    GlStateManager.translate(-doubleX, -doubleY, -doubleZ);

    GlStateManager.disableDepth();
    GlStateManager.enableTexture2D();

    Tessellator tessellator = Tessellator.getInstance();
    BufferBuilder buffer = tessellator.getBuffer();

    Minecraft.getMinecraft().getTextureManager().bindTexture(BLUEGLOW);

    buffer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_LMAP_COLOR);

    GlStateManager.enableBlend();
    GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);

    for (Map.Entry<Long, Byte> entry : cleanAir.entrySet()) {
        int value = entry.getValue() & 0xff;
        BlockPos coordinate = BlockPos.fromLong(entry.getKey());
        float x = coordinate.getX();
        float y = coordinate.getY();
        float z = coordinate.getZ();
        buffer.setTranslation(buffer.xOffset + x, buffer.yOffset + y, buffer.zOffset + z);

        int alpha = value;
        float mult = 0.4f;          // 1.1f
        if (alpha < 25) {
            mult = 0.025f;
        } else if (alpha < 50) {
            mult = 0.05f;
        } else if (alpha < 80) {
            mult = 0.1f;
        } else if (alpha < 110) {
            mult = 0.15f;
        } else if (alpha < 130) {
            mult = 0.2f;
        } else if (alpha < 150) {
            mult = 0.25f;
        } else if (alpha < 180) {
            mult = 0.3f;
        } else if (alpha < 210) {
            mult = 0.35f;
        }

        float offset = 0.5f - (mult/2);

        RenderGlowEffect.addSideFullTexture(buffer, EnumFacing.UP.ordinal(), mult, offset, alpha);
        RenderGlowEffect.addSideFullTexture(buffer, EnumFacing.DOWN.ordinal(), mult, offset, alpha);
        RenderGlowEffect.addSideFullTexture(buffer, EnumFacing.NORTH.ordinal(), mult, offset, alpha);
        RenderGlowEffect.addSideFullTexture(buffer, EnumFacing.SOUTH.ordinal(), mult, offset, alpha);
        RenderGlowEffect.addSideFullTexture(buffer, EnumFacing.WEST.ordinal(), mult, offset, alpha);
        RenderGlowEffect.addSideFullTexture(buffer, EnumFacing.EAST.ordinal(), mult, offset, alpha);
        buffer.setTranslation(buffer.xOffset - x, buffer.yOffset - y, buffer.zOffset - z);
    }
    tessellator.draw();

    GlStateManager.disableBlend();

    GlStateManager.popMatrix();
}
 
开发者ID:McJty,项目名称:needtobreath,代码行数:66,代码来源:NTBOverlayRenderer.java


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