diff --git a/src/main/java/com/hbm/blocks/generic/BlockGrate.java b/src/main/java/com/hbm/blocks/generic/BlockGrate.java index 304a0899f..5d6ded3ae 100644 --- a/src/main/java/com/hbm/blocks/generic/BlockGrate.java +++ b/src/main/java/com/hbm/blocks/generic/BlockGrate.java @@ -68,7 +68,8 @@ public class BlockGrate extends Block { @Override public boolean isSideSolid(IBlockAccess world, int x, int y, int z, ForgeDirection side) { - return side == ForgeDirection.UP; + int meta = world.getBlockMetadata(x, y, z); + return (side == ForgeDirection.UP && meta == 7) || (side == ForgeDirection.DOWN && meta == 0); } @Override diff --git a/src/main/java/com/hbm/entity/effect/EntityFalloutRain.java b/src/main/java/com/hbm/entity/effect/EntityFalloutRain.java index b4f6ccbd1..e269688fd 100644 --- a/src/main/java/com/hbm/entity/effect/EntityFalloutRain.java +++ b/src/main/java/com/hbm/entity/effect/EntityFalloutRain.java @@ -4,7 +4,6 @@ import com.hbm.blocks.ModBlocks; import com.hbm.config.BombConfig; import com.hbm.config.RadiationConfig; import com.hbm.config.VersatileConfig; -import com.hbm.main.MainRegistry; import com.hbm.saveddata.AuxSavedData; import net.minecraft.block.Block; diff --git a/src/main/java/com/hbm/items/ModItems.java b/src/main/java/com/hbm/items/ModItems.java index a617d8dd2..9f56383ba 100644 --- a/src/main/java/com/hbm/items/ModItems.java +++ b/src/main/java/com/hbm/items/ModItems.java @@ -1966,6 +1966,8 @@ public class ModItems { public static Item scrumpy; public static Item wild_p; public static Item fabsols_vodka; + public static Item injector_5htp; + public static Item injector_knife; public static Item hazmat_helmet; public static Item hazmat_plate; @@ -2965,6 +2967,8 @@ public class ModItems { scrumpy = new ItemModRevive(1).setUnlocalizedName("scrumpy").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":scrumpy"); wild_p = new ItemModRevive(3).setUnlocalizedName("wild_p").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":wild_p"); fabsols_vodka = new ItemModRevive(9999).setUnlocalizedName("fabsols_vodka").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":fabsols_vodka"); + injector_5htp = new ItemModAuto().setUnlocalizedName("injector_5htp").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":injector_5htp"); + injector_knife = new ItemModAuto().setUnlocalizedName("injector_knife").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":injector_knife"); can_empty = new Item().setUnlocalizedName("can_empty").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":can_empty"); can_smart = new ItemEnergy().setUnlocalizedName("can_smart").setContainerItem(ModItems.can_empty).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":can_smart"); @@ -6718,6 +6722,8 @@ public class ModItems { GameRegistry.registerItem(scrumpy, scrumpy.getUnlocalizedName()); GameRegistry.registerItem(wild_p, wild_p.getUnlocalizedName()); GameRegistry.registerItem(fabsols_vodka, fabsols_vodka.getUnlocalizedName()); + GameRegistry.registerItem(injector_5htp, injector_5htp.getUnlocalizedName()); + GameRegistry.registerItem(injector_knife, injector_knife.getUnlocalizedName()); //The Gadget GameRegistry.registerItem(gadget_explosive, gadget_explosive.getUnlocalizedName()); diff --git a/src/main/java/com/hbm/items/armor/ItemModAuto.java b/src/main/java/com/hbm/items/armor/ItemModAuto.java new file mode 100644 index 000000000..81fe68120 --- /dev/null +++ b/src/main/java/com/hbm/items/armor/ItemModAuto.java @@ -0,0 +1,33 @@ +package com.hbm.items.armor; + +import java.util.List; + +import com.hbm.handler.ArmorModHandler; +import com.hbm.items.ModItems; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; + +public class ItemModAuto extends ItemArmorMod { + + public ItemModAuto() { + super(ArmorModHandler.extra, false, true, false, false); + } + + @Override + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) { + + if(this == ModItems.injector_5htp) { + list.add(EnumChatFormatting.BLUE + "Imported from Japsterdam."); + } + if(this == ModItems.injector_knife) { + list.add(EnumChatFormatting.RED + "Pain."); + list.add(""); + list.add(EnumChatFormatting.RED + "Hurts, doesn't it?"); + } + + list.add(""); + super.addInformation(stack, player, list, bool); + } +} diff --git a/src/main/java/com/hbm/render/block/RenderRBMKControl.java b/src/main/java/com/hbm/render/block/RenderRBMKControl.java index 19e8f8f6d..176b7be1f 100644 --- a/src/main/java/com/hbm/render/block/RenderRBMKControl.java +++ b/src/main/java/com/hbm/render/block/RenderRBMKControl.java @@ -67,7 +67,7 @@ public class RenderRBMKControl implements ISimpleBlockRenderingHandler { tessellator.addTranslation(x + 0.5F, y, z + 0.5F); ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.rbmk_rods, "Column", iicon, tessellator, 0, true); - if(block == ModBlocks.rbmk_boiler && world.getBlock(x, y + 1, z) == Blocks.air) { + if(block == ModBlocks.rbmk_boiler && world.getBlock(x, y + 1, z) != block) { //tessellator.addTranslation(0, 0.125F, 0); ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.rbmk_rods, "Lid", iicon, tessellator, 0, true); //tessellator.addTranslation(0, -0.125F, 0); diff --git a/src/main/java/com/hbm/render/block/RenderRBMKReflector.java b/src/main/java/com/hbm/render/block/RenderRBMKReflector.java index 24b3d9c62..763e917ac 100644 --- a/src/main/java/com/hbm/render/block/RenderRBMKReflector.java +++ b/src/main/java/com/hbm/render/block/RenderRBMKReflector.java @@ -58,7 +58,7 @@ public class RenderRBMKReflector implements ISimpleBlockRenderingHandler { tessellator.addTranslation(x + 0.5F, y, z + 0.5F); ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.rbmk_reflector, "Column", iicon, tessellator, 0, true); - if(world.getBlock(x, y + 1, z) == Blocks.air) + if(world.getBlock(x, y + 1, z) != block) ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.rbmk_element, "Lid", iicon, tessellator, 0, true); tessellator.addTranslation(-x - 0.5F, -y, -z - 0.5F); diff --git a/src/main/java/com/hbm/render/block/RenderRBMKRod.java b/src/main/java/com/hbm/render/block/RenderRBMKRod.java index 14a90eb4d..b944b5ef0 100644 --- a/src/main/java/com/hbm/render/block/RenderRBMKRod.java +++ b/src/main/java/com/hbm/render/block/RenderRBMKRod.java @@ -59,7 +59,7 @@ public class RenderRBMKRod implements ISimpleBlockRenderingHandler { tessellator.addTranslation(x + 0.5F, y, z + 0.5F); ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.rbmk_element, "Column", iicon, tessellator, 0, true); - if(world.getBlock(x, y + 1, z) == Blocks.air) + if(world.getBlock(x, y + 1, z) != block) ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.rbmk_element, "Lid", iicon, tessellator, 0, true); tessellator.addTranslation(-x - 0.5F, -y, -z - 0.5F); diff --git a/src/main/java/com/hbm/tileentity/machine/rbmk/RBMKDials.java b/src/main/java/com/hbm/tileentity/machine/rbmk/RBMKDials.java index 65012ab66..47c53700d 100644 --- a/src/main/java/com/hbm/tileentity/machine/rbmk/RBMKDials.java +++ b/src/main/java/com/hbm/tileentity/machine/rbmk/RBMKDials.java @@ -12,6 +12,7 @@ public class RBMKDials { public static final String KEY_HEAT_PROVISION = "dialHeatProvision"; public static final String KEY_COLUMN_HEIGHT = "dialColumnHeight"; public static final String KEY_PERMANENT_SCRAP = "dialEnablePermaScrap"; + public static final String KEY_BOILER_HEAT_CONSUMPTION = "dialBoilerHeatConsumption"; public static void createDials(World world) { GameRules rules = world.getGameRules(); @@ -22,35 +23,72 @@ public class RBMKDials { rules.setOrCreateGameRule(KEY_HEAT_PROVISION, "0.2"); rules.setOrCreateGameRule(KEY_COLUMN_HEIGHT, "4"); rules.setOrCreateGameRule(KEY_PERMANENT_SCRAP, "false"); + rules.setOrCreateGameRule(KEY_BOILER_HEAT_CONSUMPTION, "0.1"); } - + + /** + * Returns the amount of heat per tick removed from components passively + * @param world + * @return + */ public static double getPassiveCooling(World world) { return shittyWorkaroundParseDouble(world.getGameRules().getGameRuleStringValue(KEY_PASSIVE_COOLING), 5.0D); } - //[0;1] + /** + * Returns the percentual step size how quickly neighboring component heat equalizes. 1 is instant, 0.5 is in 50% steps, et cetera. + * @param world + * @return [0;1] + */ public static double getColumnHeatFlow(World world) { return MathHelper.clamp_double(shittyWorkaroundParseDouble(world.getGameRules().getGameRuleStringValue(KEY_COLUMN_HEAT_FLOW), 5.0D), 0.0D, 1.0D); } - //[0;1] + /** + * Returns a modifier for fuel rod diffusion, i.e. how quickly the core and hull temperatures equalize. + * @param world + * @return >0 + */ public static double getFuelDiffusionMod(World world) { - return MathHelper.clamp_double(shittyWorkaroundParseDouble(world.getGameRules().getGameRuleStringValue(KEY_FUEL_DIFFUSION_MOD), 1.0D), 0.0D, 1.0D); + return Math.max(shittyWorkaroundParseDouble(world.getGameRules().getGameRuleStringValue(KEY_FUEL_DIFFUSION_MOD), 1.0D), 0.0D); } - //[0;1] + /** + * Returns the percentual step size how quickly the fuel hull heat and the component heat equalizes. 1 is instant, 0.5 is in 50% steps, et cetera. + * @param world + * @return [0;1] + */ public static double getFuelHeatProvision(World world) { return MathHelper.clamp_double(shittyWorkaroundParseDouble(world.getGameRules().getGameRuleStringValue(KEY_HEAT_PROVISION), 0.2D), 0.0D, 1.0D); } + /** + * Simple integer that decides how tall the structure is. + * @param world + * @return [0;15] + */ public static int getColumnHeight(World world) { return MathHelper.clamp_int(shittyWorkaroundParseInt(world.getGameRules().getGameRuleStringValue(KEY_COLUMN_HEIGHT), 4), 1, 16) - 1; } + /** + * Whether or not scrap entities despawn on their own or remain alive until picked up. + * @param world + * @return + */ public static boolean getPermaScrap(World world) { return world.getGameRules().getGameRuleBooleanValue(KEY_PERMANENT_SCRAP); } + /** + * How many heat units are consumed per steam unit (scaled per type) produced. + * @param world + * @return >0 + */ + public static double getBoilerHeatConsumption(World world) { + return Math.max(shittyWorkaroundParseDouble(world.getGameRules().getGameRuleStringValue(KEY_BOILER_HEAT_CONSUMPTION), 0.1D), 0D); + } + //why make the double representation accessible in a game rule when you can just force me to add a second pointless parsing operation? public static double shittyWorkaroundParseDouble(String s, double def) { diff --git a/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKBase.java b/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKBase.java index baa32f6cf..adf553ab7 100644 --- a/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKBase.java +++ b/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKBase.java @@ -132,8 +132,8 @@ public abstract class TileEntityRBMKBase extends TileEntity implements INBTPacke this.heat -= this.passiveCooling(); - if(heat < 0) - heat = 0D; + if(heat < 20) + heat = 20D; } @Override diff --git a/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKBoiler.java b/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKBoiler.java index 54dac8709..a66e2a396 100644 --- a/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKBoiler.java +++ b/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKBoiler.java @@ -42,15 +42,54 @@ public class TileEntityRBMKBoiler extends TileEntityRBMKSlottedBase implements I if(!worldObj.isRemote) { feed.updateTank(xCoord, yCoord, zCoord, worldObj.provider.dimensionId); steam.updateTank(xCoord, yCoord, zCoord, worldObj.provider.dimensionId); + + double heatCap = this.getHeatFromSteam(steam.getTankType()); + double heatProvided = this.heat - heatCap; + + if(heatProvided > 0) { + int waterUsed = (int)Math.floor(heatProvided / RBMKDials.getBoilerHeatConsumption(worldObj)); + waterUsed = Math.min(waterUsed, feed.getFill()); + feed.setFill(feed.getFill() - waterUsed); + int steamProduced = (int)Math.floor((waterUsed * 100) / getFactorFromSteam(steam.getTankType())); + steam.setFill(steam.getFill() + steamProduced); + + if(steam.getFill() > steam.getMaxFill()) { + steam.setFill(steam.getMaxFill()); + } + } + + fillFluidInit(steam.getTankType()); } super.updateEntity(); } + + public double getHeatFromSteam(FluidType type) { + + switch(type) { + case STEAM: return 100D; + case HOTSTEAM: return 300D; + case SUPERHOTSTEAM: return 450D; + case ULTRAHOTSTEAM: return 600D; + default: return 0D; + } + } + + public double getFactorFromSteam(FluidType type) { + + switch(type) { + case STEAM: return 1D; + case HOTSTEAM: return 10D; + case SUPERHOTSTEAM: return 100D; + case ULTRAHOTSTEAM: return 1000D; + default: return 0D; + } + } @Override public void fillFluidInit(FluidType type) { - fillFluid(this.xCoord, this.yCoord + 5, this.zCoord, getTact(), type); + fillFluid(this.xCoord, this.yCoord + RBMKDials.getColumnHeight(worldObj) + 1, this.zCoord, getTact(), type); } @Override diff --git a/src/main/resources/assets/hbm/lang/de_DE.lang b/src/main/resources/assets/hbm/lang/de_DE.lang index afe85734b..88f2e101b 100644 --- a/src/main/resources/assets/hbm/lang/de_DE.lang +++ b/src/main/resources/assets/hbm/lang/de_DE.lang @@ -1396,6 +1396,8 @@ item.ingot_uranium_fuel.name=Urankernbrennstoffbarren item.ingot_verticium.name=Verticiumbarren item.ingot_weidanium.name=Weidaniumbarren item.ingot_zirconium.name=Zirkoniumwürfel +item.injector_5htp.name=5-HTP-Autoinjektor +item.injector_knife.name=20cm Klingen-Autoinjektor item.ink.name=林-Tinte item.insert_doxium.name=Astolfium-dottierte Doxiumeinlage item.insert_du.name=DU-Einlage diff --git a/src/main/resources/assets/hbm/lang/en_US.lang b/src/main/resources/assets/hbm/lang/en_US.lang index f63a41a00..94fbd8b33 100644 --- a/src/main/resources/assets/hbm/lang/en_US.lang +++ b/src/main/resources/assets/hbm/lang/en_US.lang @@ -1396,6 +1396,8 @@ item.ingot_uranium_fuel.name=Ingot of Uranium Fuel item.ingot_verticium.name=Verticium Ingot item.ingot_weidanium.name=Weidanium Ingot item.ingot_zirconium.name=Zirconium Cube +item.injector_5htp.name=5-HTP Autoinjector +item.injector_knife.name=8 Inch Blade Autoinjector item.ink.name=林 Ink item.insert_doxium.name=Astolfium-Doped Doxium Insert item.insert_du.name=DU Insert diff --git a/src/main/resources/assets/hbm/textures/items/injector_5htp.png b/src/main/resources/assets/hbm/textures/items/injector_5htp.png new file mode 100644 index 000000000..19ff0a9cd Binary files /dev/null and b/src/main/resources/assets/hbm/textures/items/injector_5htp.png differ diff --git a/src/main/resources/assets/hbm/textures/items/injector_knife.png b/src/main/resources/assets/hbm/textures/items/injector_knife.png new file mode 100644 index 000000000..e5d1ce7af Binary files /dev/null and b/src/main/resources/assets/hbm/textures/items/injector_knife.png differ diff --git a/src/main/resources/assets/hbm/textures/models/weapons/lance.png b/src/main/resources/assets/hbm/textures/models/weapons/lance.png new file mode 100644 index 000000000..6513a4bca Binary files /dev/null and b/src/main/resources/assets/hbm/textures/models/weapons/lance.png differ