diff --git a/changelog b/changelog index 61558946a..404c55913 100644 --- a/changelog +++ b/changelog @@ -1,33 +1,27 @@ ## Added -* Analysis tool - * A more universal version of the power net analyzer - * Currently only works on fluid networks though - * In addition to seeing links and subscribers, the analysis tool also displays subscriber positions as well as a log (up to 50 entries) of what block received how much fluid - * This should finally give more insight in the bug that rarely causes fluids to disappear -* Leadburster - * A 40mm launcher grenade that doesn't explode, instead it attaches itself to a block and starts firing bullets - * Fires in circles for 2 seconds before it self-destructs -* Congo lake - * A 40mm pump-action grenade launcher with a capacity of 4 rounds -* Lantern - * Cheap and fancy illumination - * Will blind glyphids in a small radius - * Glyphids don't actually have eyes, just don't think about it too much -* Ashpit - * An optional part that can be placed under fireboxes and heating ovens - * Collects ashes, producing one ash pile for every 10 furnace operations worth of fuel - * Ash comes in different types like wood (from planks, logs and saplings), coal (coal, lignite and coke) and generic (everything else) - * Ashes can be used as dyes, for making industrial fertilizer, as low-efficiency furnace fuel or for carbon in the crucible - * Coal ashes can also be centrifuged, returning the flammable content as unburned coal dust as well as a small amount of boron +* PWR + * The successor to the old large nuclear reactor + * Has some design similarities with the RBMK, but in 3D + * Relatively easy to build and safe to operate + * Does not use any tile entity rendering and all math is pre-calculated when the reactor is assembled, making this one even more performant than the old large reactor +* Sodalite + * A gem that can be extracted from fluorite ore + * Can be heated in the combination oven to make sodium dust and chlorine ## Changed -* Updated polish and chinese localization -* Flechettes now get stuck in blocks for a few seconds -* NBT kits now display the amount of items in a stack -* Removed the special nuclear meteorite +* Bedrock fluorite ore now yields actual ore instead of fluorite directly +* Blocks that fall from fallout effects no longer drop items when falling on small blocks, preventing issues like gas blocks being dropped +* Bullets no longer need primers to be crafted, primers no longer exist at all +* The automatic buzzsaw can now use wood oil, ethanol, fish oil and heavy oil to run +* Fluorite ore is now centrifugable +* Fluorite crystals now centrifuge into slightly less fluorite but also yield sodalite ## Fixed -* Fixed thermos crashing config hitting before the config is saved, resulting in an empty config the first time the server is launched -* Fixed heating oven not visually connecting to exhaust pipes -* Fixed loot blocks not correctly rendering items that require multiple render passes -* Fixed special meteorites spawning in worldgen +* Fixed FEnSU's IO limit not working properly +* Fixed overflow caused by uncapped Spk values of DFC beams, they are now capped at 9,200,000 Spk +* Fixed smooth lighting not working on connected textures +* Fixed the Thermos preventer not working on Crucible type servers +* Fixed pollution save files not working correctly on certain Thermos forks +* Fixed blast furnace output overstacking +* Fixed potential crash caused by centrifuges trying to create a recipe using non-registered items +* Fixed chemplant GUI crashing when too many upgrades are applied to a short duration recipe diff --git a/src/main/java/com/hbm/blocks/bomb/NukeBoy.java b/src/main/java/com/hbm/blocks/bomb/NukeBoy.java index 01673e12d..d25f59ace 100644 --- a/src/main/java/com/hbm/blocks/bomb/NukeBoy.java +++ b/src/main/java/com/hbm/blocks/bomb/NukeBoy.java @@ -5,10 +5,12 @@ import java.util.Random; import com.hbm.blocks.ModBlocks; import com.hbm.config.BombConfig; import com.hbm.entity.effect.EntityNukeCloudSmall; +import com.hbm.entity.effect.EntityNukeTorex; import com.hbm.entity.logic.EntityNukeExplosionMK5; import com.hbm.interfaces.IBomb; import com.hbm.main.MainRegistry; import com.hbm.tileentity.bomb.TileEntityNukeBoy; +import com.hbm.util.TrackerUtil; import cpw.mods.fml.common.network.internal.FMLNetworkHandler; import net.minecraft.block.Block; @@ -124,7 +126,13 @@ public class NukeBoy extends BlockContainer implements IBomb { world.playSoundEffect(x, y, z, "random.explode", 1.0f, world.rand.nextFloat() * 0.1F + 0.9F); world.spawnEntityInWorld(EntityNukeExplosionMK5.statFac(world, BombConfig.boyRadius, x + 0.5, y + 0.5, z + 0.5)); - world.spawnEntityInWorld(EntityNukeCloudSmall.statFac(world, x, y, z, BombConfig.boyRadius)); + //world.spawnEntityInWorld(EntityNukeCloudSmall.statFac(world, x, y, z, BombConfig.boyRadius)); + + EntityNukeTorex torex = new EntityNukeTorex(world); + torex.setPositionAndRotation(x + 0.5, y + 1, z + 0.5, 0, 0); + torex.getDataWatcher().updateObject(10, 1.5F); + world.spawnEntityInWorld(torex); + TrackerUtil.setTrackingRange(world, torex, 1000); } return false; } diff --git a/src/main/java/com/hbm/blocks/machine/BlockPWR.java b/src/main/java/com/hbm/blocks/machine/BlockPWR.java index 7012f5437..d30541e60 100644 --- a/src/main/java/com/hbm/blocks/machine/BlockPWR.java +++ b/src/main/java/com/hbm/blocks/machine/BlockPWR.java @@ -3,12 +3,14 @@ package com.hbm.blocks.machine; import java.util.Random; import com.hbm.blocks.ModBlocks; +import com.hbm.inventory.fluid.FluidType; import com.hbm.lib.RefStrings; import com.hbm.render.block.ct.CT; import com.hbm.render.block.ct.CTStitchReceiver; import com.hbm.render.block.ct.IBlockCT; import com.hbm.tileentity.machine.TileEntityPWRController; +import api.hbm.fluid.IFluidConnector; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; @@ -22,6 +24,7 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; public class BlockPWR extends BlockContainer implements IBlockCT { @@ -91,7 +94,7 @@ public class BlockPWR extends BlockContainer implements IBlockCT { super.breakBlock(world, x, y, z, block, meta); } - public static class TileEntityBlockPWR extends TileEntity { + public static class TileEntityBlockPWR extends TileEntity implements IFluidConnector { public Block block; public int coreX; @@ -154,5 +157,46 @@ public class BlockPWR extends BlockContainer implements IBlockCT { this.worldObj.markTileEntityChunkModified(this.xCoord, this.yCoord, this.zCoord, this); } } + + @Override + public long transferFluid(FluidType type, int pressure, long fluid) { + + if(this.getBlockMetadata() != 1) return fluid; + if(block == null) return fluid; + + if(worldObj.getChunkProvider().chunkExists(coreX >> 4, coreZ >> 4)) { + + TileEntity tile = worldObj.getTileEntity(coreX, coreY, coreZ); + if(tile instanceof TileEntityPWRController) { + TileEntityPWRController controller = (TileEntityPWRController) tile; + return controller.transferFluid(type, pressure, fluid); + } + } + + return fluid; + } + + @Override + public long getDemand(FluidType type, int pressure) { + + if(this.getBlockMetadata() != 1) return 0; + if(block == null) return 0; + + if(worldObj.getChunkProvider().chunkExists(coreX >> 4, coreZ >> 4)) { + + TileEntity tile = worldObj.getTileEntity(coreX, coreY, coreZ); + if(tile instanceof TileEntityPWRController) { + TileEntityPWRController controller = (TileEntityPWRController) tile; + return controller.getDemand(type, pressure); + } + } + + return 0; + } + + @Override + public boolean canConnect(FluidType type, ForgeDirection dir) { + return this.getBlockMetadata() == 1; + } } } diff --git a/src/main/java/com/hbm/blocks/machine/MachineAutosaw.java b/src/main/java/com/hbm/blocks/machine/MachineAutosaw.java index fe568c409..0aeca216d 100644 --- a/src/main/java/com/hbm/blocks/machine/MachineAutosaw.java +++ b/src/main/java/com/hbm/blocks/machine/MachineAutosaw.java @@ -5,16 +5,25 @@ import java.util.List; import java.util.Locale; import com.hbm.blocks.ILookOverlay; +import com.hbm.blocks.ITooltipProvider; +import com.hbm.inventory.fluid.FluidType; +import com.hbm.items.machine.IItemFluidIdentifier; import com.hbm.tileentity.machine.TileEntityMachineAutosaw; import com.hbm.util.I18nUtil; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.ChatStyle; +import net.minecraft.util.EnumChatFormatting; import net.minecraft.world.World; import net.minecraftforge.client.event.RenderGameOverlayEvent.Pre; -public class MachineAutosaw extends BlockContainer implements ILookOverlay { +public class MachineAutosaw extends BlockContainer implements ILookOverlay, ITooltipProvider { public MachineAutosaw() { super(Material.iron); @@ -39,6 +48,30 @@ public class MachineAutosaw extends BlockContainer implements ILookOverlay { public boolean renderAsNormalBlock() { return false; } + + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { + + if(!world.isRemote && !player.isSneaking()) { + + if(player.getHeldItem() != null && player.getHeldItem().getItem() instanceof IItemFluidIdentifier) { + + TileEntityMachineAutosaw saw = (TileEntityMachineAutosaw) world.getTileEntity(x, y, z); + + FluidType type = ((IItemFluidIdentifier) player.getHeldItem().getItem()).getType(world, x, y, z, player.getHeldItem()); + if(saw.acceptedFuels.contains(type)) { + saw.tank.setTankType(type); + saw.markDirty(); + player.addChatComponentMessage(new ChatComponentText("Changed type to ").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.YELLOW)).appendSibling(new ChatComponentTranslation("hbmfluid." + type.getName().toLowerCase(Locale.US))).appendSibling(new ChatComponentText("!"))); + return true; + } + } + + return false; + } + + return true; + } @Override public void printHook(Pre event, World world, int x, int y, int z) { @@ -55,4 +88,9 @@ public class MachineAutosaw extends BlockContainer implements ILookOverlay { ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text); } + + @Override + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) { + this.addStandardInfo(stack, player, list, ext); + } } diff --git a/src/main/java/com/hbm/entity/effect/EntityNukeTorex.java b/src/main/java/com/hbm/entity/effect/EntityNukeTorex.java index b93311496..8e0ef45f1 100644 --- a/src/main/java/com/hbm/entity/effect/EntityNukeTorex.java +++ b/src/main/java/com/hbm/entity/effect/EntityNukeTorex.java @@ -36,6 +36,17 @@ public class EntityNukeTorex extends Entity { this.dataWatcher.addObject(10, new Float(1)); } + @Override + @SideOnly(Side.CLIENT) + public int getBrightnessForRender(float p_70070_1_) { + return 15728880; + } + + @Override + public float getBrightness(float p_70013_1_) { + return 1.0F; + } + @Override public void onUpdate() { @@ -151,7 +162,7 @@ public class EntityNukeTorex extends Entity { if(life > fadeOut) { float fac = (float)(life - fadeOut) / (float)(lifetime - fadeOut); - return 1F - fac * fac; + return 1F - fac; } return 1.0F; diff --git a/src/main/java/com/hbm/inventory/OreDictManager.java b/src/main/java/com/hbm/inventory/OreDictManager.java index 36a75a648..02afded30 100644 --- a/src/main/java/com/hbm/inventory/OreDictManager.java +++ b/src/main/java/com/hbm/inventory/OreDictManager.java @@ -212,6 +212,7 @@ public class OreDictManager { public static final DictFrame CINNABAR = new DictFrame("Cinnabar"); public static final DictFrame BORAX = new DictFrame("Borax"); public static final DictFrame CHLOROCALCITE = new DictFrame("Chlorocalcite"); + public static final DictFrame SODALITE = new DictFrame("Sodalite"); public static final DictFrame VOLCANIC = new DictFrame("Volcanic"); public static final DictFrame HEMATITE = new DictFrame("Hematite"); public static final DictFrame MALACHITE = new DictFrame("Malachite"); @@ -221,6 +222,8 @@ public class OreDictManager { */ /** LITHIUM */ public static final DictFrame LI = new DictFrame("Lithium"); + /** SODIUM */ + public static final DictFrame NA = new DictFrame("Sodium"); /* * PHOSPHORUS */ @@ -395,6 +398,7 @@ public class OreDictManager { CINNABAR .crystal(cinnebar) .gem(cinnebar) .ore(ore_cinnebar, ore_depth_cinnebar); BORAX .dust(powder_borax) .ore(ore_depth_borax); CHLOROCALCITE .dust(powder_chlorocalcite); + SODALITE .gem(gem_sodalite); VOLCANIC .gem(gem_volcanic) .ore(basalt_gem); HEMATITE .ore(fromOne(stone_resource, EnumStoneType.HEMATITE)); MALACHITE .ore(fromOne(stone_resource, EnumStoneType.MALACHITE)); @@ -404,6 +408,7 @@ public class OreDictManager { * HAZARDS, MISC */ LI .hydro(1F) .ingot(lithium) .dustSmall(powder_lithium_tiny) .dust(powder_lithium) .block(block_lithium) .ore(ore_gneiss_lithium, ore_meteor_lithium); + NA .hydro(1F) .dust(powder_sodium); /* * PHOSPHORUS diff --git a/src/main/java/com/hbm/inventory/fluid/Fluids.java b/src/main/java/com/hbm/inventory/fluid/Fluids.java index fba8a1b43..2ad14ed42 100644 --- a/src/main/java/com/hbm/inventory/fluid/Fluids.java +++ b/src/main/java/com/hbm/inventory/fluid/Fluids.java @@ -156,6 +156,7 @@ public class Fluids { public static FluidType SMOKE_LEADED; public static FluidType SMOKE_POISON; public static FluidType HELIUM4; + public static FluidType HEAVYWATER_HOT; private static final HashMap idMapping = new HashMap(); private static final HashMap nameMapping = new HashMap(); @@ -311,7 +312,8 @@ public class Fluids { SMOKE = new FluidType("SMOKE", 0x808080, 0, 0, 0, EnumSymbol.NONE).addTraits(GASEOUS, NOID, NOCON); SMOKE_LEADED = new FluidType("SMOKE_LEADED", 0x808080, 0, 0, 0, EnumSymbol.NONE).addTraits(GASEOUS, NOID, NOCON); SMOKE_POISON = new FluidType("SMOKE_POISON", 0x808080, 0, 0, 0, EnumSymbol.NONE).addTraits(GASEOUS, NOID, NOCON); - HELIUM4 = new FluidType(123,"HELIUM4", 0xE54B0A, 0, 0, 0, EnumSymbol.ASPHYXIANT).addTraits(GASEOUS); + HELIUM4 = new FluidType("HELIUM4", 0xE54B0A, 0, 0, 0, EnumSymbol.ASPHYXIANT).addTraits(GASEOUS); + HEAVYWATER_HOT = new FluidType(124, "HEAVYWATER_HOT",0x4D007B, 1, 0, 0, EnumSymbol.NONE).setTemp(600).addTraits(LIQUID); // ^ ^ ^ ^ ^ ^ ^ ^ //ADD NEW FLUIDS HERE @@ -323,6 +325,7 @@ public class Fluids { //vanilla metaOrder.add(WATER); metaOrder.add(HEAVYWATER); + metaOrder.add(HEAVYWATER_HOT); metaOrder.add(LAVA); //steams metaOrder.add(STEAM); @@ -490,8 +493,7 @@ public class Fluids { HOTOIL.addTraits(new FT_Coolable(OIL, 1, 1, 10).setEff(CoolingType.HEATEXCHANGER, 1.0D)); HOTCRACKOIL.addTraits(new FT_Coolable(CRACKOIL, 1, 1, 10).setEff(CoolingType.HEATEXCHANGER, 1.0D)); - COOLANT.addTraits(new FT_Heatable().setEff(HeatingType.HEATEXCHANGER, 1.0D).addStep(300, 1, COOLANT_HOT, 1)); - COOLANT.addTraits(new FT_Heatable().setEff(HeatingType.PWR, 1.0D).addStep(300, 1, COOLANT_HOT, 1)); + COOLANT.addTraits(new FT_Heatable().setEff(HeatingType.HEATEXCHANGER, 1.0D).setEff(HeatingType.PWR, 1.0D).addStep(300, 1, COOLANT_HOT, 1)); COOLANT_HOT.addTraits(new FT_Coolable(COOLANT, 1, 1, 300).setEff(CoolingType.HEATEXCHANGER, 1.0D)); MUG.addTraits(new FT_Heatable().setEff(HeatingType.HEATEXCHANGER, 1.0D).addStep(400, 1, MUG_HOT, 1)); @@ -500,6 +502,9 @@ public class Fluids { BLOOD.addTraits(new FT_Heatable().setEff(HeatingType.HEATEXCHANGER, 1.0D).addStep(500, 1, BLOOD_HOT, 1)); BLOOD_HOT.addTraits(new FT_Coolable(BLOOD, 1, 1, 500).setEff(CoolingType.HEATEXCHANGER, 1.0D)); + HEAVYWATER.addTraits(new FT_Heatable().setEff(HeatingType.PWR, 1.0D).addStep(300, 1, HEAVYWATER_HOT, 1), new FT_PWRModerator(1.25D)); + HEAVYWATER_HOT.addTraits(new FT_Coolable(HEAVYWATER, 1, 1, 300).setEff(CoolingType.HEATEXCHANGER, 1.0D)); + if(idMapping.size() != metaOrder.size()) { throw new IllegalStateException("A severe error has occoured during NTM's fluid registering process! The MetaOrder and Mappings are inconsistent! Mapping size: " + idMapping.size()+ " / MetaOrder size: " + metaOrder.size()); } diff --git a/src/main/java/com/hbm/inventory/fluid/trait/FT_PWRModerator.java b/src/main/java/com/hbm/inventory/fluid/trait/FT_PWRModerator.java new file mode 100644 index 000000000..65386405a --- /dev/null +++ b/src/main/java/com/hbm/inventory/fluid/trait/FT_PWRModerator.java @@ -0,0 +1,43 @@ +package com.hbm.inventory.fluid.trait; + +import java.io.IOException; +import java.util.List; + +import com.google.gson.JsonObject; +import com.google.gson.stream.JsonWriter; + +import net.minecraft.util.EnumChatFormatting; + +public class FT_PWRModerator extends FluidTrait { + + private double multiplier; + + public FT_PWRModerator(double mulitplier) { + this.multiplier = mulitplier; + } + + public double getMultiplier() { + return multiplier; + } + + @Override + public void addInfo(List info) { + info.add(EnumChatFormatting.BLUE + "[PWR Flux Multiplier]"); + } + + @Override + public void addInfoHidden(List info) { + int mult = (int) (multiplier * 100 - 100); + info.add(EnumChatFormatting.BLUE + "Core flux " + (mult >= 0 ? "+" : "") + mult + "%"); + } + + @Override + public void serializeJSON(JsonWriter writer) throws IOException { + writer.name("multiplier").value(multiplier); + } + + @Override + public void deserializeJSON(JsonObject obj) { + this.multiplier = obj.get("multiplier").getAsDouble(); + } +} diff --git a/src/main/java/com/hbm/inventory/fluid/trait/FluidTrait.java b/src/main/java/com/hbm/inventory/fluid/trait/FluidTrait.java index ba385ad54..ff2522d09 100644 --- a/src/main/java/com/hbm/inventory/fluid/trait/FluidTrait.java +++ b/src/main/java/com/hbm/inventory/fluid/trait/FluidTrait.java @@ -24,6 +24,7 @@ public abstract class FluidTrait { traitNameMap.put("poison", FT_Poison.class); // x traitNameMap.put("toxin", FT_Toxin.class); // x traitNameMap.put("ventradiation", FT_VentRadiation.class); // x + traitNameMap.put("pwrmoderator", FT_PWRModerator.class); // x traitNameMap.put("gaseous", FT_Gaseous.class); traitNameMap.put("gaseous_art", FT_Gaseous_ART.class); diff --git a/src/main/java/com/hbm/inventory/gui/GUIPWR.java b/src/main/java/com/hbm/inventory/gui/GUIPWR.java index af7130a47..b8888ec02 100644 --- a/src/main/java/com/hbm/inventory/gui/GUIPWR.java +++ b/src/main/java/com/hbm/inventory/gui/GUIPWR.java @@ -1,21 +1,29 @@ package com.hbm.inventory.gui; +import org.apache.commons.lang3.math.NumberUtils; +import org.lwjgl.input.Keyboard; import org.lwjgl.opengl.GL11; import com.hbm.inventory.container.ContainerPWR; import com.hbm.items.ModItems; import com.hbm.lib.RefStrings; +import com.hbm.packet.NBTControlPacket; +import com.hbm.packet.PacketDispatcher; import com.hbm.render.util.GaugeUtil; import com.hbm.render.util.GaugeUtil.Gauge; import com.hbm.tileentity.machine.TileEntityPWRController; import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.GuiTextField; import net.minecraft.client.renderer.RenderHelper; import net.minecraft.client.resources.I18n; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.MathHelper; import net.minecraft.util.ResourceLocation; public class GUIPWR extends GuiInfoContainer { @@ -23,6 +31,8 @@ public class GUIPWR extends GuiInfoContainer { protected TileEntityPWRController controller; private final ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/reactors/gui_pwr.png"); + private GuiTextField field; + public GUIPWR(InventoryPlayer inventory, TileEntityPWRController controller) { super(new ContainerPWR(inventory, controller)); this.controller = controller; @@ -30,6 +40,21 @@ public class GUIPWR extends GuiInfoContainer { this.xSize = 176; this.ySize = 188; } + + @Override + public void initGui() { + super.initGui(); + + Keyboard.enableRepeatEvents(true); + + this.field = new GuiTextField(this.fontRendererObj, guiLeft + 57, guiTop + 63, 30, 8); + this.field.setTextColor(0x00ff00); + this.field.setDisabledTextColour(0x008000); + this.field.setEnableBackgroundDrawing(false); + this.field.setMaxStringLength(3); + + this.field.setText((100 - controller.rodTarget) + ""); + } @Override public void drawScreen(int x, int y, float interp) { @@ -37,11 +62,9 @@ public class GUIPWR extends GuiInfoContainer { this.drawCustomInfoStat(x, y, guiLeft + 115, guiTop + 31, 18, 18, x, y, new String[] { "Core: " + String.format("%,d", controller.coreHeat) + " / " + String.format("%,d", controller.coreHeatCapacity) + " TU" }); this.drawCustomInfoStat(x, y, guiLeft + 151, guiTop + 31, 18, 18, x, y, new String[] { "Hull: " + String.format("%,d", controller.hullHeat) + " / " + String.format("%,d", controller.hullHeatCapacity) + " TU" }); - - //TODO: calculate some prediction using extrapolation (or some math sector that ends with -ic) - //int timeLeft = (controller.processTime - controller.progress) / 20; - //this.drawCustomInfoStat(x, y, guiLeft + 52, guiTop + 31, 36, 18, x, y, new String[] { "Cycle: " + (timeLeft / 60) + ":" + String.format("%02d", timeLeft % 60)}); + this.drawCustomInfoStat(x, y, guiLeft + 52, guiTop + 31, 36, 18, x, y, new String[] { ((int) (controller.progress * 100 / controller.processTime)) + "%" }); + this.drawCustomInfoStat(x, y, guiLeft + 52, guiTop + 53, 54, 4, x, y, "Control rod level: " + (100 - controller.rodLevel) + "%"); if(controller.typeLoaded != -1 && controller.amountLoaded > 0) { ItemStack display = new ItemStack(ModItems.pwr_fuel, 1, controller.typeLoaded); @@ -86,9 +109,15 @@ public class GUIPWR extends GuiInfoContainer { Minecraft.getMinecraft().getTextureManager().bindTexture(texture); drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize); - if(System.currentTimeMillis() % 1000 < 500) + if(controller.hullHeat > controller.hullHeatCapacity * 0.8 || controller.coreHeat > controller.coreHeatCapacity * 0.8) drawTexturedModalRect(guiLeft + 147, guiTop, 176, 14, 26, 26); + int p = (int) (controller.progress * 33 / controller.processTime); + drawTexturedModalRect(guiLeft + 54, guiTop + 33, 176, 0, p, 14); + + int c = (int) (controller.rodLevel * 52 / 100); + drawTexturedModalRect(guiLeft + 53, guiTop + 54, 176, 40, c, 2); + GaugeUtil.renderGauge(Gauge.ROUND_SMALL, guiLeft + 115, guiTop + 31, this.zLevel, (double) controller.coreHeat / (double) controller.coreHeatCapacity); GaugeUtil.renderGauge(Gauge.ROUND_SMALL, guiLeft + 151, guiTop + 31, this.zLevel, (double) controller.hullHeat / (double) controller.hullHeatCapacity); @@ -96,6 +125,40 @@ public class GUIPWR extends GuiInfoContainer { ItemStack display = new ItemStack(ModItems.pwr_fuel, 1, controller.typeLoaded); this.drawItemStack(display, guiLeft + 89, guiTop + 5, EnumChatFormatting.YELLOW + "" + controller.amountLoaded + "/" + controller.rodCount); RenderHelper.enableGUIStandardItemLighting(); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + } + + GL11.glDisable(GL11.GL_LIGHTING); + + controller.tanks[0].renderTank(guiLeft + 8, guiTop + 57, this.zLevel, 16, 52); + controller.tanks[1].renderTank(guiLeft + 26, guiTop + 57, this.zLevel, 16, 52); + + this.field.drawTextBox(); + } + + @Override + protected void mouseClicked(int mouseX, int mouseY, int i) { + super.mouseClicked(mouseX, mouseY, i); + this.field.mouseClicked(mouseX, mouseY, i); + + if(guiLeft + 88 <= mouseX && guiLeft + 88 + 18 > mouseX && guiTop + 58 < mouseY && guiTop + 58 + 18 >= mouseY) { + + if(NumberUtils.isNumber(field.getText())) { + int level = (int)MathHelper.clamp_double(Double.parseDouble(field.getText()), 0, 100); + field.setText(level + ""); + + NBTTagCompound control = new NBTTagCompound(); + control.setInteger("control", 100 - level); + PacketDispatcher.wrapper.sendToServer(new NBTControlPacket(control, controller.xCoord, controller.yCoord, controller.zCoord)); + mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1F)); + + } } } + + @Override + protected void keyTyped(char c, int i) { + if(this.field.textboxKeyTyped(c, i)) return; + super.keyTyped(c, i); + } } diff --git a/src/main/java/com/hbm/inventory/recipes/CentrifugeRecipes.java b/src/main/java/com/hbm/inventory/recipes/CentrifugeRecipes.java index a3735f8bb..1f1aa97ea 100644 --- a/src/main/java/com/hbm/inventory/recipes/CentrifugeRecipes.java +++ b/src/main/java/com/hbm/inventory/recipes/CentrifugeRecipes.java @@ -1,6 +1,7 @@ package com.hbm.inventory.recipes; import java.io.IOException; +import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map.Entry; @@ -188,8 +189,9 @@ public class CentrifugeRecipes extends SerializableRecipe { new ItemStack(ModItems.nugget_pu238, 6), new ItemStack(ModItems.nuclear_waste, 2) }); - if(OreDictionary.doesOreNameExist("nuggetNaquadria")) { - ItemStack nuggetNQR = OreDictionary.getOres("nuggetNaquadria").get(0); + ArrayList naquadriaNuggets = OreDictionary.getOres("nuggetNaquadria"); + if(naquadriaNuggets.size() != 0) { + ItemStack nuggetNQR = naquadriaNuggets.get(0); ItemStack copy = nuggetNQR.copy(); copy.stackSize = 12; recipes.put(new ComparableStack(DictFrame.fromOne(ModItems.watz_pellet_depleted, EnumWatzType.NQD)), new ItemStack[] { @@ -318,6 +320,12 @@ public class CentrifugeRecipes extends SerializableRecipe { new ItemStack(ModItems.powder_emerald, 1), new ItemStack(Blocks.gravel, 1) }); + recipes.put(new OreDictStack(F.ore()), new ItemStack[] { + new ItemStack(ModItems.fluorite, 3), + new ItemStack(ModItems.fluorite, 3), + new ItemStack(ModItems.gem_sodalite, 1), + new ItemStack(Blocks.gravel, 1) }); + recipes.put(new OreDictStack(REDSTONE.ore()), new ItemStack[] { new ItemStack(Items.redstone, 3), new ItemStack(Items.redstone, 3), @@ -455,7 +463,7 @@ public class CentrifugeRecipes extends SerializableRecipe { recipes.put(new ComparableStack(ModItems.crystal_copper), new ItemStack[] { new ItemStack(ModItems.powder_copper, 2), new ItemStack(ModItems.powder_copper, 2), new ItemStack(ModItems.sulfur, 1), new ItemStack(ModItems.powder_cobalt_tiny, 1) }); recipes.put(new ComparableStack(ModItems.crystal_tungsten), new ItemStack[] { new ItemStack(ModItems.powder_tungsten, 2), new ItemStack(ModItems.powder_tungsten, 2), new ItemStack(ModItems.powder_iron, 1), new ItemStack(ModItems.powder_lithium_tiny, 1) }); recipes.put(new ComparableStack(ModItems.crystal_aluminium), new ItemStack[] { new ItemStack(ModItems.powder_aluminium, 2), new ItemStack(ModItems.powder_aluminium, 2), new ItemStack(ModItems.powder_iron, 1), new ItemStack(ModItems.powder_lithium_tiny, 1) }); - recipes.put(new ComparableStack(ModItems.crystal_fluorite), new ItemStack[] { new ItemStack(ModItems.fluorite, 3), new ItemStack(ModItems.fluorite, 3), new ItemStack(ModItems.fluorite, 3), new ItemStack(ModItems.powder_lithium_tiny, 1) }); + recipes.put(new ComparableStack(ModItems.crystal_fluorite), new ItemStack[] { new ItemStack(ModItems.fluorite, 4), new ItemStack(ModItems.fluorite, 4), new ItemStack(ModItems.gem_sodalite, 2), new ItemStack(ModItems.powder_lithium_tiny, 1) }); recipes.put(new ComparableStack(ModItems.crystal_beryllium), new ItemStack[] { new ItemStack(ModItems.powder_beryllium, 2), new ItemStack(ModItems.powder_beryllium, 2), new ItemStack(ModItems.powder_quartz, 1), new ItemStack(ModItems.powder_lithium_tiny, 1) }); recipes.put(new ComparableStack(ModItems.crystal_lead), new ItemStack[] { new ItemStack(ModItems.powder_lead, 2), new ItemStack(ModItems.powder_lead, 2), new ItemStack(ModItems.powder_gold, 1), new ItemStack(ModItems.powder_lithium_tiny, 1) }); recipes.put(new ComparableStack(ModItems.crystal_schraranium), new ItemStack[] { new ItemStack(ModItems.nugget_schrabidium, 2), new ItemStack(ModItems.nugget_schrabidium, 2), new ItemStack(ModItems.nugget_uranium, 2), new ItemStack(ModItems.nugget_plutonium, 2) }); diff --git a/src/main/java/com/hbm/inventory/recipes/CombinationRecipes.java b/src/main/java/com/hbm/inventory/recipes/CombinationRecipes.java index d1c218639..efcd14b13 100644 --- a/src/main/java/com/hbm/inventory/recipes/CombinationRecipes.java +++ b/src/main/java/com/hbm/inventory/recipes/CombinationRecipes.java @@ -43,9 +43,10 @@ public class CombinationRecipes extends SerializableRecipe { recipes.put(LIGNITE.dust(), new Pair(DictFrame.fromOne(ModItems.coke, EnumCokeType.LIGNITE), new FluidStack(Fluids.COALCREOSOTE, 50))); recipes.put(new ComparableStack(DictFrame.fromOne(ModItems.briquette, EnumBriquetteType.LIGNITE)), new Pair(DictFrame.fromOne(ModItems.coke, EnumCokeType.LIGNITE), new FluidStack(Fluids.COALCREOSOTE, 100))); - recipes.put(CINNABAR.crystal(), new Pair(new ItemStack(ModItems.sulfur), new FluidStack(Fluids.MERCURY, 100))); //recipes.put(CHLOROCALCITE.dust(), new Pair(new ItemStack(ModItems.powder_calcium), new FluidStack(Fluids.CHLORINE, 250))); - recipes.put(new ComparableStack(Items.glowstone_dust), new Pair(new ItemStack(ModItems.sulfur), new FluidStack(Fluids.CHLORINE, 100))); + recipes.put(CINNABAR.crystal(), new Pair(new ItemStack(ModItems.sulfur), new FluidStack(Fluids.MERCURY, 100))); + recipes.put(new ComparableStack(Items.glowstone_dust), new Pair(new ItemStack(ModItems.sulfur), new FluidStack(Fluids.CHLORINE, 100))); + recipes.put(SODALITE.gem(), new Pair(new ItemStack(ModItems.powder_sodium), new FluidStack(Fluids.CHLORINE, 100))); recipes.put(new ComparableStack(DictFrame.fromOne(ModBlocks.stone_resource, EnumStoneType.BAUXITE)), new Pair(new ItemStack(ModItems.ingot_aluminium, 2), new FluidStack(Fluids.REDMUD, 250))); recipes.put(KEY_LOG, new Pair(new ItemStack(Items.coal, 1 ,1), new FluidStack(Fluids.WOODOIL, 250))); diff --git a/src/main/java/com/hbm/inventory/recipes/FuelPoolRecipes.java b/src/main/java/com/hbm/inventory/recipes/FuelPoolRecipes.java index 2e80c2bb4..9f01c9d80 100644 --- a/src/main/java/com/hbm/inventory/recipes/FuelPoolRecipes.java +++ b/src/main/java/com/hbm/inventory/recipes/FuelPoolRecipes.java @@ -11,6 +11,7 @@ import com.google.gson.stream.JsonWriter; import com.hbm.inventory.RecipesCommon.ComparableStack; import com.hbm.inventory.recipes.loader.SerializableRecipe; import com.hbm.items.ModItems; +import com.hbm.items.machine.ItemPWRFuel.EnumPWRFuel; import net.minecraft.item.ItemStack; @@ -37,6 +38,8 @@ public class FuelPoolRecipes extends SerializableRecipe { recipes.put(new ComparableStack(ModItems.waste_plate_sa326, 1, 1), new ItemStack(ModItems.waste_plate_sa326)); recipes.put(new ComparableStack(ModItems.waste_plate_ra226be, 1, 1), new ItemStack(ModItems.waste_plate_ra226be)); recipes.put(new ComparableStack(ModItems.waste_plate_pu238be, 1, 1), new ItemStack(ModItems.waste_plate_pu238be)); + + for(EnumPWRFuel pwr : EnumPWRFuel.values()) recipes.put(new ComparableStack(ModItems.pwr_fuel_hot, 1, pwr.ordinal()), new ItemStack(ModItems.pwr_fuel_depleted, 1, pwr.ordinal())); } @Override diff --git a/src/main/java/com/hbm/items/ModItems.java b/src/main/java/com/hbm/items/ModItems.java index ba2d0ba6c..119a33d3b 100644 --- a/src/main/java/com/hbm/items/ModItems.java +++ b/src/main/java/com/hbm/items/ModItems.java @@ -415,7 +415,8 @@ public class ModItems { public static Item crystal_cinnebar; public static Item crystal_trixite; public static Item crystal_osmiridium; - + + public static Item gem_sodalite; public static Item gem_tantalium; public static Item gem_volcanic; public static Item gem_alexandrite; @@ -481,6 +482,7 @@ public class ModItems { public static Item powder_steel; public static Item powder_lithium; public static Item powder_zirconium; + public static Item powder_sodium; public static Item redstone_depleted; public static Item powder_australium; @@ -2828,6 +2830,7 @@ public class ModItems { crystal_cinnebar = new Item().setUnlocalizedName("crystal_cinnebar").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":crystal_cinnebar"); crystal_trixite = new Item().setUnlocalizedName("crystal_trixite").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":crystal_trixite"); crystal_osmiridium = new Item().setUnlocalizedName("crystal_osmiridium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":crystal_osmiridium"); + gem_sodalite = new ItemCustomLore().setUnlocalizedName("gem_sodalite").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":gem_sodalite"); gem_tantalium = new ItemCustomLore().setUnlocalizedName("gem_tantalium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":gem_tantalium"); gem_volcanic = new ItemCustomLore().setRarity(EnumRarity.uncommon).setUnlocalizedName("gem_volcanic").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":gem_volcanic"); gem_alexandrite = new ItemAlexandrite().setUnlocalizedName("gem_alexandrite").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":gem_alexandrite"); @@ -2877,6 +2880,7 @@ public class ModItems { powder_steel = new Item().setUnlocalizedName("powder_steel").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":powder_steel"); powder_lithium = new Item().setUnlocalizedName("powder_lithium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":powder_lithium"); powder_zirconium = new Item().setUnlocalizedName("powder_zirconium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":powder_zirconium"); + powder_sodium = new Item().setUnlocalizedName("powder_sodium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":powder_sodium"); redstone_depleted = new Item().setUnlocalizedName("redstone_depleted").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":redstone_depleted"); powder_power = new ItemCustomLore().setRarity(EnumRarity.uncommon).setUnlocalizedName("powder_power").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":powder_energy_alt"); powder_iodine = new ItemCustomLore().setRarity(EnumRarity.epic).setUnlocalizedName("powder_iodine").setCreativeTab(null).setTextureName(RefStrings.MODID + ":powder_iodine"); @@ -5764,6 +5768,7 @@ public class ModItems { GameRegistry.registerItem(powder_lithium, powder_lithium.getUnlocalizedName()); GameRegistry.registerItem(powder_lithium_tiny, powder_lithium_tiny.getUnlocalizedName()); GameRegistry.registerItem(powder_zirconium, powder_zirconium.getUnlocalizedName()); + GameRegistry.registerItem(powder_sodium, powder_sodium.getUnlocalizedName()); GameRegistry.registerItem(powder_lignite, powder_lignite.getUnlocalizedName()); GameRegistry.registerItem(powder_iodine, powder_iodine.getUnlocalizedName()); GameRegistry.registerItem(powder_thorium, powder_thorium.getUnlocalizedName()); @@ -5871,6 +5876,7 @@ public class ModItems { GameRegistry.registerItem(crystal_cinnebar, crystal_cinnebar.getUnlocalizedName()); GameRegistry.registerItem(crystal_trixite, crystal_trixite.getUnlocalizedName()); GameRegistry.registerItem(crystal_osmiridium, crystal_osmiridium.getUnlocalizedName()); + GameRegistry.registerItem(gem_sodalite, gem_sodalite.getUnlocalizedName()); GameRegistry.registerItem(gem_tantalium, gem_tantalium.getUnlocalizedName()); GameRegistry.registerItem(gem_volcanic, gem_volcanic.getUnlocalizedName()); GameRegistry.registerItem(gem_alexandrite, gem_alexandrite.getUnlocalizedName()); diff --git a/src/main/java/com/hbm/items/special/ItemBedrockOre.java b/src/main/java/com/hbm/items/special/ItemBedrockOre.java index 9d12bade0..f4362a93f 100644 --- a/src/main/java/com/hbm/items/special/ItemBedrockOre.java +++ b/src/main/java/com/hbm/items/special/ItemBedrockOre.java @@ -95,7 +95,8 @@ public class ItemBedrockOre extends ItemEnumMulti { GOLD("Gold", 0xF9D738, B_LEAD, B_COPPER, B_BISMUTH), //occurs with copper, lead and rare bismuthide URANIUM("Uranium", 0x868D82, B_LEAD, B_RADIUM, B_POLONIUM), //uranium and its decay products THORIUM("Thorium", 0x7D401D, B_SILICON, B_URANIUM, B_TECHNETIUM), //thorium occours with uraninite and decay products - CHLOROCALCITE("Chlorocalcite", 0xCDE036, B_LITHIUM, B_SILICON, B_SILICON); //i guess? + CHLOROCALCITE("Chlorocalcite", 0xCDE036, B_LITHIUM, B_SILICON, B_SILICON), //i guess? + FLUORITE("Fluorite", 0xF6F3E7, B_SILICON, B_LITHIUM, B_ALUMINIUM); //different silicon-bearing gemstones, generic lithium, aluminium from sodium compound trailings public String oreName; public int color; diff --git a/src/main/java/com/hbm/items/tool/ItemWandD.java b/src/main/java/com/hbm/items/tool/ItemWandD.java index 984f849d5..1560b01d8 100644 --- a/src/main/java/com/hbm/items/tool/ItemWandD.java +++ b/src/main/java/com/hbm/items/tool/ItemWandD.java @@ -2,15 +2,22 @@ package com.hbm.items.tool; import java.util.List; -import com.hbm.lib.HbmWorld; +import com.hbm.entity.effect.EntityNukeTorex; +import com.hbm.handler.pollution.PollutionHandler; +import com.hbm.handler.pollution.PollutionHandler.PollutionType; import com.hbm.lib.Library; -import com.hbm.world.gen.component.OfficeFeatures.LargeOfficeCorner; +import com.hbm.util.TrackerUtil; +import cpw.mods.fml.relauncher.ReflectionHelper; +import net.minecraft.entity.EntityTracker; +import net.minecraft.entity.EntityTrackerEntry; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.util.IntHashMap; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; +import net.minecraft.world.WorldServer; public class ItemWandD extends Item { @@ -66,15 +73,16 @@ 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.getDataWatcher().updateObject(10, 1.5F); world.spawnEntityInWorld(torex); - EntityTracker entitytracker = ((WorldServer) world).getEntityTracker(); + /*EntityTracker entitytracker = ((WorldServer) world).getEntityTracker(); IntHashMap map = ReflectionHelper.getPrivateValue(EntityTracker.class, entitytracker, "trackedEntityIDs", "field_72794_c"); EntityTrackerEntry entry = (EntityTrackerEntry) map.lookup(torex.getEntityId()); - entry.blocksDistanceThreshold = 1000; - world.spawnEntityInWorld(EntityNukeExplosionMK5.statFacNoRad(world, 150, pos.blockX, pos.blockY + 1, pos.blockZ));*/ + entry.blocksDistanceThreshold = 1000;*/ + TrackerUtil.setTrackingRange(world, torex, 1000); + //world.spawnEntityInWorld(EntityNukeExplosionMK5.statFacNoRad(world, 150, pos.blockX, pos.blockY + 1, pos.blockZ)); //DungeonToolbox.generateBedrockOreWithChance(world, world.rand, pos.blockX, pos.blockZ, EnumBedrockOre.TITANIUM, new FluidStack(Fluids.SULFURIC_ACID, 500), 2, 1); diff --git a/src/main/java/com/hbm/main/ModEventHandlerClient.java b/src/main/java/com/hbm/main/ModEventHandlerClient.java index 17a4e9682..a1bc1b705 100644 --- a/src/main/java/com/hbm/main/ModEventHandlerClient.java +++ b/src/main/java/com/hbm/main/ModEventHandlerClient.java @@ -1,7 +1,6 @@ package com.hbm.main; import java.lang.reflect.Method; -import java.util.ArrayList; import java.util.List; import java.util.Locale; import java.util.Random; @@ -18,7 +17,6 @@ import com.hbm.blocks.rail.IRailNTM.MoveContext; import com.hbm.blocks.rail.IRailNTM.RailCheckType; import com.hbm.blocks.rail.IRailNTM.RailContext; import com.hbm.config.GeneralConfig; -import com.hbm.entity.effect.EntityNukeTorex; import com.hbm.entity.mob.EntityHunterChopper; import com.hbm.entity.projectile.EntityChopperMine; import com.hbm.entity.train.EntityRailCarRidable; @@ -147,11 +145,38 @@ import net.minecraftforge.event.entity.player.ItemTooltipEvent; public class ModEventHandlerClient { + public static int flashTimer; + @SubscribeEvent public void onOverlayRender(RenderGameOverlayEvent.Pre event) { EntityPlayer player = Minecraft.getMinecraft().thePlayer; + /// NUKE FLASH /// + if(event.type == ElementType.CROSSHAIRS && flashTimer > 0) { + int width = event.resolution.getScaledWidth(); + int height = event.resolution.getScaledHeight(); + Tessellator tess = Tessellator.instance; + GL11.glDisable(GL11.GL_TEXTURE_2D); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE); + GL11.glAlphaFunc(GL11.GL_GEQUAL, 0.0F); + GL11.glDepthMask(false); + tess.startDrawingQuads(); + float brightness = (flashTimer - event.partialTicks) / 200F; + tess.setColorRGBA_F(1F, 1F, 1F, brightness * 0.8F); + tess.addVertex(width, 0, 0); + tess.addVertex(0, 0, 0); + tess.addVertex(0, height, 0); + tess.addVertex(width, height, 0); + tess.draw(); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); + GL11.glDepthMask(true); + return; + } + /// HANDLE GUN OVERLAYS /// if(player.getHeldItem() != null && player.getHeldItem().getItem() instanceof IItemHUD) { ((IItemHUD)player.getHeldItem().getItem()).renderHUD(event, event.type, player, player.getHeldItem()); @@ -196,18 +221,6 @@ public class ModEventHandlerClient { } } - List torex = world.getEntitiesWithinAABB(EntityNukeTorex.class, player.boundingBox.expand(100, 100, 100)); - - if(!torex.isEmpty()) { - EntityNukeTorex t = torex.get(0); - List text = new ArrayList(); - text.add("Speed: " + t.getSimulationSpeed()); - text.add("Alpha: " + t.getAlpha()); - text.add("Age: " + t.ticksExisted + " / " + t.getMaxAge()); - text.add("Clouds: " + t.cloudlets.size()); - ILookOverlay.printGeneric(event, "DEBUG", 0xff0000, 0x4040000, text); - } - /*List text = new ArrayList(); text.add("IMPACT: " + ImpactWorldHandler.getImpactForClient(world)); text.add("DUST: " + ImpactWorldHandler.getDustForClient(world)); @@ -1250,6 +1263,8 @@ public class ModEventHandlerClient { client.sendQueue.addToSendQueue(new C0CPacketInput(client.moveStrafing, client.moveForward, client.movementInput.jump, client.movementInput.sneak)); } } + + if(event.phase == Phase.START) if(flashTimer > 0) flashTimer--; } @SubscribeEvent diff --git a/src/main/java/com/hbm/main/ModEventHandlerRenderer.java b/src/main/java/com/hbm/main/ModEventHandlerRenderer.java index 7dd68dd4c..eee0c1d97 100644 --- a/src/main/java/com/hbm/main/ModEventHandlerRenderer.java +++ b/src/main/java/com/hbm/main/ModEventHandlerRenderer.java @@ -28,8 +28,10 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.MathHelper; import net.minecraft.util.MovingObjectPosition; import net.minecraftforge.client.event.DrawBlockHighlightEvent; +import net.minecraftforge.client.event.RenderGameOverlayEvent; import net.minecraftforge.client.event.EntityViewRenderEvent.FogColors; import net.minecraftforge.client.event.EntityViewRenderEvent.FogDensity; +import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; import net.minecraftforge.client.event.RenderPlayerEvent; public class ModEventHandlerRenderer { @@ -377,4 +379,15 @@ public class ModEventHandlerRenderer { event.blue = event.blue * (1 - interp) + sootColor * interp; } } + + @SubscribeEvent + public void onRenderHUD(RenderGameOverlayEvent.Pre event) { + + if(event.type == ElementType.HOTBAR && ModEventHandlerClient.flashTimer > 0) { + double mult = (ModEventHandlerClient.flashTimer + event.partialTicks) * 0.01D; + double horizontal = MathHelper.clamp_double(Math.sin(System.currentTimeMillis() * 0.02), -0.7, 0.7) * 5; + double vertical = MathHelper.clamp_double(Math.sin(System.currentTimeMillis() * 0.01 + 2), -0.7, 0.7) * 1; + GL11.glTranslated(horizontal * mult, vertical * mult, 0); + } + } } 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 661b57773..dfa21028c 100644 --- a/src/main/java/com/hbm/render/entity/effect/RenderTorex.java +++ b/src/main/java/com/hbm/render/entity/effect/RenderTorex.java @@ -2,6 +2,7 @@ package com.hbm.render.entity.effect; import java.util.ArrayList; import java.util.Comparator; +import java.util.Random; import org.lwjgl.opengl.GL11; @@ -9,6 +10,7 @@ import com.hbm.entity.effect.EntityNukeTorex; import com.hbm.entity.effect.EntityNukeTorex.Cloudlet; import com.hbm.lib.RefStrings; import com.hbm.main.MainRegistry; +import com.hbm.main.ModEventHandlerClient; import net.minecraft.client.renderer.ActiveRenderInfo; import net.minecraft.client.renderer.OpenGlHelper; @@ -23,6 +25,7 @@ import net.minecraft.util.Vec3; public class RenderTorex extends Render { private static final ResourceLocation cloudlet = new ResourceLocation(RefStrings.MODID + ":textures/particle/particle_base.png"); + private static final ResourceLocation flash = new ResourceLocation(RefStrings.MODID + ":textures/particle/flare.png"); @Override public void doRender(Entity entity, double x, double y, double z, float f0, float interp) { @@ -31,6 +34,8 @@ public class RenderTorex extends Render { GL11.glTranslated(x, y, z); EntityNukeTorex cloud = (EntityNukeTorex)entity; cloudletWrapper(cloud, interp); + if(cloud.ticksExisted < 101) flashWrapper(cloud, interp); + if(cloud.ticksExisted < 10 && ModEventHandlerClient.flashTimer < 100) ModEventHandlerClient.flashTimer = 200; GL11.glPopMatrix(); } @@ -81,6 +86,43 @@ public class RenderTorex extends Render { GL11.glDisable(GL11.GL_BLEND); GL11.glPopMatrix(); } + + private void flashWrapper(EntityNukeTorex cloud, float interp) { + + GL11.glPushMatrix(); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE); + GL11.glAlphaFunc(GL11.GL_GREATER, 0); + GL11.glDisable(GL11.GL_ALPHA_TEST); + GL11.glDepthMask(false); + RenderHelper.disableStandardItemLighting(); + + bindTexture(flash); + + Tessellator tess = Tessellator.instance; + tess.startDrawingQuads(); + + double age = Math.min(cloud.ticksExisted + interp, 100); + float alpha = (float) ((100D - age) / 100F); + + Random rand = new Random(cloud.getEntityId()); + + for(int i = 0; i < 3; i++) { + float x = (float) (rand.nextGaussian() * 0.5F * cloud.rollerSize); + float y = (float) (rand.nextGaussian() * 0.5F * cloud.rollerSize); + float z = (float) (rand.nextGaussian() * 0.5F * cloud.rollerSize); + tessellateFlash(tess, x, y + cloud.coreHeight, z, (float) (10 * cloud.rollerSize), alpha, interp); + } + + tess.draw(); + + GL11.glDepthMask(true); + GL11.glEnable(GL11.GL_ALPHA_TEST); + RenderHelper.enableStandardItemLighting(); + GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); + GL11.glDisable(GL11.GL_BLEND); + GL11.glPopMatrix(); + } private void tessellateCloudlet(Tessellator tess, double posX, double posY, double posZ, Cloudlet cloud, float interp) { @@ -104,6 +146,23 @@ public class RenderTorex extends Render { } + private void tessellateFlash(Tessellator tess, double posX, double posY, double posZ, float scale, float alpha, float interp) { + + float f1 = ActiveRenderInfo.rotationX; + float f2 = ActiveRenderInfo.rotationZ; + float f3 = ActiveRenderInfo.rotationYZ; + float f4 = ActiveRenderInfo.rotationXY; + float f5 = ActiveRenderInfo.rotationXZ; + + tess.setColorRGBA_F(1F, 1F, 1F, alpha); + + tess.addVertexWithUV((double) (posX - f1 * scale - f3 * scale), (double) (posY - f5 * scale), (double) (posZ - f2 * scale - f4 * scale), 1, 1); + tess.addVertexWithUV((double) (posX - f1 * scale + f3 * scale), (double) (posY + f5 * scale), (double) (posZ - f2 * scale + f4 * scale), 1, 0); + tess.addVertexWithUV((double) (posX + f1 * scale + f3 * scale), (double) (posY + f5 * scale), (double) (posZ + f2 * scale + f4 * scale), 0, 0); + tess.addVertexWithUV((double) (posX + f1 * scale - f3 * scale), (double) (posY - f5 * scale), (double) (posZ + f2 * scale - f4 * scale), 0, 1); + + } + @Override protected ResourceLocation getEntityTexture(Entity p_110775_1_) { return null; diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityCoreEmitter.java b/src/main/java/com/hbm/tileentity/machine/TileEntityCoreEmitter.java index 3f0f6bba4..a3adb1bc1 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityCoreEmitter.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityCoreEmitter.java @@ -129,7 +129,7 @@ public class TileEntityCoreEmitter extends TileEntityMachineBase implements IEne Block b = worldObj.getBlock(x, y, z); - if(b != Blocks.air) { + if(!b.isAir(worldObj, x, y, z)) { if(b.getMaterial().isLiquid()) { worldObj.playSoundEffect(x + 0.5, y + 0.5, z + 0.5, "random.fizz", 1.0F, 1.0F); diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityCoreInjector.java b/src/main/java/com/hbm/tileentity/machine/TileEntityCoreInjector.java index b4fffdb9c..bd2366acc 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityCoreInjector.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityCoreInjector.java @@ -19,7 +19,6 @@ import li.cil.oc.api.machine.Context; import li.cil.oc.api.network.SimpleComponent; import net.minecraft.client.gui.GuiScreen; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; import net.minecraft.inventory.Container; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; @@ -97,7 +96,7 @@ public class TileEntityCoreInjector extends TileEntityMachineBase implements IFl break; } - if(worldObj.getBlock(x, y, z) != Blocks.air) + if(!worldObj.getBlock(x, y, z).isAir(worldObj, x, y, z)) break; } diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityCoreStabilizer.java b/src/main/java/com/hbm/tileentity/machine/TileEntityCoreStabilizer.java index 82ce38079..a60975ed3 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityCoreStabilizer.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityCoreStabilizer.java @@ -17,7 +17,6 @@ import li.cil.oc.api.machine.Context; import li.cil.oc.api.network.SimpleComponent; import net.minecraft.client.gui.GuiScreen; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; import net.minecraft.inventory.Container; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; @@ -86,7 +85,7 @@ public class TileEntityCoreStabilizer extends TileEntityMachineBase implements I break; } - if(worldObj.getBlock(x, y, z) != Blocks.air) + if(!worldObj.getBlock(x, y, z).isAir(worldObj, x, y, z)) break; } } diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineAutosaw.java b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineAutosaw.java index 2ca86eb13..3ec39159b 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineAutosaw.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineAutosaw.java @@ -1,9 +1,11 @@ package com.hbm.tileentity.machine; +import java.util.HashSet; import java.util.List; import com.hbm.blocks.ModBlocks; import com.hbm.blocks.generic.BlockTallPlant.EnumTallFlower; +import com.hbm.inventory.fluid.FluidType; import com.hbm.inventory.fluid.Fluids; import com.hbm.inventory.fluid.tank.FluidTank; import com.hbm.lib.ModDamageSource; @@ -29,6 +31,15 @@ import net.minecraft.util.Vec3; public class TileEntityMachineAutosaw extends TileEntityLoadedBase implements INBTPacketReceiver, IFluidStandardReceiver { + public static final HashSet acceptedFuels = new HashSet(); + + static { + acceptedFuels.add(Fluids.WOODOIL); + acceptedFuels.add(Fluids.ETHANOL); + acceptedFuels.add(Fluids.FISHOIL); + acceptedFuels.add(Fluids.HEAVYOIL); + } + public FluidTank tank; public boolean isOn; diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineChemplant.java b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineChemplant.java index 379a95c1b..3da9f3833 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineChemplant.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineChemplant.java @@ -304,6 +304,8 @@ public class TileEntityMachineChemplant extends TileEntityMachineBase implements this.maxProgress = recipe.getDuration() * this.speed / 100; + if(maxProgress <= 0) maxProgress = 1; + if(this.progress >= this.maxProgress) { consumeFluids(recipe); produceFluids(recipe); diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineChemplantBase.java b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineChemplantBase.java index d91102d51..99e38f3e4 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineChemplantBase.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineChemplantBase.java @@ -150,6 +150,8 @@ public abstract class TileEntityMachineChemplantBase extends TileEntityMachineBa this.maxProgress[index] = recipe.getDuration() * this.speed / 100; + if(maxProgress[index] <= 0) maxProgress[index] = 1; + if(this.progress[index] >= this.maxProgress[index]) { consumeFluids(recipe, index); produceFluids(recipe, index); diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityPWRController.java b/src/main/java/com/hbm/tileentity/machine/TileEntityPWRController.java index 564df30ac..e50143a6b 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityPWRController.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityPWRController.java @@ -1,6 +1,8 @@ package com.hbm.tileentity.machine; +import java.util.ArrayList; import java.util.HashMap; +import java.util.List; import java.util.Map.Entry; import com.hbm.blocks.ModBlocks; @@ -9,15 +11,20 @@ import com.hbm.inventory.container.ContainerPWR; import com.hbm.inventory.fluid.Fluids; import com.hbm.inventory.fluid.tank.FluidTank; import com.hbm.inventory.fluid.trait.FT_Heatable; +import com.hbm.inventory.fluid.trait.FT_PWRModerator; +import com.hbm.inventory.fluid.trait.FT_Heatable.HeatingStep; import com.hbm.inventory.fluid.trait.FT_Heatable.HeatingType; import com.hbm.inventory.gui.GUIPWR; import com.hbm.items.ModItems; import com.hbm.items.machine.ItemPWRFuel.EnumPWRFuel; +import com.hbm.main.MainRegistry; +import com.hbm.sound.AudioWrapper; import com.hbm.tileentity.IGUIProvider; import com.hbm.tileentity.TileEntityMachineBase; import com.hbm.util.EnumUtil; import com.hbm.util.fauxpointtwelve.BlockPos; +import api.hbm.fluid.IFluidStandardTransceiver; import net.minecraft.block.Block; import net.minecraft.client.gui.GuiScreen; import net.minecraft.entity.player.EntityPlayer; @@ -28,17 +35,17 @@ import net.minecraft.util.MathHelper; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -public class TileEntityPWRController extends TileEntityMachineBase implements IGUIProvider, IControlReceiver { +public class TileEntityPWRController extends TileEntityMachineBase implements IGUIProvider, IControlReceiver, IFluidStandardTransceiver { public FluidTank[] tanks; public int coreHeat; - public static final int coreHeatCapacity = 25_000_000; + public static final int coreHeatCapacity = 10_000_000; public int hullHeat; - public static final int hullHeatCapacity = 25_000_000; + public static final int hullHeatCapacity = 10_000_000; public double flux; - public int rodLevel; - public int rodTarget; + public int rodLevel = 100; + public int rodTarget = 100; public int typeLoaded; public int amountLoaded; @@ -53,6 +60,10 @@ public class TileEntityPWRController extends TileEntityMachineBase implements IG public int sourceCount; public boolean assembled; + + private AudioWrapper audio; + + protected List ports = new ArrayList(); public TileEntityPWRController() { super(3); @@ -82,6 +93,7 @@ public class TileEntityPWRController extends TileEntityMachineBase implements IG if(block == ModBlocks.pwr_heatex) heatexCount++; if(block == ModBlocks.pwr_channel) channelCount++; if(block == ModBlocks.pwr_neutron_source) sourceCount++; + if(block == ModBlocks.pwr_port) ports.add(entry.getKey()); } for(Entry entry : rodMap.entrySet()) { @@ -141,6 +153,15 @@ public class TileEntityPWRController extends TileEntityMachineBase implements IG this.tanks[0].setType(2, slots); setupTanks(); + for(BlockPos pos : ports) { + for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) { + BlockPos portPos = pos.offset(dir); + + if(tanks[1].getFill() > 0) this.sendFluid(tanks[1], worldObj, portPos.getX(), portPos.getY(), portPos.getZ(), dir); + if(worldObj.getTotalWorldTime() % 20 == 0) this.trySubscribe(tanks[0].getTankType(), worldObj, portPos.getX(), portPos.getY(), portPos.getZ(), dir); + } + } + if((typeLoaded == -1 || amountLoaded <= 0) && slots[0] != null && slots[0].getItem() == ModItems.pwr_fuel) { typeLoaded = slots[0].getItemDamage(); amountLoaded++; @@ -181,6 +202,7 @@ public class TileEntityPWRController extends TileEntityMachineBase implements IG slots[1].stackSize++; } + this.amountLoaded--; this.markChanged(); } } @@ -190,15 +212,21 @@ public class TileEntityPWRController extends TileEntityMachineBase implements IG } /* CORE COOLING */ - double coreCoolingApproachNum = getXOverE(this.heatexCount, 10) / 2D; + double coreCoolingApproachNum = getXOverE((double) this.heatexCount / (double) this.rodCount, 2) / 2D; int averageCoreHeat = (this.coreHeat + this.hullHeat) / 2; this.coreHeat -= (coreHeat - averageCoreHeat) * coreCoolingApproachNum; this.hullHeat -= (hullHeat - averageCoreHeat) * coreCoolingApproachNum; - this.hullHeat *= 0.99D; + updateCoolant(); + + this.hullHeat *= 0.999D; this.flux = newFlux; + if(tanks[0].getTankType().hasTrait(FT_PWRModerator.class)) { + this.flux *= tanks[0].getTankType().getTrait(FT_PWRModerator.class).getMultiplier(); + } + NBTTagCompound data = new NBTTagCompound(); tanks[0].writeToNBT(data, "t0"); tanks[1].writeToNBT(data, "t1"); @@ -210,10 +238,77 @@ public class TileEntityPWRController extends TileEntityMachineBase implements IG data.setDouble("progress", progress); data.setInteger("typeLoaded", typeLoaded); data.setInteger("amountLoaded", amountLoaded); + data.setInteger("rodLevel", rodLevel); + data.setInteger("rodTarget", rodTarget); this.networkPack(data, 150); + } else { + + if(amountLoaded > 0) { + + if(audio == null) { + audio = createAudioLoop(); + audio.startSound(); + } else if(!audio.isPlaying()) { + audio = rebootAudio(audio); + } + + audio.keepAlive(); + + } else { + + if(audio != null) { + audio.stopSound(); + audio = null; + } + } } } + @Override + public AudioWrapper createAudioLoop() { + return MainRegistry.proxy.getLoopedSound("hbm:block.reactorLoop", xCoord, yCoord, zCoord, 1F, 10F, 1.0F, 20); + } + + @Override + public void onChunkUnload() { + + if(audio != null) { + audio.stopSound(); + audio = null; + } + } + + @Override + public void invalidate() { + + super.invalidate(); + + if(audio != null) { + audio.stopSound(); + audio = null; + } + } + + protected void updateCoolant() { + + FT_Heatable trait = tanks[0].getTankType().getTrait(FT_Heatable.class); + if(trait == null || trait.getEfficiency(HeatingType.PWR) <= 0) return; + + double coolingEff = (double) this.channelCount / (double) this.rodCount * 0.1D; //10% cooling if numbers match + if(coolingEff > 1D) coolingEff = 1D; + + int heatToUse = (int) (this.hullHeat * coolingEff * trait.getEfficiency(HeatingType.PWR)); + HeatingStep step = trait.getFirstStep(); + int coolCycles = tanks[0].getFill() / step.amountReq; + int hotCycles = (tanks[1].getMaxFill() - tanks[1].getFill()) / step.amountProduced; + int heatCycles = heatToUse / step.heatReq; + int cycles = Math.min(coolCycles, Math.min(hotCycles, heatCycles)); + + this.hullHeat -= step.heatReq * cycles; + this.tanks[0].setFill(tanks[0].getFill() - step.amountReq * cycles); + this.tanks[1].setFill(tanks[1].getFill() + step.amountProduced * cycles); + } + public void networkUnpack(NBTTagCompound nbt) { tanks[0].readFromNBT(nbt, "t0"); tanks[1].readFromNBT(nbt, "t1"); @@ -225,6 +320,8 @@ public class TileEntityPWRController extends TileEntityMachineBase implements IG progress = nbt.getDouble("progress"); typeLoaded = nbt.getInteger("typeLoaded"); amountLoaded = nbt.getInteger("amountLoaded"); + rodLevel = nbt.getInteger("rodLevel"); + rodTarget = nbt.getInteger("rodTarget"); } protected void setupTanks() { @@ -234,6 +331,7 @@ public class TileEntityPWRController extends TileEntityMachineBase implements IG if(trait == null || trait.getEfficiency(HeatingType.PWR) <= 0) { tanks[0].setTankType(Fluids.NONE); tanks[1].setTankType(Fluids.NONE); + return; } tanks[1].setTankType(trait.getFirstStep().typeProduced); @@ -256,15 +354,66 @@ public class TileEntityPWRController extends TileEntityMachineBase implements IG @Override public void readFromNBT(NBTTagCompound nbt) { super.readFromNBT(nbt); + + tanks[0].readFromNBT(nbt, "t0"); + tanks[1].readFromNBT(nbt, "t1"); this.assembled = nbt.getBoolean("assembled"); + this.coreHeat = nbt.getInteger("coreHeat"); + this.hullHeat = nbt.getInteger("hullHeat"); + this.flux = nbt.getDouble("flux"); + this.rodLevel = nbt.getInteger("rodLevel"); + this.rodTarget = nbt.getInteger("rodTarget"); + this.typeLoaded = nbt.getInteger("typeLoaded"); + this.amountLoaded = nbt.getInteger("amountLoaded"); + this.progress = nbt.getDouble("progress"); + this.processTime = nbt.getDouble("processTime"); + + this.rodCount = nbt.getInteger("rodCount"); + this.connections = nbt.getInteger("connections"); + this.connectionsControlled = nbt.getInteger("connectionsControlled"); + this.heatexCount = nbt.getInteger("heatexCount"); + this.channelCount = nbt.getInteger("channelCount"); + this.sourceCount = nbt.getInteger("sourceCount"); + + ports.clear(); + int portCount = nbt.getInteger("portCount"); + for(int i = 0; i < portCount; i++) { + int[] port = nbt.getIntArray("p" + i); + ports.add(new BlockPos(port[0], port[1], port[2])); + } } @Override public void writeToNBT(NBTTagCompound nbt) { super.writeToNBT(nbt); + + tanks[0].writeToNBT(nbt, "t0"); + tanks[1].writeToNBT(nbt, "t1"); nbt.setBoolean("assembled", assembled); + nbt.setInteger("coreHeat", coreHeat); + nbt.setInteger("hullHeat", hullHeat); + nbt.setDouble("flux", flux); + nbt.setInteger("rodLevel", rodLevel); + nbt.setInteger("rodTarget", rodTarget); + nbt.setInteger("typeLoaded", typeLoaded); + nbt.setInteger("amountLoaded", amountLoaded); + nbt.setDouble("progress", progress); + nbt.setDouble("processTime", processTime); + + nbt.setInteger("rodCount", rodCount); + nbt.setInteger("connections", connections); + nbt.setInteger("connectionsControlled", connectionsControlled); + nbt.setInteger("heatexCount", heatexCount); + nbt.setInteger("channelCount", channelCount); + nbt.setInteger("sourceCount", sourceCount); + + nbt.setInteger("portCount", ports.size()); + for(int i = 0; i < ports.size(); i++) { + BlockPos pos = ports.get(i); + nbt.setIntArray("p" + i, new int[] { pos.getX(), pos.getY(), pos.getZ() }); + } } @Override @@ -277,6 +426,7 @@ public class TileEntityPWRController extends TileEntityMachineBase implements IG if(data.hasKey("control")) { this.rodTarget = MathHelper.clamp_int(data.getInteger("control"), 0, 100); + this.markChanged(); } } @@ -289,4 +439,19 @@ public class TileEntityPWRController extends TileEntityMachineBase implements IG public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) { return new GUIPWR(player.inventory, this); } + + @Override + public FluidTank[] getAllTanks() { + return tanks; + } + + @Override + public FluidTank[] getSendingTanks() { + return new FluidTank[] { tanks[1] }; + } + + @Override + public FluidTank[] getReceivingTanks() { + return new FluidTank[] { tanks[0] }; + } } diff --git a/src/main/java/com/hbm/util/TrackerUtil.java b/src/main/java/com/hbm/util/TrackerUtil.java index 9889d0c6e..62140046e 100644 --- a/src/main/java/com/hbm/util/TrackerUtil.java +++ b/src/main/java/com/hbm/util/TrackerUtil.java @@ -41,4 +41,13 @@ public class TrackerUtil { entry.ticks = 0; } } + + public static void setTrackingRange(World world, Entity e, int range) { + + if(world instanceof WorldServer) { + WorldServer server = (WorldServer) world; + EntityTrackerEntry entry = getTrackerEntry(server, e.getEntityId()); + entry.blocksDistanceThreshold = range; + } + } } diff --git a/src/main/java/com/hbm/world/feature/BedrockOre.java b/src/main/java/com/hbm/world/feature/BedrockOre.java index 19895823d..f20e79039 100644 --- a/src/main/java/com/hbm/world/feature/BedrockOre.java +++ b/src/main/java/com/hbm/world/feature/BedrockOre.java @@ -36,9 +36,9 @@ public class BedrockOre { registerBedrockOre(weightedOres, new BedrockOreDefinition(EnumBedrockOre.GOLD, 1), WorldConfig.bedrockGoldSpawn); registerBedrockOre(weightedOres, new BedrockOreDefinition(EnumBedrockOre.URANIUM, 4, new FluidStack(Fluids.SULFURIC_ACID, 500)), WorldConfig.bedrockUraniumSpawn); registerBedrockOre(weightedOres, new BedrockOreDefinition(EnumBedrockOre.THORIUM, 4, new FluidStack(Fluids.SULFURIC_ACID, 500)), WorldConfig.bedrockThoriumSpawn); + registerBedrockOre(weightedOres, new BedrockOreDefinition(EnumBedrockOre.FLUORITE, 1), WorldConfig.bedrockFluoriteSpawn); registerBedrockOre(weightedOres, new BedrockOreDefinition(new ItemStack(Items.coal, 4), 1, 0x202020), WorldConfig.bedrockCoalSpawn); registerBedrockOre(weightedOres, new BedrockOreDefinition(new ItemStack(ModItems.niter, 4), 2, 0x808080, new FluidStack(Fluids.ACID, 500)), WorldConfig.bedrockNiterSpawn); - registerBedrockOre(weightedOres, new BedrockOreDefinition(new ItemStack(ModItems.fluorite, 4), 1, 0xd0d0d0), WorldConfig.bedrockFluoriteSpawn); registerBedrockOre(weightedOres, new BedrockOreDefinition(new ItemStack(Items.redstone, 4), 1, 0xd01010), WorldConfig.bedrockRedstoneSpawn); registerBedrockOre(weightedOresNether, new BedrockOreDefinition(new ItemStack(Items.glowstone_dust, 4), 1, 0xF9FF4D), WorldConfig.bedrockGlowstoneSpawn); diff --git a/src/main/resources/assets/hbm/lang/de_DE.lang b/src/main/resources/assets/hbm/lang/de_DE.lang index c764f300e..a1fef17c3 100644 --- a/src/main/resources/assets/hbm/lang/de_DE.lang +++ b/src/main/resources/assets/hbm/lang/de_DE.lang @@ -3959,6 +3959,7 @@ tile.machine_assembler.name=Fertigungsmaschine tile.machine_assemfac.name=Fertigungsfabrik tile.machine_autocrafter.name=Automatische Werkbank tile.machine_autosaw.name=Automatische Kreissäge +tile.machine_autosaw.desc=Schneidet Pflanzen nieder, pflanzt Bäume nach$Akzeptiert:$-Holzöl$-Ethanol$-Fischöl$-Schweröl tile.machine_bat9000.name=Big-Ass Tank 9000 tile.machine_battery.name=Energiespeicherblock tile.machine_battery_potato.name=Kartoffelbatterieblock diff --git a/src/main/resources/assets/hbm/lang/en_US.lang b/src/main/resources/assets/hbm/lang/en_US.lang index 6e2e10e35..5aae8fd7b 100644 --- a/src/main/resources/assets/hbm/lang/en_US.lang +++ b/src/main/resources/assets/hbm/lang/en_US.lang @@ -4891,6 +4891,7 @@ tile.machine_assembler.name=Assembly Machine tile.machine_assemfac.name=Assembly Factory tile.machine_autocrafter.name=Automatic Crafting Table tile.machine_autosaw.name=Automatic Buzz Saw +tile.machine_autosaw.desc=Cuts down nearby plants, re-plants trees$Accepts:$-Wood oil$-Ethanol$-Fish oil$-Heavy oil tile.machine_bat9000.name=Big-Ass Tank 9000 tile.machine_battery.name=Energy Storage Block tile.machine_battery_potato.name=Potato Battery Block diff --git a/src/main/resources/assets/hbm/sounds.json b/src/main/resources/assets/hbm/sounds.json index 90efc5334..d2c6248c7 100644 --- a/src/main/resources/assets/hbm/sounds.json +++ b/src/main/resources/assets/hbm/sounds.json @@ -58,6 +58,7 @@ "block.hornNearDual": {"category": "block", "sounds": [{"name": "block/hornNearDual", "stream": false}]}, "block.hornFarSingle": {"category": "block", "sounds": [{"name": "block/hornFarSingle", "stream": false}]}, "block.hornFarDual": {"category": "block", "sounds": [{"name": "block/hornFarDual", "stream": false}]}, + "block.reactorLoop": {"category": "block", "sounds": [{"name": "block/reactorLoop", "stream": false}]}, "door.TransitionSealOpen": {"category": "block", "sounds": [{"name": "block/door/transition_seal_open", "stream": true}]}, "door.wghStart": {"category": "block", "sounds": [{"name": "block/door/wgh_start", "stream": true}]}, diff --git a/src/main/resources/assets/hbm/sounds/block/reactorLoop.ogg b/src/main/resources/assets/hbm/sounds/block/reactorLoop.ogg new file mode 100644 index 000000000..428ddeabb Binary files /dev/null and b/src/main/resources/assets/hbm/sounds/block/reactorLoop.ogg differ diff --git a/src/main/resources/assets/hbm/textures/gui/fluids/heavywater_hot.png b/src/main/resources/assets/hbm/textures/gui/fluids/heavywater_hot.png new file mode 100644 index 000000000..119b76cda Binary files /dev/null and b/src/main/resources/assets/hbm/textures/gui/fluids/heavywater_hot.png differ diff --git a/src/main/resources/assets/hbm/textures/items/gem_sodalite.png b/src/main/resources/assets/hbm/textures/items/gem_sodalite.png new file mode 100644 index 000000000..10aaa045e Binary files /dev/null and b/src/main/resources/assets/hbm/textures/items/gem_sodalite.png differ diff --git a/src/main/resources/assets/hbm/textures/items/powder_sodium.png b/src/main/resources/assets/hbm/textures/items/powder_sodium.png new file mode 100644 index 000000000..d7e6c4ffc Binary files /dev/null and b/src/main/resources/assets/hbm/textures/items/powder_sodium.png differ