tp method

RestActionAble tp({
  1. Location? location,
  2. Entity? entity,
  3. dynamic facing,
  4. Rotation? rot,
})

Generates a Tp Widget

entity.tp(Location.here()).queue()

Implementation

RestActionAble tp({
  Location? location,
  Entity? entity,
  dynamic facing,
  Rotation? rot,
}) {
  //Teleport to entity
  if (entity != null && facing != null) {
    return StraitWidget.builder
        .create(Tp.entity(this, to: entity, facing: facing));
  }

  if (entity != null) {
    return StraitWidget.builder.create(Tp.entity(this, to: entity));
  }

  // Teleport to Location
  if (location != null && facing != null && rot != null) {
    return StraitWidget.builder
        .create(Tp(this, to: location, facing: facing, rot: rot));
  }
  if (location != null && facing != null) {
    return StraitWidget.builder
        .create(Tp(this, to: location, facing: facing));
  }
  if (location != null && rot != null) {
    return StraitWidget.builder.create(Tp(this, to: location, rot: rot));
  }
  if (location != null) {
    return StraitWidget.builder.create(Tp(this, to: location));
  }
  throw Error();
}