diff --git a/changelog b/changelog index 8bf2eb32a..8ba38aaa3 100644 --- a/changelog +++ b/changelog @@ -3,3 +3,8 @@ * Mud production rates have been halved, to prevent currently working setups from exploding instantly * This is your reminder that you can achieve more power, mud and depletion by building larger watz powerplants, i.e. stacking more watz segments on top of each other. Your tiny poo reactors make me sick. * Watz pellets now have a 50% smaller yield, halving the expected time until depletion +* Adjusted the nuclear flash's intensity, the flash will now deal less and less radiation the longer it goes on +* The nuclear flash now bypasses radiation resistance, being only affected by blocks and distance + +## Fixed +* Fixed a rare crash caused by radars force-loading chunks conflicting with certain mods' chunk loading changes diff --git a/src/main/java/com/hbm/config/CommonConfig.java b/src/main/java/com/hbm/config/CommonConfig.java index 578f98bef..8d809ccf4 100644 --- a/src/main/java/com/hbm/config/CommonConfig.java +++ b/src/main/java/com/hbm/config/CommonConfig.java @@ -25,6 +25,7 @@ public class CommonConfig { public static final String CATEGORY_HAZARD = "14_hazard"; public static final String CATEGORY_STRUCTURES = "15_structures"; public static final String CATEGORY_POLLUTION = "16_pollution"; + public static final String CATEGORY_BIOMES = "17_biomes"; public static final String CATEGORY_528 = "528"; public static final String CATEGORY_LBSM = "LESS BULLSHIT MODE"; diff --git a/src/main/java/com/hbm/config/FalloutConfigJSON.java b/src/main/java/com/hbm/config/FalloutConfigJSON.java index eba732a84..de787053b 100644 --- a/src/main/java/com/hbm/config/FalloutConfigJSON.java +++ b/src/main/java/com/hbm/config/FalloutConfigJSON.java @@ -55,13 +55,8 @@ public class FalloutConfigJSON { private static void initDefault() { double woodEffectRange = 65D; - /* destroy all leaves within the radios, kill all leaves outside of it */ - entries.add(new FalloutEntry() .mB(Blocks.leaves) .prim(new Triplet(Blocks.air, 0, 1)) .max(woodEffectRange)); - entries.add(new FalloutEntry() .mB(Blocks.leaves2) .prim(new Triplet(Blocks.air, 0, 1)) .max(woodEffectRange)); - entries.add(new FalloutEntry() .mB(ModBlocks.waste_leaves) .prim(new Triplet(Blocks.air, 0, 1)) .max(woodEffectRange)); - entries.add(new FalloutEntry() .mB(Blocks.leaves) .prim(new Triplet(ModBlocks.waste_leaves, 0, 1)) .min(woodEffectRange)); - entries.add(new FalloutEntry() .mB(Blocks.leaves2) .prim(new Triplet(ModBlocks.waste_leaves, 0, 1)) .min(woodEffectRange)); + /* petrify all wooden things possible */ entries.add(new FalloutEntry() .mB(Blocks.log) .prim(new Triplet(ModBlocks.waste_log, 0, 1)) .max(woodEffectRange)); entries.add(new FalloutEntry() .mB(Blocks.log2) .prim(new Triplet(ModBlocks.waste_log, 0, 1)) .max(woodEffectRange)); entries.add(new FalloutEntry() .mB(Blocks.red_mushroom_block).mM(10) .prim(new Triplet(ModBlocks.waste_log, 0, 1)) .max(woodEffectRange)); @@ -69,24 +64,33 @@ public class FalloutConfigJSON { entries.add(new FalloutEntry() .mB(Blocks.red_mushroom_block) .prim(new Triplet(Blocks.air, 0, 1)) .max(woodEffectRange)); entries.add(new FalloutEntry() .mB(Blocks.brown_mushroom_block) .prim(new Triplet(Blocks.air, 0, 1)) .max(woodEffectRange)); entries.add(new FalloutEntry() .mB(Blocks.planks) .prim(new Triplet(ModBlocks.waste_planks, 0, 1)) .max(woodEffectRange)); - - FalloutEntry stoneCore = new FalloutEntry().prim(new Triplet(ModBlocks.sellafield, 1, 1)).max(5).sol(true); - FalloutEntry stoneInner = new FalloutEntry().prim(new Triplet(ModBlocks.sellafield, 0, 1)).min(5).max(15).sol(true); - FalloutEntry stoneOuter = new FalloutEntry().prim(new Triplet(ModBlocks.sellafield_slaked, 0, 1)).min(15).max(50).sol(true); + /* if it can't be petrified, destroy it */ + entries.add(new FalloutEntry() .mMa(Material.wood) .prim(new Triplet(Blocks.air, 0, 1)) .max(woodEffectRange)); + /* destroy all leaves within the radios, kill all leaves outside of it */ + entries.add(new FalloutEntry() .mMa(Material.leaves) .prim(new Triplet(Blocks.air, 0, 1)) .max(woodEffectRange)); + entries.add(new FalloutEntry() .mMa(Material.plants) .prim(new Triplet(Blocks.air, 0, 1)) .max(woodEffectRange)); + entries.add(new FalloutEntry() .mB(ModBlocks.waste_leaves) .prim(new Triplet(Blocks.air, 0, 1)) .max(woodEffectRange)); + entries.add(new FalloutEntry() .mB(Blocks.leaves) .prim(new Triplet(ModBlocks.waste_leaves, 0, 1)) .min(woodEffectRange)); + entries.add(new FalloutEntry() .mB(Blocks.leaves2) .prim(new Triplet(ModBlocks.waste_leaves, 0, 1)) .min(woodEffectRange)); - entries.add(stoneCore.clone().mB(Blocks.stone)); - entries.add(stoneInner.clone().mB(Blocks.stone)); + + entries.add(new FalloutEntry().prim(new Triplet(ModBlocks.sellafield_slaked, 0, 1)).max(35).sol(true).mMa(Material.ground)); + + //FalloutEntry stoneCore = new FalloutEntry().prim(new Triplet(ModBlocks.sellafield, 1, 1)).max(5).sol(true); + //FalloutEntry stoneInner = new FalloutEntry().prim(new Triplet(ModBlocks.sellafield, 0, 1)).min(5).max(15).sol(true); + FalloutEntry stoneOuter = new FalloutEntry().prim(new Triplet(ModBlocks.sellafield_slaked, 0, 1)).max(50).sol(true); + + //entries.add(stoneCore.clone().mB(Blocks.stone)); + //entries.add(stoneInner.clone().mB(Blocks.stone)); entries.add(stoneOuter.clone().mB(Blocks.stone)); - entries.add(stoneCore.clone().mB(Blocks.gravel)); - entries.add(stoneInner.clone().mB(Blocks.gravel)); + //entries.add(stoneCore.clone().mB(Blocks.gravel)); + //entries.add(stoneInner.clone().mB(Blocks.gravel)); entries.add(stoneOuter.clone().mB(Blocks.gravel)); /* recontaminate slaked sellafield */ - entries.add(stoneCore.clone().mB(ModBlocks.sellafield_slaked)); - entries.add(stoneInner.clone().mB(ModBlocks.sellafield_slaked)); + //entries.add(stoneCore.clone().mB(ModBlocks.sellafield_slaked)); + //entries.add(stoneInner.clone().mB(ModBlocks.sellafield_slaked)); - entries.add(new FalloutEntry() - .mB(Blocks.grass) - .prim(new Triplet(ModBlocks.waste_earth, 0, 1))); + //entries.add(new FalloutEntry().mB(Blocks.grass).prim(new Triplet(ModBlocks.waste_earth, 0, 1))); entries.add(new FalloutEntry() .mB(Blocks.mycelium) .prim(new Triplet(ModBlocks.waste_mycelium, 0, 1))); @@ -125,14 +129,14 @@ public class FalloutConfigJSON { /// COMPAT /// Block deepslate = Compat.tryLoadBlock(Compat.MOD_EF, "deepslate"); if(deepslate != null) { //identical to stone - entries.add(stoneCore.clone().mB(deepslate)); - entries.add(stoneInner.clone().mB(deepslate)); + //entries.add(stoneCore.clone().mB(deepslate)); + //entries.add(stoneInner.clone().mB(deepslate)); entries.add(stoneOuter.clone().mB(deepslate)); } Block stone = Compat.tryLoadBlock(Compat.MOD_EF, "stone"); if(stone != null) { //identical to stone - entries.add(stoneCore.clone().mB(stone)); - entries.add(stoneInner.clone().mB(stone)); + //entries.add(stoneCore.clone().mB(stone)); + //entries.add(stoneInner.clone().mB(stone)); entries.add(stoneOuter.clone().mB(stone)); } } @@ -191,6 +195,7 @@ public class FalloutConfigJSON { private double minDist = 0.0D; private double maxDist = 100.0D; + /** Whether the depth value should be decremented when this block is converted */ private boolean isSolid = false; public FalloutEntry clone() { diff --git a/src/main/java/com/hbm/config/WorldConfig.java b/src/main/java/com/hbm/config/WorldConfig.java index 46add586c..30b356306 100644 --- a/src/main/java/com/hbm/config/WorldConfig.java +++ b/src/main/java/com/hbm/config/WorldConfig.java @@ -107,6 +107,10 @@ public class WorldConfig { public static int meteorStrikeChance = 20 * 60 * 180; public static int meteorShowerChance = 20 * 60 * 5; public static int meteorShowerDuration = 6000; + + public static int craterBiomeId = 80; + public static int craterBiomeInnerId = 81; + public static int craterBiomeOuterId = 82; public static void loadFromConfig(Configuration config) { @@ -218,6 +222,11 @@ public class WorldConfig { meteorShowerChance = CommonConfig.createConfigInt(config, CATEGORY_METEOR, "5.04_meteorShowerChance", "The probability of a meteor spawning during meteor shower (an average of once every nTH ticks)", 20 * 60 * 15); meteorShowerDuration = CommonConfig.createConfigInt(config, CATEGORY_METEOR, "5.05_meteorShowerDuration", "Max duration of meteor shower in ticks", 20 * 60 * 30); + final String CATEGORY_BIOMES = CommonConfig.CATEGORY_BIOMES; + craterBiomeId = CommonConfig.createConfigInt(config, CATEGORY_METEOR, "17.00_craterBiomeId", "The numeric ID for the crater biome", 80); + craterBiomeInnerId = CommonConfig.createConfigInt(config, CATEGORY_METEOR, "17.01_craterBiomeInnerId", "The numeric ID for the inner crater biome", 81); + craterBiomeOuterId = CommonConfig.createConfigInt(config, CATEGORY_METEOR, "17.02_craterBiomeOuterId", "The numeric ID for the outer crater biome", 82); + radioStructure = CommonConfig.setDefZero(radioStructure, 1000); antennaStructure = CommonConfig.setDefZero(antennaStructure, 1000); atomStructure = CommonConfig.setDefZero(atomStructure, 1000); diff --git a/src/main/java/com/hbm/entity/effect/EntityFalloutRain.java b/src/main/java/com/hbm/entity/effect/EntityFalloutRain.java index 35b0c595a..2ce57ccfe 100644 --- a/src/main/java/com/hbm/entity/effect/EntityFalloutRain.java +++ b/src/main/java/com/hbm/entity/effect/EntityFalloutRain.java @@ -7,7 +7,7 @@ import com.hbm.config.FalloutConfigJSON.FalloutEntry; import com.hbm.entity.item.EntityFallingBlockNT; import com.hbm.saveddata.AuxSavedData; import com.hbm.world.WorldUtil; -import com.hbm.world.biome.BiomeGenCrater; +import com.hbm.world.biome.BiomeGenCraterBase; import net.minecraft.block.Block; import net.minecraft.block.material.Material; @@ -17,6 +17,7 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.Vec3; import net.minecraft.world.ChunkCoordIntPair; import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; import net.minecraft.world.storage.WorldInfo; import net.minecraftforge.common.util.ForgeDirection; @@ -57,28 +58,40 @@ public class EntityFalloutRain extends Entity { long chunkPos = chunksToProcess.remove(chunksToProcess.size() - 1); // Just so it doesn't shift the whole list every time int chunkPosX = (int) (chunkPos & Integer.MAX_VALUE); int chunkPosZ = (int) (chunkPos >> 32 & Integer.MAX_VALUE); + boolean biomeModified = false; for(int x = chunkPosX << 4; x <= (chunkPosX << 4) + 16; x++) { for(int z = chunkPosZ << 4; z <= (chunkPosZ << 4) + 16; z++) { - stomp(x, z, Math.hypot(x - posX, z - posZ) * 100 / getScale()); - //WorldUtil.setBiome(worldObj, x, z, BiomeGenCrater.craterBiome); + double percent = Math.hypot(x - posX, z - posZ) * 100 / getScale(); + stomp(x, z, percent); + BiomeGenBase biome = getBiomeChange(percent, getScale()); + if(biome != null) { + WorldUtil.setBiome(worldObj, x, z, biome); + biomeModified = true; + } } } - //WorldUtil.syncBiomeChange(worldObj, chunkPosX, chunkPosZ); + if(biomeModified) WorldUtil.syncBiomeChange(worldObj, chunkPosX << 4, chunkPosZ << 4); } else if (!outerChunksToProcess.isEmpty()) { long chunkPos = outerChunksToProcess.remove(outerChunksToProcess.size() - 1); int chunkPosX = (int) (chunkPos & Integer.MAX_VALUE); int chunkPosZ = (int) (chunkPos >> 32 & Integer.MAX_VALUE); + boolean biomeModified = false; for(int x = chunkPosX << 4; x <= (chunkPosX << 4) + 16; x++) { for(int z = chunkPosZ << 4; z <= (chunkPosZ << 4) + 16; z++) { double distance = Math.hypot(x - posX, z - posZ); if(distance <= getScale()) { - stomp(x, z, distance * 100 / getScale()); - //WorldUtil.setBiome(worldObj, x, z, BiomeGenCrater.craterBiome); + double percent = distance * 100 / getScale(); + stomp(x, z, percent); + BiomeGenBase biome = getBiomeChange(percent, getScale()); + if(biome != null) { + WorldUtil.setBiome(worldObj, x, z, biome); + biomeModified = true; + } } } } - //WorldUtil.syncBiomeChange(worldObj, chunkPosX, chunkPosZ); + if(biomeModified) WorldUtil.syncBiomeChange(worldObj, chunkPosX << 4, chunkPosZ << 4); } else { setDead(); @@ -99,6 +112,13 @@ public class EntityFalloutRain extends Entity { } } } + + public static BiomeGenBase getBiomeChange(double dist, int scale) { + if(scale >= 150 && dist < 15) return BiomeGenCraterBase.craterInnerBiome; + if(scale >= 100 && dist < 50) return BiomeGenCraterBase.craterBiome; + if(scale >= 25) return BiomeGenCraterBase.craterOuterBiome; + return null; + } private final List chunksToProcess = new ArrayList<>(); private final List outerChunksToProcess = new ArrayList<>(); @@ -129,25 +149,21 @@ public class EntityFalloutRain extends Entity { Collections.reverse(outerChunksToProcess); } - //private List changedPositions = new ArrayList(); - - // TODO cache chunks? private void stomp(int x, int z, double dist) { int depth = 0; for(int y = 255; y >= 0; y--) { - if(depth >= 3) - return; + if(depth >= 3) return; Block b = worldObj.getBlock(x, y, z); + + if(b.getMaterial() == Material.air) continue; + Block ab = worldObj.getBlock(x, y + 1, z); int meta = worldObj.getBlockMetadata(x, y, z); - if(b.getMaterial() == Material.air) - continue; - if(b != ModBlocks.fallout && (ab == Blocks.air || (ab.isReplaceable(worldObj, x, y + 1, z) && !ab.getMaterial().isLiquid()))) { double d = dist / 100; diff --git a/src/main/java/com/hbm/entity/logic/EntityNukeExplosionMK5.java b/src/main/java/com/hbm/entity/logic/EntityNukeExplosionMK5.java index 15cb2679b..90596a9af 100644 --- a/src/main/java/com/hbm/entity/logic/EntityNukeExplosionMK5.java +++ b/src/main/java/com/hbm/entity/logic/EntityNukeExplosionMK5.java @@ -63,7 +63,7 @@ public class EntityNukeExplosionMK5 extends EntityExplosionChunkloading { } if(!worldObj.isRemote && fallout && explosion != null && this.ticksExisted < 10) { - radiate(500_000, this.length * 2); + radiate(2_500_000F / (this.ticksExisted * 5 + 1), this.length * 2); } if(!mute) { @@ -131,7 +131,7 @@ public class EntityNukeExplosionMK5 extends EntityExplosionChunkloading { eRads /= (float)res; eRads /= (float)(len * len); - ContaminationUtil.contaminate(e, HazardType.RADIATION, ContaminationType.CREATIVE, eRads); + ContaminationUtil.contaminate(e, HazardType.RADIATION, ContaminationType.RAD_BYPASS, eRads); } } diff --git a/src/main/java/com/hbm/items/tool/ItemWandD.java b/src/main/java/com/hbm/items/tool/ItemWandD.java index 64d5158ce..05f3e197f 100644 --- a/src/main/java/com/hbm/items/tool/ItemWandD.java +++ b/src/main/java/com/hbm/items/tool/ItemWandD.java @@ -3,12 +3,10 @@ package com.hbm.items.tool; import java.util.List; import com.hbm.lib.Library; -import com.hbm.saveddata.TomSaveData; import com.hbm.world.WorldUtil; -import com.hbm.world.biome.BiomeGenCrater; +import com.hbm.world.biome.BiomeGenCraterBase; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.MovingObjectPosition; @@ -49,12 +47,13 @@ public class ItemWandD extends Item { data.dust = 0F; data.markDirty();*/ - /*for(int i = -5; i <= 5; i++) { + for(int i = -5; i <= 5; i++) { for(int j = -5; j <= 5; j++) { - WorldUtil.setBiome(world, pos.blockX + i, pos.blockZ + j, BiomeGenCrater.craterBiome); - WorldUtil.syncBiomeChangeBlock(world, pos.blockX + i, pos.blockZ + j); + WorldUtil.setBiome(world, pos.blockX + i, pos.blockZ + j, BiomeGenCraterBase.craterBiome); } - }*/ + } + + WorldUtil.syncBiomeChange(world, pos.blockX, pos.blockZ); /*EntityTomBlast tom = new EntityTomBlast(world); tom.posX = pos.blockX; diff --git a/src/main/java/com/hbm/main/MainRegistry.java b/src/main/java/com/hbm/main/MainRegistry.java index c9b458f71..050d0c61a 100644 --- a/src/main/java/com/hbm/main/MainRegistry.java +++ b/src/main/java/com/hbm/main/MainRegistry.java @@ -47,6 +47,7 @@ import com.hbm.tileentity.machine.TileEntityMachineReactorLarge; import com.hbm.tileentity.machine.TileEntityNukeFurnace; import com.hbm.tileentity.machine.rbmk.RBMKDials; import com.hbm.util.*; +import com.hbm.world.biome.BiomeGenCraterBase; import com.hbm.world.feature.BedrockOre; import com.hbm.world.feature.OreCave; import com.hbm.world.feature.OreLayer3D; @@ -294,6 +295,8 @@ public class MainRegistry { MinecraftForge.EVENT_BUS.register(oreMan); //OreRegisterEvent OreDictManager.registerGroups(); //important to run first OreDictManager.registerOres(); + + BiomeGenCraterBase.initDictionary(); Library.superuser.add("192af5d7-ed0f-48d8-bd89-9d41af8524f8"); Library.superuser.add("5aee1e3d-3767-4987-a222-e7ce1fbdf88e"); diff --git a/src/main/java/com/hbm/main/ModEventHandlerRenderer.java b/src/main/java/com/hbm/main/ModEventHandlerRenderer.java index 50156b735..47431818c 100644 --- a/src/main/java/com/hbm/main/ModEventHandlerRenderer.java +++ b/src/main/java/com/hbm/main/ModEventHandlerRenderer.java @@ -10,6 +10,7 @@ import com.hbm.items.armor.IArmorDisableModel; import com.hbm.items.armor.IArmorDisableModel.EnumPlayerPart; import com.hbm.packet.PermaSyncHandler; import com.hbm.render.model.ModelMan; +import com.hbm.world.biome.BiomeGenCraterBase; import cpw.mods.fml.common.eventhandler.EventPriority; import cpw.mods.fml.common.eventhandler.SubscribeEvent; @@ -27,6 +28,8 @@ import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.util.MathHelper; import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraftforge.client.ForgeHooksClient; import net.minecraftforge.client.event.DrawBlockHighlightEvent; import net.minecraftforge.client.event.RenderGameOverlayEvent; import net.minecraftforge.client.event.EntityViewRenderEvent.FogColors; @@ -369,6 +372,17 @@ public class ModEventHandlerRenderer { @SubscribeEvent(priority = EventPriority.LOW) public void tintFog(FogColors event) { + + EntityPlayer player = MainRegistry.proxy.me(); + BiomeGenBase biome = player.worldObj.getBiomeGenForCoords((int) Math.floor(player.posX), (int) Math.floor(player.posZ)); + + if(biome instanceof BiomeGenCraterBase) { + int color = ForgeHooksClient.getSkyBlendColour(player.worldObj, (int) Math.floor(player.posX), (int) Math.floor(player.posY), (int) Math.floor(player.posZ)); + event.red = ((color & 0xff0000) >> 16) / 255F; + event.green = ((color & 0x00ff00) >> 8) / 255F; + event.blue = (color & 0x0000ff) / 255F; + } + float soot = (float) (renderSoot - RadiationConfig.sootFogThreshold); float sootColor = 0.15F; float sootReq = (float) RadiationConfig.sootFogDivisor; diff --git a/src/main/java/com/hbm/util/ContaminationUtil.java b/src/main/java/com/hbm/util/ContaminationUtil.java index c09b3ba4a..63689591b 100644 --- a/src/main/java/com/hbm/util/ContaminationUtil.java +++ b/src/main/java/com/hbm/util/ContaminationUtil.java @@ -254,7 +254,7 @@ public class ContaminationUtil { DIGAMMA, //preventable by fau armor or stability DIGAMMA2, //preventable by robes CREATIVE, //preventable by creative mode, for rad calculation armor piece bonuses still apply - RAD_BYPASS, //same as craative but will not apply radiation resistance calculation + RAD_BYPASS, //same as creative but will not apply radiation resistance calculation NONE //not preventable } diff --git a/src/main/java/com/hbm/world/WorldUtil.java b/src/main/java/com/hbm/world/WorldUtil.java index ef9c0f361..b06cf9d86 100644 --- a/src/main/java/com/hbm/world/WorldUtil.java +++ b/src/main/java/com/hbm/world/WorldUtil.java @@ -26,7 +26,7 @@ public class WorldUtil { public static void syncBiomeChange(World world, int x, int z) { Chunk chunk = world.getChunkFromBlockCoords(x, z); - PacketDispatcher.wrapper.sendToAllAround(new BiomeSyncPacket(x, z, chunk.getBiomeArray()), new TargetPoint(world.provider.dimensionId, x, 128, z, 1024D)); + PacketDispatcher.wrapper.sendToAllAround(new BiomeSyncPacket(x >> 4, z >> 4, chunk.getBiomeArray()), new TargetPoint(world.provider.dimensionId, x, 128, z, 1024D)); } public static void syncBiomeChangeBlock(World world, int x, int z) { @@ -83,10 +83,14 @@ public class WorldUtil { } public static Chunk provideChunk(WorldServer world, int chunkX, int chunkZ) { - ChunkProviderServer provider = world.theChunkProviderServer; - Chunk chunk = (Chunk) provider.loadedChunkHashMap.getValueByKey(ChunkCoordIntPair.chunkXZ2Int(chunkX, chunkZ)); - if(chunk != null) return chunk; - return loadChunk(world, provider, chunkX, chunkZ); + try { + ChunkProviderServer provider = world.theChunkProviderServer; + Chunk chunk = (Chunk) provider.loadedChunkHashMap.getValueByKey(ChunkCoordIntPair.chunkXZ2Int(chunkX, chunkZ)); + if(chunk != null) return chunk; + return loadChunk(world, provider, chunkX, chunkZ); + } catch(Throwable x) { + return null; + } } private static Chunk loadChunk(WorldServer world, ChunkProviderServer provider, int chunkX, int chunkZ) { diff --git a/src/main/java/com/hbm/world/biome/BiomeGenCrater.java b/src/main/java/com/hbm/world/biome/BiomeGenCrater.java deleted file mode 100644 index e3d5e7876..000000000 --- a/src/main/java/com/hbm/world/biome/BiomeGenCrater.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.hbm.world.biome; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import net.minecraft.world.biome.BiomeGenBase; - -public class BiomeGenCrater extends BiomeGenBase { - - //public static final BiomeGenBase craterBiome = new BiomeGenCrater(50 /* TEMP */).setDisableRain(); - - public BiomeGenCrater(int id) { - super(id); - this.waterColorMultiplier = 0xE0FFAE; //swamp color - this.setBiomeName("Crater"); - } - - @Override - @SideOnly(Side.CLIENT) - public int getBiomeGrassColor(int x, int y, int z) { - double noise = plantNoise.func_151601_a((double) x * 0.225D, (double) z * 0.225D); - return noise < -0.1D ? 0x606060 : 0x505050; - } - - @Override - @SideOnly(Side.CLIENT) - public int getBiomeFoliageColor(int x, int y, int z) { - return 0x6A7039; - } - - @Override - @SideOnly(Side.CLIENT) - public int getSkyColorByTemp(float temp) { - //return 0x66BBA9; - return 0x6B9189; - } -} diff --git a/src/main/java/com/hbm/world/biome/BiomeGenCraterBase.java b/src/main/java/com/hbm/world/biome/BiomeGenCraterBase.java new file mode 100644 index 000000000..6f3afd39a --- /dev/null +++ b/src/main/java/com/hbm/world/biome/BiomeGenCraterBase.java @@ -0,0 +1,83 @@ +package com.hbm.world.biome; + +import com.hbm.config.WorldConfig; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraftforge.common.BiomeDictionary; +import static net.minecraftforge.common.BiomeDictionary.Type.*; + +public class BiomeGenCraterBase extends BiomeGenBase { + + public static final BiomeGenBase craterBiome = new BiomeGenCrater(WorldConfig.craterBiomeId).setDisableRain().setBiomeName("Crater"); + public static final BiomeGenBase craterInnerBiome = new BiomeGenCraterInner(WorldConfig.craterBiomeInnerId).setDisableRain().setBiomeName("Inner Crater"); + public static final BiomeGenBase craterOuterBiome = new BiomeGenCraterOuter(WorldConfig.craterBiomeOuterId).setDisableRain().setBiomeName("Outer Crater"); + + public static void initDictionary() { + BiomeDictionary.registerBiomeType(craterBiome, DRY, DEAD, WASTELAND); + BiomeDictionary.registerBiomeType(craterInnerBiome, DRY, DEAD, WASTELAND); + BiomeDictionary.registerBiomeType(craterOuterBiome, DRY, DEAD, WASTELAND); + } + + public BiomeGenCraterBase(int id) { + super(id); + this.waterColorMultiplier = 0xE0FFAE; //swamp color + this.spawnableCreatureList.clear(); + this.spawnableWaterCreatureList.clear(); + this.spawnableCaveCreatureList.clear(); + } + + public static class BiomeGenCrater extends BiomeGenCraterBase { + + public BiomeGenCrater(int id) { super(id); } + + @Override @SideOnly(Side.CLIENT) + public int getBiomeGrassColor(int x, int y, int z) { + double noise = plantNoise.func_151601_a((double) x * 0.225D, (double) z * 0.225D); + return noise < -0.1D ? 0x606060 : 0x505050; + } + + @Override @SideOnly(Side.CLIENT) + public int getBiomeFoliageColor(int x, int y, int z) { return 0x6A7039; } + + @Override @SideOnly(Side.CLIENT) + public int getSkyColorByTemp(float temp) { return 0x525A52; } + } + + public static class BiomeGenCraterOuter extends BiomeGenCraterBase { + + public BiomeGenCraterOuter(int id) { super(id); } + + @Override @SideOnly(Side.CLIENT) + public int getBiomeGrassColor(int x, int y, int z) { + double noise = plantNoise.func_151601_a((double) x * 0.225D, (double) z * 0.225D); + return noise < -0.1D ? 0x776F59 : 0x6F6752; + } + + @Override @SideOnly(Side.CLIENT) + public int getBiomeFoliageColor(int x, int y, int z) { return 0x6A7039; } + + @Override @SideOnly(Side.CLIENT) + public int getSkyColorByTemp(float temp) { return 0x6B9189; } + + } + + public static class BiomeGenCraterInner extends BiomeGenCraterBase { + + public BiomeGenCraterInner(int id) { super(id); } + + @Override @SideOnly(Side.CLIENT) + public int getBiomeGrassColor(int x, int y, int z) { + double noise = plantNoise.func_151601_a((double) x * 0.225D, (double) z * 0.225D); + return noise < -0.1D ? 0x404040 : 0x303030; + } + + @Override @SideOnly(Side.CLIENT) + public int getBiomeFoliageColor(int x, int y, int z) { return 0x6A7039; } + + @Override @SideOnly(Side.CLIENT) + public int getSkyColorByTemp(float temp) { return 0x424A42; } + + } +} diff --git a/src/main/resources/assets/hbm/lang/en_US.lang b/src/main/resources/assets/hbm/lang/en_US.lang index 33604be1b..80aae005a 100644 --- a/src/main/resources/assets/hbm/lang/en_US.lang +++ b/src/main/resources/assets/hbm/lang/en_US.lang @@ -5109,7 +5109,7 @@ tile.machine_forcefield.name=Forcefield Emitter tile.machine_fraction_tower.name=Fractioning Tower tile.machine_fracking_tower.name=Hydraulic Fracking Tower tile.machine_funnel.name=Combinator Funnel -tile.machine_funnel.desc=Automatically compresses items in a 2x2 or 3x3 crafting grid$Top: Input$Bottom: Output$Side: Output for clearing incredients +tile.machine_funnel.desc=Automatically compresses items in a 2x2 or 3x3 crafting grid$Top: Input$Bottom: Output$Side: Output for clearing ingredients tile.machine_gascent.name=Gas Centrifuge tile.machine_generator.name=Nuclear Reactor (Old) tile.machine_geo.name=Geothermal Electric Generator