本文整理汇总了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;
}
示例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;
}
示例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();
}
示例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);
}
}
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}