Fusion reactor fixes & rewrite, energy fixes.

This commit is contained in:
Dragon2488 2016-07-22 21:45:55 +07:00
parent fe64b8ccf7
commit 06fad2264f
13 changed files with 279 additions and 386 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)).crafingTickTime != 0 if (((TileEntityFusionController) worldIn.getTileEntity(pos)).recipe != null
&& ((TileEntityFusionController) worldIn.getTileEntity(pos)).checkCoils()) && ((TileEntityFusionController) worldIn.getTileEntity(pos)).checkCoils())
{ {
entityIn.attackEntityFrom(new FusionDamageSource(), 200F); entityIn.attackEntityFrom(new FusionDamageSource(), 200F);

View file

@ -7,21 +7,22 @@ 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;
@ -31,105 +32,73 @@ 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();
for (int i = 0; i < this.listeners.size(); i++) FusionReactorRecipe rec = fusionController.recipe;
{ for (int i = 0; i < this.listeners.size(); i++) {
IContainerListener IContainerListener = this.listeners.get(i); IContainerListener listener = this.listeners.get(i);
if (this.coilStatus != fusionController.coilStatus) listener.sendProgressBarUpdate(this, 0, fusionController.hasCoils ? 1 : 0);
{ listener.sendProgressBarUpdate(this, 1, (int) fusionController.getEnergy());
IContainerListener.sendProgressBarUpdate(this, 0, fusionController.coilStatus); listener.sendProgressBarUpdate(this, 2, rec == null ? 0 : (int) rec.getStartEU());
} listener.sendProgressBarUpdate(this, 3, rec == null ? -1 : fusionController.recipeTickTime);
if (this.energy != (int) fusionController.getEnergy()) listener.sendProgressBarUpdate(this, 4, rec == null ? 0 : rec.getTickTime());
{
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 crafting) public void addListener(IContainerListener listener) {
{ super.addListener(listener);
super.addListener(crafting); FusionReactorRecipe rec = fusionController.recipe;
crafting.sendProgressBarUpdate(this, 0, fusionController.coilStatus); listener.sendProgressBarUpdate(this, 0, fusionController.hasCoils ? 1 : 0);
crafting.sendProgressBarUpdate(this, 1, (int) fusionController.getEnergy()); listener.sendProgressBarUpdate(this, 1, (int) fusionController.getEnergy());
crafting.sendProgressBarUpdate(this, 2, fusionController.crafingTickTime); listener.sendProgressBarUpdate(this, 2, rec == null ? 0 : (int) rec.getStartEU());
crafting.sendProgressBarUpdate(this, 3, fusionController.finalTickTime); listener.sendProgressBarUpdate(this, 3, rec == null ? -1 : fusionController.recipeTickTime);
crafting.sendProgressBarUpdate(this, 4, fusionController.neededPower); listener.sendProgressBarUpdate(this, 4, rec == null ? 0 : rec.getTickTime());
} }
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
@Override @Override
public void updateProgressBar(int id, int value) public void updateProgressBar(int id, int value) {
{ switch (id) {
if (id == 0) case 0:
{ this.hasCoils = value == 1;
this.coilStatus = value; break;
} else if (id == 1) case 1:
{ this.energy = value;
this.energy = value; break;
} else if (id == 2) case 2:
{ this.neededEnergy = value;
this.tickTime = value; break;
} else if (id == 3) case 3:
{ this.tickTime = value;
this.finalTickTime = value; break;
} else if (id == 4) case 4:
{ this.finalTickTime = value;
this.neededEU = value; break;
}
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,6 +9,7 @@ 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;
@ -19,29 +20,28 @@ public class GuiFusionReactor extends GuiContainer
"textures/gui/fusion_reactor.png"); "textures/gui/fusion_reactor.png");
ContainerFusionReactor containerFusionReactor; ContainerFusionReactor containerFusionReactor;
TileEntityFusionController fusionController; public GuiFusionReactor(EntityPlayer player, TileEntityFusionController tileaesu) {
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", new Object[0]), 8, this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
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.coilStatus == 1 ? "Yes" : "No"), 11, 16, this.fontRendererObj.drawString("Coils: " + (containerFusionReactor.hasCoils ? "Yes" : "No"), 11, 16, 16448255);
16448255);
if (containerFusionReactor.neededEU > 1 && containerFusionReactor.tickTime < 1) if(containerFusionReactor.tickTime != -1) {
this.fontRendererObj.drawString( if (containerFusionReactor.tickTime == 0) {
"Start: " + percentage(containerFusionReactor.neededEU, containerFusionReactor.energy) + "%", 11, this.fontRendererObj.drawString("Start: " + percentage(containerFusionReactor.neededEnergy,
24, 16448255); containerFusionReactor.energy) + "%", 11, 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(int MaxValue, int CurrentValue) public int percentage(double MaxValue, double CurrentValue)
{ {
if (CurrentValue == 0) if (CurrentValue == 0)
return 0; return 0;

View file

@ -4,6 +4,8 @@ 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;
@ -119,6 +121,12 @@ 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,7 +3,9 @@ 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.*; import ic2.api.energy.tile.IEnergyAcceptor;
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;
@ -34,7 +36,6 @@ 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;
@ -300,36 +301,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);
continue; if(extractedEU != 0) 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);
continue; if (extractedEU != 0) 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));
continue; if (extractedEU != 0) continue;
} }
} }
@ -342,18 +343,17 @@ 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);
continue; if (extractedEU != 0) 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);
continue; if (extractedEU != 0) 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);
continue; if (extractedEU != 0) 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.powerSystem.TilePowerAcceptor; import reborncore.common.tile.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 TilePowerAcceptorProducer implements IWrenchable { public class TileAesu extends TilePowerAcceptor implements IEnergyProducerTile, 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,19 +44,11 @@ public class TileAesu 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();
for(EnumFacing facing : EnumFacing.VALUES) { double disposed = emitEnergy(getFacingEnum(), maxOutput);
double disposed = emitEnergy(facing, maxOutput); if (maxOutput != 0 && disposed != 0) useEnergy(disposed);
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(
@ -67,6 +59,16 @@ public class TileAesu 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;
}
@Override @Override
public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) { public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) {

View file

@ -5,10 +5,12 @@ 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.powerSystem.TilePowerAcceptor; import reborncore.common.explosion.RebornExplosion;
import reborncore.common.tile.TilePowerAcceptorProducer; import reborncore.common.tile.TilePowerAcceptor;
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;
@ -16,21 +18,16 @@ 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 TilePowerAcceptorProducer implements IInventoryProvider public class TileEntityFusionController extends TilePowerAcceptor implements IEnergyProducerTile, IInventoryProvider {
{
public Inventory inventory = new Inventory(3, "TileEntityFusionController", 64, this); public Inventory inventory = new Inventory(3, "TileEntityFusionController", 64, this);
// 0= no coils, 1 = coils public boolean hasCoils;
public int coilStatus = 0;
public int crafingTickTime = 0; public int recipeTickTime = 0;
public int finalTickTime = 0;
public int neededPower = 0; public FusionReactorRecipe recipe = null;
int topStackSlot = 0; public boolean repeatSameRecipe = false;
int bottomStackSlot = 1;
int outputStackSlot = 2;
FusionReactorRecipe currentRecipe = null;
boolean hasStartedCrafting = false;
@Override @Override
public double getMaxPower() { public double getMaxPower() {
@ -39,66 +36,54 @@ public class TileEntityFusionController extends TilePowerAcceptorProducer implem
@Override @Override
public boolean canAcceptEnergy(EnumFacing direction) { public boolean canAcceptEnergy(EnumFacing direction) {
return hasStartedCrafting; return recipeTickTime == 0;
} }
@Override @Override
public boolean canProvideEnergy(EnumFacing direction) { public boolean canProvideEnergy(EnumFacing direction) {
return !hasStartedCrafting; return recipeTickTime != 0;
} }
@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);
crafingTickTime = tagCompound.getInteger("crafingTickTime"); if(tagCompound.hasKey("recipeTickTime") && checkCoils()) {
finalTickTime = tagCompound.getInteger("finalTickTime"); ItemStack topInput = ItemStack.loadItemStackFromNBT(tagCompound.getCompoundTag("TopInput"));
neededPower = tagCompound.getInteger("neededPower"); ItemStack bottomInput = ItemStack.loadItemStackFromNBT(tagCompound.getCompoundTag("BottomInput"));
hasStartedCrafting = tagCompound.getBoolean("hasStartedCrafting"); FusionReactorRecipe newRecipe = findNewNBTRecipe(topInput, bottomInput);
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()));
if (crafingTickTime == -1) tagCompound.setInteger("recipeTickTime", recipeTickTime);
{ 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))
@ -122,211 +107,140 @@ public class TileEntityFusionController extends TilePowerAcceptorProducer implem
&& (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;
} }
coilStatus = 0; hasCoils = false;
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.getTotalWorldTime() % 20 == 0) if (!worldObj.isRemote) {
{ if (worldObj.getTotalWorldTime() % 20 == 0) {
checkCoils(); checkCoils();
} }
if (!worldObj.isRemote) if (hasCoils) {
{ if (recipe == null || inventory.hasChanged) {
if (coilStatus == 1) FusionReactorRecipe newRecipe = findNewRecipe();
{ if (newRecipe != null && newRecipe != recipe) {
if (currentRecipe == null) this.recipe = newRecipe;
{ this.repeatSameRecipe = false;
if (inventory.hasChanged || crafingTickTime != 0) this.recipeTickTime = 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 (currentRecipe != null) if (recipeTickTime == 0) {
{ if (canUseEnergy(recipe.getStartEU())) {
resetCrafter(); useEnergy(recipe.getStartEU());
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 (inventory.hasChanged) if (!worldObj.isRemote && getEnergy() > 0 && recipeTickTime != 0) {
{ double maxOutput = getEnergy() > getMaxOutput() ? getMaxOutput() : getEnergy();
inventory.hasChanged = false; double disposed = 0;
} for(EnumFacing facing : EnumFacing.VALUES) {
if(canProvideEnergy(facing)) {
if (!worldObj.isRemote && getEnergy() > 0 && hasStartedCrafting) { double emitted = emitEnergy(facing, maxOutput);
double maxOutput = getEnergy() > getMaxOutput() ? getMaxOutput() : getEnergy(); maxOutput -= emitted;
for(EnumFacing facing : EnumFacing.VALUES) { disposed += emitted;
double disposed = emitEnergy(facing, maxOutput); }
if(disposed != 0) {
maxOutput -= disposed;
useEnergy(disposed);
if (maxOutput == 0) return;
} }
if (disposed != 0)
useEnergy(disposed);
} }
} }
} }
//TODO move to RebornCore public FusionReactorRecipe findNewRecipe() {
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;
} }
private boolean validateRecipe() public void consumeInputStacks() {
{ if(--getStackInSlot(0).stackSize == 0) setInventorySlotContents(0, null);
if (ItemUtils.isItemEqual(getStackInSlot(topStackSlot), currentRecipe.getTopInput(), true, true, true)) if(--getStackInSlot(1).stackSize == 0) setInventorySlotContents(1, null);
{
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;
} }
private void resetCrafter() public void addOutputStack(ItemStack output) {
{ ItemStack stack = getStackInSlot(2);
currentRecipe = null; if(stack == null) setInventorySlotContents(2, output);
crafingTickTime = -1; else stack.stackSize++;
finalTickTime = -1;
neededPower = -1;
hasStartedCrafting = false;
} }
public boolean canFitStack(ItemStack stack, int slot, boolean oreDic) public boolean canEmptyStack(ItemStack stack, int slot) {
{// Checks to see if it can fit the stack return inventory.getStackInSlot(slot) != null &&
if (stack == null) ItemUtils.isItemEqual(inventory.getStackInSlot(slot), stack, true, true, true);
{ }
public boolean canFitStack(ItemStack stack, int slot) {
if (stack == null || inventory.getStackInSlot(slot) == null) {
return true; return true;
} }
if (inventory.getStackInSlot(slot) == null) if (ItemUtils.isItemEqual(inventory.getStackInSlot(slot), stack, true, true, true)) {
{ 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;
} }
} }
@ -334,25 +248,23 @@ public class TileEntityFusionController extends TilePowerAcceptorProducer implem
} }
@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,19 +101,11 @@ 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();
for(EnumFacing facing : EnumFacing.VALUES) { double disposed = emitEnergy(getFacingEnum(), maxOutput);
double disposed = emitEnergy(facing, maxOutput); if (maxOutput != 0 && disposed != 0) useEnergy(disposed);
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(
@ -124,6 +116,16 @@ 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,19 +72,11 @@ 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();
for(EnumFacing facing : EnumFacing.VALUES) { double disposed = emitEnergy(getFacingEnum(), maxOutput);
double disposed = emitEnergy(facing, maxOutput); if (maxOutput != 0 && disposed != 0) useEnergy(disposed);
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(
@ -95,6 +87,16 @@ 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, 32, 32, 40000); super("BatBox", 2, ModBlocks.batBox, EnumPowerTier.LOW, 40000);
} }
} }

View file

@ -9,9 +9,11 @@ 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;
@ -22,23 +24,19 @@ import java.util.List;
/** /**
* Created by Rushmead * Created by Rushmead
*/ */
public class TileEnergyStorage extends TilePowerAcceptorProducer implements IWrenchable, ITickable, IInventoryProvider, IListInfoProvider { public class TileEnergyStorage extends TilePowerAcceptor implements IEnergyProducerTile, 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 maxInput, int maxOuput, int maxStorage) { public TileEnergyStorage(String name, int invSize, Block wrenchDrop, EnumPowerTier tier, 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;
} }
@ -93,23 +91,13 @@ public class TileEnergyStorage extends TilePowerAcceptorProducer implements IWre
} }
} }
if (!worldObj.isRemote && getEnergy() > 0) { if (!worldObj.isRemote && getEnergy() > 0) {
double maxOutput = getEnergy() > getMaxOutput() ? getMaxOutput() : getEnergy(); double maxOutput = getEnergy() > getMaxOutput() ? getMaxOutput() : getEnergy();
for(EnumFacing facing : EnumFacing.VALUES) { double disposed = emitEnergy(getFacingEnum(), maxOutput);
double disposed = emitEnergy(facing, maxOutput); if (maxOutput != 0 && disposed != 0) useEnergy(disposed);
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(
@ -120,6 +108,16 @@ public class TileEnergyStorage extends TilePowerAcceptorProducer implements IWre
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.MEDIUM, 512, 512, 4000000); super("MFE", 2, ModBlocks.mfe, EnumPowerTier.HIGH, 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.HIGH, 2048, 2048, 40000000); super("MFSU", 2, ModBlocks.mfsu, EnumPowerTier.EXTREME, 40000000);
} }
} }