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


Java BlockCoord类代码示例

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


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


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