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

Java BlockCoord类代码示例

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

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



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

示例1: tryPlaceMultiPart

import codechicken.lib.vec.BlockCoord; //导入依赖的package包/类
public boolean tryPlaceMultiPart(final World world, final BlockCoord pos, final ItemStack item, final int side, final boolean doPlace) {
    final TileMultipart tile = TileMultipart.getOrConvertTile(world, pos);
    if (tile == null) {
        return false;
    }
    final TMultiPart part = this.createMultiPart(world, pos, item, side);
    if (part == null) {
        return false;
    }
    if (tile.canAddPart(part)) {
        if (doPlace) {
            TileMultipart.addPart(world, pos, part);
        }
        return true;
    }
    return false;
}
 
开发者ID:sameer,项目名称:ExtraUtilities,代码行数:18,代码来源:ItemBlockMultiPart.java


示例2: getPart

import codechicken.lib.vec.BlockCoord; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
public TMultiPart getPart(final Vector3 pos, final Cuboid6 bounds) {
    final World world = XUHelperClient.clientWorld();
    final TileMultipart t = TileMultipart.getOrConvertTile(world, new BlockCoord(pos));
    if (t == null) {
        return null;
    }
    for (final TMultiPart part : t.jPartList()) {
        if (part instanceof JNormalOcclusion) {
            for (final Cuboid6 bound : ((JNormalOcclusion)part).getOcclusionBoxes()) {
                if (bound.intersects(bounds)) {
                    return part;
                }
            }
        }
    }
    return null;
}
 
开发者ID:sameer,项目名称:ExtraUtilities,代码行数:19,代码来源:ConnectedTextureMicroMaterial.java


示例3: convert

import codechicken.lib.vec.BlockCoord; //导入依赖的package包/类
public TMultiPart convert(final World world, final BlockCoord pos) {
    final Block id = world.getBlock(pos.x, pos.y, pos.z);
    int meta = world.getBlockMetadata(pos.x, pos.y, pos.z);
    if (id != ExtraUtils.transferPipe && id != ExtraUtils.transferPipe2) {
        return null;
    }
    if (id == ExtraUtils.transferPipe2) {
        meta += 16;
    }
    if (meta != 9) {
        return (TMultiPart)new PipePart(meta);
    }
    if (world.getTileEntity(pos.x, pos.y, pos.z) instanceof TileEntityFilterPipe) {
        final InventoryBasic t = ((TileEntityFilterPipe)world.getTileEntity(pos.x, pos.y, pos.z)).items;
        return (TMultiPart)new FilterPipePart(t);
    }
    return (TMultiPart)new FilterPipePart();
}
 
开发者ID:sameer,项目名称:ExtraUtilities,代码行数:19,代码来源:RegisterPipeParts.java


示例4: rayTraceCuboids

import codechicken.lib.vec.BlockCoord; //导入依赖的package包/类
public void rayTraceCuboids(Vector3 start, Vector3 end, List<IndexedCuboid6> cuboids, BlockCoord pos, Block block, List<ExtendedMOP> hitList)
{
    for(IndexedCuboid6 cuboid : cuboids)
    {
        MovingObjectPosition mop = rayTraceCuboid(start, end, cuboid);
        if(mop != null)
        {
            ExtendedMOP emop = new ExtendedMOP(mop, cuboid.data, s_dist);
            emop.typeOfHit = MovingObjectType.BLOCK;
            emop.blockX = pos.x;
            emop.blockY = pos.y;
            emop.blockZ = pos.z;
            hitList.add(emop);
        }
    }
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:17,代码来源:RayTracer.java


示例5: newPart

import codechicken.lib.vec.BlockCoord; //导入依赖的package包/类
@Override
public TMultiPart newPart(ItemStack item, EntityPlayer player, World world, BlockCoord pos, int side, Vector3 vHit)
{
	EnumColor col = EnumColor.DYES[item.getItemDamage()];
	ForgeDirection orientation = getSideFromVector3(vHit.subtract(Vector3.center));
	
	if(pos != null && orientation != null)
	{
		BlockCoord pos1 = pos.copy().inset(orientation.getOpposite().ordinal());
		
		if(world.isSideSolid(pos1.x, pos1.y, pos1.z, orientation.getOpposite()))
		{
			return new PartGlowPanel(col, orientation);
		}
		
		if(world.getTileEntity(pos.x, pos.y, pos.z) instanceof TileMultipart && ((TileMultipart) world.getTileEntity(pos.x, pos.y, pos.z)).partMap(orientation.ordinal()) instanceof HollowMicroblock)
		{
			return new PartGlowPanel(col, orientation);
		}
	}

	return null;
}
 
开发者ID:Microsoft,项目名称:vsminecraft,代码行数:24,代码来源:ItemGlowPanel.java


示例6: newPart

import codechicken.lib.vec.BlockCoord; //导入依赖的package包/类
@Override
public TMultiPart newPart(ItemStack item, EntityPlayer player, World world, BlockCoord loc, int side, Vector3 hit) {

    NBTTagCompound tag = item.getTagCompound();

    if (tag == null)
        return null;
    if (!tag.hasKey("modifiers"))
        return null;

    NBTTagList l = tag.getTagList("modifiers", new NBTTagString().getId());
    List<IFrameModifier> mods = new ArrayList<IFrameModifier>();
    for (int i = 0; i < l.tagCount(); i++) {
        IFrameModifier mod = FrameModifierRegistry.instance().findModifier(l.getStringTagAt(i));
        if (mod != null)
            mods.add(mod);
    }

    return FrameFactory.createFrame(PartFrame.class, mods);
}
 
开发者ID:amadornes,项目名称:Framez,代码行数:21,代码来源:ItemPartFrame.java


示例7: findFrames

import codechicken.lib.vec.BlockCoord; //导入依赖的package包/类
@Override
public List<IFrame> findFrames(World world, int x, int y, int z) {

    if (world == null)
        return null;

    List<IFrame> l = new ArrayList<IFrame>();

    Block b = world.getBlock(x, y, z);
    if (b instanceof IFrame)
        l.add((IFrame) b);

    TileEntity te = world.getTileEntity(x, y, z);
    if (te != null && te instanceof IFrame)
        l.add((IFrame) te);

    TileMultipart tmp = TileMultipart.getTile(world, new BlockCoord(x, y, z));
    if (tmp != null)
        for (TMultiPart p : tmp.jPartList())
            if (p instanceof IFrame)
                l.add((IFrame) p);// FIXME actual multipart handling

    return l;
}
 
开发者ID:amadornes,项目名称:Framez,代码行数:25,代码来源:FrameMovementRegistry.java


示例8: getMovementType

import codechicken.lib.vec.BlockCoord; //导入依赖的package包/类
@Override
@Priority(PriorityEnum.OVERRIDE)
public BlockMovementType getMovementType(World world, int x, int y, int z, ForgeDirection side, IMovement movement) {

    TileMultipart tmp = TileMultipart.getTile(world, new BlockCoord(x, y, z));
    if (tmp == null)
        return null;

    for (TMultiPart p : tmp.jPartList()) {
        if (p instanceof TSlottedPart) {
            int slot = ((TSlottedPart) p).getSlotMask();
            if (slot == PartMap.face(side.ordinal()).mask && (p instanceof FaceMicroblock || p instanceof HollowMicroblock)) {
                if (((CommonMicroblock) p).getSize() == 1)
                    return BlockMovementType.UNMOVABLE;
            }
        }
    }

    return null;
}
 
开发者ID:amadornes,项目名称:Framez,代码行数:21,代码来源:MovementHandlerFMP.java


示例9: placePart

import codechicken.lib.vec.BlockCoord; //导入依赖的package包/类
public boolean placePart(World world, BlockCoord pos, ItemStack item, int side, boolean doPlace) {
	TileMultipart tile = TileMultipart.getOrConvertTile(world, pos);
	if (tile == null) {
		return false;
	}
	TMultiPart part = createMultiPart(world, pos, item, side);
	if (part == null) {
		return false;
	}
	if (tile.canAddPart(part)) {
		if (doPlace) {
			TileMultipart.addPart(world, pos, part);
		}
		return true;
	}
	return false;
}
 
开发者ID:Chisel-2,项目名称:Chisel-2,代码行数:18,代码来源:ItemBlockChiselTorchPart.java


示例10: addPartToWorldBruteforce

import codechicken.lib.vec.BlockCoord; //导入依赖的package包/类
@Override
public boolean addPartToWorldBruteforce(IPart part, World world, Vec3i location) {

    BlockCoord b = new BlockCoord(location.getX(), location.getY(), location.getZ());
    TileMultipart tmp = TileMultipart.getOrConvertTile(world, b);
    if (tmp == null)
        return false;

    FMPPart p = (FMPPart) getPartHolder(world, location);
    boolean isNew = false;
    if (p == null) {
        p = new FMPPart();
        isNew = true;
    }

    p.addPart(part);

    if (isNew && !world.isRemote)
        TileMultipart.addPart(world, b, p);

    return true;
}
 
开发者ID:Qmunity,项目名称:QmunityLib,代码行数:23,代码来源:FMPCompat.java


示例11: canConnectRedstone

import codechicken.lib.vec.BlockCoord; //导入依赖的package包/类
@Override
public boolean canConnectRedstone(World world, Vec3i location, ForgeDirection side, ForgeDirection face) {

    if (!isMultipart(world, location))
        return false;

    int s = Direction.getMovementDirection(side.offsetX, side.offsetZ);

    TileMultipart tmp = TileMultipart.getOrConvertTile(world, new BlockCoord(location.getX(), location.getY(), location.getZ()));

    if (face == ForgeDirection.UNKNOWN)
        return tmp.canConnectRedstone(s);

    TMultiPart slotPart = tmp.partMap(side.ordinal());
    if (slotPart != null) {
        if (slotPart instanceof IRedstonePart)
            return ((IRedstonePart) slotPart).canConnectRedstone(side.ordinal());
        return false;
    }

    for (TMultiPart p : tmp.jPartList())
        if (p instanceof IRedstonePart && ((IRedstonePart) p).canConnectRedstone(s))
            return true;

    return false;
}
 
开发者ID:Qmunity,项目名称:QmunityLib,代码行数:27,代码来源:FMPCompat.java


示例12: placePart

import codechicken.lib.vec.BlockCoord; //导入依赖的package包/类
public TMultiPart placePart(final ItemStack stack, final EntityPlayer player, final World world, final BlockCoord pos, final int side, final Vector3 arg5, final int materialID) {
    final TileMultipart tile = TileMultipart.getOrConvertTile(world, new BlockCoord(pos.x, pos.y, pos.z));
    if (tile == null) {
        return null;
    }
    final TMultiPart part = tile.partMap(6);
    if (part != null) {
        return (TMultiPart)new PartPipeJacket(materialID);
    }
    return null;
}
 
开发者ID:sameer,项目名称:ExtraUtilities,代码行数:12,代码来源:PartPipeJacket.java


示例13: onItemUse

import codechicken.lib.vec.BlockCoord; //导入依赖的package包/类
public boolean onItemUse(final ItemStack item, final EntityPlayer player, final World world, final int x, final int y, final int z, final int side, final float hitX, final float hitY, final float hitZ) {
    final BlockCoord pos = new BlockCoord(x, y, z);
    final Vector3 vhit = new Vector3((double)hitX, (double)hitY, (double)hitZ);
    final double d = this.getHitDepth(vhit, side);
    if (d < 1.0 && this.place(item, player, world, pos, side, vhit)) {
        return true;
    }
    pos.offset(side);
    return this.place(item, player, world, pos, side, vhit);
}
 
开发者ID:sameer,项目名称:ExtraUtilities,代码行数:11,代码来源:ItemMicroBlock.java


示例14: place

import codechicken.lib.vec.BlockCoord; //导入依赖的package包/类
public boolean place(final ItemStack stack, final EntityPlayer player, final World world, final BlockCoord pos, final int side, final Vector3 arg5) {
    final TMultiPart part = this.newPart(stack, player, world, pos, side, arg5);
    if (part == null || !TileMultipart.canPlacePart(world, pos, part)) {
        return false;
    }
    if (!world.isRemote) {
        TileMultipart.addPart(world, pos, part);
    }
    if (!player.capabilities.isCreativeMode) {
        --stack.stackSize;
    }
    return true;
}
 
开发者ID:sameer,项目名称:ExtraUtilities,代码行数:14,代码来源:ItemMicroBlock.java


示例15: newPart

import codechicken.lib.vec.BlockCoord; //导入依赖的package包/类
public TMultiPart newPart(final ItemStack stack, final EntityPlayer player, final World world, final BlockCoord pos, final int side, final Vector3 arg5) {
    if (!stack.hasTagCompound()) {
        return null;
    }
    final String material = stack.getTagCompound().getString("mat");
    if (material.equals("") || MicroMaterialRegistry.getMaterial(material) == null) {
        return null;
    }
    final IMicroBlock part = RegisterMicroBlocks.mParts.get(stack.getItemDamage());
    if (part != null) {
        return part.placePart(stack, player, world, pos, side, arg5, MicroMaterialRegistry.materialID(material));
    }
    return null;
}
 
开发者ID:sameer,项目名称:ExtraUtilities,代码行数:15,代码来源:ItemMicroBlock.java


示例16: convert

import codechicken.lib.vec.BlockCoord; //导入依赖的package包/类
public TMultiPart convert(final World world, final BlockCoord pos) {
    final Block id = world.getBlock(pos.x, pos.y, pos.z);
    if (id == this.block) {
        try {
            return (TMultiPart)this.part.getConstructor((Class<?>[])new Class[0]).newInstance(new Object[0]);
        }
        catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }
    return null;
}
 
开发者ID:sameer,项目名称:ExtraUtilities,代码行数:14,代码来源:RegisterBlockPart.java


示例17: convert

import codechicken.lib.vec.BlockCoord; //导入依赖的package包/类
public TMultiPart convert(final World world, final BlockCoord pos) {
    final Block id = world.getBlock(pos.x, pos.y, pos.z);
    final int meta = world.getBlockMetadata(pos.x, pos.y, pos.z);
    if (id == ExtraUtils.transferNode) {
        if (meta < 6) {
            if (world.getTileEntity(pos.x, pos.y, pos.z) instanceof TileEntityTransferNodeInventory) {
                return (TMultiPart)new TransferNodePartInventory(meta, (TileEntityTransferNodeInventory)world.getTileEntity(pos.x, pos.y, pos.z));
            }
        }
        else if (meta < 12) {
            if (world.getTileEntity(pos.x, pos.y, pos.z) instanceof TileEntityTransferNodeLiquid) {
                return (TMultiPart)new TransferNodePartLiquid(meta, (TileEntityTransferNodeLiquid)world.getTileEntity(pos.x, pos.y, pos.z));
            }
        }
        else if (meta == 12) {
            if (world.getTileEntity(pos.x, pos.y, pos.z) instanceof TileEntityTransferNodeEnergy) {
                return (TMultiPart)new TransferNodePartEnergy(meta, (TileEntityTransferNodeEnergy)world.getTileEntity(pos.x, pos.y, pos.z));
            }
        }
        else if (meta == 13 && world.getTileEntity(pos.x, pos.y, pos.z) instanceof TileEntityTransferNodeHyperEnergy) {
            return (TMultiPart)new TransferNodePartHyperEnergy(meta, (TileEntityTransferNodeHyperEnergy)world.getTileEntity(pos.x, pos.y, pos.z));
        }
    }
    if (id == ExtraUtils.transferNodeRemote) {
        if (meta < 6) {
            if (world.getTileEntity(pos.x, pos.y, pos.z) instanceof TileEntityRetrievalNodeInventory) {
                return (TMultiPart)new TransferNodePartInventoryRemote(meta, (TileEntityRetrievalNodeInventory)world.getTileEntity(pos.x, pos.y, pos.z));
            }
        }
        else if (meta < 12) {
            if (world.getTileEntity(pos.x, pos.y, pos.z) instanceof TileEntityRetrievalNodeLiquid) {
                return (TMultiPart)new TransferNodePartLiquidRemote(meta, (TileEntityRetrievalNodeLiquid)world.getTileEntity(pos.x, pos.y, pos.z));
            }
        }
        else if (meta == 12 && world.getTileEntity(pos.x, pos.y, pos.z) instanceof TileEntityTransferNodeEnergy) {
            return (TMultiPart)new TransferNodePartEnergy(meta, (TileEntityTransferNodeEnergy)world.getTileEntity(pos.x, pos.y, pos.z));
        }
    }
    return null;
}
 
开发者ID:sameer,项目名称:ExtraUtilities,代码行数:41,代码来源:RegisterTransferNodeParts.java


示例18: rayTraceCuboid

import codechicken.lib.vec.BlockCoord; //导入依赖的package包/类
public MovingObjectPosition rayTraceCuboid(Vector3 start, Vector3 end, Cuboid6 cuboid, BlockCoord pos)
{
    MovingObjectPosition mop = rayTraceCuboid(start, end, cuboid);
    if(mop != null)
    {
        mop.typeOfHit = MovingObjectType.BLOCK;
        mop.blockX = pos.x;
        mop.blockY = pos.y;
        mop.blockZ = pos.z;
    }
    return mop;
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:13,代码来源:RayTracer.java


示例19: handleMobSpawnerID

import codechicken.lib.vec.BlockCoord; //导入依赖的package包/类
private void handleMobSpawnerID(World world, BlockCoord coord, String mobtype) {
    TileEntity tile = world.getTileEntity(coord.x, coord.y, coord.z);
    if (tile instanceof TileEntityMobSpawner) {
        ((TileEntityMobSpawner) tile).func_145881_a().setEntityName(mobtype);
        tile.markDirty();
        world.markBlockForUpdate(coord.x, coord.y, coord.z);
    }
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:9,代码来源:NEISPH.java


示例20: handleMobSpawnerID

import codechicken.lib.vec.BlockCoord; //导入依赖的package包/类
private void handleMobSpawnerID(World world, BlockCoord coord, String mobtype) {
    TileEntity tile = world.getTileEntity(coord.pos());
    if (tile instanceof TileEntityMobSpawner) {
        ((TileEntityMobSpawner) tile).getSpawnerBaseLogic().setEntityName(mobtype);
        tile.markDirty();
        world.markBlockForUpdate(coord.pos());
    }
}
 
开发者ID:SneakyTactician,项目名称:BIGB,代码行数:9,代码来源:NEISPH.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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