net.minecraft.util.math.AxisAlignedBB.contains()方法的使用及代码示例

x33g5p2x  于11个月前 转载在 其他  
字(7.0k)|赞(0)|评价(0)|浏览(24)

本文整理了Java中net.minecraft.util.math.AxisAlignedBB.contains()方法的一些代码示例,展示了AxisAlignedBB.contains()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AxisAlignedBB.contains()方法的具体详情如下:
包路径:net.minecraft.util.math.AxisAlignedBB
类名称:AxisAlignedBB
方法名:contains

AxisAlignedBB.contains介绍

暂无

代码示例

代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2

if( bb.contains( pos ) )
  if( bb.contains( pos ) )

代码示例来源:origin: OpenMods/OpenModsLib

public Map.Entry<AxisAlignedBB, T> findEntryContainingPoint(Vec3d point) {
  for (Map.Entry<AxisAlignedBB, T> e : entries)
    if (e.getKey().contains(point)) return e;
  return null;
}

代码示例来源:origin: OpenMods/OpenModsLib

public void findAllEntriesContainingPoint(Vec3d point, Collection<Map.Entry<AxisAlignedBB, T>> output) {
  for (Map.Entry<AxisAlignedBB, T> e : entries)
    if (e.getKey().contains(point)) output.add(e);
}

代码示例来源:origin: TeamLapen/Vampirism

@Override
public boolean isWithinHomeDistance(double x, double y, double z) {
  if (home != null) {
    return home.contains(new Vec3d(x, y, z));
  }
  return true;
}

代码示例来源:origin: P3pp3rF1y/AncientWarfare2

@Override
public boolean contains(Vec3d vec3) {
  return getMin().contains(vec3) || getMax().contains(vec3) || getTop().contains(vec3);
}

代码示例来源:origin: SleepyTrousers/EnderIO

private boolean isEntityInRange(Entity entity) {
 return getRange().contains(new Vec3d(entity.posX, entity.posY, entity.posZ));
}

代码示例来源:origin: TeamLapen/Vampirism

public String makeDebugString(BlockPos pos) {
  Village v = getVillage();
  if (v == null) {
    return "MC Village does not exist" + getCenter();
  } else {
    StringBuilder builder = new StringBuilder();
    builder.append("Center: ").append(getCenter().toString());
    builder.append("Overtaken: ").append(isOvertaken());
    builder.append("\nIs inside: ").append(v.isBlockPosWithinSqVillageRadius(pos)).append(" (").append(getBoundingBox().contains(new Vec3d(pos))).append(')');
    builder.append("\n").append(String.format("RBitten: %s, RConv: %s, RBDeath: %s, Agrr: %s", recentlyBitten, recentlyConverted, recentlyBittenToDeath, agressive));
    List<EntityVillager> allVillagers = getAllVillager();
    List<EntityBasicHunter> hunters = getHunters();
    List<IAggressiveVillager> hunterVillagers = filterHunterVillagers(allVillagers);
    List<EntityVillager> normalVillager = filterNormalVillagers(allVillagers);
    List<EntityBasicVampire> vampires = getVampires();
    List<EntityVillager> vampireVillagers = filterVampireVillagers(allVillagers);
    builder.append("\n").append(String.format("Stats: Doors: %s, Aggro: %s, v: %s, vh: %s, h: %s, v: %s, vv: %s", v.getNumVillageDoors(), calculateAggressiveCounter(), normalVillager.size(), hunterVillagers.size(), hunters.size(), vampires.size(), vampireVillagers.size()));
    int hunterCount = hunters.size() + hunterVillagers.size() / 2;
    int vampireCount = vampires.size() + vampireVillagers.size() / 2;
    boolean spawn = (isOvertaken() ? vampireCount : hunterCount) < (Balance.village.MIN_HUNTER_COUNT_VILLAGE_PER_DOOR * v.getNumVillageDoors() + 1);
    builder.append("\nShould Spawn: ").append(hunterCount).append('(').append(spawn).append(')');
    builder.append("\nAggressors: ").append(villageAggressorVampires.toString());
    return builder.toString();
  }
}

代码示例来源:origin: Vazkii/Botania

int ez = pz + j - diff;
if(!axis.contains(new Vec3d(ex + 0.5, py + 1, ez + 0.5)))
  continue;
BlockPos pos = new BlockPos(ex, py, ez);

代码示例来源:origin: RS485/LogisticsPipes

@Override
  public IBounds getBoundsInside(AxisAlignedBB boundingBox) {
    Cuboid6 c = null;
    for (Vertex5 v : model.verts) {
      if (boundingBox.contains(new Vec3d(v.vec.x, v.vec.y, v.vec.z))) {
        if (c == null) {
          c = new Cuboid6(v.vec.copy(), v.vec.copy());
        } else {
          c.enclose(v.vec);
        }
      }
    }
    if(c == null) return null;
    return wrap(c);
  }
}

代码示例来源:origin: P3pp3rF1y/AncientWarfare2

RayTraceResult raytraceresult = axisalignedbb.calculateIntercept(positionEyes, vec3d2);
if (axisalignedbb.contains(positionEyes)) {
  if (d >= 0.0D) {
    pointedEntity = entity;

代码示例来源:origin: Alex-the-666/Ice_and_Fire

RayTraceResult raytraceresult = axisalignedbb.calculateIntercept(vec3d, vec3d2);
if (axisalignedbb.contains(vec3d)) {
  if (d2 >= 0.0D) {
    pointedEntity = entity1;

代码示例来源:origin: SquidDev-CC/plethora

private static int getIntersectSlot(Vec3d fromVec, Vec3d toVec, Matrix4f transform) {
  Matrix4f inv = new Matrix4f();
  inv.invert(transform);
  // Convert the vectors into "minecart" space
  Vector4f to = new Vector4f((float) toVec.x, (float) toVec.y, (float) toVec.z, 1);
  inv.transform(to);
  Vector4f from = new Vector4f((float) fromVec.x, (float) fromVec.y, (float) fromVec.z, 1);
  inv.transform(from);
  Vector4f step = new Vector4f();
  step.sub(to, from);
  step.scale(1 / 100.0f);
  // Now ray-trace to find where they intersect with the bounding box.
  for (int offset = 0; offset <= 100; offset++) {
    for (int i = 0; i < BOUNDS.length; i++) {
      AxisAlignedBB bb = BOUNDS[i];
      if (bb.contains(new Vec3d(from.getX(), from.getY(), from.getZ()))) {
        // If we got the actual block itself then pretend nothing happened.
        return i - 1;
      }
    }
    from.add(step);
  }
  return -1;
}

代码示例来源:origin: P3pp3rF1y/AncientWarfare2

if (entityBB.contains(testVector)) {
  return new BlockPos(testEntity.posX, testEntity.posY, testEntity.posZ);

代码示例来源:origin: Vazkii/Psi

RayTraceResult interceptPosition = hitbox.calculateIntercept(positionVector, reachVector);
if(hitbox.contains(positionVector)) {
  if(0.0D < minDistance || minDistance == 0.0D) {
    lookedEntity = entity;

代码示例来源:origin: SquidDev-CC/plethora

RayTraceResult intercept = box.calculateIntercept(origin, target);
if (box.contains(origin)) {
  if (closestDistance >= 0.0D) {
    closestEntity = entityHit;

代码示例来源:origin: MatterOverdrive/MatterOverdrive-Legacy-Edition

RayTraceResult movingobjectposition = axisalignedbb.calculateIntercept(Vec3d, Vec3d2);
if (axisalignedbb.contains(Vec3d)) {
  if (0.0D < d2 || d2 == 0.0D) {
    pointedEntity = entity;

代码示例来源:origin: SquidDev-CC/plethora

@SideOnly(Side.CLIENT)
@SubscribeEvent
public void drawHighlight(DrawBlockHighlightEvent event) {
  if (event.getTarget().typeOfHit != RayTraceResult.Type.BLOCK) return;
  BlockPos blockPos = event.getTarget().getBlockPos();
  IBlockState state = event.getPlayer().getEntityWorld().getBlockState(blockPos);
  if (state.getBlock() != this) return;
  EnumFacing facing = state.getValue(FACING);
  Vec3d hit = event.getTarget().hitVec.subtract(blockPos.getX(), blockPos.getY(), blockPos.getZ());
  ManipulatorType type = state.getValue(TYPE);
  for (AxisAlignedBB box : type.boxesFor(facing)) {
    if (box.grow(BOX_EXPAND, BOX_EXPAND, BOX_EXPAND).contains(hit)) {
      RenderHelper.renderBoundingBox(event.getPlayer(), box, event.getTarget().getBlockPos(), event.getPartialTicks());
      event.setCanceled(true);
      break;
    }
  }
}

代码示例来源:origin: jabelar/ExampleMod-1.12

RayTraceResult mop0 = aabb.calculateIntercept(pos, var8);
if (aabb.contains(pos))

代码示例来源:origin: SquidDev-CC/plethora

for (int i = 0; i < type.size(); i++) {
  AxisAlignedBB box = boxes[i];
  if (box.grow(BOX_EXPAND, BOX_EXPAND, BOX_EXPAND).contains(hit)) {
    final ItemStack stack = stacks.get(i);
    if (heldStack.isEmpty() && !stack.isEmpty()) {

代码示例来源:origin: thraaawn/CompactMachines

(lastCoords << 10) + size, 40 + size, size
    );
if(!bb.contains(new Vec3d(event.player.posX, event.player.posY, event.player.posZ))) {
  event.player.addPotionEffect(new PotionEffect(Potion.getPotionFromResourceLocation("minecraft:nausea"), 200, 5, false, false));
  event.player.addPotionEffect(new PotionEffect(Potion.getPotionFromResourceLocation("minecraft:wither"), 160, 1, false, false));

相关文章