ServerPlayers are always in ServerWorlds
import org.spongepowered.api.text.chat.ChatType;
import org.spongepowered.api.text.chat.ChatVisibility;
import org.spongepowered.api.world.WorldBorder;
+import org.spongepowered.api.world.server.ServerWorld;
import org.spongepowered.plugin.PluginContainer;
import java.time.Instant;
@@ -297,4 +298,9 @@ default boolean hasPlayedBefore() {
default Optional<Value.Mutable<Entity>> spectatorTarget() {
return this.getValue(Keys.SPECTATOR_TARGET).map(Value::asMutable);
}
+
+ @Override
+ default ServerWorld getWorld() {
+ return this.getServerLocation().getWorld();
+ }
}
