コード例 #1
0
  @Override
  public void spawn(World world, double x, double y, double z) {
    super.spawn(world, x, y, z);

    double offset =
        HolographicDisplays.is1_8()
            ? Offsets.ARMOR_STAND_WITH_SLIME
            : Offsets.WITHER_SKULL_WITH_SLIME;

    nmsSlime = HolographicDisplays.getNMSManager().spawnNMSSlime(world, x, y + offset, z, this);

    if (HolographicDisplays.is1_8()) {
      nmsVehicle =
          HolographicDisplays.getNMSManager().spawnNMSArmorStand(world, x, y + offset, z, this);
    } else {
      nmsVehicle =
          HolographicDisplays.getNMSManager().spawnNMSWitherSkull(world, x, y + offset, z, this);
    }

    nmsSlime.setPassengerOfNMS(nmsVehicle);

    nmsSlime.setLockTick(true);
    nmsVehicle.setLockTick(true);
  }
コード例 #2
0
  @Override
  public void teleport(double x, double y, double z) {

    double offset =
        HolographicDisplays.is1_8()
            ? Offsets.ARMOR_STAND_WITH_SLIME
            : Offsets.WITHER_SKULL_WITH_SLIME;

    if (nmsVehicle != null) {
      nmsVehicle.setLocationNMS(x, y + offset, z);
    }

    if (nmsSlime != null) {
      nmsSlime.setLocationNMS(x, y + offset, z);
    }
  }