Java Code Examples for net.minecraft.world.World.getWorldType()

The following are Jave code examples for showing how to use getWorldType() of the net.minecraft.world.World class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: Firma   File: JoinHandler.java   Source Code and License Vote up 6 votes
@SubscribeEvent
public void move(TickEvent.PlayerTickEvent event) {
	

	if (event.player.world.isRemote) {
		//System.out.println("CLIENT "+event.player.world.getBiome(event.player.getPosition()).getBiomeName());

		return;
	}
	//System.out.println(event.player.world.getBiome(event.player.getPosition()).getBiomeName());
	if (CommonProxy.d == 0) {
		return;
	}
	World w = event.player.world;
	if (w != null && w.getWorldType() == WorldType.DEFAULT) {
		new SpawnTeleport(DimensionManager.getWorld(CommonProxy.d)).teleport(event.player, DimensionManager.getWorld(CommonProxy.d));
	}
}
 
Example 2
Project: Geolosys   File: ChunkData.java   Source Code and License Vote up 6 votes
public void addChunk(ChunkPos pos, World world, IBlockState state)
{
    populatedChunks.add(pos);
    if (world.getWorldType() == WorldType.FLAT)
    {
        return;
    }

    int cap = getSampleCount(state);
    for (int i = 0; i < cap; i++)
    {
        BlockPos p = getSamplePos(world, pos);

        if (world.getBlockState(p.down()).getBlock() instanceof BlockSample || world.getBlockState(p.down()).getBlock() instanceof BlockSampleVanilla)
        {
            continue;
        }
        if (Config.getInstance().generateSamplesInWater || !isMoist(world, p))
        {
            world.setBlockState(p, state);
        }
    }
}
 
Example 3
Project: ExPetrum   File: ExPHandlerServer.java   Source Code and License Vote up 5 votes
public void handleWorldSettings(World w)
{
	try
	{
		if (w.getChunkProvider() instanceof ChunkProviderServer && w.getWorldType() instanceof WorldTypeExP)
		{
			ChunkProviderServer cps = (ChunkProviderServer) w.getChunkProvider();
			if (cps.chunkGenerator instanceof ChunkGeneratorOverworld)
			{
				ChunkGeneratorOverworld cpo = (ChunkGeneratorOverworld) cps.chunkGenerator;
				for (Field f : ChunkGeneratorOverworld.class.getDeclaredFields())
				{
					if (f.getType() == ChunkGeneratorSettings.class)
					{
						f.setAccessible(true);
						ChunkGeneratorSettings.Factory factory = new ChunkGeneratorSettings.Factory();
						factory.seaLevel = 127;
						factory.baseSize = 17.25f;
						f.set(cpo, factory.build());
						break;
					}
				}
			}
		}
	}
	catch (Exception ex)
	{
		ex.printStackTrace();
	}
}
 
Example 4
Project: modName   File: GeneralUtil.java   Source Code and License Vote up 4 votes
public static boolean isWorldATG(World world) {
    return world.getWorldType() == ExampleMod.worldType;
}