mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
Merge remote-tracking branch 'HbmMods/master'
This commit is contained in:
commit
0609cd524c
50
changelog
50
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
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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<Integer, FluidType> idMapping = new HashMap();
|
||||
private static final HashMap<String, FluidType> 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());
|
||||
}
|
||||
|
||||
@ -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<String> info) {
|
||||
info.add(EnumChatFormatting.BLUE + "[PWR Flux Multiplier]");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInfoHidden(List<String> 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();
|
||||
}
|
||||
}
|
||||
@ -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);
|
||||
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@ -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<ItemStack> 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) });
|
||||
|
||||
@ -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)));
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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());
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
@ -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<EntityNukeTorex> torex = world.getEntitiesWithinAABB(EntityNukeTorex.class, player.boundingBox.expand(100, 100, 100));
|
||||
|
||||
if(!torex.isEmpty()) {
|
||||
EntityNukeTorex t = torex.get(0);
|
||||
List<String> 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<String> 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
|
||||
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@ -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<FluidType> 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;
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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<BlockPos> 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<BlockPos, Block> 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] };
|
||||
}
|
||||
}
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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}]},
|
||||
|
||||
BIN
src/main/resources/assets/hbm/sounds/block/reactorLoop.ogg
Normal file
BIN
src/main/resources/assets/hbm/sounds/block/reactorLoop.ogg
Normal file
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 464 B |
BIN
src/main/resources/assets/hbm/textures/items/gem_sodalite.png
Normal file
BIN
src/main/resources/assets/hbm/textures/items/gem_sodalite.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 504 B |
BIN
src/main/resources/assets/hbm/textures/items/powder_sodium.png
Normal file
BIN
src/main/resources/assets/hbm/textures/items/powder_sodium.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 488 B |
Loading…
x
Reference in New Issue
Block a user