Revert "Fusion reactor fixes & rewrite, energy fixes."

This reverts commit 06fad2264f.
This commit is contained in:
modmuss50 2016-08-10 00:30:08 +01:00
parent 22fd152ec9
commit 8a0d981018
13 changed files with 386 additions and 279 deletions

View file

@ -44,7 +44,7 @@ public class BlockFusionControlComputer extends BlockMachineBase implements IAdv
super.onEntityWalk(worldIn, pos, entityIn); super.onEntityWalk(worldIn, pos, entityIn);
if (worldIn.getTileEntity(pos) instanceof TileEntityFusionController) if (worldIn.getTileEntity(pos) instanceof TileEntityFusionController)
{ {
if (((TileEntityFusionController) worldIn.getTileEntity(pos)).recipe != null if (((TileEntityFusionController) worldIn.getTileEntity(pos)).crafingTickTime != 0
&& ((TileEntityFusionController) worldIn.getTileEntity(pos)).checkCoils()) && ((TileEntityFusionController) worldIn.getTileEntity(pos)).checkCoils())
{ {
entityIn.attackEntityFrom(new FusionDamageSource(), 200F); entityIn.attackEntityFrom(new FusionDamageSource(), 200F);

View file

@ -7,22 +7,21 @@ import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
import reborncore.client.gui.SlotOutput; import reborncore.client.gui.SlotOutput;
import reborncore.common.container.RebornContainer; import reborncore.common.container.RebornContainer;
import techreborn.api.reactor.FusionReactorRecipe;
import techreborn.tiles.fusionReactor.TileEntityFusionController; import techreborn.tiles.fusionReactor.TileEntityFusionController;
public class ContainerFusionReactor extends RebornContainer { public class ContainerFusionReactor extends RebornContainer
{
public int coilStatus;
public int energy;
public int tickTime; public int tickTime;
public int finalTickTime; public int finalTickTime;
public int neededEU;
public int neededEnergy;
public int energy;
public boolean hasCoils;
TileEntityFusionController fusionController; TileEntityFusionController fusionController;
public ContainerFusionReactor(TileEntityFusionController tileEntityFusionController, EntityPlayer player) { public ContainerFusionReactor(TileEntityFusionController tileEntityFusionController, EntityPlayer player)
{
super(); super();
this.fusionController = tileEntityFusionController; this.fusionController = tileEntityFusionController;
@ -32,73 +31,105 @@ public class ContainerFusionReactor extends RebornContainer {
int i; int i;
for (i = 0; i < 3; ++i) { for (i = 0; i < 3; ++i)
for (int j = 0; j < 9; ++j) { {
for (int j = 0; j < 9; ++j)
{
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
} }
} }
for (i = 0; i < 9; ++i) { for (i = 0; i < 9; ++i)
{
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142)); this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
} }
} }
@Override @Override
public boolean canInteractWith(EntityPlayer player) { public boolean canInteractWith(EntityPlayer player)
{
return true; return true;
} }
@Override @Override
public void detectAndSendChanges() { public void detectAndSendChanges()
{
super.detectAndSendChanges(); super.detectAndSendChanges();
FusionReactorRecipe rec = fusionController.recipe; for (int i = 0; i < this.listeners.size(); i++)
for (int i = 0; i < this.listeners.size(); i++) { {
IContainerListener listener = this.listeners.get(i); IContainerListener IContainerListener = this.listeners.get(i);
listener.sendProgressBarUpdate(this, 0, fusionController.hasCoils ? 1 : 0); if (this.coilStatus != fusionController.coilStatus)
listener.sendProgressBarUpdate(this, 1, (int) fusionController.getEnergy()); {
listener.sendProgressBarUpdate(this, 2, rec == null ? 0 : (int) rec.getStartEU()); IContainerListener.sendProgressBarUpdate(this, 0, fusionController.coilStatus);
listener.sendProgressBarUpdate(this, 3, rec == null ? -1 : fusionController.recipeTickTime); }
listener.sendProgressBarUpdate(this, 4, rec == null ? 0 : rec.getTickTime()); if (this.energy != (int) fusionController.getEnergy())
{
IContainerListener.sendProgressBarUpdate(this, 1, (int) fusionController.getEnergy());
}
if (this.tickTime != fusionController.crafingTickTime)
{
IContainerListener.sendProgressBarUpdate(this, 2, fusionController.crafingTickTime);
}
if (this.finalTickTime != fusionController.finalTickTime)
{
IContainerListener.sendProgressBarUpdate(this, 3, fusionController.finalTickTime);
}
if (this.neededEU != fusionController.neededPower)
{
IContainerListener.sendProgressBarUpdate(this, 4, fusionController.neededPower);
}
} }
} }
@Override @Override
public void addListener(IContainerListener listener) { public void addListener(IContainerListener crafting)
super.addListener(listener); {
FusionReactorRecipe rec = fusionController.recipe; super.addListener(crafting);
listener.sendProgressBarUpdate(this, 0, fusionController.hasCoils ? 1 : 0); crafting.sendProgressBarUpdate(this, 0, fusionController.coilStatus);
listener.sendProgressBarUpdate(this, 1, (int) fusionController.getEnergy()); crafting.sendProgressBarUpdate(this, 1, (int) fusionController.getEnergy());
listener.sendProgressBarUpdate(this, 2, rec == null ? 0 : (int) rec.getStartEU()); crafting.sendProgressBarUpdate(this, 2, fusionController.crafingTickTime);
listener.sendProgressBarUpdate(this, 3, rec == null ? -1 : fusionController.recipeTickTime); crafting.sendProgressBarUpdate(this, 3, fusionController.finalTickTime);
listener.sendProgressBarUpdate(this, 4, rec == null ? 0 : rec.getTickTime()); crafting.sendProgressBarUpdate(this, 4, fusionController.neededPower);
} }
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
@Override @Override
public void updateProgressBar(int id, int value) { public void updateProgressBar(int id, int value)
switch (id) { {
case 0: if (id == 0)
this.hasCoils = value == 1; {
break; this.coilStatus = value;
case 1: } else if (id == 1)
this.energy = value; {
break; this.energy = value;
case 2: } else if (id == 2)
this.neededEnergy = value; {
break; this.tickTime = value;
case 3: } else if (id == 3)
this.tickTime = value; {
break; this.finalTickTime = value;
case 4: } else if (id == 4)
this.finalTickTime = value; {
break; this.neededEU = value;
}
if (tickTime == -1)
{
tickTime = 0;
}
if (finalTickTime == -1)
{
finalTickTime = 0;
}
if (neededEU == -1)
{
neededEU = 0;
} }
} }
public int getProgressScaled() { public int getProgressScaled()
{
return Math.max(0, Math.min(24, return Math.max(0, Math.min(24,
(this.tickTime > 0 ? 1 : 0) + this.tickTime * 24 / (this.finalTickTime < 1 ? 1 : this.finalTickTime))); (this.tickTime > 0 ? 1 : 0) + this.tickTime * 24 / (this.finalTickTime < 1 ? 1 : this.finalTickTime)));
} }
} }

View file

@ -9,7 +9,6 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n; import net.minecraft.util.text.translation.I18n;
import reborncore.common.powerSystem.PowerSystem; import reborncore.common.powerSystem.PowerSystem;
import techreborn.api.reactor.FusionReactorRecipe;
import techreborn.client.container.ContainerFusionReactor; import techreborn.client.container.ContainerFusionReactor;
import techreborn.tiles.fusionReactor.TileEntityFusionController; import techreborn.tiles.fusionReactor.TileEntityFusionController;
@ -20,28 +19,29 @@ public class GuiFusionReactor extends GuiContainer
"textures/gui/fusion_reactor.png"); "textures/gui/fusion_reactor.png");
ContainerFusionReactor containerFusionReactor; ContainerFusionReactor containerFusionReactor;
public GuiFusionReactor(EntityPlayer player, TileEntityFusionController tileaesu) { TileEntityFusionController fusionController;
public GuiFusionReactor(EntityPlayer player, TileEntityFusionController tileaesu)
{
super(new ContainerFusionReactor(tileaesu, player)); super(new ContainerFusionReactor(tileaesu, player));
containerFusionReactor = (ContainerFusionReactor) this.inventorySlots; containerFusionReactor = (ContainerFusionReactor) this.inventorySlots;
this.fusionController = tileaesu;
} }
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) { protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
{
String name = I18n.translateToLocal("tile.techreborn.fusioncontrolcomputer.name"); String name = I18n.translateToLocal("tile.techreborn.fusioncontrolcomputer.name");
this.fontRendererObj.drawString(name, 87, 6, 4210752); this.fontRendererObj.drawString(name, 87, 6, 4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory"), 8, this.ySize - 96 + 2, 4210752); this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752);
this.fontRendererObj.drawString(PowerSystem.getLocalizedPower(containerFusionReactor.energy), 11, 8, 16448255); this.fontRendererObj.drawString(PowerSystem.getLocalizedPower(containerFusionReactor.energy), 11, 8, 16448255);
this.fontRendererObj.drawString("Coils: " + (containerFusionReactor.hasCoils ? "Yes" : "No"), 11, 16, 16448255); this.fontRendererObj.drawString("Coils: " + (containerFusionReactor.coilStatus == 1 ? "Yes" : "No"), 11, 16,
16448255);
if(containerFusionReactor.tickTime != -1) { if (containerFusionReactor.neededEU > 1 && containerFusionReactor.tickTime < 1)
if (containerFusionReactor.tickTime == 0) { this.fontRendererObj.drawString(
this.fontRendererObj.drawString("Start: " + percentage(containerFusionReactor.neededEnergy, "Start: " + percentage(containerFusionReactor.neededEU, containerFusionReactor.energy) + "%", 11,
containerFusionReactor.energy) + "%", 11, 24, 16448255); 24, 16448255);
} else {
this.fontRendererObj.drawString("Fusion: " + percentage(containerFusionReactor.finalTickTime,
containerFusionReactor.tickTime) + "%", 11, 24, 16448255);
}
}
} }
@ -85,7 +85,7 @@ public class GuiFusionReactor extends GuiContainer
} }
public int percentage(double MaxValue, double CurrentValue) public int percentage(int MaxValue, int CurrentValue)
{ {
if (CurrentValue == 0) if (CurrentValue == 0)
return 0; return 0;

View file

@ -4,8 +4,6 @@ import com.google.common.collect.ImmutableList;
import net.minecraft.init.Blocks; import net.minecraft.init.Blocks;
import net.minecraft.init.Items; import net.minecraft.init.Items;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fml.common.Loader; import net.minecraftforge.fml.common.Loader;
import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.OreDictionary;
import techreborn.Core; import techreborn.Core;
@ -121,12 +119,6 @@ public class OreDict {
String oreDictName = "nugget" + OreDictUtils.toFirstUpper(type); String oreDictName = "nugget" + OreDictUtils.toFirstUpper(type);
OreDictionary.registerOre(oreDictName, ItemNuggets.getNuggetByName(type)); OreDictionary.registerOre(oreDictName, ItemNuggets.getNuggetByName(type));
} }
for(Fluid fluid : FluidRegistry.getRegisteredFluids().values()) {
ItemStack cell = DynamicCell.getCellWithFluid(fluid);
String oreDictName = "cell" + OreDictUtils.toFirstUpper(fluid.getName().toLowerCase());
OreDictionary.registerOre(oreDictName, cell);
}
} }

View file

@ -3,9 +3,7 @@ package techreborn.parts.powerCables;
import cofh.api.energy.IEnergyConnection; import cofh.api.energy.IEnergyConnection;
import cofh.api.energy.IEnergyProvider; import cofh.api.energy.IEnergyProvider;
import cofh.api.energy.IEnergyReceiver; import cofh.api.energy.IEnergyReceiver;
import ic2.api.energy.tile.IEnergyAcceptor; import ic2.api.energy.tile.*;
import ic2.api.energy.tile.IEnergyEmitter;
import ic2.api.energy.tile.IEnergySource;
import ic2.api.tile.IEnergyStorage; import ic2.api.tile.IEnergyStorage;
import net.darkhax.tesla.api.ITeslaProducer; import net.darkhax.tesla.api.ITeslaProducer;
import net.darkhax.tesla.capability.TeslaCapabilities; import net.darkhax.tesla.capability.TeslaCapabilities;
@ -36,6 +34,7 @@ import net.minecraftforge.common.property.IExtendedBlockState;
import net.minecraftforge.common.property.IUnlistedProperty; import net.minecraftforge.common.property.IUnlistedProperty;
import net.minecraftforge.common.property.Properties; import net.minecraftforge.common.property.Properties;
import net.minecraftforge.fml.common.Loader; import net.minecraftforge.fml.common.Loader;
import reborncore.api.power.IEnergyInterfaceTile;
import reborncore.api.power.tile.IEnergyProducerTile; import reborncore.api.power.tile.IEnergyProducerTile;
import reborncore.api.power.tile.IEnergyReceiverTile; import reborncore.api.power.tile.IEnergyReceiverTile;
import reborncore.common.RebornCoreConfig; import reborncore.common.RebornCoreConfig;
@ -301,36 +300,36 @@ public class CableMultipart extends Multipart
if(tileEntity == null) continue; if(tileEntity == null) continue;
EnumFacing opposite = connection.getOpposite(); EnumFacing opposite = connection.getOpposite();
//TODO rewrite for new version
if(tileEntity instanceof IEnergyProducerTile) { if(tileEntity instanceof IEnergyProducerTile) {
IEnergyProducerTile interfaceTile = (IEnergyProducerTile) tileEntity; IEnergyProducerTile interfaceTile = (IEnergyProducerTile) tileEntity;
if(interfaceTile.canProvideEnergy(opposite)) { if(interfaceTile.canProvideEnergy(opposite)) {
double extractedEU = interfaceTile.useEnergy(getCableType().transferRate, true); double extractedEU = interfaceTile.useEnergy(getCableType().transferRate, true);
double dispatched = EnergyUtils.dispatchWiresEnergyPacket(getWorld(), getPos(), extractedEU, blockPos); double dispatched = EnergyUtils.dispatchWiresEnergyPacket(getWorld(), getPos(), extractedEU, blockPos);
interfaceTile.useEnergy(dispatched); interfaceTile.useEnergy(dispatched);
if(extractedEU != 0) continue; continue;
} }
} }
if(Loader.isModLoaded("IC2") && RebornCoreConfig.getRebornPower().eu()) { if(Loader.isModLoaded("IC2") && RebornCoreConfig.getRebornPower().eu()) {
if (tileEntity instanceof IEnergySource) { if (tileEntity instanceof IEnergySource) {
IEnergySource source = (IEnergySource) tileEntity; IEnergySource source = (IEnergySource) tileEntity;
if (source.emitsEnergyTo((emitter, from) -> true, opposite)) { if(source.emitsEnergyTo((emitter, from) -> true, opposite)) {
double extractedEU = source.getOfferedEnergy(); double extractedEU = source.getOfferedEnergy();
if (extractedEU > getCableType().transferRate) if (extractedEU > getCableType().transferRate)
extractedEU = getCableType().transferRate; extractedEU = getCableType().transferRate;
double dispatched = EnergyUtils.dispatchWiresEnergyPacket(getWorld(), getPos(), extractedEU, blockPos); double dispatched = EnergyUtils.dispatchWiresEnergyPacket(getWorld(), getPos(), extractedEU, blockPos);
source.drawEnergy(dispatched); source.drawEnergy(dispatched);
if (extractedEU != 0) continue; continue;
} }
} } else if(tileEntity instanceof IEnergyStorage) {
if (tileEntity instanceof IEnergyStorage) {
IEnergyStorage storage = (IEnergyStorage) tileEntity; IEnergyStorage storage = (IEnergyStorage) tileEntity;
double extractedEU = storage.getStored(); double extractedEU = storage.getStored();
if (extractedEU > getCableType().transferRate) if(extractedEU > getCableType().transferRate)
extractedEU = getCableType().transferRate; extractedEU = getCableType().transferRate;
double dispatched = EnergyUtils.dispatchWiresEnergyPacket(getWorld(), getPos(), extractedEU, blockPos); double dispatched = EnergyUtils.dispatchWiresEnergyPacket(getWorld(), getPos(), extractedEU, blockPos);
storage.setStored((int) (extractedEU - dispatched)); storage.setStored((int) (extractedEU - dispatched));
if (extractedEU != 0) continue; continue;
} }
} }
@ -343,17 +342,18 @@ public class CableMultipart extends Multipart
double extractedEU = extractedRF / (RebornCoreConfig.euPerRF * 1f); double extractedEU = extractedRF / (RebornCoreConfig.euPerRF * 1f);
double dispatched = EnergyUtils.dispatchWiresEnergyPacket(getWorld(), getPos(), extractedEU, blockPos); double dispatched = EnergyUtils.dispatchWiresEnergyPacket(getWorld(), getPos(), extractedEU, blockPos);
provider.extractEnergy(opposite, (int) (dispatched * RebornCoreConfig.euPerRF), false); provider.extractEnergy(opposite, (int) (dispatched * RebornCoreConfig.euPerRF), false);
if (extractedEU != 0) continue; continue;
} }
} } else if(tileEntity instanceof cofh.api.energy.IEnergyStorage) {
if (tileEntity instanceof cofh.api.energy.IEnergyStorage) {
cofh.api.energy.IEnergyStorage energyStorage = (cofh.api.energy.IEnergyStorage) tileEntity; cofh.api.energy.IEnergyStorage energyStorage = (cofh.api.energy.IEnergyStorage) tileEntity;
int extractedRF = energyStorage.extractEnergy( int extractedRF = energyStorage.extractEnergy(
getCableType().transferRate * RebornCoreConfig.euPerRF, true); getCableType().transferRate * RebornCoreConfig.euPerRF, true);
double extractedEU = extractedRF / (RebornCoreConfig.euPerRF * 1f); double extractedEU = extractedRF / (RebornCoreConfig.euPerRF * 1f);
if (extractedEU > getCableType().transferRate)
extractedEU = getCableType().transferRate;
double dispatched = EnergyUtils.dispatchWiresEnergyPacket(getWorld(), getPos(), extractedEU, blockPos); double dispatched = EnergyUtils.dispatchWiresEnergyPacket(getWorld(), getPos(), extractedEU, blockPos);
energyStorage.extractEnergy((int) (dispatched * RebornCoreConfig.euPerRF), false); energyStorage.extractEnergy((int) (dispatched * RebornCoreConfig.euPerRF), false);
if (extractedEU != 0) continue; continue;
} }
} }
@ -364,7 +364,7 @@ public class CableMultipart extends Multipart
double extractedEU = extractedRF / (RebornCoreConfig.euPerRF * 1F); double extractedEU = extractedRF / (RebornCoreConfig.euPerRF * 1F);
double dispatched = EnergyUtils.dispatchWiresEnergyPacket(getWorld(), getPos(), extractedEU, blockPos); double dispatched = EnergyUtils.dispatchWiresEnergyPacket(getWorld(), getPos(), extractedEU, blockPos);
producer.takePower((long) (dispatched * RebornCoreConfig.euPerRF), false); producer.takePower((long) (dispatched * RebornCoreConfig.euPerRF), false);
if (extractedEU != 0) continue; continue;
} }
} }

View file

@ -1,20 +1,20 @@
package techreborn.tiles; package techreborn.tiles;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import reborncore.api.power.tile.IEnergyProducerTile;
import reborncore.common.IWrenchable; import reborncore.common.IWrenchable;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumFacing;
import reborncore.api.power.EnumPowerTier; import reborncore.api.power.EnumPowerTier;
import reborncore.common.tile.TilePowerAcceptor; import reborncore.common.powerSystem.TilePowerAcceptor;
import reborncore.common.tile.TilePowerAcceptorProducer;
import reborncore.common.util.Inventory; import reborncore.common.util.Inventory;
import techreborn.config.ConfigTechReborn; import techreborn.config.ConfigTechReborn;
import techreborn.init.ModBlocks; import techreborn.init.ModBlocks;
import techreborn.power.EnergyUtils; import techreborn.power.EnergyUtils;
public class TileAesu extends TilePowerAcceptor implements IEnergyProducerTile, IWrenchable { public class TileAesu extends TilePowerAcceptorProducer implements IWrenchable {
public static final int MAX_OUTPUT = ConfigTechReborn.AesuMaxOutput; public static final int MAX_OUTPUT = ConfigTechReborn.AesuMaxOutput;
public static final int MAX_STORAGE = ConfigTechReborn.AesuMaxStorage; public static final int MAX_STORAGE = ConfigTechReborn.AesuMaxStorage;
@ -44,11 +44,19 @@ public class TileAesu extends TilePowerAcceptor implements IEnergyProducerTile,
if (!worldObj.isRemote && getEnergy() > 0) { if (!worldObj.isRemote && getEnergy() > 0) {
double maxOutput = getEnergy() > getMaxOutput() ? getMaxOutput() : getEnergy(); double maxOutput = getEnergy() > getMaxOutput() ? getMaxOutput() : getEnergy();
double disposed = emitEnergy(getFacingEnum(), maxOutput); for(EnumFacing facing : EnumFacing.VALUES) {
if (maxOutput != 0 && disposed != 0) useEnergy(disposed); double disposed = emitEnergy(facing, maxOutput);
if(disposed != 0) {
maxOutput -= disposed;
useEnergy(disposed);
if (maxOutput == 0) return;
}
}
} }
} }
//TODO move to RebornCore
public double emitEnergy(EnumFacing enumFacing, double amount) { public double emitEnergy(EnumFacing enumFacing, double amount) {
BlockPos pos = getPos().offset(enumFacing); BlockPos pos = getPos().offset(enumFacing);
EnergyUtils.PowerNetReceiver receiver = EnergyUtils.getReceiver( EnergyUtils.PowerNetReceiver receiver = EnergyUtils.getReceiver(
@ -59,16 +67,6 @@ public class TileAesu extends TilePowerAcceptor implements IEnergyProducerTile,
return 0; return 0;
} }
@Override
public boolean canAcceptEnergy(EnumFacing direction) {
return getFacingEnum() != direction;
}
@Override
public boolean canProvideEnergy(EnumFacing direction) {
return getFacingEnum() == direction;
}
@Override @Override
public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) { public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) {

View file

@ -5,12 +5,10 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TextComponentString;
import reborncore.api.power.EnumPowerTier; import reborncore.api.power.EnumPowerTier;
import reborncore.api.power.tile.IEnergyProducerTile;
import reborncore.api.tile.IInventoryProvider; import reborncore.api.tile.IInventoryProvider;
import reborncore.common.explosion.RebornExplosion; import reborncore.common.powerSystem.TilePowerAcceptor;
import reborncore.common.tile.TilePowerAcceptor; import reborncore.common.tile.TilePowerAcceptorProducer;
import reborncore.common.util.Inventory; import reborncore.common.util.Inventory;
import reborncore.common.util.ItemUtils; import reborncore.common.util.ItemUtils;
import techreborn.api.reactor.FusionReactorRecipe; import techreborn.api.reactor.FusionReactorRecipe;
@ -18,16 +16,21 @@ import techreborn.api.reactor.FusionReactorRecipeHelper;
import techreborn.init.ModBlocks; import techreborn.init.ModBlocks;
import techreborn.power.EnergyUtils; import techreborn.power.EnergyUtils;
public class TileEntityFusionController extends TilePowerAcceptor implements IEnergyProducerTile, IInventoryProvider { public class TileEntityFusionController extends TilePowerAcceptorProducer implements IInventoryProvider
{
public Inventory inventory = new Inventory(3, "TileEntityFusionController", 64, this); public Inventory inventory = new Inventory(3, "TileEntityFusionController", 64, this);
public boolean hasCoils; // 0= no coils, 1 = coils
public int coilStatus = 0;
public int recipeTickTime = 0; public int crafingTickTime = 0;
public int finalTickTime = 0;
public FusionReactorRecipe recipe = null; public int neededPower = 0;
public boolean repeatSameRecipe = false; int topStackSlot = 0;
int bottomStackSlot = 1;
int outputStackSlot = 2;
FusionReactorRecipe currentRecipe = null;
boolean hasStartedCrafting = false;
@Override @Override
public double getMaxPower() { public double getMaxPower() {
@ -36,54 +39,66 @@ public class TileEntityFusionController extends TilePowerAcceptor implements IEn
@Override @Override
public boolean canAcceptEnergy(EnumFacing direction) { public boolean canAcceptEnergy(EnumFacing direction) {
return recipeTickTime == 0; return hasStartedCrafting;
} }
@Override @Override
public boolean canProvideEnergy(EnumFacing direction) { public boolean canProvideEnergy(EnumFacing direction) {
return recipeTickTime != 0; return !hasStartedCrafting;
} }
@Override @Override
public double getMaxOutput() { public double getMaxOutput() {
if (!hasStartedCrafting)
{
return 0;
}
return 1000000; return 1000000;
} }
@Override @Override
public EnumPowerTier getTier() { public EnumPowerTier getTier()
{
return EnumPowerTier.INSANE; return EnumPowerTier.INSANE;
} }
@Override @Override
public void readFromNBT(NBTTagCompound tagCompound) { public void readFromNBT(NBTTagCompound tagCompound)
{
super.readFromNBT(tagCompound); super.readFromNBT(tagCompound);
if(tagCompound.hasKey("recipeTickTime") && checkCoils()) { crafingTickTime = tagCompound.getInteger("crafingTickTime");
ItemStack topInput = ItemStack.loadItemStackFromNBT(tagCompound.getCompoundTag("TopInput")); finalTickTime = tagCompound.getInteger("finalTickTime");
ItemStack bottomInput = ItemStack.loadItemStackFromNBT(tagCompound.getCompoundTag("BottomInput")); neededPower = tagCompound.getInteger("neededPower");
FusionReactorRecipe newRecipe = findNewNBTRecipe(topInput, bottomInput); hasStartedCrafting = tagCompound.getBoolean("hasStartedCrafting");
if(newRecipe != null) {
this.recipeTickTime = tagCompound.getInteger("recipeTickTime");
this.repeatSameRecipe = tagCompound.getBoolean("repeatSameRecipe");
this.recipe = newRecipe;
}
}
} }
@Override @Override
public NBTTagCompound writeToNBT(NBTTagCompound tagCompound) { public NBTTagCompound writeToNBT(NBTTagCompound tagCompound)
{
super.writeToNBT(tagCompound); super.writeToNBT(tagCompound);
if(recipe != null) {
tagCompound.setTag("TopInput", recipe.getTopInput().writeToNBT(new NBTTagCompound()));
tagCompound.setTag("BottomInput", recipe.getBottomInput().writeToNBT(new NBTTagCompound()));
tagCompound.setInteger("recipeTickTime", recipeTickTime); if (crafingTickTime == -1)
tagCompound.setBoolean("repeatSameRecipe", repeatSameRecipe); {
crafingTickTime = 0;
} }
if (finalTickTime == -1)
{
finalTickTime = 0;
}
if (neededPower == -1)
{
neededPower = 0;
}
tagCompound.setInteger("crafingTickTime", crafingTickTime);
tagCompound.setInteger("finalTickTime", finalTickTime);
tagCompound.setInteger("neededPower", neededPower);
tagCompound.setBoolean("hasStartedCrafting", hasStartedCrafting);
return tagCompound; return tagCompound;
} }
public boolean checkCoils() { public boolean checkCoils()
{
if ((isCoil(this.getPos().getX() + 3, this.getPos().getY(), this.getPos().getZ() + 1)) if ((isCoil(this.getPos().getX() + 3, this.getPos().getY(), this.getPos().getZ() + 1))
&& (isCoil(this.getPos().getX() + 3, this.getPos().getY(), this.getPos().getZ())) && (isCoil(this.getPos().getX() + 3, this.getPos().getY(), this.getPos().getZ()))
&& (isCoil(this.getPos().getX() + 3, this.getPos().getY(), this.getPos().getZ() - 1)) && (isCoil(this.getPos().getX() + 3, this.getPos().getY(), this.getPos().getZ() - 1))
@ -107,140 +122,211 @@ public class TileEntityFusionController extends TilePowerAcceptor implements IEn
&& (isCoil(this.getPos().getX() - 1, this.getPos().getY(), this.getPos().getZ() - 2)) && (isCoil(this.getPos().getX() - 1, this.getPos().getY(), this.getPos().getZ() - 2))
&& (isCoil(this.getPos().getX() - 1, this.getPos().getY(), this.getPos().getZ() - 3)) && (isCoil(this.getPos().getX() - 1, this.getPos().getY(), this.getPos().getZ() - 3))
&& (isCoil(this.getPos().getX(), this.getPos().getY(), this.getPos().getZ() + 3)) && (isCoil(this.getPos().getX(), this.getPos().getY(), this.getPos().getZ() + 3))
&& (isCoil(this.getPos().getX(), this.getPos().getY(), this.getPos().getZ() - 3))) { && (isCoil(this.getPos().getX(), this.getPos().getY(), this.getPos().getZ() - 3)))
hasCoils = true; {
coilStatus = 1;
return true; return true;
} }
hasCoils = false; coilStatus = 0;
return false; return false;
} }
private boolean isCoil(int x, int y, int z) { private boolean isCoil(int x, int y, int z)
{
return worldObj.getBlockState(new BlockPos(x, y, z)).getBlock() == ModBlocks.FusionCoil; return worldObj.getBlockState(new BlockPos(x, y, z)).getBlock() == ModBlocks.FusionCoil;
} }
@Override @Override
public void update() { public void update()
{
super.update(); super.update();
// TODO improve this code a lot
if (!worldObj.isRemote) { if (worldObj.getTotalWorldTime() % 20 == 0)
if (worldObj.getTotalWorldTime() % 20 == 0) { {
checkCoils(); checkCoils();
} }
if (hasCoils) { if (!worldObj.isRemote)
if (recipe == null || inventory.hasChanged) { {
FusionReactorRecipe newRecipe = findNewRecipe(); if (coilStatus == 1)
if (newRecipe != null && newRecipe != recipe) { {
this.recipe = newRecipe; if (currentRecipe == null)
this.repeatSameRecipe = false; {
this.recipeTickTime = 0; if (inventory.hasChanged || crafingTickTime != 0)
{
for (FusionReactorRecipe reactorRecipe : FusionReactorRecipeHelper.reactorRecipes)
{
if (ItemUtils.isItemEqual(getStackInSlot(topStackSlot), reactorRecipe.getTopInput(), true,
true, true))
{
if (reactorRecipe.getBottomInput() != null)
{
if (!ItemUtils.isItemEqual(getStackInSlot(bottomStackSlot),
reactorRecipe.getBottomInput(), true, true, true))
{
break;
}
}
if (canFitStack(reactorRecipe.getOutput(), outputStackSlot, true))
{
currentRecipe = reactorRecipe;
if (crafingTickTime != 0)
{
finalTickTime = currentRecipe.getTickTime();
neededPower = (int) currentRecipe.getStartEU();
}
hasStartedCrafting = false;
crafingTickTime = 0;
finalTickTime = currentRecipe.getTickTime();
neededPower = (int) currentRecipe.getStartEU();
break;
}
}
}
}
} else
{
if (inventory.hasChanged)
{
if (!validateRecipe())
{
resetCrafter();
return;
}
}
if (!hasStartedCrafting)
{
if (canUseEnergy(currentRecipe.getStartEU() + 64))
{
useEnergy(currentRecipe.getStartEU());
hasStartedCrafting = true;
}
} else
{
if (crafingTickTime < currentRecipe.getTickTime())
{
if (currentRecipe.getEuTick() > 0)
{ // Power gen
addEnergy(currentRecipe.getEuTick()); // Waste
// power
// if it
// has
// no
// where
// to go
crafingTickTime++;
} else
{ // Power user
if (canUseEnergy(currentRecipe.getEuTick() * -1))
{
setEnergy(getEnergy() - (currentRecipe.getEuTick() * -1));
crafingTickTime++;
}
}
} else
{
if (canFitStack(currentRecipe.getOutput(), outputStackSlot, true))
{
if (getStackInSlot(outputStackSlot) == null)
{
setInventorySlotContents(outputStackSlot, currentRecipe.getOutput().copy());
} else
{
decrStackSize(outputStackSlot, -currentRecipe.getOutput().stackSize);
}
decrStackSize(topStackSlot, currentRecipe.getTopInput().stackSize);
if (currentRecipe.getBottomInput() != null)
{
decrStackSize(bottomStackSlot, currentRecipe.getBottomInput().stackSize);
}
resetCrafter();
}
}
} }
} }
} else
if (recipe != null) { {
if (recipeTickTime == 0) { if (currentRecipe != null)
if (canUseEnergy(recipe.getStartEU())) { {
useEnergy(recipe.getStartEU()); resetCrafter();
consumeInputStacks();
++recipeTickTime;
}
} else if (++recipeTickTime >= recipe.getTickTime()) {
addOutputStack(recipe.getOutput());
FusionReactorRecipe newRecipe = findNewRecipe();
if (newRecipe == recipe) {
consumeInputStacks();
this.repeatSameRecipe = true;
recipeTickTime = 1;
} else {
this.recipe = null;
this.repeatSameRecipe = false;
recipeTickTime = 0;
}
} else {
double euTick = recipe.getEuTick();
if (euTick > 0) addEnergy(euTick);
else if (useEnergy(-euTick) != euTick) {
this.recipeTickTime = 0;
this.repeatSameRecipe = false;
this.recipe = null;
}
}
} }
} }
}
if (!worldObj.isRemote && getEnergy() > 0 && recipeTickTime != 0) { if (inventory.hasChanged)
double maxOutput = getEnergy() > getMaxOutput() ? getMaxOutput() : getEnergy(); {
double disposed = 0; inventory.hasChanged = false;
for(EnumFacing facing : EnumFacing.VALUES) { }
if(canProvideEnergy(facing)) {
double emitted = emitEnergy(facing, maxOutput); if (!worldObj.isRemote && getEnergy() > 0 && hasStartedCrafting) {
maxOutput -= emitted; double maxOutput = getEnergy() > getMaxOutput() ? getMaxOutput() : getEnergy();
disposed += emitted; for(EnumFacing facing : EnumFacing.VALUES) {
} double disposed = emitEnergy(facing, maxOutput);
} if(disposed != 0) {
if (disposed != 0) maxOutput -= disposed;
useEnergy(disposed); useEnergy(disposed);
if (maxOutput == 0) return;
}
} }
} }
} }
public FusionReactorRecipe findNewRecipe() { //TODO move to RebornCore
for(FusionReactorRecipe reactorRecipe : FusionReactorRecipeHelper.reactorRecipes) {
if(canFitStack(reactorRecipe.getOutput(), 2) &&
canEmptyStack(reactorRecipe.getTopInput(), 0) &&
canEmptyStack(reactorRecipe.getBottomInput(), 1)) {
return reactorRecipe;
}
}
return null;
}
public FusionReactorRecipe findNewNBTRecipe(ItemStack top, ItemStack bottom) {
for(FusionReactorRecipe reactorRecipe : FusionReactorRecipeHelper.reactorRecipes) {
if(canFitStack(reactorRecipe.getOutput(), 2) &&
ItemUtils.isItemEqual(top, reactorRecipe.getTopInput(), true, true) &&
ItemUtils.isItemEqual(bottom, reactorRecipe.getBottomInput(), true, true)) {
return reactorRecipe;
}
}
return null;
}
public double emitEnergy(EnumFacing enumFacing, double amount) { public double emitEnergy(EnumFacing enumFacing, double amount) {
BlockPos pos = getPos().offset(enumFacing); BlockPos pos = getPos().offset(enumFacing);
EnergyUtils.PowerNetReceiver receiver = EnergyUtils.getReceiver( EnergyUtils.PowerNetReceiver receiver = EnergyUtils.getReceiver(
worldObj, enumFacing.getOpposite(), pos); worldObj, enumFacing.getOpposite(), pos);
if (receiver != null) { if(receiver != null) {
return receiver.receiveEnergy(amount, false); return receiver.receiveEnergy(amount, false);
} }
return 0; return 0;
} }
public void consumeInputStacks() { private boolean validateRecipe()
if(--getStackInSlot(0).stackSize == 0) setInventorySlotContents(0, null); {
if(--getStackInSlot(1).stackSize == 0) setInventorySlotContents(1, null); if (ItemUtils.isItemEqual(getStackInSlot(topStackSlot), currentRecipe.getTopInput(), true, true, true))
{
if (currentRecipe.getBottomInput() != null)
{
if (!ItemUtils.isItemEqual(getStackInSlot(bottomStackSlot), currentRecipe.getBottomInput(), true, true,
true))
{
return false;
}
}
if (canFitStack(currentRecipe.getOutput(), outputStackSlot, true))
{
return true;
}
}
return false;
} }
public void addOutputStack(ItemStack output) { private void resetCrafter()
ItemStack stack = getStackInSlot(2); {
if(stack == null) setInventorySlotContents(2, output); currentRecipe = null;
else stack.stackSize++; crafingTickTime = -1;
finalTickTime = -1;
neededPower = -1;
hasStartedCrafting = false;
} }
public boolean canEmptyStack(ItemStack stack, int slot) { public boolean canFitStack(ItemStack stack, int slot, boolean oreDic)
return inventory.getStackInSlot(slot) != null && {// Checks to see if it can fit the stack
ItemUtils.isItemEqual(inventory.getStackInSlot(slot), stack, true, true, true); if (stack == null)
} {
public boolean canFitStack(ItemStack stack, int slot) {
if (stack == null || inventory.getStackInSlot(slot) == null) {
return true; return true;
} }
if (ItemUtils.isItemEqual(inventory.getStackInSlot(slot), stack, true, true, true)) { if (inventory.getStackInSlot(slot) == null)
if (stack.stackSize + inventory.getStackInSlot(slot).stackSize <= stack.getMaxStackSize()) { {
return true;
}
if (ItemUtils.isItemEqual(inventory.getStackInSlot(slot), stack, true, true, oreDic))
{
if (stack.stackSize + inventory.getStackInSlot(slot).stackSize <= stack.getMaxStackSize())
{
return true; return true;
} }
} }
@ -248,23 +334,25 @@ public class TileEntityFusionController extends TilePowerAcceptor implements IEn
} }
@Override @Override
public String getName() { public String getName()
{
return "Fusion Reactor"; return "Fusion Reactor";
} }
@Override @Override
public boolean hasCustomName() { public boolean hasCustomName()
{
return false; return false;
} }
@Override @Override
public ITextComponent getDisplayName() { public ITextComponent getDisplayName()
return new TextComponentString(getName()); {
return null;
} }
@Override @Override
public Inventory getInventory() { public Inventory getInventory() {
return inventory; return inventory;
} }
} }

View file

@ -101,11 +101,19 @@ public class TileIDSU extends TilePowerAcceptorProducer implements IWrenchable {
if (!worldObj.isRemote && getEnergy() > 0) { if (!worldObj.isRemote && getEnergy() > 0) {
double maxOutput = getEnergy() > getMaxOutput() ? getMaxOutput() : getEnergy(); double maxOutput = getEnergy() > getMaxOutput() ? getMaxOutput() : getEnergy();
double disposed = emitEnergy(getFacingEnum(), maxOutput); for(EnumFacing facing : EnumFacing.VALUES) {
if (maxOutput != 0 && disposed != 0) useEnergy(disposed); double disposed = emitEnergy(facing, maxOutput);
if(disposed != 0) {
maxOutput -= disposed;
useEnergy(disposed);
if (maxOutput == 0) return;
}
}
} }
} }
//TODO move to RebornCore
public double emitEnergy(EnumFacing enumFacing, double amount) { public double emitEnergy(EnumFacing enumFacing, double amount) {
BlockPos pos = getPos().offset(enumFacing); BlockPos pos = getPos().offset(enumFacing);
EnergyUtils.PowerNetReceiver receiver = EnergyUtils.getReceiver( EnergyUtils.PowerNetReceiver receiver = EnergyUtils.getReceiver(
@ -116,16 +124,6 @@ public class TileIDSU extends TilePowerAcceptorProducer implements IWrenchable {
return 0; return 0;
} }
@Override
public boolean canAcceptEnergy(EnumFacing direction) {
return getFacingEnum() != direction;
}
@Override
public boolean canProvideEnergy(EnumFacing direction) {
return getFacingEnum() == direction;
}
public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) { public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) {
return false; return false;

View file

@ -72,11 +72,19 @@ public class TileLesu extends TilePowerAcceptorProducer {// TODO wrench
if (!worldObj.isRemote && getEnergy() > 0) { if (!worldObj.isRemote && getEnergy() > 0) {
double maxOutput = getEnergy() > getMaxOutput() ? getMaxOutput() : getEnergy(); double maxOutput = getEnergy() > getMaxOutput() ? getMaxOutput() : getEnergy();
double disposed = emitEnergy(getFacingEnum(), maxOutput); for(EnumFacing facing : EnumFacing.VALUES) {
if (maxOutput != 0 && disposed != 0) useEnergy(disposed); double disposed = emitEnergy(facing, maxOutput);
if(disposed != 0) {
maxOutput -= disposed;
useEnergy(disposed);
if (maxOutput == 0) return;
}
}
} }
} }
//TODO move to RebornCore
public double emitEnergy(EnumFacing enumFacing, double amount) { public double emitEnergy(EnumFacing enumFacing, double amount) {
BlockPos pos = getPos().offset(enumFacing); BlockPos pos = getPos().offset(enumFacing);
EnergyUtils.PowerNetReceiver receiver = EnergyUtils.getReceiver( EnergyUtils.PowerNetReceiver receiver = EnergyUtils.getReceiver(
@ -87,16 +95,6 @@ public class TileLesu extends TilePowerAcceptorProducer {// TODO wrench
return 0; return 0;
} }
@Override
public boolean canAcceptEnergy(EnumFacing direction) {
return getFacingEnum() != direction;
}
@Override
public boolean canProvideEnergy(EnumFacing direction) {
return getFacingEnum() == direction;
}
public double getEuChange() { public double getEuChange() {
if (euChange == -1) { if (euChange == -1) {

View file

@ -9,7 +9,7 @@ import techreborn.init.ModBlocks;
public class TileBatBox extends TileEnergyStorage { public class TileBatBox extends TileEnergyStorage {
public TileBatBox() { public TileBatBox() {
super("BatBox", 2, ModBlocks.batBox, EnumPowerTier.LOW, 40000); super("BatBox", 2, ModBlocks.batBox, EnumPowerTier.LOW, 32, 32, 40000);
} }
} }

View file

@ -9,11 +9,9 @@ import net.minecraft.util.math.BlockPos;
import reborncore.api.IListInfoProvider; import reborncore.api.IListInfoProvider;
import reborncore.api.power.EnumPowerTier; import reborncore.api.power.EnumPowerTier;
import reborncore.api.power.IEnergyItemInfo; import reborncore.api.power.IEnergyItemInfo;
import reborncore.api.power.tile.IEnergyProducerTile;
import reborncore.api.tile.IInventoryProvider; import reborncore.api.tile.IInventoryProvider;
import reborncore.common.IWrenchable; import reborncore.common.IWrenchable;
import reborncore.common.powerSystem.PoweredItem; import reborncore.common.powerSystem.PoweredItem;
import reborncore.common.tile.TilePowerAcceptor;
import reborncore.common.tile.TilePowerAcceptorProducer; import reborncore.common.tile.TilePowerAcceptorProducer;
import reborncore.common.util.Inventory; import reborncore.common.util.Inventory;
import techreborn.blocks.storage.BlockEnergyStorage; import techreborn.blocks.storage.BlockEnergyStorage;
@ -24,19 +22,23 @@ import java.util.List;
/** /**
* Created by Rushmead * Created by Rushmead
*/ */
public class TileEnergyStorage extends TilePowerAcceptor implements IEnergyProducerTile, IWrenchable, ITickable, IInventoryProvider, IListInfoProvider { public class TileEnergyStorage extends TilePowerAcceptorProducer implements IWrenchable, ITickable, IInventoryProvider, IListInfoProvider {
public Inventory inventory; public Inventory inventory;
public String name; public String name;
public Block wrenchDrop; public Block wrenchDrop;
public EnumPowerTier tier; public EnumPowerTier tier;
public int maxInput;
public int maxOutput;
public int maxStorage; public int maxStorage;
public TileEnergyStorage(String name, int invSize, Block wrenchDrop, EnumPowerTier tier, int maxStorage) { public TileEnergyStorage(String name, int invSize, Block wrenchDrop, EnumPowerTier tier, int maxInput, int maxOuput, int maxStorage) {
inventory = new Inventory(invSize, "Tile" + name, 64, this); inventory = new Inventory(invSize, "Tile" + name, 64, this);
this.wrenchDrop = wrenchDrop; this.wrenchDrop = wrenchDrop;
this.tier = tier; this.tier = tier;
this.name = name; this.name = name;
this.maxInput = maxInput;
this.maxOutput = maxOuput;
this.maxStorage = maxStorage; this.maxStorage = maxStorage;
} }
@ -91,13 +93,23 @@ public class TileEnergyStorage extends TilePowerAcceptor implements IEnergyProdu
} }
} }
if (!worldObj.isRemote && getEnergy() > 0) { if (!worldObj.isRemote && getEnergy() > 0) {
double maxOutput = getEnergy() > getMaxOutput() ? getMaxOutput() : getEnergy(); double maxOutput = getEnergy() > getMaxOutput() ? getMaxOutput() : getEnergy();
double disposed = emitEnergy(getFacingEnum(), maxOutput); for(EnumFacing facing : EnumFacing.VALUES) {
if (maxOutput != 0 && disposed != 0) useEnergy(disposed); double disposed = emitEnergy(facing, maxOutput);
if(disposed != 0) {
maxOutput -= disposed;
useEnergy(disposed);
if (maxOutput == 0) return;
}
}
} }
} }
//TODO move to RebornCore
public double emitEnergy(EnumFacing enumFacing, double amount) { public double emitEnergy(EnumFacing enumFacing, double amount) {
BlockPos pos = getPos().offset(enumFacing); BlockPos pos = getPos().offset(enumFacing);
EnergyUtils.PowerNetReceiver receiver = EnergyUtils.getReceiver( EnergyUtils.PowerNetReceiver receiver = EnergyUtils.getReceiver(
@ -108,16 +120,6 @@ public class TileEnergyStorage extends TilePowerAcceptor implements IEnergyProdu
return 0; return 0;
} }
@Override
public boolean canAcceptEnergy(EnumFacing direction) {
return getFacingEnum() != direction;
}
@Override
public boolean canProvideEnergy(EnumFacing direction) {
return getFacingEnum() == direction;
}
@Override @Override
public void setFacing(EnumFacing enumFacing) { public void setFacing(EnumFacing enumFacing) {
worldObj.setBlockState(pos, worldObj.getBlockState(pos).withProperty(BlockEnergyStorage.FACING, enumFacing)); worldObj.setBlockState(pos, worldObj.getBlockState(pos).withProperty(BlockEnergyStorage.FACING, enumFacing));

View file

@ -9,7 +9,7 @@ import techreborn.init.ModBlocks;
public class TileMFE extends TileEnergyStorage { public class TileMFE extends TileEnergyStorage {
public TileMFE() { public TileMFE() {
super("MFE", 2, ModBlocks.mfe, EnumPowerTier.HIGH, 4000000); super("MFE", 2, ModBlocks.mfe, EnumPowerTier.MEDIUM, 512, 512, 4000000);
} }
} }

View file

@ -9,7 +9,7 @@ import techreborn.init.ModBlocks;
public class TileMFSU extends TileEnergyStorage { public class TileMFSU extends TileEnergyStorage {
public TileMFSU() { public TileMFSU() {
super("MFSU", 2, ModBlocks.mfsu, EnumPowerTier.EXTREME, 40000000); super("MFSU", 2, ModBlocks.mfsu, EnumPowerTier.HIGH, 2048, 2048, 40000000);
} }
} }