当前位置: 首页>>代码示例>>Java>>正文


Java World.getSeed方法代码示例

本文整理汇总了Java中net.minecraft.world.World.getSeed方法的典型用法代码示例。如果您正苦于以下问题:Java World.getSeed方法的具体用法?Java World.getSeed怎么用?Java World.getSeed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.world.World的用法示例。


在下文中一共展示了World.getSeed方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: BiomeProviderATG

import net.minecraft.world.World; //导入方法依赖的package包/类
public BiomeProviderATG(World world)
{
    this.world = world;
    this.settings = WorldSettings.loadWorldSettings(world).biomeSettings;

    this.noise = new CoreNoise(world.getSeed());

    this.fuzz = new Random();
    this.biomeCache = new BiomeCache(this);
    this.biomesToSpawnIn = Lists.newArrayList(allowedBiomes);

    this.biomeRegistry = new BiomeRegistry();
    this.biomeRegistry.populate(this.settings);

    // TODO: Set things based on the world settings
}
 
开发者ID:stuebz88,项目名称:modName,代码行数:17,代码来源:BiomeProviderATG.java

示例2: generateWorld

import net.minecraft.world.World; //导入方法依赖的package包/类
/**
 * Callback hook for world gen - if your mod wishes to add extra mod related generation to the world
 * call this
 *
 * @param chunkX         Chunk X coordinate
 * @param chunkZ         Chunk Z coordinate
 * @param world          World we're generating into
 * @param chunkGenerator The chunk generator
 * @param chunkProvider  The chunk provider
 */
public static void generateWorld(int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider)
{
    if (sortedGeneratorList == null)
    {
        computeSortedGeneratorList();
    }
    long worldSeed = world.getSeed();
    Random fmlRandom = new Random(worldSeed);
    long xSeed = fmlRandom.nextLong() >> 2 + 1L;
    long zSeed = fmlRandom.nextLong() >> 2 + 1L;
    long chunkSeed = (xSeed * chunkX + zSeed * chunkZ) ^ worldSeed;

    for (IWorldGenerator generator : sortedGeneratorList)
    {
        fmlRandom.setSeed(chunkSeed);
        generator.generate(fmlRandom, chunkX, chunkZ, world, chunkGenerator, chunkProvider);
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:29,代码来源:GameRegistry.java

示例3: getStoneTypeAt

import net.minecraft.world.World; //导入方法依赖的package包/类
public static EnumRockClass getStoneTypeAt(World w, BlockPos at)
{
	if (lastRememberedSeed != w.getSeed())
	{
		rand.setSeed(w.getSeed());
		offsetStone = new Vec3i(rand.nextInt(300000) - rand.nextInt(300000), 0, rand.nextInt(300000) - rand.nextInt(300000));
		offsetDirt = new Vec3i(rand.nextInt(300000) - rand.nextInt(300000), 0, rand.nextInt(300000) - rand.nextInt(300000));
	}
	
	BlockPos actual = at.add(offsetStone);
	
	try
	{
		FeatureProvider provider = ((BiomeProviderExP)w.getBiomeProvider()).featureProvider;
		return EnumRockClass.values()[Math.abs(provider.getByte(actual, provider.cacheRocks)) % 16];
	}
	catch (Exception ex)
	{
		ex.printStackTrace();
		return EnumRockClass.ANDESITE;
	}
}
 
开发者ID:V0idWa1k3r,项目名称:ExPetrum,代码行数:23,代码来源:GenerationHelper.java

示例4: getDirtTypeAt

import net.minecraft.world.World; //导入方法依赖的package包/类
public static EnumDirtClass getDirtTypeAt(World w, BlockPos at)
{
	if (lastRememberedSeed != w.getSeed())
	{
		rand.setSeed(w.getSeed());
		offsetStone = new Vec3i(rand.nextInt(300000) - rand.nextInt(300000), 0, rand.nextInt(300000) - rand.nextInt(300000));
		offsetDirt = new Vec3i(rand.nextInt(300000) - rand.nextInt(300000), 0, rand.nextInt(300000) - rand.nextInt(300000));
	}
	
	BlockPos actual = at.add(offsetDirt);
	
	try
	{
		FeatureProvider provider = ((BiomeProviderExP)w.getBiomeProvider()).featureProvider;
		return EnumDirtClass.values()[Math.abs(provider.getByte(actual, provider.cacheSoil)) % 16];
	}
	catch (Exception ex)
	{
		ex.printStackTrace();
		return EnumDirtClass.ACRISOL;
	}
}
 
开发者ID:V0idWa1k3r,项目名称:ExPetrum,代码行数:23,代码来源:GenerationHelper.java

示例5: genSeed

import net.minecraft.world.World; //导入方法依赖的package包/类
private static long genSeed(World world) {
    Random prng = new Random(world.getSeed());
    long seed = prng.nextLong();
    while (seed == 0) {
        seed = prng.nextLong();
    }
    return seed;
}
 
开发者ID:Randores,项目名称:Randores2,代码行数:9,代码来源:RandoresWorldData.java

示例6: ChunkProviderBasic

import net.minecraft.world.World; //导入方法依赖的package包/类
public ChunkProviderBasic(World world) {
    this.world = world;
    this.random = new Random(world.getSeed());
    this.structuresEnabled = this.world.getWorldInfo().isMapFeaturesEnabled();

    this.surfaceNoise = new NoiseGeneratorPerlin(this.random, 4);

    this.initFeatures();
}
 
开发者ID:stuebz88,项目名称:modName,代码行数:10,代码来源:ChunkProviderBasic.java

示例7: get

import net.minecraft.world.World; //导入方法依赖的package包/类
@Override
@Callback
public Object[] get(Context context, Arguments args, World worldIn, TileEntitySensor teIn) {
	if (args.checkString(0).equalsIgnoreCase("biome")) {
		return new Object[] { worldIn.getBiomeGenForCoords((teIn.xCoord + rangeLimit(args.optInteger(1, 0))), (teIn.zCoord + rangeLimit(args.optInteger(1, 0)))).biomeName };
	} else if (args.checkString(0).equalsIgnoreCase("lightlevel")) {
		return new Object[] { worldIn.getBlockLightValue((teIn.xCoord + rangeLimit(args.optInteger(1, 0))), (teIn.yCoord + rangeLimit(rangeLimit(args.optInteger(1, 0)))), (teIn.zCoord + rangeLimit(args.optInteger(1, 0)))) };
	} else if (args.checkString(0).equalsIgnoreCase("raining")) {
		return new Object[] { worldIn.isRaining() };
	} else if (args.checkString(0).equalsIgnoreCase("thundering")) {
		return new Object[] { worldIn.isThundering() };
	} else if (args.checkString(0).equalsIgnoreCase("daytime")) {
		return new Object[] { worldIn.isDaytime() };
	} else if (args.checkString(0).equalsIgnoreCase("moonphase")) {
		return new Object[] { worldIn.getCurrentMoonPhaseFactor() };
	} else if (args.checkString(0).equalsIgnoreCase("celestialangle")) {
		return new Object[] { worldIn.getCelestialAngle(1.0F)};
	} else if (args.checkString(0).equalsIgnoreCase("dimension")) {
		return new Object[] { worldIn.getWorldInfo().getVanillaDimension()};
	} else if (args.checkString(0).equalsIgnoreCase("temperature") || args.checkString(0).equalsIgnoreCase("temp")) {
		return new Object[] { worldIn.getBiomeGenForCoords((teIn.xCoord + rangeLimit(args.optInteger(1, 0))), (teIn.zCoord + rangeLimit(args.optInteger(1, 0)))).temperature};
	} else if (args.checkString(0).equalsIgnoreCase("highhumidity")) {
		return new Object[] { worldIn.getBiomeGenForCoords((teIn.xCoord + rangeLimit(args.optInteger(1, 0))), (teIn.zCoord + rangeLimit(args.optInteger(1, 0)))).isHighHumidity()};
	} else if (args.checkString(0).equalsIgnoreCase("humidity")) {
		return new Object[] { worldIn.getBiomeGenForCoords((teIn.xCoord + rangeLimit(args.optInteger(1, 0))), (teIn.zCoord + rangeLimit(args.optInteger(1, 0)))).rainfall};
	} else if (args.checkString(0).equalsIgnoreCase("worldseed")) {
		return new Object[] { worldIn.getSeed()};
	}
	return new Object[] { "No method passed, or not found" };
}
 
开发者ID:PC-Logix,项目名称:OpenSensors,代码行数:31,代码来源:ItemWorldSensor.java

示例8: getBiomeProvider

import net.minecraft.world.World; //导入方法依赖的package包/类
@Override
public BiomeProvider getBiomeProvider(World world) {
	return new FirmaBiomeProvider(world.getSeed(), this, world.getWorldInfo().getGeneratorOptions());
}
 
开发者ID:trigg,项目名称:Firma,代码行数:5,代码来源:FirmaWorld.java

示例9: VolatileChunkProvider

import net.minecraft.world.World; //导入方法依赖的package包/类
public VolatileChunkProvider(World worldIn) {
	worldObj = worldIn;
	chunkGenerator = new PontusChunkProvider(worldIn, worldIn.getSeed());
}
 
开发者ID:kenijey,项目名称:harshencastle,代码行数:5,代码来源:VolatileChunkProvider.java

示例10: WorldChunkManager

import net.minecraft.world.World; //导入方法依赖的package包/类
public WorldChunkManager(World worldIn)
{
    this(worldIn.getSeed(), worldIn.getWorldInfo().getTerrainType(), worldIn.getWorldInfo().getGeneratorOptions());
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:5,代码来源:WorldChunkManager.java

示例11: getSpikesForWorld

import net.minecraft.world.World; //导入方法依赖的package包/类
public static WorldGenSpikes.EndSpike[] getSpikesForWorld(World p_185426_0_)
{
    Random random = new Random(p_185426_0_.getSeed());
    long i = random.nextLong() & 65535L;
    return (WorldGenSpikes.EndSpike[])SPIKE_CACHE.getUnchecked(Long.valueOf(i));
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:7,代码来源:BiomeEndDecorator.java


注:本文中的net.minecraft.world.World.getSeed方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。