本文整理汇总了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
}
示例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);
}
}
示例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;
}
}
示例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;
}
}
示例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;
}
示例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();
}
示例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" };
}
示例8: getBiomeProvider
import net.minecraft.world.World; //导入方法依赖的package包/类
@Override
public BiomeProvider getBiomeProvider(World world) {
return new FirmaBiomeProvider(world.getSeed(), this, world.getWorldInfo().getGeneratorOptions());
}
示例9: VolatileChunkProvider
import net.minecraft.world.World; //导入方法依赖的package包/类
public VolatileChunkProvider(World worldIn) {
worldObj = worldIn;
chunkGenerator = new PontusChunkProvider(worldIn, worldIn.getSeed());
}
示例10: WorldChunkManager
import net.minecraft.world.World; //导入方法依赖的package包/类
public WorldChunkManager(World worldIn)
{
this(worldIn.getSeed(), worldIn.getWorldInfo().getTerrainType(), worldIn.getWorldInfo().getGeneratorOptions());
}
示例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));
}