Search in sources :

Example 1 with IntegratedServer

use of net.minecraft.client.server.IntegratedServer in project SpongeCommon by SpongePowered.

the class MinecraftMixin_API method server.

@Override
public Optional<LocalServer> server() {
    final MinecraftBridge minecraftBridge = (MinecraftBridge) (this);
    final IntegratedServer integratedServer = minecraftBridge.bridge$getTemporaryIntegratedServer();
    if (integratedServer != null) {
        return (Optional<LocalServer>) (Object) Optional.ofNullable(integratedServer);
    }
    return (Optional<LocalServer>) (Object) Optional.ofNullable(this.shadow$getSingleplayerServer());
}
Also used : IntegratedServer(net.minecraft.client.server.IntegratedServer) Optional(java.util.Optional) MinecraftBridge(org.spongepowered.common.bridge.client.MinecraftBridge)

Aggregations

Optional (java.util.Optional)1 IntegratedServer (net.minecraft.client.server.IntegratedServer)1 MinecraftBridge (org.spongepowered.common.bridge.client.MinecraftBridge)1