类net.minecraft.world.biome.Biome源码实例Demo

下面列出了怎么用net.minecraft.world.biome.Biome的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: Traverse-Legacy-1-12-2   文件: TraverseWorld.java
public static void register(Version versionAdded,
                            Biome biome,
                            BiomeType type,
                            String name,
                            int weight,
                            boolean disabled,
                            boolean canSpawn,
                            VillageReplacements villageReplacements,
                            RegistryEvent.Register<Biome> event,
                            BiomeDictionary.Type... biomeDictTypes) {
	if (!disabled) {
		biome.setRegistryName(new ResourceLocation(TraverseConstants.MOD_ID, name));
		event.getRegistry().register(biome);
		for (BiomeDictionary.Type biomeDictType : biomeDictTypes) {
			BiomeDictionary.addTypes(biome, biomeDictType);
		}
		biomeList.add(new TraverseBiomeEntry(biome, type, weight, canSpawn, !TraverseConfig.disallowVillages && villageReplacements != NO_VILLAGES, versionAdded));
		if (!TraverseConfig.disallowVillages && villageReplacements != NO_VILLAGES && villageReplacements != NO_REPLACEMENTS) {
			villageReplacementBiomes.put(biome, villageReplacements);
		}
	}
}
 
源代码2 项目: TofuCraftReload   文件: GenLayerRiverMix.java
/**
 * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall
 * amounts, or biomeList[] indices based on the particular GenLayer subclass.
 */
public int[] getInts(int par1, int par2, int par3, int par4)
{
    int[] aint = this.biomePatternGeneratorChain.getInts(par1, par2, par3, par4);
    int[] aint1 = this.riverPatternGeneratorChain.getInts(par1, par2, par3, par4);
    int[] aint2 = IntCache.getIntCache(par3 * par4);

    for (int i1 = 0; i1 < par3 * par4; ++i1)
    {
        if (aint1[i1] == Biome.getIdForBiome(TofuBiomes.TOFU_RIVER))
        {
            aint2[i1] = aint1[i1] & 255;
        }
        else
        {
            aint2[i1] = aint[i1];
        }
    }

    return aint2;
}
 
源代码3 项目: TofuCraftReload   文件: GenLayerBiome.java
/**
 * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall
 * amounts, or biomeList[] indices based on the particular GenLayer subclass.
 */
@Override
public int[] getInts(int par1, int par2, int par3, int par4)
{
    this.parent.getInts(par1, par2, par3, par4);
    int[] aint1 = IntCache.getIntCache(par3 * par4);

    for (int i1 = 0; i1 < par4; ++i1)
    {
        for (int j1 = 0; j1 < par3; ++j1)
        {
            this.initChunkSeed((j1 + par1), (i1 + par2));
            int idx = this.nextInt(this.allowedBiomes.length);
            aint1[j1 + i1 * par3] = Biome.getIdForBiome(this.allowedBiomes[idx]);
        }
    }

    return aint1;
}
 
源代码4 项目: AdvancedRocketry   文件: ItemBiomeChanger.java
@Override
public void useNetworkData(EntityPlayer player, Side side, byte id,
		NBTTagCompound nbt, ItemStack stack) {
	if(id == -1) {
		//If -1 then discover current biome
		((SatelliteBiomeChanger)getSatellite(stack)).addBiome(Biome.getIdForBiome(player.world.getBiome(new BlockPos((int)player.posX, 0, (int)player.posZ))));
		player.closeScreen();
	}
	if(id == 0) {
		int biomeId = nbt.getInteger("biome");

		
			setBiomeId(stack, biomeId);
		player.closeScreen();
	}
}
 
源代码5 项目: Kettle   文件: CraftChunk.java
private static float[] getTemperatures(BiomeProvider chunkmanager, int chunkX, int chunkZ) {
    Biome[] biomes = chunkmanager.getBiomes(null, chunkX, chunkZ, 16, 16);
    float[] temps = new float[biomes.length];

    for (int i = 0; i < biomes.length; i++) {
        float temp = biomes[i].getDefaultTemperature(); // Vanilla of olde: ((int) biomes[i].temperature * 65536.0F) / 65536.0F

        if (temp > 1F) {
            temp = 1F;
        }

        temps[i] = temp;
    }

    return temps;
}
 
源代码6 项目: GregTech   文件: CachedGridEntry.java
public CachedGridEntry(World world, int gridX, int gridZ, int primerChunkX, int primerChunkZ) {
    this.gridX = gridX;
    this.gridZ = gridZ;
    long worldSeed = world.getSeed();
    this.gridRandom = new XSTR(31 * 31 * gridX + gridZ * 31 + Long.hashCode(worldSeed));

    int gridSizeX = WorldGeneratorImpl.GRID_SIZE_X * 16;
    int gridSizeZ = WorldGeneratorImpl.GRID_SIZE_Z * 16;
    BlockPos blockPos = new BlockPos(gridX * gridSizeX + gridSizeX / 2, world.getActualHeight(), gridZ * gridSizeZ + gridSizeZ / 2);
    Biome currentBiome = world.getBiomeProvider().getBiome(blockPos);
    this.cachedDepositMap = new ArrayList<>(WorldGenRegistry.INSTANCE.getCachedBiomeVeins(world.provider, currentBiome));

    this.worldSeaLevel = world.getSeaLevel();
    this.masterEntry = searchMasterOrNull(world);
    if (masterEntry == null) {
        Chunk primerChunk = world.getChunkFromChunkCoords(primerChunkX, primerChunkZ);
        BlockPos heightSpot = findOptimalSpot(gridX, gridZ, primerChunkX, primerChunkZ);
        int masterHeight = world.getHeight(heightSpot).getY();
        int masterBottomHeight = world.getTopSolidOrLiquidBlock(heightSpot).getY();
        this.masterEntry = primerChunk.getCapability(GTWorldGenCapability.CAPABILITY, null);
        this.masterEntry = new GTWorldGenCapability();
        this.masterEntry.setMaxHeight(masterHeight, masterBottomHeight);
    }

    triggerVeinsGeneration();
}
 
源代码7 项目: AdvancedRocketry   文件: AdvancedRocketry.java
@SubscribeEvent
public void register(RegistryEvent.Register<Biome> evt)
{
    System.out.println("REGISTERING BIOMES");
       AdvancedRocketryBiomes.moonBiome = new BiomeGenMoon(config.get(BIOMECATETORY, "moonBiomeId", 110).getInt(), true);
       AdvancedRocketryBiomes.alienForest = new BiomeGenAlienForest(config.get(BIOMECATETORY, "alienForestBiomeId", 111).getInt(), true);
       AdvancedRocketryBiomes.hotDryBiome = new BiomeGenHotDryRock(config.get(BIOMECATETORY, "hotDryBiome", 112).getInt(), true);
       AdvancedRocketryBiomes.spaceBiome = new BiomeGenSpace(config.get(BIOMECATETORY, "spaceBiomeId", 113).getInt(), true);
       AdvancedRocketryBiomes.stormLandsBiome = new BiomeGenStormland(config.get(BIOMECATETORY, "stormLandsBiomeId", 114).getInt(), true);
       AdvancedRocketryBiomes.crystalChasms = new BiomeGenCrystal(config.get(BIOMECATETORY, "crystalChasmsBiomeId", 115).getInt(), true);
       AdvancedRocketryBiomes.swampDeepBiome = new BiomeGenDeepSwamp(config.get(BIOMECATETORY, "deepSwampBiomeId", 116).getInt(), true);
       AdvancedRocketryBiomes.marsh = new BiomeGenMarsh(config.get(BIOMECATETORY, "marsh", 117).getInt(), true);
       AdvancedRocketryBiomes.oceanSpires = new BiomeGenOceanSpires(config.get(BIOMECATETORY, "oceanSpires", 118).getInt(), true);
       AdvancedRocketryBiomes.moonBiomeDark = new BiomeGenMoonDark(config.get(BIOMECATETORY, "moonBiomeDarkId", 119).getInt(), true);

       AdvancedRocketryBiomes.instance.registerBiome(AdvancedRocketryBiomes.moonBiome, evt.getRegistry());
       AdvancedRocketryBiomes.instance.registerBiome(AdvancedRocketryBiomes.alienForest, evt.getRegistry());
       AdvancedRocketryBiomes.instance.registerBiome(AdvancedRocketryBiomes.hotDryBiome, evt.getRegistry());
       AdvancedRocketryBiomes.instance.registerBiome(AdvancedRocketryBiomes.spaceBiome, evt.getRegistry());
       AdvancedRocketryBiomes.instance.registerBiome(AdvancedRocketryBiomes.stormLandsBiome, evt.getRegistry());
       AdvancedRocketryBiomes.instance.registerBiome(AdvancedRocketryBiomes.crystalChasms, evt.getRegistry());
       AdvancedRocketryBiomes.instance.registerBiome(AdvancedRocketryBiomes.swampDeepBiome, evt.getRegistry());
       AdvancedRocketryBiomes.instance.registerBiome(AdvancedRocketryBiomes.marsh, evt.getRegistry());
       AdvancedRocketryBiomes.instance.registerBiome(AdvancedRocketryBiomes.oceanSpires, evt.getRegistry());
       AdvancedRocketryBiomes.instance.registerBiome(AdvancedRocketryBiomes.moonBiomeDark, evt.getRegistry());
}
 
源代码8 项目: AdvancedRocketry   文件: BiomeGenDeepSwamp.java
public BiomeGenDeepSwamp(int biomeId, boolean register) {
	super(new BiomeProperties("DeepSwamp").setBaseHeight(-0.1f).setHeightVariation(0.2f).setRainfall(0.9f).setTemperature(0.9f).setWaterColor(14745518));

       this.setRegistryName(new ResourceLocation("advancedrocketry:DeepSwamp"));
	
	this.decorator.treesPerChunk = 10;
       this.decorator.flowersPerChunk = 1;
       this.decorator.deadBushPerChunk = 1;
       this.decorator.mushroomsPerChunk = 8;
       this.decorator.reedsPerChunk = 10;
       this.decorator.clayPerChunk = 1;
       this.decorator.waterlilyPerChunk = 4;
       this.decorator.sandPatchesPerChunk = 0;
       this.decorator.grassPerChunk = 5;
       this.spawnableMonsterList.add(new Biome.SpawnListEntry(EntitySlime.class, 1, 1, 1));
       this.flowers.clear();
       this.addFlower(Blocks.RED_FLOWER.getDefaultState(), 10);
	swampTree = new WorldGenSwampTree(2);
}
 
源代码9 项目: Sakura_mod   文件: WorldGenBambooShot.java
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator,IChunkProvider chunkProvider) {
    int x = chunkX * 16;
    int z = chunkZ * 16;
    
    Biome biome = world.getBiomeForCoordsBody(new BlockPos(x, 0, z));
    if (BiomeDictionary.hasType(biome, BiomeDictionary.Type.DEAD)
    		||BiomeDictionary.hasType(biome, BiomeDictionary.Type.SANDY)) {
      return;
    }
    
       if (random.nextFloat() < SakuraConfig.bambooshot_weight / 4000.0F)
    {
      int posX = x+ world.rand.nextInt(16) + 8;
      int posZ = z+ world.rand.nextInt(16) + 8;
      BlockPos newPos = WorldUtil.findGround(world, new BlockPos(posX, 0, posZ), true, true, true);
      if ((newPos != null) && (BlockLoader.BAMBOOSHOOT.canBlockStay(world, newPos))) {
        world.setBlockState(newPos, BlockLoader.BAMBOOSHOOT.getDefaultState(), 2);
      }
    }
}
 
源代码10 项目: Sakura_mod   文件: WorldGenPepper.java
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator,IChunkProvider chunkProvider) {
    int x = chunkX * 16;
    int z = chunkZ * 16;
    
    Biome biome = world.getBiomeForCoordsBody(new BlockPos(x, 0, z));
    if (BiomeDictionary.hasType(biome, BiomeDictionary.Type.DEAD)
    		||BiomeDictionary.hasType(biome, BiomeDictionary.Type.SANDY)) {
      return;
    }

	if (random.nextFloat() < SakuraConfig.pepper_weight / 4000.0F) {
      int posX = x  + world.rand.nextInt(16) + 8;
      int posZ = z  + world.rand.nextInt(16) + 8;
      BlockPos newPos = WorldUtil.findGround(world, new BlockPos(posX, 0, posZ), true, true, true);
      if ((newPos != null) && (BlockLoader.PEPPER_SPLINT.canPlaceBlockAt(world, newPos))) {
        world.setBlockState(newPos, BlockLoader.PEPPERCROP.getDefaultState(), 2);
      }
    }
}
 
源代码11 项目: Sakura_mod   文件: WorldGenVanilla.java
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator,IChunkProvider chunkProvider) {
    int x = chunkX * 16;
    int z = chunkZ * 16;
    
    Biome biome = world.getBiomeForCoordsBody(new BlockPos(x, 0, z));
    if (BiomeDictionary.hasType(biome, BiomeDictionary.Type.DEAD)
    		||BiomeDictionary.hasType(biome, BiomeDictionary.Type.SANDY)) {
      return;
    }

	if (random.nextFloat() < SakuraConfig.vanilla_weight / 4000.0F)
    {
      int posX = x + world.rand.nextInt(16) + 8;
      int posZ = z + world.rand.nextInt(16) + 8;
      BlockPos newPos = WorldUtil.findGround(world, new BlockPos(posX, 0, posZ), true, true, true);
      if ((newPos != null) && (BlockLoader.VANILLA_SPLINT.canPlaceBlockAt(world, newPos))) {
        world.setBlockState(newPos, BlockLoader.VANILLACROP.getDefaultState(), 2);
      }
    }
}
 
源代码12 项目: YUNoMakeGoodMap   文件: WorldProviderHellVoid.java
@Override
public Chunk generateChunk(int x, int z)
{
    ChunkPrimer data = new ChunkPrimer();

    if(YUNoMakeGoodMap.instance.shouldGenerateNetherFortress(world))
        genNetherBridge.generate(world, x, z, data);
    else
        genNetherBridge.generate(world, x, z, null);

    Chunk ret = new Chunk(world, data, x, z);
    Biome[] biomes = world.getBiomeProvider().getBiomes(null, x * 16, z * 16, 16, 16);
    byte[] ids = ret.getBiomeArray();

    for (int i = 0; i < ids.length; ++i)
    {
        ids[i] = (byte)Biome.getIdForBiome(biomes[i]);
    }

    ret.generateSkylightMap();
    return ret;
}
 
@Inject(method = "getEntitySpawnList", at = @At(value = "INVOKE", ordinal = 1, shift = At.Shift.BEFORE,
        target = "Lnet/minecraft/world/gen/feature/StructureFeature;isApproximatelyInsideStructure(Lnet/minecraft/world/IWorld;Lnet/minecraft/util/math/BlockPos;)Z"),
        cancellable = true)
private void onGetEntitySpawnList(EntityCategory entityCategory_1, BlockPos blockPos_1,
        CallbackInfoReturnable<List<Biome.SpawnEntry>> cir)
{
    if (CarpetSettings.huskSpawningInTemples)
    {
        if (Feature.DESERT_PYRAMID.isApproximatelyInsideStructure(this.world, blockPos_1))
        {
            cir.setReturnValue(Feature.DESERT_PYRAMID.getMonsterSpawns());
        }
    }
}
 
源代码14 项目: CommunityMod   文件: BiomeBadlands.java
public BiomeBadlands() {
	super(properties);
	decorator.treesPerChunk = 1;
	decorator.extraTreeChance = 4;
	decorator.flowersPerChunk = 0;
	decorator.grassPerChunk = 16;

	spawnableCreatureList.clear();
	spawnableCreatureList.add(new Biome.SpawnListEntry(EntitySheep.class, 4, 2, 4));
	spawnableCreatureList.add(new Biome.SpawnListEntry(EntityPig.class, 3, 2, 4));
	spawnableCreatureList.add(new Biome.SpawnListEntry(EntityChicken.class, 3, 2, 4));
	spawnableCreatureList.add(new Biome.SpawnListEntry(EntityCow.class, 2, 2, 4));
	spawnableCreatureList.add(new Biome.SpawnListEntry(EntityRabbit.class, 1, 2, 7));
}
 
源代码15 项目: minecraft-roguelike   文件: CommandRouteBiome.java
@Override
public void execute(ICommandContext context, List<String> args) {
	
	ArgumentParser ap = new ArgumentParser(args);
	
	IWorldEditor editor = context.createEditor();
	Coord pos;
	if(!ap.hasEntry(0)){
		pos = context.getPos();
	} else {
		int x; int z;
		try {
			x = CommandBase.parseInt(ap.get(0));
			z = CommandBase.parseInt(ap.get(1));
		} catch (NumberInvalidException e) {
			context.sendMessage("Failure: Invalid Coords: X Z", MessageType.ERROR);
			return;
		}
		pos = new Coord(x, 0, z);
	}
	
	context.sendMessage("Biome Information for " + pos.toString(), MessageType.SPECIAL);
	
	Biome biome = editor.getInfo(pos).getBiome();
	context.sendMessage(biome.getBiomeName(), MessageType.SPECIAL);
	
	Set<BiomeDictionary.Type> biomeTypes = BiomeDictionary.getTypes(biome);
	String types = "";
	for(BiomeDictionary.Type type : biomeTypes){
		types += type.getName() + " ";
	}
	
	context.sendMessage(types, MessageType.SPECIAL);
	return;
}
 
源代码16 项目: Galacticraft-Rewoven   文件: MoonChunkGenerator.java
public List<Biome.SpawnEntry> getEntitySpawnList(Biome biome, StructureAccessor accessor, SpawnGroup group, BlockPos pos) {
    if (group == SpawnGroup.MONSTER) {
        if (accessor.method_28388(pos, false, StructureFeature.PILLAGER_OUTPOST).hasChildren()) {
            return StructureFeature.PILLAGER_OUTPOST.getMonsterSpawns();
        }
    }

    return super.getEntitySpawnList(biome, accessor, group, pos);
}
 
源代码17 项目: fabric-carpet   文件: EndCityFeatureMixin.java
@Override
public List<Biome.SpawnEntry> getMonsterSpawns()
{
    if (CarpetSettings.shulkerSpawningInEndCities)
        return spawnList;
    return Collections.emptyList();
}
 
源代码18 项目: Galacticraft-Rewoven   文件: OilPoolGenerator.java
public static void registerOilLake() {
    for (Biome biome : Biome.BIOMES) {
        if (!biome.getCategory().equals(Biomes.NETHER_WASTES.getCategory()) && !biome.getCategory().equals(Biomes.THE_END.getCategory())) {

            biome.addFeature(GenerationStep.Feature.UNDERGROUND_DECORATION, new ConfiguredFeature<>((LakeFeature) Feature.LAKE, new SingleStateFeatureConfig(GalacticraftBlocks.CRUDE_OIL.getDefaultState())));
        }
    }
}
 
源代码19 项目: TofuCraftReload   文件: ChunkProviderTofu.java
@Override
public Chunk generateChunk(int x, int z) {

    this.chunkX = x;
    this.chunkZ = z;
    this.rand.setSeed((long) x * 341873128712L + (long) z * 132897987541L);
    ChunkPrimer chunkprimer = new ChunkPrimer();
    this.biomesForGeneration = this.world.getBiomeProvider().getBiomes(this.biomesForGeneration, x * 16, z * 16, 16, 16);
    this.setBlocksInChunk(x, z, chunkprimer);
    this.buildSurfaces(chunkprimer);
    this.setBedRock(chunkprimer);

    this.caveGenerator.generate(this.world, x, z, chunkprimer);


    if (this.mapFeaturesEnabled) {
        this.mineshaft.generate(this.world, x, z, chunkprimer);
        this.villageGenerator.generate(this.world, x, z, chunkprimer);
        this.tofuCastle.generate(this.world, x, z, chunkprimer);
    }

    Chunk chunk = new Chunk(this.world, chunkprimer, x, z);
    byte[] abyte = chunk.getBiomeArray();

    for (int i = 0; i < abyte.length; ++i) {
        abyte[i] = (byte) Biome.getIdForBiome(this.biomesForGeneration[i]);
    }

    chunk.generateSkylightMap();
    return chunk;
}
 
源代码20 项目: Traverse-Legacy-1-12-2   文件: TraverseWorld.java
public static void register(Version versionAdded,
                            Biome biome,
                            BiomeType type,
                            String name,
                            int weight,
                            boolean disabled,
                            boolean canSpawn,
                            RegistryEvent.Register<Biome> event,
                            BiomeDictionary.Type... biomeDictTypes) {
	register(versionAdded, biome, type, name, weight, disabled, canSpawn, NO_VILLAGES, event, biomeDictTypes);

}
 
源代码21 项目: GregTech   文件: OreDepositDefinition.java
@ZenMethod("getBiomeWeightModifier")
@Method(modid = GTValues.MODID_CT)
public int ctGetBiomeWeightModifier(IBiome biome) {
    int biomeIndex = ArrayUtils.indexOf(CraftTweakerMC.biomes, biome);
    Biome mcBiome = Biome.REGISTRY.getObjectById(biomeIndex);
    return mcBiome == null ? 0 : getBiomeWeightModifier().apply(mcBiome);
}
 
源代码22 项目: Moo-Fluids   文件: EntityHelper.java
public static void addSpawnFromType(final Class<? extends EntityLiving> entityClass,
                                    final int weightedProb, final int min, final int max,
                                    final EnumCreatureType typeOfCreature,
                                    final BiomeDictionary.Type... biomeTypes) {
  final ArrayList<Biome> biomes = new ArrayList<Biome>();
  for (final BiomeDictionary.Type biomeType : biomeTypes) {
    biomes.addAll(BiomeDictionary.getBiomes(biomeType));
  }

  EntityRegistry.addSpawn(entityClass, weightedProb, min, max, typeOfCreature,
                          biomes.toArray(new Biome[biomes.size()]));
}
 
源代码23 项目: CommunityMod   文件: CommandFindBiome.java
public static BlockPos spiralOutwardsLookingForBiome(ICommandSender sender, World world, Biome biomeToFind, double startX, double startZ, int timeout) {
	double a = 16 / Math.sqrt(Math.PI);
	double b = 2 * Math.sqrt(Math.PI);
	double x;
	double z;
	double dist = 0;
	int n;
	long start = System.currentTimeMillis();
	BlockPos.PooledMutableBlockPos pos = BlockPos.PooledMutableBlockPos.retain();
	int previous = 0;
	int i = 0;
	for (n = 0; dist < Integer.MAX_VALUE; ++n) {
		if ((System.currentTimeMillis() - start) > timeout) {
			return null;
		}
		double rootN = Math.sqrt(n);
		dist = a * rootN;
		x = startX + (dist * Math.sin(b * rootN));
		z = startZ + (dist * Math.cos(b * rootN));
		pos.setPos(x, 0, z);
		if (sender instanceof EntityPlayer) {
			if (previous == 3)
				previous = 0;
			String s = (previous == 0 ? "." : previous == 1 ? ".." : "...");
			((EntityPlayer) sender).sendStatusMessage(new TextComponentString("Scanning" + s), true);
			if (i == 1501) {
				previous++;
				i = 0;
			}
			i++;
		}
		if (world.getBiome(pos).equals(biomeToFind)) {
			pos.release();
			if (sender instanceof EntityPlayer)
				((EntityPlayer) sender).sendStatusMessage(new TextComponentString("Found Biome"), true);
			return new BlockPos((int) x, 0, (int) z);
		}
	}
	return null;
}
 
源代码24 项目: fabric-carpet   文件: ChunkGeneratorMixin.java
@Inject(method = "hasStructure", at = @At("HEAD"), cancellable = true)
private void skipGenerationBiomeChecks(Biome biome_1, StructureFeature<? extends FeatureConfig> structureFeature_1, CallbackInfoReturnable<Boolean> cir)
{
    if (CarpetSettings.skipGenerationChecks)
    {
        cir.setReturnValue(true);
        cir.cancel();
    }
}
 
源代码25 项目: CommunityMod   文件: BiomeLushSwamp.java
public BiomeLushSwamp() {
	super(properties);
	decorator.treesPerChunk = 2;
	decorator.flowersPerChunk = 5;
	decorator.deadBushPerChunk = 1;
	decorator.mushroomsPerChunk = 4;
	decorator.reedsPerChunk = 10;
	decorator.clayPerChunk = 1;
	decorator.waterlilyPerChunk = 4;
	decorator.sandPatchesPerChunk = 0;
	decorator.grassPerChunk = 10;

	spawnableMonsterList.add(new Biome.SpawnListEntry(EntitySlime.class, 1, 1, 1));
}
 
源代码26 项目: CommunityMod   文件: CommandFindBiome.java
@Override
public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException {
	Biome biome = null;
	if (args.length == 0) {
		sender.sendMessage(new TextComponentString("No biome specified"));
		return;
	}
	for (Biome b : ForgeRegistries.BIOMES.getValues()) {
		String name = b.getRegistryName().toString().replaceAll(" ", "_").toLowerCase();
		if (args[0].equalsIgnoreCase(name)) {
			biome = b;
		}
	}
	if (biome == null) {
		sender.sendMessage(new TextComponentString(TextFormatting.RED + "Error! Biome '" + args[0] + "' cannot be found!"));
		return;
	}
	long start = System.currentTimeMillis();
	final Biome finalBiome = biome;
	new Thread(() -> {
		BlockPos pos = spiralOutwardsLookingForBiome(sender, sender.getEntityWorld(), finalBiome, sender.getPosition().getX(), sender.getPosition().getZ(), TraverseConfig.findBiomeCommandTimeout);
		if (pos == null) {
			server.addScheduledTask(() -> sender.sendMessage(new TextComponentString(TextFormatting.RED + "Error! Biome '" + args[0] + "' could not be found after " + TextFormatting.GRAY + TraverseConfig.findBiomeCommandTimeout + "ms" + TextFormatting.RED + ".")));
			return;
		}
		if (sender instanceof EntityPlayerMP) {
			server.addScheduledTask(() -> {
				EntityPlayerMP playerMP = (EntityPlayerMP) sender;
				playerMP.connection.setPlayerLocation(pos.getX(), 150, pos.getZ(), 0, 0);
				sender.sendMessage(new TextComponentString(TextFormatting.WHITE + "Found '" + finalBiome.getRegistryName().toString() + "' Biome! " + TextFormatting.GRAY + "(" + (System.currentTimeMillis() - start) + "ms)"));
			});
			return;
		}
		server.addScheduledTask(() -> sender.sendMessage(new TextComponentString(TextFormatting.RED + "Error! An unknown error occurred.")));
	}, "Biome Finder - Traverse").start();
}
 
源代码27 项目: Traverse-Legacy-1-12-2   文件: CommandFindBiome.java
@Override
public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException {
	Biome biome = null;
	if (args.length == 0) {
		sender.sendMessage(new TextComponentString("No biome specified"));
		return;
	}
	for (Biome b : ForgeRegistries.BIOMES.getValues()) {
		String name = b.getRegistryName().toString().replaceAll(" ", "_").toLowerCase();
		if (args[0].equalsIgnoreCase(name)) {
			biome = b;
		}
	}
	if (biome == null) {
		sender.sendMessage(new TextComponentString(TextFormatting.RED + "Error! Biome '" + args[0] + "' cannot be found!"));
		return;
	}
	long start = System.currentTimeMillis();
	final Biome finalBiome = biome;
	new Thread(() -> {
		BlockPos pos = spiralOutwardsLookingForBiome(sender, sender.getEntityWorld(), finalBiome, sender.getPosition().getX(), sender.getPosition().getZ(), TraverseConfig.findBiomeCommandTimeout);
		if (pos == null) {
			server.addScheduledTask(() -> sender.sendMessage(new TextComponentString(TextFormatting.RED + "Error! Biome '" + args[0] + "' could not be found after " + TextFormatting.GRAY + TraverseConfig.findBiomeCommandTimeout + "ms" + TextFormatting.RED + ".")));
			return;
		}
		if (sender instanceof EntityPlayerMP) {
			server.addScheduledTask(() -> {
				EntityPlayerMP playerMP = (EntityPlayerMP) sender;
				playerMP.connection.setPlayerLocation(pos.getX(), 150, pos.getZ(), 0, 0);
				sender.sendMessage(new TextComponentString(TextFormatting.WHITE + "Found '" + finalBiome.getRegistryName().toString() + "' Biome! " + TextFormatting.GRAY + "(" + (System.currentTimeMillis() - start) + "ms)"));
			});
			return;
		}
		server.addScheduledTask(() -> sender.sendMessage(new TextComponentString(TextFormatting.RED + "Error! An unknown error occurred.")));
	}, "Biome Finder - Traverse").start();
}
 
源代码28 项目: AdvancedRocketry   文件: ItemBiomeChanger.java
private void setBiomeId(ItemStack stack, int id) {
	if(Biome.getBiome(id) != null) {
		SatelliteBase sat = getSatellite(stack);
		if(sat != null && sat instanceof SatelliteBiomeChanger) {
			((SatelliteBiomeChanger)sat).setBiome(id);
		}
	}
}
 
源代码29 项目: AdvancedRocketry   文件: BiomeGenWatermelon.java
public BiomeGenWatermelon(int biomeId, boolean register) {
	super(new BiomeProperties("Watermelon").setBaseHeight(1f).setHeightVariation(0.1f).setTemperature(0.9f).setRainDisabled());
	
	//cold and dry
	
	this.decorator.generateFalls=false;
	this.decorator.flowersPerChunk=0;
	this.decorator.grassPerChunk=0;
	this.decorator.treesPerChunk=0;
	this.fillerBlock = this.topBlock = Blocks.MELON_BLOCK.getDefaultState();
	
	this.spawnableMonsterList.clear();
	this.spawnableMonsterList.add(new Biome.SpawnListEntry(EntityEnderman.class, 10, 1, 10));
}
 
源代码30 项目: GT-Classic   文件: GTWorldGen.java
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator,
		IChunkProvider chunkProvider) {
	Biome biomegenbase = world.getBiome(new BlockPos(chunkX * 16 + 16, 128, chunkZ * 16 + 16));
	// Any Biome
	GTOreGenerator.generateBasicVein(GTBlocks.oreIridium, GTConfig.generation.iridiumGenerate, GTConfig.generation.iridiumSize, GTConfig.generation.iridiumWeight, 0, 128, Blocks.STONE, world, random, chunkX, chunkZ);
	// Jungle Biomes
	if (BiomeDictionary.hasType(biomegenbase, Type.JUNGLE)) {
		GTOreGenerator.generateBasicVein(GTBlocks.oreSheldonite, GTConfig.generation.sheldoniteGenerate, GTConfig.generation.sheldoniteSize, GTConfig.generation.sheldoniteWeight, 10, 30, Blocks.STONE, world, random, chunkX, chunkZ);
	}
	// Hot Biomes
	if (BiomeDictionary.hasType(biomegenbase, Type.HOT)) {
		GTOreGenerator.generateBasicVein(GTBlocks.oreRuby, GTConfig.generation.rubyGenerate, GTConfig.generation.rubySize, GTConfig.generation.rubyWeight, 0, 48, Blocks.STONE, world, random, chunkX, chunkZ);
	}
	// Ocean Biomes
	if (BiomeDictionary.hasType(biomegenbase, Type.OCEAN) || BiomeDictionary.hasType(biomegenbase, Type.BEACH)) {
		GTOreGenerator.generateBasicVein(GTBlocks.oreSapphire, GTConfig.generation.sapphireGenerate, GTConfig.generation.sapphireSize, GTConfig.generation.sapphireWeight, 0, 48, Blocks.STONE, world, random, chunkX, chunkZ);
	}
	// Forest or Plains Biomes
	if (BiomeDictionary.hasType(biomegenbase, Type.FOREST)
			|| (BiomeDictionary.hasType(biomegenbase, Type.PLAINS))) {
		GTOreGenerator.generateBasicVein(GTBlocks.oreBauxite, GTConfig.generation.bauxiteGenerate, GTConfig.generation.bauxiteSize, GTConfig.generation.bauxiteWeight, 50, 120, Blocks.STONE, world, random, chunkX, chunkZ);
	}
	if (world.provider.getDimensionType().equals(DimensionType.OVERWORLD)) {
		for (Block block : GTBedrockOreHandler.getBedrockOreMap().keySet()) {
			if (GTBedrockOreHandler.shouldGTCHandleGeneration(block)) {
				GTOreGenerator.generateBedrockVein(block, world, random, chunkX, chunkZ);
			}
		}
	}
}
 
 类所在包
 类方法
 同包方法