net.minecraft.entity.Entity.equals()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(3.8k)|赞(0)|评价(0)|浏览(104)

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

Entity.equals介绍

暂无

代码示例

代码示例来源:origin: WayofTime/BloodMagic

@Override
public boolean equals(Object o) {
  if (this == o) return true;
  if (!(o instanceof Teleport)) return false;
  Teleport teleport = (Teleport) o;
  if (x != teleport.x) return false;
  if (y != teleport.y) return false;
  if (z != teleport.z) return false;
  if (entity != null ? !entity.equals(teleport.entity) : teleport.entity != null) return false;
  return networkOwner != null ? networkOwner.equals(teleport.networkOwner) : teleport.networkOwner == null;
}

代码示例来源:origin: ldtteam/minecolonies

@Override
public boolean equals(@Nullable final Object o)
{
  return !(o == null || getClass() != o.getClass() || !super.equals(o));
}

代码示例来源:origin: cabaletta/baritone

private boolean followable(Entity entity) {
  if (entity == null) {
    return false;
  }
  if (entity.isDead) {
    return false;
  }
  if (entity.equals(ctx.player())) {
    return false;
  }
  return ctx.world().loadedEntityList.contains(entity);
}

代码示例来源:origin: iLexiconn/LLibrary

/**
 * Remove a tracker from a player.
 *
 * @param player the player instance
 * @param entity the entity instance
 */
public void removeTracker(EntityPlayerMP player, Entity entity) {
  List<PropertiesTracker<?>> trackerList = this.trackerMap.get(player);
  if (trackerList != null && trackerList.size() > 0) {
    Iterator<PropertiesTracker<?>> iterator = trackerList.iterator();
    while (iterator.hasNext()) {
      PropertiesTracker<?> tracker = iterator.next();
      if (tracker.getEntity().equals(entity)) {
        iterator.remove();
        tracker.removeTracker();
      }
    }
  }
}

代码示例来源:origin: JurassiCraftTeam/JurassiCraft2

@Override
protected void removePassenger(Entity passenger) {
  super.removePassenger(passenger);
  for (int i = 0; i < this.seats.length; i++) {
    if (passenger.equals(this.getEntityInSeat(i))) {
      passenger.noClip = false;
    break;
    }
  }
}

代码示例来源:origin: JurassiCraftTeam/JurassiCraft2

@Override
protected void removePassenger(Entity passenger) {
  super.removePassenger(passenger);
  for (int i = 0; i < this.seats.length; i++) {
    if (passenger.equals(this.getEntityInSeat(i))) {
      passenger.noClip = false;
      break;
    }
  }
  // !!!DO NOT DELETE!!!
  /*
   * if (this.world.isRemote) { System.out.println("REMOVED"); EntityPlayerSP
   * player = Minecraft.getMinecraft().player; DummyCameraEntity dummyCamera = new
   * DummyCameraEntity(Minecraft.getMinecraft(), this.world);
   * dummyCamera.setPosition(player.posX, player.posY, player.posZ);
   * this.world.spawnEntity(dummyCamera);
   * Minecraft.getMinecraft().setRenderViewEntity(dummyCamera); }
   */
  //
}

代码示例来源:origin: OpenModularTurretsTeam/OpenModularTurrets

private static boolean isTargetAlreadyTargeted(TurretBase base, Entity entity) {
  for (TileEntity tileEntity : WorldUtil.getTouchingTileEntities(base.getWorld(), base.getPos())) {
    if (tileEntity instanceof TurretHead) {
      if (entity.equals(((TurretHead) tileEntity).target)) {
        return true;
      }
    }
  }
  return false;
}

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

@SuppressWarnings("unchecked")
public void renderOthers(RenderHandler renderHandler, float ticks) {
  Minecraft.getMinecraft().world.getLoadedEntityList().stream()
      .filter(o -> o instanceof EntityPlayer)
      .filter(player -> !player.equals(Minecraft.getMinecraft().player))
      .forEach(o -> {
        EntityPlayer player = (EntityPlayer) o;
        if (shouldRenderBeam(player)) {
          renderRaycastedBeam(player.getPositionEyes(ticks).addVector(0, player.getEyeHeight(), 0), player.getLook(0), new Vec3d(-0.5, -0.3, 1), player);
        } else {
          stopWeaponSound(player);
        }
      });
}

代码示例来源:origin: cabaletta/baritone

baritone.getFollowProcess().follow(x -> effectivelyFinal.equals(x));
logDirect("Following " + toFollow.get());
return true;

代码示例来源:origin: WayofTime/BloodMagic

throwingEntity = ((EntityThrowable) projectile).getThrower();
if (throwingEntity != null && throwingEntity.equals(event.getEntityLiving()))
  continue;

相关文章

Entity类方法