net.minecraft.client.Minecraft.getIntegratedServer()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(2.9k)|赞(0)|评价(0)|浏览(138)

本文整理了Java中net.minecraft.client.Minecraft.getIntegratedServer()方法的一些代码示例,展示了Minecraft.getIntegratedServer()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Minecraft.getIntegratedServer()方法的具体详情如下:
包路径:net.minecraft.client.Minecraft
类名称:Minecraft
方法名:getIntegratedServer

Minecraft.getIntegratedServer介绍

暂无

代码示例

代码示例来源:origin: Vazkii/Botania

Entity ent = Minecraft.getMinecraft().getIntegratedServer().getEntityFromUuid(id);
if (ent != null) {
  World serverWorld = Minecraft.getMinecraft().getIntegratedServer().getEntityFromUuid(id).world;
  event.getLeft().add(PREFIX + String.format("(INTEGRATED SERVER DIM %d) netColl : %d, netPool: %d", serverWorld.provider.getDimension(), ManaNetworkHandler.instance.getAllCollectorsInWorld(serverWorld).size(), ManaNetworkHandler.instance.getAllPoolsInWorld(serverWorld).size()));

代码示例来源:origin: CoFH/CoFHCore

@Override
public IThreadListener getServerListener() {
  return Minecraft.getMinecraft().getIntegratedServer();
}

代码示例来源:origin: gegy1000/Terrarium

public static WorldType getLoadingWorldType() {
  WorldType worldType = null;
  if (MC.world != null) {
    worldType = MC.world.getWorldType();
  } else if (MC.getIntegratedServer() != null) {
    try {
      WorldSettings serverSettings = LoadingWorldGetter.getServerSettings(MC.getIntegratedServer());
      if (serverSettings != null) {
        worldType = serverSettings.getTerrainType();
      }
    } catch (Exception e) {
      Terrarium.LOGGER.warn("Failed to get IntegratedServer world settings", e);
    }
  }
  return worldType;
}

代码示例来源:origin: cabaletta/baritone

File readme;
IntegratedServer integratedServer = mc.getIntegratedServer();

代码示例来源:origin: ata4/dragon-mounts

private void getServerDragon() {
  if (!mc.isSingleplayer()) {
    // not possible on dedicated
    return;
  }
  
  if (dragonClient == null) {
    // client dragon required
    dragonServer = null;
    return;
  }
  
  if (dragonServer != null && dragonServer.getEntityId() == dragonClient.getEntityId()) {
    // done before
    return;
  }
  
  MinecraftServer mcs = mc.getIntegratedServer();
  
  for (WorldServer ws : mcs.worldServers) {
    Entity ent = ws.getEntityByID(dragonClient.getEntityId());
    if (ent != null && ent instanceof EntityTameableDragon) {
      dragonServer = (EntityTameableDragon) ent;
      return;
    }
  }
}

代码示例来源:origin: cabaletta/baritone

if (mc.getIntegratedServer() != null && mc.getIntegratedServer().worlds[0] != null) {
  mc.getIntegratedServer().worlds[0].setSpawnPoint(STARTING_POSITION);
  mc.getIntegratedServer().worlds[0].getGameRules().setOrCreateGameRule("spawnRadius", "0");
  if (mc.isSingleplayer() && !mc.getIntegratedServer().getPublic()) {
    mc.getIntegratedServer().shareToLAN(GameType.getByName("survival"), false);

代码示例来源:origin: lorddusk/HQM

public EntityPlayerMP getPlayerMP() {
    if(HardcoreQuesting.loadingSide.isServer()){
      return FMLCommonHandler.instance().getMinecraftServerInstance().getPlayerList().getPlayerByUUID(this.getUUID());
    } else {
      if(Minecraft.getMinecraft().isIntegratedServerRunning()){
        return Minecraft.getMinecraft().getIntegratedServer().getPlayerList().getPlayerByUUID(this.getUUID());
      }
    }
    return null;
  }
}

相关文章