tp method
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();
}