Skip to content

Commit

Permalink
JEI, Fixes, RBMK Guide
Browse files Browse the repository at this point in the history
Added JEI support to Transmutation and Nuclear Waste Storage Drum
Added ILookoverlay to batteries
Added gas mask no-filter rendering
Added Crystal schraranium recipe
Added missing hen silex recipes
Added alot more pages to RBMK Guide
Added RBMK Guide recipe
Added Forge Energy support to power converters

Changed RBMK Neg-Quad functions
Changed default fallout speed to 10
Changed RBMK fuel function display
Changed Meteor Dungeon spawn height from 10  to 12
Changed some textures

Fixed mercury cyclotron recipe balance
Fixed Explosion crash
Fixed fluid pipe rendering crash
Fixed Particle Lag for Factories
Fixed config desc error
Fixed DiFurnace recipe when 1st is normal and 2nd oredict
Fixed Gas mask tooltip crash
Fixed missing rads of pile rods
Fixed RBMK fuel rod grammar
Fixed Zombie hazmat equip
Fixed Advancement triggering
Fixed solid cable and duct fps lag
  • Loading branch information
Alcatergit committed May 24, 2023
1 parent 336e6e8 commit faa49ad
Show file tree
Hide file tree
Showing 91 changed files with 1,149 additions and 473 deletions.
24 changes: 12 additions & 12 deletions src/main/java/api/hbm/energy/IEnergyConnector.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,18 +76,18 @@ public default void trySubscribe(World world, BlockPos pos, ForgeDirection dir)
red = true;
}

if(particleDebug) {//
NBTTagCompound data = new NBTTagCompound();
data.setString("type", "network");
data.setString("mode", "power");
double posX = pos.getX() + 0.5 + dir.offsetX * 0.5 + world.rand.nextDouble() * 0.5 - 0.25;
double posY = pos.getY() + 0.5 + dir.offsetY * 0.5 + world.rand.nextDouble() * 0.5 - 0.25;
double posZ = pos.getZ() + 0.5 + dir.offsetZ * 0.5 + world.rand.nextDouble() * 0.5 - 0.25;
data.setDouble("mX", -dir.offsetX * (red ? 0.025 : 0.1));
data.setDouble("mY", -dir.offsetY * (red ? 0.025 : 0.1));
data.setDouble("mZ", -dir.offsetZ * (red ? 0.025 : 0.1));
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, posX, posY, posZ), new TargetPoint(world.provider.getDimension(), posX, posY, posZ, 25));
}
// if(particleDebug) {//
// NBTTagCompound data = new NBTTagCompound();
// data.setString("type", "network");
// data.setString("mode", "power");
// double posX = pos.getX() + 0.5 + dir.offsetX * 0.5 + world.rand.nextDouble() * 0.5 - 0.25;
// double posY = pos.getY() + 0.5 + dir.offsetY * 0.5 + world.rand.nextDouble() * 0.5 - 0.25;
// double posZ = pos.getZ() + 0.5 + dir.offsetZ * 0.5 + world.rand.nextDouble() * 0.5 - 0.25;
// data.setDouble("mX", -dir.offsetX * (red ? 0.025 : 0.1));
// data.setDouble("mY", -dir.offsetY * (red ? 0.025 : 0.1));
// data.setDouble("mZ", -dir.offsetZ * (red ? 0.025 : 0.1));
// PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, posX, posY, posZ), new TargetPoint(world.provider.getDimension(), posX, posY, posZ, 25));
// }
}

public default void tryUnsubscribe(World world, BlockPos pos) {
Expand Down
24 changes: 12 additions & 12 deletions src/main/java/api/hbm/energy/IEnergyUser.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,17 +87,17 @@ public default void sendPower(World world, BlockPos pos, ForgeDirection dir) {
}
}

if(particleDebug) {
NBTTagCompound data = new NBTTagCompound();
data.setString("type", "network");
data.setString("mode", "power");
double posX = pos.getX() + 0.5 + dir.offsetX * 0.5 + world.rand.nextDouble() * 0.5 - 0.25;
double posY = pos.getY() + 0.5 + dir.offsetY * 0.5 + world.rand.nextDouble() * 0.5 - 0.25;
double posZ = pos.getZ() + 0.5 + dir.offsetZ * 0.5 + world.rand.nextDouble() * 0.5 - 0.25;
data.setDouble("mX", dir.offsetX * (red ? 0.025 : 0.1));
data.setDouble("mY", dir.offsetY * (red ? 0.025 : 0.1));
data.setDouble("mZ", dir.offsetZ * (red ? 0.025 : 0.1));
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, posX, posY, posZ), new TargetPoint(world.provider.getDimension(), posX, posY, posZ, 25));
}
// if(particleDebug) {
// NBTTagCompound data = new NBTTagCompound();
// data.setString("type", "network");
// data.setString("mode", "power");
// double posX = pos.getX() + 0.5 + dir.offsetX * 0.5 + world.rand.nextDouble() * 0.5 - 0.25;
// double posY = pos.getY() + 0.5 + dir.offsetY * 0.5 + world.rand.nextDouble() * 0.5 - 0.25;
// double posZ = pos.getZ() + 0.5 + dir.offsetZ * 0.5 + world.rand.nextDouble() * 0.5 - 0.25;
// data.setDouble("mX", dir.offsetX * (red ? 0.025 : 0.1));
// data.setDouble("mY", dir.offsetY * (red ? 0.025 : 0.1));
// data.setDouble("mZ", dir.offsetZ * (red ? 0.025 : 0.1));
// PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, posX, posY, posZ), new TargetPoint(world.provider.getDimension(), posX, posY, posZ, 25));
// }
}
}
30 changes: 29 additions & 1 deletion src/main/java/com/hbm/blocks/machine/MachineBattery.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
package com.hbm.blocks.machine;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

import com.hbm.util.I18nUtil;
import com.hbm.blocks.ModBlocks;
import com.hbm.blocks.ILookOverlay;
import com.hbm.lib.Library;
import com.hbm.lib.InventoryHelper;
import com.hbm.main.MainRegistry;
Expand All @@ -30,8 +33,9 @@
import net.minecraft.util.Rotation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.client.event.RenderGameOverlayEvent.Pre;

public class MachineBattery extends BlockContainer {
public class MachineBattery extends BlockContainer implements ILookOverlay {

public static final PropertyDirection FACING = BlockHorizontal.FACING;
private long maxPower;
Expand Down Expand Up @@ -247,4 +251,28 @@ public void addInformation(ItemStack stack, World worldIn, List<String> list, IT
list.add(color+Library.getShortNumber(charge)+color2+"/"+Library.getShortNumber(this.maxPower)+"HE "+color+"("+percent+"%)§r");
}
}

@Override
public void printHook(Pre event, World world, int x, int y, int z) {

TileEntity te = world.getTileEntity(new BlockPos(x, y, z));

if(!(te instanceof TileEntityMachineBattery))
return;

TileEntityMachineBattery battery = (TileEntityMachineBattery) te;
List<String> text = new ArrayList();
text.add("§6<> §rStored Energy: " + Library.getShortNumber(battery.power) + "/" + Library.getShortNumber(getMaxPower()) + "HE");
if(battery.powerDelta == 0){
text.add("§e-- §r0HE/s");
}
else if(battery.powerDelta > 0){
text.add("§a-> §r" + Library.getShortNumber(battery.powerDelta) + "HE/s");
}
else{
text.add("§c<- §r" + Library.getShortNumber(-battery.powerDelta) + "HE/s");
}
text.add("&["+Library.getColorProgress((double)battery.power/(double)getMaxPower())+"&] "+Library.getPercentage((double)battery.power/(double)getMaxPower())+"%");
ILookOverlay.printGeneric(event, getLocalizedName(), 0xffff00, 0x404000, text);
}
}
5 changes: 2 additions & 3 deletions src/main/java/com/hbm/blocks/machine/MachineChungus.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import java.util.ArrayList;
import java.util.List;

import com.hbm.util.I18nUtil;
import com.hbm.lib.Library;
import com.hbm.blocks.ILookOverlay;
import com.hbm.blocks.BlockDummyable;
Expand Down Expand Up @@ -158,8 +157,8 @@ public void printHook(Pre event, World world, int x, int y, int z) {
text.add("§a-> §r" + chungus.types[0].getLocalizedName(new FluidStack(chungus.types[0], 1)) + ": " + chungus.tanks[0].getFluidAmount() + "/" + chungus.tanks[0].getCapacity() + "mB");
if(chungus.types[1] != null)
text.add("§c<- §r" + chungus.types[1].getLocalizedName(new FluidStack(chungus.types[1], 1)) + ": " + chungus.tanks[1].getFluidAmount() + "/" + chungus.tanks[1].getCapacity() + "mB");
text.add("§6<> §rStored Energy: " + Library.getShortNumber(chungus.power)+ "/" + Library.getShortNumber(chungus.maxPower) + "HE");
text.add("§6<> §rStored Energy: " + Library.getShortNumber(chungus.power) + "/" + Library.getShortNumber(chungus.maxPower) + "HE");

ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
ILookOverlay.printGeneric(event, getLocalizedName(), 0xffff00, 0x404000, text);
}
}
27 changes: 26 additions & 1 deletion src/main/java/com/hbm/blocks/machine/MachineFENSU.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
package com.hbm.blocks.machine;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

import com.hbm.lib.Library;
import com.hbm.lib.InventoryHelper;
import com.hbm.blocks.ILookOverlay;
import com.hbm.lib.Library;
import com.hbm.blocks.BlockDummyableMBB;
import com.hbm.blocks.ModBlocks;
import com.hbm.main.MainRegistry;
Expand All @@ -25,9 +28,10 @@
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.oredict.OreDictionary;
import net.minecraftforge.client.event.RenderGameOverlayEvent.Pre;
import net.minecraftforge.fml.common.network.internal.FMLNetworkHandler;

public class MachineFENSU extends BlockDummyableMBB {
public class MachineFENSU extends BlockDummyableMBB implements ILookOverlay {

public MachineFENSU(Material materialIn, String s) {
super(materialIn, s);
Expand Down Expand Up @@ -213,4 +217,25 @@ public void addInformation(ItemStack stack, World worldIn, List<String> list, IT
list.add(color+Library.getShortNumber(charge)+color2+"/9.22EHE "+color+"("+percent+"%)§r");
}
}

@Override
public void printHook(Pre event, World world, int x, int y, int z) {

TileEntity te = world.getTileEntity(new BlockPos(x, y, z));

if(!(te instanceof TileEntityMachineFENSU))
return;

TileEntityMachineFENSU battery = (TileEntityMachineFENSU) te;
List<String> text = new ArrayList();
text.add("§6<> §rStored Energy: " + Library.getShortNumber(battery.power) + "/9.22EHE");
if(battery.powerDelta == 0)
text.add("§e-- §r0HE/s");
else if(battery.powerDelta > 0)
text.add("§a-> §r" + Library.getShortNumber(battery.powerDelta) + "HE/s");
else
text.add("§c<- §r" + Library.getShortNumber(-battery.powerDelta) + "HE/s");
text.add("&["+Library.getColorProgress((double)battery.power/(double)Long.MAX_VALUE)+"&] "+Library.getPercentage((double)battery.power/(double)Long.MAX_VALUE)+"%");
ILookOverlay.printGeneric(event, getLocalizedName(), 0xffff00, 0x404000, text);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ public void printHook(Pre event, World world, int x, int y, int z) {
if(ductFluid == null){
text.add("§7None");
} else{
int color = ModForgeFluids.fluidColors.get(ductFluid);
int color = ModForgeFluids.getFluidColor(ductFluid);
text.add("&[" + color + "&]" +I18nUtil.resolveKey(ductFluid.getUnlocalizedName()));
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/hbm/config/BombConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class BombConfig {
public static int mk4 = 1024;
public static int blastSpeed = 1024;
public static int falloutRange = 100;
public static int fChunkSpeed = 20;
public static int fChunkSpeed = 10;
public static boolean evaporateWater = true;
public static boolean fillCraterWithWater = true;
public static int oceanHeight = 0;
Expand Down Expand Up @@ -92,7 +92,7 @@ public static void loadFromConfig(Configuration config) {
falloutRangeProp.setComment("Radius of fallout area (base radius * value in percent)");
falloutRange = falloutRangeProp.getInt();
// new explosion speed
Property falloutChunkSpeed = config.get(CATEGORY_NUKE, "6.04_falloutChunkSpeed", 6);
Property falloutChunkSpeed = config.get(CATEGORY_NUKE, "6.04_falloutChunkSpeed", 10);
falloutChunkSpeed.setComment("Process a Chunk every nth tick by the fallout rain");
fChunkSpeed = falloutChunkSpeed.getInt();
//Whether fallout and nuclear radiation is enabled at all
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/hbm/config/CompatibilityConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -198,11 +198,11 @@ public static void loadFromConfig(Configuration config) {
meteorShowerDuration = CommonConfig.createConfigHashMap(config, CATEGORY_METEOR, "05.03_meteorShowerDuration", "Max duration of meteor shower in ticks - <dimID:n> (Int:Int)", "Int", "Int", new String[]{ "0:"+20 * 60 * 30, "-28:"+20 * 60 * 60, "-27:"+20 * 60 * 3, "-26:"+20 * 60 * 3, "-29:"+20 * 60 * 60, "-30:"+20*10, "-31:"+20 * 60 }, ":");


String mobModRadComment = "Amount of radiation resistance the all mobs of that mod get. Radresistance s is calculated as s=(1-0.2^r). So a resistance value of 3.0 means that 99.2%=(1-0.2^3.0) of the radiation gets blocked. - <mod=radresistance> (String:Float)";
String mobModRadComment = "Amount of radiation resistance the all mobs of that mod get. Radresistance s is calculated as s=(1-0.1^r). So a resistance value of 3.0 means that 99.9%=(1-0.1^3.0) of the radiation gets blocked. - <mod=radresistance> (String:Float)";
mobModRadresistance = CommonConfig.createConfigHashMap(config, CATEGORY_MOB, "06.01_mobModRadresistance", mobModRadComment, "String", "Float", new String[]{ "biomesoplenty=0.5" }, "=");
mobModRadimmune = CommonConfig.createConfigHashSet(config, CATEGORY_MOB, "06.02_mobModRadimmune", "List of mods whose entities should all be immune to radiation. - <mob> (String)", "String", new String[]{ "srparasites" });

String mobRadComment = "Amount of radiation resistance the mob gets. Radresistance s is calculated as s=(1-0.2^r). So a resistance value of 3.0 means that 99.2%=(1-0.2^3.0) of the radiation gets blocked. - <mod:mob=radresistance> (String:Float)";
String mobRadComment = "Amount of radiation resistance the mob gets. Radresistance s is calculated as s=(1-0.1^r). So a resistance value of 3.0 means that 99.9%=(1-0.1^3.0) of the radiation gets blocked. - <mod:mob=radresistance> (String:Float)";
mobRadresistance = CommonConfig.createConfigHashMap(config, CATEGORY_MOB, "06.03_mobRadresistance", mobRadComment, "String", "Float", new String[]{ "biomesoplenty:entity.wasp=2.0" }, "=");
mobRadimmune = CommonConfig.createConfigHashSet(config, CATEGORY_MOB, "06.04_mobRadimmune", "List of mobs that are immune to radiation. - <mob> (String)", "String", new String[]{ "minecraft:entity.Slime", "minecraft:entity.Vex" });

Expand Down
8 changes: 0 additions & 8 deletions src/main/java/com/hbm/config/VersatileConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,6 @@

public class VersatileConfig {

public static Item getTransmutatorItem() {

if(GeneralConfig.enableBabyMode)
return ModItems.ingot_schrabidium;

return ModItems.ingot_schraranium;
}

public static int getSchrabOreChance() {

if(GeneralConfig.enableBabyMode)
Expand Down
24 changes: 13 additions & 11 deletions src/main/java/com/hbm/explosion/ExplosionChaos.java
Original file line number Diff line number Diff line change
Expand Up @@ -199,17 +199,19 @@ public static void c(World world, int x, int y, int z, int bombStartStrength) {
}
}

if(entity instanceof EntityPlayer && ArmorUtil.checkForHazmat((EntityPlayer) entity)) {
} else {

if(entity instanceof EntityLivingBase && ((EntityLivingBase) entity).isPotionActive(HbmPotion.taint)) {
((EntityLivingBase) entity).removePotionEffect(HbmPotion.taint);
((EntityLivingBase) entity).addPotionEffect(new PotionEffect(HbmPotion.mutation, 1 * 60 * 60 * 20, 0, false, true));
} else {
if(ArmorRegistry.hasProtection((EntityLivingBase) entity, EntityEquipmentSlot.HEAD, HazardClass.BACTERIA)){
ArmorUtil.damageGasMaskFilter((EntityLivingBase) entity, 1);
}else{
entity.attackEntityFrom(ModDamageSource.cloud, 3);
if(!(entity instanceof EntityPlayer && ArmorUtil.checkForHazmat((EntityPlayer) entity))) {

if(entity instanceof EntityLivingBase){
EntityLivingBase livi = (EntityLivingBase)entity;
if(livi.isPotionActive(HbmPotion.taint)) {
livi.removePotionEffect(HbmPotion.taint);
livi.addPotionEffect(new PotionEffect(HbmPotion.mutation, 1 * 60 * 60 * 20, 0, false, true));
} else {
if(ArmorRegistry.hasProtection(livi, EntityEquipmentSlot.HEAD, HazardClass.BACTERIA)){
ArmorUtil.damageGasMaskFilter(livi, 1);
}else{
entity.attackEntityFrom(ModDamageSource.cloud, 3);
}
}
}
}
Expand Down
21 changes: 21 additions & 0 deletions src/main/java/com/hbm/handler/ArmorUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,27 @@ public static boolean checkForGoggles(EntityPlayer player) {
return false;
}

/**
* Grabs the installed filter or the filter of the attachment, used for attachment rendering
* @param mask
* @param entity
* @return
*/
public static ItemStack getGasMaskFilterRecursively(ItemStack mask) {

ItemStack filter = getGasMaskFilter(mask);

if((filter == null || filter.isEmpty()) && ArmorModHandler.hasMods(mask)) {

ItemStack mods[] = ArmorModHandler.pryMods(mask);

if(mods[ArmorModHandler.helmet_only] != null && mods[ArmorModHandler.helmet_only].getItem() instanceof IGasMask)
filter = ((IGasMask)mods[ArmorModHandler.helmet_only].getItem()).getFilter(mods[ArmorModHandler.helmet_only]);
}

return filter;
}

public static void addGasMaskTooltip(ItemStack mask, World world, List<String> list, ITooltipFlag flagIn){

if(mask == null || !(mask.getItem() instanceof IGasMask))
Expand Down
8 changes: 8 additions & 0 deletions src/main/java/com/hbm/handler/RadiationWorldHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,14 @@ public static void handleWorldDestruction(World world) {
} else if(bblock == ModBlocks.waste_leaves) {
if(world.rand.nextInt(8) == 0) {
world.setBlockState(pos, Blocks.AIR.getDefaultState(), 1);
IBlockState state = world.getBlockState(pos);
world.notifyBlockUpdate(pos, state, state, 1);
}

} else if(bblock instanceof BlockLeaves) {
world.setBlockState(pos, ModBlocks.waste_leaves.getDefaultState(), 1);
IBlockState state = world.getBlockState(pos);
world.notifyBlockUpdate(pos, state, state, 1);
}
}
}
Expand Down Expand Up @@ -172,10 +176,14 @@ public static void handleWorldDestruction(World world) {
} else if(bblock == ModBlocks.waste_leaves) {
if(world.rand.nextInt(8) == 0) {
world.setBlockState(pos, Blocks.AIR.getDefaultState(), 1);
IBlockState state = world.getBlockState(pos);
world.notifyBlockUpdate(pos, state, state, 1);
}

} else if(bblock instanceof BlockLeaves) {
world.setBlockState(pos, ModBlocks.waste_leaves.getDefaultState(), 1);
IBlockState state = world.getBlockState(pos);
world.notifyBlockUpdate(pos, state, state, 1);
}
}
}
Expand Down
Loading

0 comments on commit faa49ad

Please sign in to comment.