use of net.minecraft.world.WorldType in project SpongeCommon by SpongePowered.
the class MixinWorldServer method createWorldGenerator.
@Override
public SpongeWorldGenerator createWorldGenerator(String settings) {
final WorldServer worldServer = (WorldServer) (Object) this;
final WorldType worldType = worldServer.getWorldType();
final IChunkGenerator chunkGenerator;
final BiomeProvider biomeProvider;
if (worldType instanceof SpongeWorldType) {
chunkGenerator = ((SpongeWorldType) worldType).getChunkGenerator(worldServer, settings);
biomeProvider = ((SpongeWorldType) worldType).getBiomeProvider(worldServer);
} else {
final IChunkGenerator currentGenerator = this.getChunkProvider().chunkGenerator;
if (currentGenerator != null) {
chunkGenerator = currentGenerator;
} else {
final WorldProvider worldProvider = worldServer.provider;
((IMixinWorldProvider) worldProvider).setGeneratorSettings(settings);
chunkGenerator = worldProvider.createChunkGenerator();
}
biomeProvider = worldServer.provider.biomeProvider;
}
return new SpongeWorldGenerator(worldServer, (BiomeGenerator) biomeProvider, SpongeGenerationPopulator.of(worldServer, chunkGenerator));
}
use of net.minecraft.world.WorldType in project SpongeCommon by SpongePowered.
the class GeneratorTypeRegistryModule method registerDefaults.
@Override
public void registerDefaults() {
for (WorldType worldType : WorldType.WORLD_TYPES) {
this.registerAdditionalCatalog((GeneratorType) worldType);
}
this.registerAdditionalCatalog((GeneratorType) new SpongeWorldTypeEnd());
this.registerAdditionalCatalog((GeneratorType) new SpongeWorldTypeNether());
this.registerAdditionalCatalog((GeneratorType) new SpongeWorldTypeOverworld());
}
use of net.minecraft.world.WorldType in project BiomeTweaker by superckl.
the class ScriptCommandRemoveBOPWorldType method perform.
@Override
public void perform() throws Exception {
final WorldType type = WorldType.parseWorldType(this.name);
if (type == null)
throw new IllegalArgumentException("Unable to find world type with name: " + this.name);
BOPBiomes.excludedDecoratedWorldTypes.remove(type);
}
use of net.minecraft.world.WorldType in project BiomeTweaker by superckl.
the class ScriptCommandAverageBiomeSize method perform.
@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);
}
use of net.minecraft.world.WorldType in project Engine by VoltzEngine-Project.
the class DevWorldLoader method preInit.
@Override
public void preInit() {
emptyWorldGenerator = new WorldType("voidTestWorld") {
@Override
public IChunkProvider getChunkGenerator(World world, String generatorOptions) {
return new ChunkProviderEmpty(world);
}
@Override
public boolean getCanBeCreated() {
return true;
}
};
stoneWorldGenerator = new WorldType("stoneTestWorld") {
@Override
public IChunkProvider getChunkGenerator(World world, String generatorOptions) {
return new ChunkProviderStone(world);
}
@Override
public boolean getCanBeCreated() {
return true;
}
};
stoneWorldGenerator = new WorldType("chessTestWorld") {
@Override
public IChunkProvider getChunkGenerator(World world, String generatorOptions) {
return new ChunkProviderChess(world);
}
@Override
public boolean getCanBeCreated() {
return true;
}
};
MinecraftForge.EVENT_BUS.register(this);
}
Aggregations