biome test
@ -1,3 +1,4 @@
|
||||
## Fixed
|
||||
* Fixed fatal gamebreaking hard drive corrupting issue where taurun leggings were misspelled
|
||||
* Fixed minor display issue where compressed air ducts would visually connect to non-ejector pneumatic tubes
|
||||
* Fixed minor display issue where compressed air ducts would visually connect to non-ejector pneumatic tubes
|
||||
* Fixed special creeper types being able to spawn in other dimensions
|
||||
@ -33,7 +33,7 @@ public class EntityCreeperGold extends EntityCreeper {
|
||||
|
||||
@Override
|
||||
public boolean getCanSpawnHere() {
|
||||
return super.getCanSpawnHere() && this.posY <= 40;
|
||||
return super.getCanSpawnHere() && this.posY <= 40 && this.dimension == 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -25,6 +25,11 @@ public class EntityCreeperPhosgene extends EntityCreeper {
|
||||
|
||||
return super.attackEntityFrom(source, amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getCanSpawnHere() {
|
||||
return super.getCanSpawnHere() && this.dimension == 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void func_146077_cc() {
|
||||
|
||||
@ -33,7 +33,7 @@ public class EntityCreeperVolatile extends EntityCreeper {
|
||||
|
||||
@Override
|
||||
public boolean getCanSpawnHere() {
|
||||
return super.getCanSpawnHere() && this.posY <= 40;
|
||||
return super.getCanSpawnHere() && this.posY <= 40 && this.dimension == 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -45,6 +45,7 @@ import com.hbm.tileentity.bomb.TileEntityNukeCustom;
|
||||
import com.hbm.tileentity.machine.rbmk.RBMKDials;
|
||||
import com.hbm.util.*;
|
||||
import com.hbm.world.biome.BiomeGenCraterBase;
|
||||
import com.hbm.world.biome.BiomeGenNoMansLand;
|
||||
import com.hbm.world.feature.BedrockOre;
|
||||
import com.hbm.world.feature.OreCave;
|
||||
import com.hbm.world.feature.OreLayer3D;
|
||||
@ -299,6 +300,7 @@ public class MainRegistry {
|
||||
OreDictManager.registerOres();
|
||||
|
||||
if(WorldConfig.enableCraterBiomes) BiomeGenCraterBase.initDictionary();
|
||||
BiomeGenNoMansLand.initDictionary();
|
||||
|
||||
aMatSchrab.customCraftingMaterial = ModItems.ingot_schrabidium;
|
||||
aMatHaz.customCraftingMaterial = ModItems.hazmat_cloth;
|
||||
|
||||
130
src/main/java/com/hbm/world/biome/BiomeDecoratorNoMansLand.java
Normal file
@ -0,0 +1,130 @@
|
||||
package com.hbm.world.biome;
|
||||
|
||||
import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.*;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.world.feature.WorldGenSurfaceSpot;
|
||||
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.world.biome.BiomeDecorator;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraft.world.gen.feature.WorldGenAbstractTree;
|
||||
import net.minecraft.world.gen.feature.WorldGenDeadBush;
|
||||
import net.minecraft.world.gen.feature.WorldGenLiquids;
|
||||
import net.minecraft.world.gen.feature.WorldGenerator;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.terraingen.DecorateBiomeEvent;
|
||||
import net.minecraftforge.event.terraingen.TerrainGen;
|
||||
|
||||
public class BiomeDecoratorNoMansLand extends BiomeDecorator {
|
||||
|
||||
public WorldGenerator sellafiteGen;
|
||||
public WorldGenerator gravelGen;
|
||||
public int sellafitePerChunk;
|
||||
public int gravelPerChunk;
|
||||
|
||||
public BiomeDecoratorNoMansLand() {
|
||||
super();
|
||||
|
||||
//TODO: instead of multiple localized shitty generators, make one that covers everything
|
||||
this.sellafiteGen = new WorldGenSurfaceSpot(ModBlocks.sellafield_slaked, 6, 0.15F);
|
||||
this.gravelGen = new WorldGenSurfaceSpot(ModBlocks.sellafield_slaked, 6, 0.15F);
|
||||
this.sellafitePerChunk = 2;
|
||||
this.gravelPerChunk = 2;
|
||||
}
|
||||
|
||||
protected void genDecorations(BiomeGenBase biome) {
|
||||
MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Pre(currentWorld, randomGenerator, chunk_X, chunk_Z));
|
||||
this.generateOres();
|
||||
|
||||
int x;
|
||||
int y;
|
||||
int z;
|
||||
|
||||
/// SAND IN WATER ///
|
||||
boolean doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, SAND);
|
||||
for(int i = 0; doGen && i < this.sandPerChunk2; ++i) {
|
||||
x = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
|
||||
z = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
|
||||
this.sandGen.generate(this.currentWorld, this.randomGenerator, x, this.currentWorld.getTopSolidOrLiquidBlock(x, z), z);
|
||||
}
|
||||
|
||||
/// GRAVEL IN WATER ///
|
||||
doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, SAND_PASS2);
|
||||
for(int i = 0; doGen && i < this.sandPerChunk; ++i) {
|
||||
x = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
|
||||
z = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
|
||||
this.gravelAsSandGen.generate(this.currentWorld, this.randomGenerator, x, this.currentWorld.getTopSolidOrLiquidBlock(x, z), z);
|
||||
}
|
||||
|
||||
/// SELLAFITE ///
|
||||
for(int i = 0; i < this.sellafitePerChunk; ++i) {
|
||||
x = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
|
||||
z = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
|
||||
this.sellafiteGen.generate(this.currentWorld, this.randomGenerator, x, this.currentWorld.getTopSolidOrLiquidBlock(x, z), z);
|
||||
}
|
||||
|
||||
/// GRAVEL ///
|
||||
for(int i = 0; i < this.gravelPerChunk; ++i) {
|
||||
x = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
|
||||
z = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
|
||||
this.gravelGen.generate(this.currentWorld, this.randomGenerator, x, this.currentWorld.getTopSolidOrLiquidBlock(x, z), z);
|
||||
}
|
||||
|
||||
int trees = this.treesPerChunk;
|
||||
|
||||
if(this.randomGenerator.nextInt(10) == 0) trees++;
|
||||
|
||||
/// TREES ///
|
||||
doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, TREE);
|
||||
for(int i = 0; doGen && i < trees; ++i) {
|
||||
x = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
|
||||
z = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
|
||||
y = this.currentWorld.getHeightValue(x, z);
|
||||
WorldGenAbstractTree worldgenabstracttree = biome.func_150567_a(this.randomGenerator);
|
||||
worldgenabstracttree.setScale(1.0D, 1.0D, 1.0D);
|
||||
|
||||
if(worldgenabstracttree.generate(this.currentWorld, this.randomGenerator, x, y, z)) {
|
||||
worldgenabstracttree.func_150524_b(this.currentWorld, this.randomGenerator, x, y, z);
|
||||
}
|
||||
}
|
||||
|
||||
/// TALL GRASS ///
|
||||
doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, GRASS);
|
||||
for(int i = 0; doGen && i < this.grassPerChunk; ++i) {
|
||||
x = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
|
||||
z = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
|
||||
y = nextInt(this.currentWorld.getHeightValue(x, z) * 2);
|
||||
WorldGenerator worldgenerator = biome.getRandomWorldGenForGrass(this.randomGenerator);
|
||||
worldgenerator.generate(this.currentWorld, this.randomGenerator, x, y, z);
|
||||
}
|
||||
|
||||
/// SHRUBBERY ///
|
||||
doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, DEAD_BUSH);
|
||||
for(int i = 0; doGen && i < this.deadBushPerChunk; ++i) {
|
||||
x = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
|
||||
z = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
|
||||
y = nextInt(this.currentWorld.getHeightValue(x, z) * 2);
|
||||
(new WorldGenDeadBush(Blocks.deadbush)).generate(this.currentWorld, this.randomGenerator, x, y, z);
|
||||
}
|
||||
|
||||
/// LAKES ///
|
||||
doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, LAKE);
|
||||
if(doGen && this.generateLakes) {
|
||||
for(int i = 0; i < 50; ++i) {
|
||||
x = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
|
||||
y = this.randomGenerator.nextInt(this.randomGenerator.nextInt(248) + 8);
|
||||
z = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
|
||||
(new WorldGenLiquids(Blocks.flowing_water)).generate(this.currentWorld, this.randomGenerator, x, y, z);
|
||||
}
|
||||
}
|
||||
|
||||
MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Post(currentWorld, randomGenerator, chunk_X, chunk_Z));
|
||||
}
|
||||
|
||||
private int nextInt(int i) {
|
||||
if(i <= 1)
|
||||
return 0;
|
||||
return this.randomGenerator.nextInt(i);
|
||||
}
|
||||
}
|
||||
@ -21,6 +21,7 @@ public class BiomeGenCraterBase extends BiomeGenBase {
|
||||
BiomeDictionary.registerBiomeType(craterOuterBiome, DRY, DEAD, WASTELAND);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getWaterColorMultiplier() {
|
||||
return 0x505020; //0x50d030
|
||||
}
|
||||
@ -65,7 +66,6 @@ public class BiomeGenCraterBase extends BiomeGenBase {
|
||||
|
||||
@Override @SideOnly(Side.CLIENT)
|
||||
public int getSkyColorByTemp(float temp) { return 0x6B9189; }
|
||||
|
||||
}
|
||||
|
||||
public static class BiomeGenCraterInner extends BiomeGenCraterBase {
|
||||
@ -83,6 +83,5 @@ public class BiomeGenCraterBase extends BiomeGenBase {
|
||||
|
||||
@Override @SideOnly(Side.CLIENT)
|
||||
public int getSkyColorByTemp(float temp) { return 0x424A42; }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
61
src/main/java/com/hbm/world/biome/BiomeGenNoMansLand.java
Normal file
@ -0,0 +1,61 @@
|
||||
package com.hbm.world.biome;
|
||||
|
||||
import static net.minecraftforge.common.BiomeDictionary.Type.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.entity.mob.EntityUndeadSoldier;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.entity.EnumCreatureType;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraftforge.common.BiomeDictionary;
|
||||
import net.minecraftforge.common.BiomeManager;
|
||||
import net.minecraftforge.common.BiomeManager.BiomeEntry;
|
||||
import net.minecraftforge.common.BiomeManager.BiomeType;
|
||||
|
||||
public class BiomeGenNoMansLand extends BiomeGenBase {
|
||||
|
||||
public static final BiomeGenBase noMansLand = new BiomeGenNoMansLand(99).setBiomeName("No Man's Land");
|
||||
public static final List EMPTY_LIST = new ArrayList(0);
|
||||
public static final List HOSTILE_LIST = new ArrayList(0);
|
||||
|
||||
public static void initDictionary() {
|
||||
BiomeDictionary.registerBiomeType(noMansLand, DEAD, PLAINS, WASTELAND);
|
||||
BiomeManager.addBiome(BiomeType.WARM, new BiomeEntry(noMansLand, 5));
|
||||
}
|
||||
|
||||
public BiomeGenNoMansLand(int id) {
|
||||
super(id);
|
||||
this.theBiomeDecorator = new BiomeDecoratorNoMansLand();
|
||||
this.waterColorMultiplier = 0x6F6F12;
|
||||
this.spawnableCreatureList.clear();
|
||||
this.spawnableWaterCreatureList.clear();
|
||||
this.spawnableCaveCreatureList.clear();
|
||||
this.setHeight(height_LowPlains);
|
||||
this.theBiomeDecorator.treesPerChunk = -999;
|
||||
this.theBiomeDecorator.flowersPerChunk = 0;
|
||||
this.theBiomeDecorator.grassPerChunk = 0;
|
||||
this.flowers.clear();
|
||||
|
||||
this.HOSTILE_LIST.add(new BiomeGenBase.SpawnListEntry(EntityUndeadSoldier.class, 1, 4, 6));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List getSpawnableList(EnumCreatureType type) {
|
||||
if(type == type.monster) return this.HOSTILE_LIST;
|
||||
if(!EMPTY_LIST.isEmpty()) EMPTY_LIST.clear();
|
||||
return EMPTY_LIST;
|
||||
}
|
||||
|
||||
@Override @SideOnly(Side.CLIENT)
|
||||
public int getBiomeGrassColor(int x, int y, int z) { return 0x696F59; }
|
||||
|
||||
@Override @SideOnly(Side.CLIENT)
|
||||
public int getBiomeFoliageColor(int x, int y, int z) { return 0x767C67; }
|
||||
|
||||
@Override @SideOnly(Side.CLIENT)
|
||||
public int getSkyColorByTemp(float temp) { return 0x949494; }
|
||||
}
|
||||
45
src/main/java/com/hbm/world/feature/WorldGenSurfaceSpot.java
Normal file
@ -0,0 +1,45 @@
|
||||
package com.hbm.world.feature;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.gen.feature.WorldGenerator;
|
||||
|
||||
public class WorldGenSurfaceSpot extends WorldGenerator {
|
||||
|
||||
private Block block;
|
||||
private int radius;
|
||||
private float chance;
|
||||
|
||||
public WorldGenSurfaceSpot(Block block, int radius, float chance) {
|
||||
this.block = block;
|
||||
this.radius = radius;
|
||||
this.chance = chance;
|
||||
}
|
||||
|
||||
public boolean generate(World world, Random rand, int x, int y, int z) {
|
||||
int r = rand.nextInt(this.radius - 2) + 2;
|
||||
byte depth = 2;
|
||||
|
||||
for(int iX = x - r; iX <= x + r; ++iX) {
|
||||
for(int iZ = z - r; iZ <= z + r; ++iZ) {
|
||||
int k1 = iX - x;
|
||||
int l1 = iZ - z;
|
||||
|
||||
if(k1 * k1 + l1 * l1 <= r * r) {
|
||||
for(int iY = y - depth; iY <= y + depth; ++iY) {
|
||||
Block block = world.getBlock(iX, iY, iZ);
|
||||
|
||||
if(block == Blocks.dirt || block == Blocks.grass) {
|
||||
if(rand.nextFloat() < this.chance) world.setBlock(iX, iY, iZ, this.block, 0, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 305 B |
|
Before Width: | Height: | Size: 296 B |
|
Before Width: | Height: | Size: 387 B |
|
Before Width: | Height: | Size: 425 B |
|
Before Width: | Height: | Size: 435 B |
|
Before Width: | Height: | Size: 386 B |
|
Before Width: | Height: | Size: 375 B |
|
Before Width: | Height: | Size: 414 B |
|
Before Width: | Height: | Size: 229 B |
|
Before Width: | Height: | Size: 186 B |
|
Before Width: | Height: | Size: 339 B |
|
Before Width: | Height: | Size: 126 B |
|
Before Width: | Height: | Size: 230 B |
|
Before Width: | Height: | Size: 178 B |
|
Before Width: | Height: | Size: 335 B |
|
Before Width: | Height: | Size: 229 B |
|
Before Width: | Height: | Size: 212 B |
|
Before Width: | Height: | Size: 210 B |
|
Before Width: | Height: | Size: 189 B |
|
Before Width: | Height: | Size: 444 B |
|
Before Width: | Height: | Size: 326 B |
|
Before Width: | Height: | Size: 557 B |
|
Before Width: | Height: | Size: 550 B |
|
Before Width: | Height: | Size: 270 B |
|
Before Width: | Height: | Size: 262 B |
|
Before Width: | Height: | Size: 958 B |
|
Before Width: | Height: | Size: 876 B |
|
Before Width: | Height: | Size: 910 B |
|
Before Width: | Height: | Size: 372 B |
|
Before Width: | Height: | Size: 233 B |
|
Before Width: | Height: | Size: 484 B |