net.minecraft.world.WorldType.getName()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(3.6k)|赞(0)|评价(0)|浏览(76)

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

WorldType.getName介绍

暂无

代码示例

代码示例来源:origin: superckl/BiomeTweaker

@Override
public void perform() throws Exception {
  if(this.type == null){
    BiomeEventHandler.globalSize = this.size;
    return;
  }
  WorldType type = null;
  for(final WorldType worldType:WorldType.WORLD_TYPES)
    if(worldType.getName().equals(this.type)){
      type = worldType;
      break;
    }
  if(type == null){
    LogHelper.warn("Failed to retrieve WorldType for '"+this.type+"'!");
    return;
  }
  BiomeEventHandler.sizes.put(type, this.size);
}

代码示例来源:origin: superckl/BiomeTweaker

.append("World Name: ").append(this.worldName.trim()).append(newLine)
.append("World Seed: ").append(i).append(newLine)
.append("World Type: ").append(WorldType.WORLD_TYPES[this.selectedIndex].getName()).append(newLine)
.append("Size: ").append(this.radius*2).append("x").append(this.radius*2).append(" chunks").append(newLine)
.append("Center: (").append(this.xCoord).append(", ").append(this.yCoord).append(')').append(newLine).append(newLine)

代码示例来源:origin: McJtyMods/LostCities

private BiomeProvider getInternalBiomeProvider(World world) {
  if (biomeProvider == null) {
    for (WorldType type : WorldType.WORLD_TYPES) {
      if ("BIOMESOP".equals(type.getName())) {
        WorldType orig = world.getWorldInfo().getTerrainType();
        world.getWorldInfo().setTerrainType(type);
        biomeProvider = type.getBiomeProvider(world);
        world.getWorldInfo().setTerrainType(orig);
        break;
      }
    }
  }
  return biomeProvider;
}

代码示例来源:origin: lawremi/CustomOreGen

properties.put("world.gameMode", worldInfo == null ? "" : worldInfo.getGameType().getName());
properties.put("world.gameMode.id", worldInfo == null ? 0 : worldInfo.getGameType().getID());
properties.put("world.type", worldInfo == null ? "" : worldInfo.getTerrainType().getName());
properties.put("world.type.version", worldInfo == null ? 0 : worldInfo.getTerrainType().getVersion());
String genName = "RandomLevelSource";

代码示例来源:origin: McJtyMods/LostCities

private BiomeProvider getInternalBiomeProvider(World world) {
  if (biomeProvider == null) {
    for (WorldType type : WorldType.WORLD_TYPES) {
      if ("BIOMESOP".equals(type.getName())) {
        WorldType orig = world.getWorldInfo().getTerrainType();
        world.getWorldInfo().setTerrainType(type);
        biomeProvider = type.getBiomeProvider(world);
        world.getWorldInfo().setTerrainType(orig);
        break;
      }
    }
  }
  return biomeProvider;
}

代码示例来源:origin: McJtyMods/LostCities

@Override
  protected BiomeProvider getInternalBiomeProvider(World world) {
    if (biomeProvider == null) {
      for (WorldType type : WorldType.WORLD_TYPES) {
        if (otherWorldtype.equals(type.getName())) {
          WorldType orig = world.getWorldInfo().getTerrainType();
          world.getWorldInfo().setTerrainType(type);
          biomeProvider = type.getBiomeProvider(world);
          world.getWorldInfo().setTerrainType(orig);
          break;
        }
      }
    }
    return biomeProvider;
  }
}

代码示例来源:origin: McJtyMods/LostCities

@Override
public IChunkGenerator getChunkGenerator(World world, String generatorOptions) {
  if (otherGenerator == null) {
    for (WorldType type : WorldType.WORLD_TYPES) {
      if (otherWorldtype.equals(type.getName())) {
        WorldType orig = world.getWorldInfo().getTerrainType();
        world.getWorldInfo().setTerrainType(type);
        otherGenerator = type.getChunkGenerator(world, generatorOptions);
        world.getWorldInfo().setTerrainType(orig);
        if (otherGenerator instanceof IChunkPrimerFactory) {
          factory = (IChunkPrimerFactory) otherGenerator;
        }
        break;
      }
    }
  }
  return new LostCityChunkGenerator(world, factory);
}

相关文章