From 65d6df374191d074e82e8c54e47738902d1f61d8 Mon Sep 17 00:00:00 2001 From: 9Valjews <64272884+9Valjew@users.noreply.github.com> Date: Sat, 30 Dec 2023 16:04:07 +0200 Subject: [PATCH 1/4] The satellitening part 1 --- .../tileentity/machine/TileEntityMachineRadarNT.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineRadarNT.java b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineRadarNT.java index 93d4a8218..357779cc7 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineRadarNT.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineRadarNT.java @@ -22,6 +22,7 @@ import com.hbm.main.MainRegistry; import com.hbm.saveddata.SatelliteSavedData; import com.hbm.saveddata.satellites.Satellite; import com.hbm.saveddata.satellites.Satellite.Interfaces; +import com.hbm.saveddata.satellites.SatelliteHorizons; import com.hbm.saveddata.satellites.SatelliteLaser; import com.hbm.tileentity.IConfigurableMachine; import com.hbm.tileentity.IGUIProvider; @@ -428,6 +429,16 @@ public class TileEntityMachineRadarNT extends TileEntityMachineBase implements I sat.onClick(world, x, z); } } + if(sat instanceof SatelliteHorizons) { + if(data.hasKey("launchPosX")) { + int x = data.getInteger("launchPosX"); + int z = data.getInteger("launchPosZ"); + int y = 60; //one day I will make radars transmit Y coordinate as well and you will be butchered alhamdulila + worldObj.playSoundAtEntity(player, "hbm:item.techBleep", 1.0F, 1.0F); + sat.onCoordAction(world,player,x,y,z); + } + + } } From c2fb48cb59d567c76184b25782fd3025d14b7c6c Mon Sep 17 00:00:00 2001 From: Doctor17-git <60807716+Doctor17-git@users.noreply.github.com> Date: Tue, 9 Jan 2024 13:15:07 +0300 Subject: [PATCH 2/4] Updated ru_RU.lang updated russian localization --- src/main/resources/assets/hbm/lang/ru_RU.lang | 28 +++++++++++-------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/src/main/resources/assets/hbm/lang/ru_RU.lang b/src/main/resources/assets/hbm/lang/ru_RU.lang index 38f25617b..82de31e27 100644 --- a/src/main/resources/assets/hbm/lang/ru_RU.lang +++ b/src/main/resources/assets/hbm/lang/ru_RU.lang @@ -1987,6 +1987,9 @@ container.assembler=Сборочная машина tile.machine_assemfac.name=Сборочный завод tile.machine_autocrafter.name=Стол автокрафта container.autocrafter=Стол автокрафта +container.machineFunnel=Комбинаторная воронка +tile.machine_funnel.name=Комбинаторная воронка +tile.machine_funnel.descАвтоматически сжимает предметы в сетке 2x2 или 3x3 для крафтинга$Верх: Вход$Низ: Выход$Бок: Выход для очистки ингредиентов tile.machine_chemplant.name=Химическая установка container.chemplant=Химическая установка tile.machine_chemfac.name=Химический завод @@ -2431,6 +2434,16 @@ tile.rail_wood.name=Деревянные рельсы container.trainTram=Трамвай с плоской платформой item.train.cargo_tram.name=Трамвай с плоской платформой +tile.rail_large_buffer.name=Стандартный буферный упорный рельс (5м) +tile.rail_large_curve.name=Стандартная кривая колея (5м) +tile.rail_large_curve_7.name=Стандартная кривая колея (7м) +tile.rail_large_curve_9.name=Стандартная кривая рельса (9м) +tile.rail_large_ramp.name=Стандартная рампа (5м) +tile.rail_large_straight.name=Стандартная колея (5м) +tile.rail_large_straight_short.name=Стандартная колея (1м) +tile.rail_large_switch.name=Переключатель стандартной колеи (15м, левый) +tile.rail_large_switch_flipped.name=Переключатель стандартной колеи (15м, правый) + tile.factory_titanium_hull.name=Корпус базовой фабрики tile.factory_titanium_furnace.name=Люк доступа базовой фабрики tile.factory_titanium_conductor.name=Порт электричества базовой фабрики @@ -2750,11 +2763,10 @@ item.ingot_polymer.name=Полимер item.ingot_rubber.name=Резина item.ingot_biorubber.name=Брусок латекса item.ingot_polonium.name=Слиток полония-210 -item.bolt_dura_steel.name=Высокоскоростной стальной стержень item.pipes_steel.name=Стальные трубы item.pipes_steel.desc=Раскрафт был исключен из-за уклонения от уплаты налогов item.drill_titanium.name=Титановый бур -item.bolt_tungsten.name=Вольфрамовый стержень +item.bolt.name=%s стержень item.bolt_compound.name=Укрепленный вал турбины item.plate_polymer.name=Изолятор item.ingot_solinium.name=Солиниевый слиток @@ -5118,17 +5130,8 @@ item.mp_thruster_20_solid.name=Твердотопливный ракетный item.mp_thruster_20_solid_multi.name=Твердотопливные 30-сопловые двигатели 20-го размера item.mp_thruster_20_solid_multier.name=Твердотопливные 47-сопловые двигатели 20-го размера -item.missile_skin_camo.name=Скин Ракеты: Камуфляж -item.missile_skin_desert.name=Скин Ракеты: Пустынный Камуфляж -item.missile_skin_flames.name=Скин Ракеты: Sick Flames -item.missile_skin_manly_pink.name=Скин Ракеты: Мужественный Розовый -item.missile_skin_orange_insulation.name=Скин Ракеты: Оранжевый Изолятор -item.missile_skin_sleek.name=Скин Ракеты: IF-R&D -item.missile_skin_soviet_glory.name=Скин Ракеты: Советская Слава -item.missile_skin_soviet_stank.name=Скин Ракеты: Советская Вонь -item.missile_skin_metal.name=Скин Ракеты: Металл - item.missile_custom.name=Пользовательская Ракета +item.missile_stealth.name=Стелс-ракета item.missile_carrier.name=Ракета-носитель HTR-01 item.missile_soyuz.name=Союз-ФГ @@ -5147,6 +5150,7 @@ item.sat_chip.name=Спутниковый ID-чип item.sat_interface.name=Интерфейс спутникового управления item.sat_coord.name=Спутниковый целеуказатель item.sat_designator.name=Спутниковый лазерный целеуказатель +item.sat_relay.name=Спутниковый радарный передатчик tile.sat_mapper.name=Спутник для картографирования поверхности (Декор) tile.sat_scanner.name=Спутник с модулем глубинно-ресурсного сканирования (Декор) tile.sat_radar.name=Спутник с радиолокационным зондированием (Декор) From e3d167ff01dc317004635af4c4491b3eb8b0448e Mon Sep 17 00:00:00 2001 From: Boblet Date: Tue, 9 Jan 2024 13:08:15 +0100 Subject: [PATCH 3/4] yeag --- changelog | 5 ++ .../java/com/hbm/config/CommonConfig.java | 1 + .../com/hbm/config/FalloutConfigJSON.java | 51 +++++++----- src/main/java/com/hbm/config/WorldConfig.java | 9 ++ .../hbm/entity/effect/EntityFalloutRain.java | 46 ++++++---- .../entity/logic/EntityNukeExplosionMK5.java | 4 +- .../java/com/hbm/items/tool/ItemWandD.java | 13 ++- src/main/java/com/hbm/main/MainRegistry.java | 3 + .../com/hbm/main/ModEventHandlerRenderer.java | 14 ++++ .../java/com/hbm/util/ContaminationUtil.java | 2 +- src/main/java/com/hbm/world/WorldUtil.java | 14 ++-- .../com/hbm/world/biome/BiomeGenCrater.java | 36 -------- .../hbm/world/biome/BiomeGenCraterBase.java | 83 +++++++++++++++++++ src/main/resources/assets/hbm/lang/en_US.lang | 2 +- 14 files changed, 193 insertions(+), 90 deletions(-) delete mode 100644 src/main/java/com/hbm/world/biome/BiomeGenCrater.java create mode 100644 src/main/java/com/hbm/world/biome/BiomeGenCraterBase.java 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 From abf0b858e6e072b79d36d617b6ec979cba35397d Mon Sep 17 00:00:00 2001 From: Bob Date: Tue, 9 Jan 2024 21:45:46 +0100 Subject: [PATCH 4/4] sellafite variants, some torex tests --- changelog | 4 ++ src/main/java/com/hbm/blocks/ModBlocks.java | 2 +- .../blocks/generic/BlockSellafieldSlaked.java | 53 ++++++++++++++ .../com/hbm/config/FalloutConfigJSON.java | 67 +++++------------- .../hbm/entity/effect/EntityFalloutRain.java | 6 +- .../hbm/entity/effect/EntityNukeTorex.java | 65 +++++++++++++++-- .../java/com/hbm/items/tool/ItemWandD.java | 11 +-- .../hbm/render/entity/effect/RenderTorex.java | 2 +- .../hbm/world/biome/BiomeGenCraterBase.java | 5 ++ .../textures/blocks/sellafield_slaked_1.png | Bin 0 -> 750 bytes .../textures/blocks/sellafield_slaked_2.png | Bin 0 -> 783 bytes .../textures/blocks/sellafield_slaked_3.png | Bin 0 -> 704 bytes 12 files changed, 149 insertions(+), 66 deletions(-) create mode 100644 src/main/java/com/hbm/blocks/generic/BlockSellafieldSlaked.java create mode 100644 src/main/resources/assets/hbm/textures/blocks/sellafield_slaked_1.png create mode 100644 src/main/resources/assets/hbm/textures/blocks/sellafield_slaked_2.png create mode 100644 src/main/resources/assets/hbm/textures/blocks/sellafield_slaked_3.png diff --git a/changelog b/changelog index 8ba38aaa3..8e9ac0516 100644 --- a/changelog +++ b/changelog @@ -1,10 +1,14 @@ ## Changed +* Nuclear craters have been reworked + * The fallout effect no longer creates dead grass, instead it converts the area into three new biomes, the outer crater, crater and inner crater + * The entire crater is now slaked sellafite which now has texture variance to look more like debris, as well as getting darker towards the center * The watz now cools up to 20% of its current heat level instead of 10%, making reactors a lot cooler and therefore react faster, which means more energy and faster depletion rates * 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 +* Mushroom clouds' initial scale is now based on the total scale instead of all spawning roughly at the same size, causing fireballs to be comically small for huge bombs ## 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/blocks/ModBlocks.java b/src/main/java/com/hbm/blocks/ModBlocks.java index 24fef696d..613279cd8 100644 --- a/src/main/java/com/hbm/blocks/ModBlocks.java +++ b/src/main/java/com/hbm/blocks/ModBlocks.java @@ -1776,7 +1776,7 @@ public class ModBlocks { sand_dirty_red = new BlockFalling(Material.sand).setBlockName("sand_dirty_red").setStepSound(Block.soundTypeSand).setCreativeTab(MainRegistry.blockTab).setHardness(0.5F).setBlockTextureName(RefStrings.MODID + ":sand_dirty_red"); stone_cracked = new BlockFalling(Material.rock).setBlockName("stone_cracked").setStepSound(Block.soundTypeStone).setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setBlockTextureName(RefStrings.MODID + ":stone_cracked"); - sellafield_slaked = new BlockGeneric(Material.rock).setBlockName("sellafield_slaked").setStepSound(Block.soundTypeStone).setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setBlockTextureName(RefStrings.MODID + ":sellafield_slaked"); + sellafield_slaked = new BlockSellafieldSlaked(Material.rock).setBlockName("sellafield_slaked").setStepSound(Block.soundTypeStone).setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setBlockTextureName(RefStrings.MODID + ":sellafield_slaked"); sellafield = new BlockSellafield(Material.rock).setBlockName("sellafield").setStepSound(Block.soundTypeStone).setHardness(5.0F).setBlockTextureName(RefStrings.MODID + ":sellafield_0"); /*sellafield_0 = new BlockHazard(Material.rock).setBlockName("sellafield_0").setStepSound(Block.soundTypeStone).setHardness(5.0F).setBlockTextureName(RefStrings.MODID + ":sellafield_0"); sellafield_1 = new BlockHazard(Material.rock).setBlockName("sellafield_1").setStepSound(Block.soundTypeStone).setHardness(5.0F).setBlockTextureName(RefStrings.MODID + ":sellafield_1"); diff --git a/src/main/java/com/hbm/blocks/generic/BlockSellafieldSlaked.java b/src/main/java/com/hbm/blocks/generic/BlockSellafieldSlaked.java new file mode 100644 index 000000000..d30efb41a --- /dev/null +++ b/src/main/java/com/hbm/blocks/generic/BlockSellafieldSlaked.java @@ -0,0 +1,53 @@ +package com.hbm.blocks.generic; + +import java.awt.Color; + +import com.hbm.lib.RefStrings; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; + +public class BlockSellafieldSlaked extends Block { + + public IIcon[] icons; + + public BlockSellafieldSlaked(Material mat) { + super(mat); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) { + long l = (long) (x * 3129871) ^ (long)y * 116129781L ^ (long)z; + l = l * l * 42317861L + l * 11L; + int i = (int)(l >> 16 & 3L); + return icons[(int)(Math.abs(i) % icons.length)]; + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) { + return icons[meta % icons.length]; + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) { + icons = new IIcon[4]; + icons[0] = reg.registerIcon(RefStrings.MODID + ":sellafield_slaked"); + icons[1] = reg.registerIcon(RefStrings.MODID + ":sellafield_slaked_1"); + icons[2] = reg.registerIcon(RefStrings.MODID + ":sellafield_slaked_2"); + icons[3] = reg.registerIcon(RefStrings.MODID + ":sellafield_slaked_3"); + } + + @SideOnly(Side.CLIENT) + public int colorMultiplier(IBlockAccess world, int x, int y, int z) { + int meta = world.getBlockMetadata(x, y, z); + return Color.HSBtoRGB(0F, 0F, 1F - meta / 15F); + } +} diff --git a/src/main/java/com/hbm/config/FalloutConfigJSON.java b/src/main/java/com/hbm/config/FalloutConfigJSON.java index de787053b..5c59d3a83 100644 --- a/src/main/java/com/hbm/config/FalloutConfigJSON.java +++ b/src/main/java/com/hbm/config/FalloutConfigJSON.java @@ -69,26 +69,29 @@ public class FalloutConfigJSON { /* 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() .mMa(Material.vine) .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(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(new FalloutEntry().mB(Blocks.mossy_cobblestone).prim(new Triplet(Blocks.coal_ore, 0, 1))); + entries.add(new FalloutEntry().mB(Blocks.coal_ore).prim(new Triplet(Blocks.diamond_ore, 0, 3), new Triplet(Blocks.emerald_ore, 0, 2)).c(0.5)); + entries.add(new FalloutEntry().mB(ModBlocks.ore_lignite).prim(new Triplet(Blocks.diamond_ore, 0, 1)).c(0.2)); + entries.add(new FalloutEntry().mB(ModBlocks.ore_uranium).prim(new Triplet(ModBlocks.ore_schrabidium, 0, 1), new Triplet(ModBlocks.ore_uranium_scorched, 0, 99))); + entries.add(new FalloutEntry().mB(ModBlocks.ore_nether_uranium).prim(new Triplet(ModBlocks.ore_nether_schrabidium, 0, 1), new Triplet(ModBlocks.ore_nether_uranium_scorched, 0, 99))); + entries.add(new FalloutEntry().mB(ModBlocks.ore_gneiss_uranium).prim(new Triplet(ModBlocks.ore_gneiss_schrabidium, 0, 1), new Triplet(ModBlocks.ore_gneiss_uranium_scorched, 0, 99))); - //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(stoneOuter.clone().mB(Blocks.gravel)); - /* recontaminate slaked sellafield */ - //entries.add(stoneCore.clone().mB(ModBlocks.sellafield_slaked)); - //entries.add(stoneInner.clone().mB(ModBlocks.sellafield_slaked)); + Block deepslate = Compat.tryLoadBlock(Compat.MOD_EF, "deepslate"); + Block stone = Compat.tryLoadBlock(Compat.MOD_EF, "stone"); + + for(int i = 1; i <= 10; i++) { + entries.add(new FalloutEntry() .prim(new Triplet(ModBlocks.sellafield_slaked, 10 - i, 1)).max(i * 5).sol(true).mMa(Material.rock)); + entries.add(new FalloutEntry() .prim(new Triplet(ModBlocks.sellafield_slaked, 10 - i, 1)).max(i * 5).sol(true).mB(Blocks.gravel)); + entries.add(new FalloutEntry() .prim(new Triplet(ModBlocks.sellafield_slaked, 10 - i, 1)).max(i * 5).sol(true).mMa(Material.ground)); + if(i <= 9) entries.add(new FalloutEntry() .prim(new Triplet(ModBlocks.sellafield_slaked, 10 - i, 1)).max(i * 5).sol(true).mMa(Material.grass)); + if(deepslate != null) entries.add(new FalloutEntry() .prim(new Triplet(ModBlocks.sellafield_slaked, 10 - i, 1)).max(i * 5).sol(true).mB(deepslate)); + if(stone != null) entries.add(new FalloutEntry() .prim(new Triplet(ModBlocks.sellafield_slaked, 10 - i, 1)).max(i * 5).sol(true).mB(stone)); + } //entries.add(new FalloutEntry().mB(Blocks.grass).prim(new Triplet(ModBlocks.waste_earth, 0, 1))); entries.add(new FalloutEntry() @@ -105,40 +108,6 @@ public class FalloutConfigJSON { entries.add(new FalloutEntry() .mB(Blocks.clay) .prim(new Triplet(Blocks.hardened_clay, 0, 1))); - entries.add(new FalloutEntry() - .mB(Blocks.mossy_cobblestone) - .prim(new Triplet(Blocks.coal_ore, 0, 1))); - entries.add(new FalloutEntry() - .mB(Blocks.coal_ore) - .prim(new Triplet(Blocks.diamond_ore, 0, 3), new Triplet(Blocks.emerald_ore, 0, 2)) - .c(0.5)); - entries.add(new FalloutEntry() - .mB(ModBlocks.ore_lignite) - .prim(new Triplet(Blocks.diamond_ore, 0, 1)) - .c(0.2)); - entries.add(new FalloutEntry() - .mB(ModBlocks.ore_uranium) - .prim(new Triplet(ModBlocks.ore_schrabidium, 0, 1), new Triplet(ModBlocks.ore_uranium_scorched, 0, 99))); - entries.add(new FalloutEntry() - .mB(ModBlocks.ore_nether_uranium) - .prim(new Triplet(ModBlocks.ore_nether_schrabidium, 0, 1), new Triplet(ModBlocks.ore_nether_uranium_scorched, 0, 99))); - entries.add(new FalloutEntry() - .mB(ModBlocks.ore_gneiss_uranium) - .prim(new Triplet(ModBlocks.ore_gneiss_schrabidium, 0, 1), new Triplet(ModBlocks.ore_gneiss_uranium_scorched, 0, 99))); - - /// 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(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(stoneOuter.clone().mB(stone)); - } } private static void writeDefault(File file) { diff --git a/src/main/java/com/hbm/entity/effect/EntityFalloutRain.java b/src/main/java/com/hbm/entity/effect/EntityFalloutRain.java index 2ce57ccfe..bcc6cd6b3 100644 --- a/src/main/java/com/hbm/entity/effect/EntityFalloutRain.java +++ b/src/main/java/com/hbm/entity/effect/EntityFalloutRain.java @@ -115,7 +115,7 @@ 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 >= 100 && dist < 55) return BiomeGenCraterBase.craterBiome; if(scale >= 25) return BiomeGenCraterBase.craterOuterBiome; return null; } @@ -183,10 +183,6 @@ public class EntityFalloutRain extends Entity { for(FalloutEntry entry : FalloutConfigJSON.entries) { - if(b == Blocks.grass) { - break; - } - if(entry.eval(worldObj, x, y, z, b, meta, dist)) { if(entry.isSolid()) { depth++; diff --git a/src/main/java/com/hbm/entity/effect/EntityNukeTorex.java b/src/main/java/com/hbm/entity/effect/EntityNukeTorex.java index 56f2a9f67..0ded68a02 100644 --- a/src/main/java/com/hbm/entity/effect/EntityNukeTorex.java +++ b/src/main/java/com/hbm/entity/effect/EntityNukeTorex.java @@ -59,6 +59,8 @@ public class EntityNukeTorex extends Entity { if(worldObj.isRemote) { + if(ticksExisted == 1) this.setScale((float) s); + if(lastSpawnY == -1) { lastSpawnY = posY - 3; } @@ -82,7 +84,7 @@ public class EntityNukeTorex extends Entity { double x = posX + rand.nextGaussian() * range; double z = posZ + rand.nextGaussian() * range; Cloudlet cloud = new Cloudlet(x, lastSpawnY, z, (float)(rand.nextDouble() * 2D * Math.PI), 0, lifetime); - cloud.setScale(1F + this.ticksExisted * 0.005F * (float) cs, 5F * (float) cs); + cloud.setScale(1F + this.ticksExisted * 0.005F * (float) s, 5F * (float) cs); cloudlets.add(cloud); } @@ -104,13 +106,44 @@ public class EntityNukeTorex extends Entity { // spawn ring clouds if(ticksExisted < 200) { + lifetime *= s; for(int i = 0; i < 2; i++) { Cloudlet cloud = new Cloudlet(posX, posY + coreHeight, posZ, (float)(rand.nextDouble() * 2D * Math.PI), 0, lifetime, TorexType.RING); - cloud.setScale(1F + this.ticksExisted * 0.005F * (float) cs * 0.5F, 3F * (float) (cs * s)); + cloud.setScale(1F + this.ticksExisted * 0.0025F * (float) (cs * s), 3F * (float) (cs * s)); cloudlets.add(cloud); } } + // spawn condensation clouds + if(ticksExisted > 200 && ticksExisted < 600) { + + for(int i = 0; i < 50; i++) { + for(int j = 0; j < 4; j++) { + float angle = (float) (Math.PI * 2 * rand.nextDouble()); + Vec3 vec = Vec3.createVectorHelper(torusWidth + rollerSize * 3, 0, 0); + vec.rotateAroundZ((float) (Math.PI / 45 * j)); + vec.rotateAroundY(angle); + Cloudlet cloud = new Cloudlet(posX + vec.xCoord, posY + coreHeight - 5 + j * s, posZ + vec.zCoord, angle, 0, (int) ((20 + ticksExisted / 10) * (1 + rand.nextDouble() * 0.1)), TorexType.CONDENSATION); + cloud.setScale(0.125F * (float) (cs * s), 3F * (float) (cs * s)); + cloudlets.add(cloud); + } + } + } + if(ticksExisted > 300 && ticksExisted < 600) { + + for(int i = 0; i < 50; i++) { + for(int j = 0; j < 4; j++) { + float angle = (float) (Math.PI * 2 * rand.nextDouble()); + Vec3 vec = Vec3.createVectorHelper(torusWidth + rollerSize * 2, 0, 0); + vec.rotateAroundZ((float) (Math.PI / 45 * j)); + vec.rotateAroundY(angle); + Cloudlet cloud = new Cloudlet(posX + vec.xCoord, posY + coreHeight + 25 + j * s, posZ + vec.zCoord, angle, 0, (int) ((20 + ticksExisted / 10) * (1 + rand.nextDouble() * 0.1)), TorexType.CONDENSATION); + cloud.setScale(0.125F * (float) (cs * s), 3F * (float) (cs * s)); + cloudlets.add(cloud); + } + } + } + for(Cloudlet cloud : cloudlets) { cloud.update(); } @@ -131,7 +164,7 @@ public class EntityNukeTorex extends Entity { } public EntityNukeTorex setScale(float scale) { - getDataWatcher().updateObject(10, scale); + if(!worldObj.isRemote) getDataWatcher().updateObject(10, scale); this.coreHeight = this.coreHeight / 1.5D * scale; this.convectionHeight = this.convectionHeight / 1.5D * scale; this.torusWidth = this.torusWidth / 1.5D * scale; @@ -270,6 +303,11 @@ public class EntityNukeTorex extends Entity { this.motionX = motion.xCoord; this.motionY = motion.yCoord; this.motionZ = motion.zCoord; + } else if(this.type == TorexType.CONDENSATION) { + Vec3 motion = getCondensationMotion(); + this.motionX = motion.xCoord; + this.motionY = motion.yCoord; + this.motionZ = motion.zCoord; } double mult = this.motionMult * getSimulationSpeed(); @@ -281,6 +319,15 @@ public class EntityNukeTorex extends Entity { this.updateColor(); } + private Vec3 getCondensationMotion() { + Vec3 delta = Vec3.createVectorHelper(posX - EntityNukeTorex.this.posX, 0, posZ - EntityNukeTorex.this.posZ); + double speed = 0.00002 * EntityNukeTorex.this.getScale() * EntityNukeTorex.this.ticksExisted; + delta.xCoord *= speed; + //delta.yCoord *= speed * 0.75 * EntityNukeTorex.this.getScale(); + delta.zCoord *= speed; + return delta; + } + private Vec3 getRingMotion(double simPosX, double simPosZ) { /*Vec3 targetPos = Vec3.createVectorHelper( @@ -440,6 +487,11 @@ public class EntityNukeTorex extends Entity { } public Vec3 getInterpColor(float interp) { + + if(this.type == TorexType.CONDENSATION) { + return Vec3.createVectorHelper(1F, 1F, 1F); + } + double greying = EntityNukeTorex.this.getGreying(); if(this.type == TorexType.RING) { @@ -453,7 +505,9 @@ public class EntityNukeTorex extends Entity { } public float getAlpha() { - return (1F - ((float)age / (float)cloudletLife)) * EntityNukeTorex.this.getAlpha(); + float alpha = (1F - ((float)age / (float)cloudletLife)) * EntityNukeTorex.this.getAlpha(); + if(this.type == TorexType.CONDENSATION) alpha *= 0.25; + return alpha; } private float startingScale = 1; @@ -479,7 +533,8 @@ public class EntityNukeTorex extends Entity { public static enum TorexType { STANDARD, - RING + RING, + CONDENSATION } @Override protected void writeEntityToNBT(NBTTagCompound nbt) { } diff --git a/src/main/java/com/hbm/items/tool/ItemWandD.java b/src/main/java/com/hbm/items/tool/ItemWandD.java index 05f3e197f..01eecea43 100644 --- a/src/main/java/com/hbm/items/tool/ItemWandD.java +++ b/src/main/java/com/hbm/items/tool/ItemWandD.java @@ -2,7 +2,9 @@ package com.hbm.items.tool; import java.util.List; +import com.hbm.entity.effect.EntityNukeTorex; import com.hbm.lib.Library; +import com.hbm.util.TrackerUtil; import com.hbm.world.WorldUtil; import com.hbm.world.biome.BiomeGenCraterBase; @@ -47,13 +49,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, BiomeGenCraterBase.craterBiome); } } - WorldUtil.syncBiomeChange(world, pos.blockX, pos.blockZ); + WorldUtil.syncBiomeChange(world, pos.blockX, pos.blockZ);*/ /*EntityTomBlast tom = new EntityTomBlast(world); tom.posX = pos.blockX; @@ -62,12 +64,11 @@ public class ItemWandD extends Item { tom.destructionRange = 600; world.spawnEntityInWorld(tom);*/ - /*EntityNukeTorex torex = new EntityNukeTorex(world); + EntityNukeTorex torex = new EntityNukeTorex(world); torex.setPositionAndRotation(pos.blockX, pos.blockY + 1, pos.blockZ, 0, 0); torex.setScale(1.5F); - torex.setType(1); world.spawnEntityInWorld(torex); - TrackerUtil.setTrackingRange(world, torex, 1000);*/ + TrackerUtil.setTrackingRange(world, torex, 1000); /*EntityTracker entitytracker = ((WorldServer) world).getEntityTracker(); IntHashMap map = ReflectionHelper.getPrivateValue(EntityTracker.class, entitytracker, "trackedEntityIDs", "field_72794_c"); diff --git a/src/main/java/com/hbm/render/entity/effect/RenderTorex.java b/src/main/java/com/hbm/render/entity/effect/RenderTorex.java index e90761d3e..10094d1ad 100644 --- a/src/main/java/com/hbm/render/entity/effect/RenderTorex.java +++ b/src/main/java/com/hbm/render/entity/effect/RenderTorex.java @@ -138,7 +138,7 @@ public class RenderTorex extends Render { float f4 = ActiveRenderInfo.rotationXY; float f5 = ActiveRenderInfo.rotationXZ; - float brightness = 0.75F * cloud.colorMod; + float brightness = cloud.type == cloud.type.CONDENSATION ? 0.9F : 0.75F * cloud.colorMod; Vec3 color = cloud.getInterpColor(interp); tess.setColorRGBA_F((float)color.xCoord * brightness, (float)color.yCoord * brightness, (float)color.zCoord * brightness, alpha); diff --git a/src/main/java/com/hbm/world/biome/BiomeGenCraterBase.java b/src/main/java/com/hbm/world/biome/BiomeGenCraterBase.java index 6f3afd39a..467ee78ef 100644 --- a/src/main/java/com/hbm/world/biome/BiomeGenCraterBase.java +++ b/src/main/java/com/hbm/world/biome/BiomeGenCraterBase.java @@ -6,6 +6,7 @@ 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 { @@ -20,6 +21,10 @@ public class BiomeGenCraterBase extends BiomeGenBase { BiomeDictionary.registerBiomeType(craterOuterBiome, DRY, DEAD, WASTELAND); } + public int getWaterColorMultiplier() { + return 0x505020; //0x50d030 + } + public BiomeGenCraterBase(int id) { super(id); this.waterColorMultiplier = 0xE0FFAE; //swamp color diff --git a/src/main/resources/assets/hbm/textures/blocks/sellafield_slaked_1.png b/src/main/resources/assets/hbm/textures/blocks/sellafield_slaked_1.png new file mode 100644 index 0000000000000000000000000000000000000000..32bd9afb47479dd98c8084895817f3e5f31b962b GIT binary patch literal 750 zcmVW}$crdUvb4&OPVr8in<$D{EEYWb`YRUm1-D_J@>YE<@NnM# z^(O$v7?e_o2-Rwp+uINkp;@ot`#z&^fTKO4C_+6y=>QOfcRbpxP_6HNinJE$_xs!g zJ&Z8`+<%Xz0g%h(ct4qPKk4B7@cnmo zyi9Oimv*}iz`OI;Jg(F*#$c_@1ObvHVXK&9ct7JNxJJ!Ip|!?Z3qZf$=Yh*{=ZKS| zV{V6iT-RkIr`Rgy0Js|sXdixoYmA}u>)mr16o}SuxF(DWP)OYp~k?eu%y4n0+u({mYMVh9#)>=g6sMhxYXti4F zUkL(4gze1|0BXWH;4$ozWj}M=dYPg#_YBZ5fS`eFSDH_ zNe1=8zs7nc)ND3mHlOn1#ZOpk$rnGP-q@$}^h*Frn-v~cw%I6GNs@$vgM)PkOkrK5 z&XYqf|Gpw$+{m&&0lu|g3 zLpT~S8V2MGC6rQFYne|!(%SzV90#p6JC!o(CJb?17vJ{@x|jc>-e|V*JP*(FP)e~; g-pX7WW0=RnzmG;vjW=2QE&u=k07*qoM6N<$f@RfTGynhq literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/hbm/textures/blocks/sellafield_slaked_2.png b/src/main/resources/assets/hbm/textures/blocks/sellafield_slaked_2.png new file mode 100644 index 0000000000000000000000000000000000000000..32f32cfa3d48a6b9d7e6b131a5e522fa9d3d7e92 GIT binary patch literal 783 zcmV+q1MvKbP)1Pwd5#c*q9};t7^M{Z-5#YCzVIn#1xb=1 zJb~z}lY)#r^u8)9J+V`N(ef zowjZ9T#waiMQ1G{PjmkM@`b)1u(l)1a$Zg^c%Da9*8oIeh%W?6YpS}YC<^MjX0ccx z0NS?2T8lP@&RU`{B+GKnN9Sm*+3)vgV=%^$XE{yNFquqve0ap0PA8v(Amoqt?{OT5 zrmnHCuPl}e>bgcNO`hkJWl7g{xUP%QhL>Nz&{`t~;QHe=4-XI2RZSGdbhbk&g;tuX zlJxyR5+`(Ri>xHFl3a{0Xj_B0zP?5&h0%sAOL1Kftrd@tkHk@g5dK>#iR*b>&Snh# zfUG286d|6UpUKl4rPW(kL6+qJIIjC9(t_hKD`o^?fa|)XNs1o`{s+|iht~Ja&IJGf N002ovPDHLkV1hTPY32X` literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/hbm/textures/blocks/sellafield_slaked_3.png b/src/main/resources/assets/hbm/textures/blocks/sellafield_slaked_3.png new file mode 100644 index 0000000000000000000000000000000000000000..834cb05fd04b62b3a0a6c4fec2e764547f5298b8 GIT binary patch literal 704 zcmV;x0zdtUP)Zdy}gAj%jo-_-``&VwANg&SBjz_%QB)UB7{Jm=QK^j`Fti#Q(j+RQN|d) zzP^~I3GY2Z2%K|F(?lG{NGTb|k#QW6Qc@HJ!!Xcw9c|m9K0ZDOArL|!%Q67^zGs>y z@;pZ=g_M%M@44M>SZit9mJkAe{`^5X=U6V67-Ik!hJmsynWkx8r4++35JKQ|I^n%1 z&vT@dh&YZ(l7znRNz;_|dd+IJ!dgpNmaJAQlu{UDsOuUb1VRYLam0I%+U<7ypJ|%7 zUawedXYRw{fOC$bC`i*3=N!fuk|e=ei?G(>y`R~=_e4=d9LIcqev;=oRaMdVJyJ^I zIA*a};JrsmiE5e#r4-XNp|vK8A|8(iLI^gS4Y%8kaU7|tiYSVZQvP#aDPCS)P(la* zq?Bl_ky3KM-zm$IEXxQXa6X@Te}5-UQ{p&gyWL`~1wd`LTcniKb