本文整理匯總了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;
}