mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
bufferless HE to RF converters
This commit is contained in:
parent
081df1c8fe
commit
fb28b5cf16
@ -8,8 +8,6 @@ public interface IBlockMultiPass {
|
||||
|
||||
public int getPasses();
|
||||
|
||||
public int getColorFromPass(IBlockAccess world, int x, int y, int z, boolean inv);
|
||||
|
||||
public static int renderID = RenderingRegistry.getNextAvailableRenderId();
|
||||
public static int getRenderType() {
|
||||
return renderID;
|
||||
|
||||
@ -4,9 +4,7 @@ import com.hbm.tileentity.machine.TileEntityConverterHeRf;
|
||||
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockConverterHeRf extends BlockContainer {
|
||||
@ -19,26 +17,4 @@ public class BlockConverterHeRf extends BlockContainer {
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||
return new TileEntityConverterHeRf();
|
||||
}
|
||||
|
||||
@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)
|
||||
{
|
||||
return true;
|
||||
} else if(!player.isSneaking())
|
||||
{
|
||||
TileEntityConverterHeRf entity = (TileEntityConverterHeRf) world.getTileEntity(x, y, z);
|
||||
if(entity != null)
|
||||
{
|
||||
player.addChatComponentMessage(new ChatComponentText("Note: Buffer may not accuratly represent current conversion rate, keep tact rates in mind."));
|
||||
player.addChatComponentMessage(new ChatComponentText("HE: " + (entity.buf / 4)));
|
||||
player.addChatComponentMessage(new ChatComponentText("RF: " + entity.buf));
|
||||
//FMLNetworkHandler.openGui(player, MainRegistry.instance, ModBlocks.guiID_converter_he_rf, world, x, y, z);
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
package com.hbm.blocks.network;
|
||||
|
||||
import com.hbm.blocks.IBlockMultiPass;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.render.block.RenderBlockMultipass;
|
||||
import com.hbm.tileentity.conductor.TileEntityFluidDuctSimple;
|
||||
|
||||
@ -10,7 +9,6 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
@ -66,9 +64,4 @@ public class BlockFluidDuctSolid extends BlockContainer implements IBlockMultiPa
|
||||
|
||||
return 0xffffff;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColorFromPass(IBlockAccess world, int x, int y, int z, boolean inv) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -210,13 +210,6 @@ public class GUIHandler implements IGuiHandler {
|
||||
return null;
|
||||
}
|
||||
|
||||
case ModBlocks.guiID_converter_he_rf: {
|
||||
if(entity instanceof TileEntityConverterHeRf) {
|
||||
return new ContainerConverterHeRf(player.inventory, (TileEntityConverterHeRf) entity);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
case ModBlocks.guiID_schrabidium_transmutator: {
|
||||
if(entity instanceof TileEntityMachineSchrabidiumTransmutator) {
|
||||
return new ContainerMachineSchrabidiumTransmutator(player.inventory, (TileEntityMachineSchrabidiumTransmutator) entity);
|
||||
@ -1052,13 +1045,6 @@ public class GUIHandler implements IGuiHandler {
|
||||
return null;
|
||||
}
|
||||
|
||||
case ModBlocks.guiID_converter_he_rf: {
|
||||
if(entity instanceof TileEntityConverterHeRf) {
|
||||
return new GUIConverterHeRf(player.inventory, (TileEntityConverterHeRf) entity);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
case ModBlocks.guiID_schrabidium_transmutator: {
|
||||
if(entity instanceof TileEntityMachineSchrabidiumTransmutator) {
|
||||
return new GUIMachineSchrabidiumTransmutator(player.inventory, (TileEntityMachineSchrabidiumTransmutator) entity);
|
||||
|
||||
@ -2,6 +2,7 @@ package com.hbm.hazard;
|
||||
|
||||
import static com.hbm.blocks.ModBlocks.*;
|
||||
import static com.hbm.items.ModItems.*;
|
||||
import static com.hbm.inventory.OreDictManager.*;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.hazard.modifier.*;
|
||||
@ -170,7 +171,7 @@ public class HazardRegistry {
|
||||
HazardSystem.register(demon_core_closed, makeData(RADIATION, 100_000F));
|
||||
|
||||
HazardSystem.register(cell_tritium, makeData(RADIATION, 0.001F));
|
||||
HazardSystem.register(cell_sas3, new HazardData().addEntry(RADIATION, sas3).addEntry(BLINDING, 3F));
|
||||
HazardSystem.register(cell_sas3, makeData().addEntry(RADIATION, sas3).addEntry(BLINDING, 3F));
|
||||
HazardSystem.register(cell_balefire, makeData(RADIATION, 50F));
|
||||
HazardSystem.register(powder_balefire, makeData(RADIATION, 500F));
|
||||
HazardSystem.register(egg_balefire_shard, makeData(RADIATION, bf * nugget));
|
||||
@ -178,8 +179,8 @@ public class HazardRegistry {
|
||||
|
||||
HazardSystem.register(nuclear_waste_long, makeData(RADIATION, 5F));
|
||||
HazardSystem.register(nuclear_waste_long_tiny, makeData(RADIATION, 0.5F));
|
||||
HazardSystem.register(nuclear_waste_short, new HazardData().addEntry(RADIATION, 30F).addEntry(HOT, 5F));
|
||||
HazardSystem.register(nuclear_waste_short_tiny, new HazardData().addEntry(RADIATION, 3F).addEntry(HOT, 5F));
|
||||
HazardSystem.register(nuclear_waste_short, makeData().addEntry(RADIATION, 30F).addEntry(HOT, 5F));
|
||||
HazardSystem.register(nuclear_waste_short_tiny, makeData().addEntry(RADIATION, 3F).addEntry(HOT, 5F));
|
||||
HazardSystem.register(nuclear_waste_long_depleted, makeData(RADIATION, 0.5F));
|
||||
HazardSystem.register(nuclear_waste_long_depleted_tiny, makeData(RADIATION, 0.05F));
|
||||
HazardSystem.register(nuclear_waste_short_depleted, makeData(RADIATION, 3F));
|
||||
@ -226,7 +227,7 @@ public class HazardRegistry {
|
||||
HazardSystem.register(rod_zirnox_plutonium_fuel_depleted, makeData(RADIATION, 100F + 30F));
|
||||
HazardSystem.register(rod_zirnox_u233_fuel_depleted, makeData(RADIATION, u233 * rod_dual * 100));
|
||||
HazardSystem.register(rod_zirnox_u235_fuel_depleted, makeData(RADIATION, u235 * rod_dual * 100));
|
||||
HazardSystem.register(rod_zirnox_les_fuel_depleted, new HazardData().addEntry(RADIATION, saf * rod_dual * 100).addEntry(BLINDING, 5F));
|
||||
HazardSystem.register(rod_zirnox_les_fuel_depleted, makeData().addEntry(RADIATION, saf * rod_dual * 100).addEntry(BLINDING, 5F));
|
||||
HazardSystem.register(rod_zirnox_tritium, makeData(RADIATION, 0.001F * rod_dual));
|
||||
|
||||
registerOtherWaste(waste_natural_uranium, u * billet * 100);
|
||||
@ -262,9 +263,9 @@ public class HazardRegistry {
|
||||
registerOtherWaste(waste_plate_sa326, sa326 * ingot * 100);
|
||||
registerOtherWaste(waste_plate_ra226be, po210 * nugget * 3);
|
||||
|
||||
HazardSystem.register(debris_graphite, new HazardData().addEntry(RADIATION, 70F).addEntry(HOT, 5F));
|
||||
HazardSystem.register(debris_graphite, makeData().addEntry(RADIATION, 70F).addEntry(HOT, 5F));
|
||||
HazardSystem.register(debris_metal, makeData(RADIATION, 5F));
|
||||
HazardSystem.register(debris_fuel, new HazardData().addEntry(RADIATION, 500F).addEntry(HOT, 5F));
|
||||
HazardSystem.register(debris_fuel, makeData().addEntry(RADIATION, 500F).addEntry(HOT, 5F));
|
||||
HazardSystem.register(debris_concrete, makeData(RADIATION, 30F));
|
||||
HazardSystem.register(debris_exchanger, makeData(RADIATION, 25F));
|
||||
HazardSystem.register(debris_shrapnel, makeData(RADIATION, 2.5F));
|
||||
@ -298,10 +299,10 @@ public class HazardRegistry {
|
||||
HazardSystem.register(billet_americium_fuel, makeData(RADIATION, amf * billet));
|
||||
HazardSystem.register(ingot_americium_fuel, makeData(RADIATION, amf * ingot));
|
||||
|
||||
HazardSystem.register(nugget_schrabidium_fuel, new HazardData().addEntry(RADIATION, saf * nugget).addEntry(BLINDING, 5F * nugget));
|
||||
HazardSystem.register(billet_schrabidium_fuel, new HazardData().addEntry(RADIATION, saf * billet).addEntry(BLINDING, 5F * billet));
|
||||
HazardSystem.register(ingot_schrabidium_fuel, new HazardData().addEntry(RADIATION, saf * ingot).addEntry(BLINDING, 5F * ingot));
|
||||
HazardSystem.register(block_schrabidium_fuel, new HazardData().addEntry(RADIATION, saf * block).addEntry(BLINDING, 5F * block));
|
||||
HazardSystem.register(nugget_schrabidium_fuel, makeData().addEntry(RADIATION, saf * nugget).addEntry(BLINDING, 5F * nugget));
|
||||
HazardSystem.register(billet_schrabidium_fuel, makeData().addEntry(RADIATION, saf * billet).addEntry(BLINDING, 5F * billet));
|
||||
HazardSystem.register(ingot_schrabidium_fuel, makeData().addEntry(RADIATION, saf * ingot).addEntry(BLINDING, 5F * ingot));
|
||||
HazardSystem.register(block_schrabidium_fuel, makeData().addEntry(RADIATION, saf * block).addEntry(BLINDING, 5F * block));
|
||||
|
||||
HazardSystem.register(nugget_hes, makeData(RADIATION, saf * nugget));
|
||||
HazardSystem.register(billet_hes, makeData(RADIATION, saf * billet));
|
||||
@ -312,7 +313,7 @@ public class HazardRegistry {
|
||||
HazardSystem.register(ingot_les, makeData(RADIATION, saf * ingot));
|
||||
|
||||
HazardSystem.register(billet_balefire_gold, makeData(RADIATION, au198 * billet));
|
||||
HazardSystem.register(billet_flashlead, new HazardData().addEntry(RADIATION, pb209 * 1.25F * billet).addEntry(HOT, 7F));
|
||||
HazardSystem.register(billet_flashlead, makeData().addEntry(RADIATION, pb209 * 1.25F * billet).addEntry(HOT, 7F));
|
||||
HazardSystem.register(billet_po210be, makeData(RADIATION, pobe * billet));
|
||||
HazardSystem.register(billet_ra226be, makeData(RADIATION, rabe * billet));
|
||||
HazardSystem.register(billet_pu238be, makeData(RADIATION, pube * billet));
|
||||
@ -397,7 +398,7 @@ public class HazardRegistry {
|
||||
HazardSystem.register(ModItems.fallout, makeData(RADIATION, fo * powder));
|
||||
HazardSystem.register(ModBlocks.fallout, makeData(RADIATION, fo * powder * 2));
|
||||
HazardSystem.register(ModBlocks.block_fallout, makeData(RADIATION, yc * block * powder_mult));
|
||||
HazardSystem.register(powder_caesium, new HazardData().addEntry(HYDROACTIVE, 1F).addEntry(HOT, 3F));
|
||||
HazardSystem.register(powder_caesium, makeData().addEntry(HYDROACTIVE, 1F).addEntry(HOT, 3F));
|
||||
|
||||
HazardSystem.register(wire_schrabidium, makeData(RADIATION, sa326 * nugget));
|
||||
|
||||
@ -430,11 +431,11 @@ public class HazardRegistry {
|
||||
HazardSystem.register(mike_core, makeData(RADIATION, u238 * nugget * 10));
|
||||
HazardSystem.register(tsar_core, makeData(RADIATION, pu239 * nugget * 15));
|
||||
|
||||
HazardSystem.register(fleija_propellant, new HazardData().addEntry(RADIATION, 15F).addEntry(EXPLOSIVE, 8F).addEntry(BLINDING, 5F));
|
||||
HazardSystem.register(fleija_propellant, makeData().addEntry(RADIATION, 15F).addEntry(EXPLOSIVE, 8F).addEntry(BLINDING, 5F));
|
||||
HazardSystem.register(fleija_core, makeData(RADIATION, 10F));
|
||||
|
||||
HazardSystem.register(solinium_propellant, makeData(EXPLOSIVE, 10F));
|
||||
HazardSystem.register(solinium_core, new HazardData().addEntry(RADIATION, sa327 * nugget * 8).addEntry(BLINDING, 5F));
|
||||
HazardSystem.register(solinium_core, makeData().addEntry(RADIATION, sa327 * nugget * 8).addEntry(BLINDING, 5F));
|
||||
|
||||
HazardSystem.register(nuke_fstbmb, makeData(DIGAMMA, 0.01F));
|
||||
HazardSystem.register(new ItemStack(ModItems.holotape_image, 1, EnumHoloImage.HOLO_RESTORED.ordinal()), makeData(DIGAMMA, 1F));
|
||||
@ -442,11 +443,8 @@ public class HazardRegistry {
|
||||
/*
|
||||
* Blacklist
|
||||
*/
|
||||
HazardSystem.blacklist(new ItemStack(ore_uranium));
|
||||
HazardSystem.blacklist(new ItemStack(ore_gneiss_uranium));
|
||||
HazardSystem.blacklist(new ItemStack(ore_nether_uranium));
|
||||
HazardSystem.blacklist(new ItemStack(ore_meteor_uranium));
|
||||
HazardSystem.blacklist(new ItemStack(ore_thorium));
|
||||
HazardSystem.blacklist(TH232.ore());
|
||||
HazardSystem.blacklist(U.ore());
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@ -38,7 +38,8 @@ public class HazardSystem {
|
||||
/*
|
||||
* For items that should, for whichever reason, be completely exempt from the hazard system.
|
||||
*/
|
||||
public static final HashSet<ComparableStack> blacklist = new HashSet();
|
||||
public static final HashSet<ComparableStack> stackBlacklist = new HashSet();
|
||||
public static final HashSet<String> dictBlacklist = new HashSet();
|
||||
/*
|
||||
* List of hazard transformers, called in order before and after unrolling all the HazardEntries.
|
||||
*/
|
||||
@ -67,12 +68,29 @@ public class HazardSystem {
|
||||
* Prevents the stack from returning any HazardData
|
||||
* @param stack
|
||||
*/
|
||||
public static void blacklist(ItemStack stack) {
|
||||
blacklist.add(new ComparableStack(stack).makeSingular());
|
||||
public static void blacklist(Object o) {
|
||||
|
||||
if(o instanceof ItemStack) {
|
||||
stackBlacklist.add(new ComparableStack((ItemStack) o).makeSingular());
|
||||
} else if(o instanceof String) {
|
||||
dictBlacklist.add((String) o);
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isItemBlacklisted(ItemStack stack) {
|
||||
return blacklist.contains(new ComparableStack(stack).makeSingular());
|
||||
|
||||
if(stackBlacklist.contains(new ComparableStack(stack).makeSingular()))
|
||||
return true;
|
||||
|
||||
int[] ids = OreDictionary.getOreIDs(stack);
|
||||
for(int id : ids) {
|
||||
String name = OreDictionary.getOreName(id);
|
||||
|
||||
if(dictBlacklist.contains(name))
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -8,7 +8,6 @@ import static com.hbm.items.ModItems.*;
|
||||
import static com.hbm.blocks.ModBlocks.*;
|
||||
import static com.hbm.inventory.OreDictManager.DictFrame.*;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.config.GeneralConfig;
|
||||
import com.hbm.hazard.HazardData;
|
||||
import com.hbm.hazard.HazardEntry;
|
||||
@ -16,7 +15,6 @@ import com.hbm.hazard.HazardRegistry;
|
||||
import com.hbm.hazard.HazardSystem;
|
||||
import com.hbm.items.ItemEnums.EnumCokeType;
|
||||
import com.hbm.items.ItemEnums.EnumTarType;
|
||||
import com.hbm.items.ModItems;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Items;
|
||||
|
||||
@ -1,64 +0,0 @@
|
||||
package com.hbm.inventory.container;
|
||||
|
||||
import com.hbm.tileentity.machine.TileEntityConverterHeRf;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.ICrafting;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ContainerConverterHeRf extends Container {
|
||||
|
||||
private TileEntityConverterHeRf diFurnace;
|
||||
|
||||
private int water;
|
||||
private int flux;
|
||||
|
||||
public ContainerConverterHeRf(InventoryPlayer invPlayer, TileEntityConverterHeRf tedf) {
|
||||
|
||||
diFurnace = tedf;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCraftingToCrafters(ICrafting crafting) {
|
||||
super.addCraftingToCrafters(crafting);
|
||||
crafting.sendProgressBarUpdate(this, 1, this.diFurnace.storage.getEnergyStored());
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int p_82846_2_)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void detectAndSendChanges() {
|
||||
super.detectAndSendChanges();
|
||||
|
||||
for(int i = 0; i < this.crafters.size(); i++)
|
||||
{
|
||||
ICrafting par1 = (ICrafting)this.crafters.get(i);
|
||||
|
||||
if(this.flux != this.diFurnace.storage.getEnergyStored())
|
||||
{
|
||||
par1.sendProgressBarUpdate(this, 1, this.diFurnace.storage.getEnergyStored());
|
||||
}
|
||||
}
|
||||
|
||||
this.flux = this.diFurnace.storage.getEnergyStored();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateProgressBar(int i, int j) {
|
||||
if(i == 1)
|
||||
{
|
||||
diFurnace.storage.setEnergyStored(j);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,47 +0,0 @@
|
||||
package com.hbm.inventory.gui;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.inventory.container.ContainerConverterHeRf;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.tileentity.machine.TileEntityConverterHeRf;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class GUIConverterHeRf extends GuiContainer {
|
||||
|
||||
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/gui_he_rf_converter.png");
|
||||
private TileEntityConverterHeRf diFurnace;
|
||||
|
||||
public GUIConverterHeRf(InventoryPlayer invPlayer, TileEntityConverterHeRf tedf) {
|
||||
super(new ContainerConverterHeRf(invPlayer, tedf));
|
||||
diFurnace = tedf;
|
||||
|
||||
this.xSize = 176;
|
||||
this.ySize = 86;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int i, int j) {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||
|
||||
if(diFurnace.power > 0) {
|
||||
int i = (int)diFurnace.getPowerScaled(52);
|
||||
drawTexturedModalRect(guiLeft + 28, guiTop + 69 - i, 176, 52 - i, 12, i);
|
||||
}
|
||||
|
||||
if(diFurnace.storage.getEnergyStored() > 0) {
|
||||
int i = (int)diFurnace.getFluxScaled(52);
|
||||
drawTexturedModalRect(guiLeft + 136, guiTop + 69 - i, 188, 52 - i, 12, i);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -46,7 +46,7 @@ public class ItemHolotapeImage extends ItemHoloTape {
|
||||
HOLO_NV_CRATER( EnumChatFormatting.GOLD, "Brown", "031-MOUNTAIN", "The tape contains an audio track that is mostly gabled sound and garbage noise. There is an image file on it, depicting a large dome in blue light surrounded by many smaller buildings. In the distance, there is a smaller dome with red lights."),
|
||||
HOLO_NV_DIVIDE( EnumChatFormatting.GOLD, "Brown", "032-ROAD", "The tape contains an audio track that is mostly gabled sound and garbage noise. There is an image file on it, depicting a large chasm with broken highways and destroyed buildings littering the landscape."),
|
||||
HOLO_NV_BM( EnumChatFormatting.GOLD, "Brown", "033-BROADCAST", "The tape contains an audio track that is mostly gabled sound and garbage noise. There is an image file on it, depicting a satellite broadcasting station on top of a hill. In the distance, there is a very large person walking hand in hand with a robot into the sunset."),
|
||||
HOLO_O_1( EnumChatFormatting.WHITE, "Chroma", "X00-TRANSCRIPT", "[Start of Automated Audio Transcript] <unintelligible> in a boardroom, right, and they're trying to come up with some new ideas. So one guy just says they should reuse this other characteer from somewhere else, who has like this night-theme you know, and just change the entire schtick to day. So when they had to come up with a name, one guy said, why not take the original name, replace the N with a D, because of night to day, right, and run with it? Now the name sounds like 'Dicks'! Funniest thing I've ever heard! [End of Transcript]"),
|
||||
HOLO_O_1( EnumChatFormatting.WHITE, "Chroma", "X00-TRANSCRIPT", "[Start of Automated Audio Transcript] <unintelligible> in a boardroom, right, and they're trying to come up with some new ideas. So one guy just says they should reuse this other character from somewhere else, who has like this night-theme you know, and just change the entire schtick to day. So when they had to come up with a name, one guy said, why not take the original name, replace the N with a D, because of night to day, right, and run with it? Now the name sounds like 'Dicks'! Funniest thing I've ever heard! [End of Transcript]"),
|
||||
HOLO_O_2( EnumChatFormatting.WHITE, "Chroma", "X01-NEWS", "The tape contains a news article, reporting an unusually pale person throwing flashbangs at people in public. The image at the bottom shows one of the incidents, unsurprisingly the light from one of the flashbangs made it unrecognizable."),
|
||||
HOLO_O_3( EnumChatFormatting.WHITE, "Chroma", "X02-FICTION", "The tape contains an article from a science fiction magazine, engaging with various reader comments about what to do with a time machine. One of those comments suggests engaging in various unsanitary acts with the future self, being signed off with just the initial '~D'."),
|
||||
;
|
||||
|
||||
@ -3,6 +3,7 @@ package com.hbm.tileentity.machine;
|
||||
import com.hbm.calc.Location;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
|
||||
import api.hbm.energy.IEnergyConnector;
|
||||
import api.hbm.energy.IEnergyUser;
|
||||
import cofh.api.energy.EnergyStorage;
|
||||
import cofh.api.energy.IEnergyHandler;
|
||||
@ -11,72 +12,19 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityConverterHeRf extends TileEntityMachineBase implements IEnergyUser, IEnergyHandler {
|
||||
public class TileEntityConverterHeRf extends TileEntity implements IEnergyConnector, IEnergyHandler {
|
||||
|
||||
public TileEntityConverterHeRf() {
|
||||
super(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "";
|
||||
}
|
||||
|
||||
public long power;
|
||||
public long maxPower = 500000000;
|
||||
public EnergyStorage storage = new EnergyStorage(2000000000, 2000000000, 2000000000);
|
||||
|
||||
public int buf;
|
||||
|
||||
//Thanks to the great people of Fusion Warfare for helping me with this part.
|
||||
//Thanks to the great people of Fusion Warfare for helping me with the original implementation of the RF energy API
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
|
||||
if (!worldObj.isRemote) {
|
||||
|
||||
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS)
|
||||
this.trySubscribe(worldObj, xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ, dir);
|
||||
|
||||
storage.setCapacity((int)power * 4);
|
||||
storage.setEnergyStored((int)power * 4);
|
||||
|
||||
buf = storage.getEnergyStored();
|
||||
|
||||
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
|
||||
|
||||
Location loc = new Location(worldObj, xCoord, yCoord, zCoord).add(dir);
|
||||
TileEntity entity = loc.getTileEntity();
|
||||
|
||||
if (entity != null && entity instanceof IEnergyReceiver) {
|
||||
|
||||
IEnergyReceiver receiver = (IEnergyReceiver) entity;
|
||||
|
||||
int maxExtract = storage.getMaxExtract();
|
||||
int maxAvailable = storage.extractEnergy(maxExtract, true);
|
||||
int energyTransferred = receiver.receiveEnergy(dir.getOpposite(), maxAvailable, false);
|
||||
|
||||
storage.extractEnergy(energyTransferred, false);
|
||||
}
|
||||
}
|
||||
|
||||
power = storage.getEnergyStored() / 4;
|
||||
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setInteger("rf", storage.getEnergyStored());
|
||||
data.setInteger("maxrf", storage.getEnergyStored());
|
||||
data.setLong("he", power);
|
||||
data.setLong("maxhe", power);
|
||||
this.networkPack(data, 25);
|
||||
}
|
||||
}
|
||||
|
||||
public void networkUnpack(NBTTagCompound nbt) {
|
||||
storage.setEnergyStored(nbt.getInteger("rf"));
|
||||
storage.setCapacity(nbt.getInteger("maxrf"));
|
||||
power = nbt.getLong("he");
|
||||
maxPower = nbt.getLong("maxhe");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnectEnergy(ForgeDirection from) {
|
||||
return true;
|
||||
@ -84,64 +32,56 @@ public class TileEntityConverterHeRf extends TileEntityMachineBase implements IE
|
||||
|
||||
@Override
|
||||
public int extractEnergy(ForgeDirection from, int maxExtract, boolean simulate) {
|
||||
return storage.extractEnergy(maxExtract, simulate);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getEnergyStored(ForgeDirection from) {
|
||||
return storage.getEnergyStored();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxEnergyStored(ForgeDirection from) {
|
||||
return storage.getMaxEnergyStored();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPower(long i) {
|
||||
power = i;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getPower() {
|
||||
return power;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getMaxPower() {
|
||||
|
||||
if(power < 1000000)
|
||||
return 500000000;//Long.MAX_VALUE / 100;
|
||||
|
||||
return maxPower;
|
||||
}
|
||||
|
||||
public long getPowerScaled(long i) {
|
||||
return (power * i) / maxPower;
|
||||
}
|
||||
|
||||
public long getFluxScaled(long i) {
|
||||
return (storage.getEnergyStored() * i) / storage.getMaxEnergyStored();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
|
||||
this.power = nbt.getLong("power");
|
||||
storage.readFromNBT(nbt);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
|
||||
nbt.setLong("power", power);
|
||||
storage.writeToNBT(nbt);
|
||||
return Integer.MAX_VALUE / 4;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int receiveEnergy(ForgeDirection from, int maxReceive, boolean simulate) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long transferPower(long power) {
|
||||
|
||||
// we have to limit the transfer amount because otherwise FEnSUs would overflow the RF output, twice
|
||||
long out = Math.min(power, Long.MAX_VALUE / 4);
|
||||
int toRF = (int) Math.min(Integer.MAX_VALUE, out * 4);
|
||||
int energyTransferred = 0;
|
||||
|
||||
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
|
||||
|
||||
Location loc = new Location(worldObj, xCoord, yCoord, zCoord).add(dir);
|
||||
TileEntity entity = loc.getTileEntity();
|
||||
|
||||
if(entity != null && entity instanceof IEnergyReceiver) {
|
||||
|
||||
IEnergyReceiver receiver = (IEnergyReceiver) entity;
|
||||
energyTransferred = receiver.receiveEnergy(dir.getOpposite(), toRF, false);
|
||||
|
||||
toRF -= energyTransferred; //to prevent energy duping
|
||||
}
|
||||
}
|
||||
|
||||
return power - (energyTransferred / 4);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,16 +1,9 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.interfaces.Untested;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
|
||||
import api.hbm.energy.IEnergyGenerator;
|
||||
import cofh.api.energy.EnergyStorage;
|
||||
import cofh.api.energy.IEnergyHandler;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user