本文整理汇总了Java中net.minecraft.world.World.getWorldType方法的典型用法代码示例。如果您正苦于以下问题:Java World.getWorldType方法的具体用法?Java World.getWorldType怎么用?Java World.getWorldType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.world.World
的用法示例。
在下文中一共展示了World.getWorldType方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: move
import net.minecraft.world.World; //导入方法依赖的package包/类
@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));
}
}
示例2: addChunk
import net.minecraft.world.World; //导入方法依赖的package包/类
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);
}
}
}
示例3: handleWorldSettings
import net.minecraft.world.World; //导入方法依赖的package包/类
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();
}
}
示例4: isWorldATG
import net.minecraft.world.World; //导入方法依赖的package包/类
public static boolean isWorldATG(World world) {
return world.getWorldType() == ExampleMod.worldType;
}