Revert "Rewrite to use new RebornCore Power API. Texture fixes."
This reverts commit b292fdd352
.
# Conflicts:
# src/main/java/techreborn/client/gui/GuiImplosionCompressor.java
# src/main/java/techreborn/client/gui/GuiIndustrialGrinder.java
# src/main/java/techreborn/client/gui/GuiIndustrialSawmill.java
# src/main/java/techreborn/client/gui/GuiVacuumFreezer.java
# src/main/java/techreborn/tiles/TileAlloyFurnace.java
# src/main/java/techreborn/tiles/TileAlloySmelter.java
# src/main/java/techreborn/tiles/TileAssemblingMachine.java
# src/main/java/techreborn/tiles/TileImplosionCompressor.java
# src/main/java/techreborn/tiles/TileIndustrialSawmill.java
# src/main/java/techreborn/tiles/TileVacuumFreezer.java
# src/main/java/techreborn/tiles/multiblock/TileBlastFurnace.java
# src/main/java/techreborn/tiles/multiblock/TileIndustrialGrinder.java
# src/main/java/techreborn/tiles/teir1/TileCompressor.java
# src/main/java/techreborn/tiles/teir1/TileElectricFurnace.java
# src/main/java/techreborn/tiles/teir1/TileExtractor.java
# src/main/java/techreborn/tiles/teir1/TileGrinder.java
# src/main/java/techreborn/tiles/teir1/TileRecycler.java
This commit is contained in:
parent
9b882e75ce
commit
cdae866b2d
87 changed files with 3721 additions and 1277 deletions
|
@ -8,7 +8,6 @@ import net.minecraft.util.text.ITextComponent;
|
|||
import reborncore.api.power.EnumPowerTier;
|
||||
import reborncore.api.tile.IInventoryProvider;
|
||||
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||
import reborncore.common.tile.TilePowerAcceptorProducer;
|
||||
import reborncore.common.util.Inventory;
|
||||
import reborncore.common.util.ItemUtils;
|
||||
import techreborn.api.reactor.FusionReactorRecipe;
|
||||
|
@ -16,7 +15,7 @@ import techreborn.api.reactor.FusionReactorRecipeHelper;
|
|||
import techreborn.init.ModBlocks;
|
||||
import techreborn.power.EnergyUtils;
|
||||
|
||||
public class TileEntityFusionController extends TilePowerAcceptorProducer implements IInventoryProvider
|
||||
public class TileEntityFusionController extends TilePowerAcceptor implements IInventoryProvider
|
||||
{
|
||||
|
||||
public Inventory inventory = new Inventory(3, "TileEntityFusionController", 64, this);
|
||||
|
@ -32,23 +31,31 @@ public class TileEntityFusionController extends TilePowerAcceptorProducer implem
|
|||
FusionReactorRecipe currentRecipe = null;
|
||||
boolean hasStartedCrafting = false;
|
||||
|
||||
public TileEntityFusionController()
|
||||
{
|
||||
super(4);
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getMaxPower() {
|
||||
return 100000000;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canAcceptEnergy(EnumFacing direction) {
|
||||
return hasStartedCrafting;
|
||||
public boolean canAcceptEnergy(EnumFacing direction)
|
||||
{
|
||||
return !(direction == EnumFacing.DOWN || direction == EnumFacing.UP);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvideEnergy(EnumFacing direction) {
|
||||
return !hasStartedCrafting;
|
||||
public boolean canProvideEnergy(EnumFacing direction)
|
||||
{
|
||||
return direction == EnumFacing.DOWN || direction == EnumFacing.UP;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getMaxOutput() {
|
||||
public double getMaxOutput()
|
||||
{
|
||||
if (!hasStartedCrafting)
|
||||
{
|
||||
return 0;
|
||||
|
@ -56,10 +63,18 @@ public class TileEntityFusionController extends TilePowerAcceptorProducer implem
|
|||
return 1000000;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getMaxInput() {
|
||||
if (hasStartedCrafting) {
|
||||
return 0;
|
||||
}
|
||||
return 8192;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumPowerTier getTier()
|
||||
{
|
||||
return EnumPowerTier.INSANE;
|
||||
return EnumPowerTier.EXTREME;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -137,9 +152,9 @@ public class TileEntityFusionController extends TilePowerAcceptorProducer implem
|
|||
}
|
||||
|
||||
@Override
|
||||
public void update()
|
||||
public void updateEntity()
|
||||
{
|
||||
super.update();
|
||||
super.updateEntity();
|
||||
// TODO improve this code a lot
|
||||
|
||||
if (worldObj.getTotalWorldTime() % 20 == 0)
|
||||
|
@ -261,29 +276,11 @@ public class TileEntityFusionController extends TilePowerAcceptorProducer implem
|
|||
|
||||
if (!worldObj.isRemote && getEnergy() > 0 && hasStartedCrafting) {
|
||||
double maxOutput = getEnergy() > getMaxOutput() ? getMaxOutput() : getEnergy();
|
||||
for(EnumFacing facing : EnumFacing.VALUES) {
|
||||
double disposed = emitEnergy(facing, maxOutput);
|
||||
if(disposed != 0) {
|
||||
maxOutput -= disposed;
|
||||
useEnergy(disposed);
|
||||
if (maxOutput == 0) return;
|
||||
}
|
||||
}
|
||||
useEnergy(EnergyUtils.dispatchEnergyToNeighbours(worldObj, getPos(), this, maxOutput));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//TODO move to RebornCore
|
||||
public double emitEnergy(EnumFacing enumFacing, double amount) {
|
||||
BlockPos pos = getPos().offset(enumFacing);
|
||||
EnergyUtils.PowerNetReceiver receiver = EnergyUtils.getReceiver(
|
||||
worldObj, enumFacing.getOpposite(), pos);
|
||||
if(receiver != null) {
|
||||
return receiver.receiveEnergy(amount, false);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
private boolean validateRecipe()
|
||||
{
|
||||
if (ItemUtils.isItemEqual(getStackInSlot(topStackSlot), currentRecipe.getTopInput(), true, true, true))
|
||||
|
@ -336,7 +333,7 @@ public class TileEntityFusionController extends TilePowerAcceptorProducer implem
|
|||
@Override
|
||||
public String getName()
|
||||
{
|
||||
return "Fusion Reactor";
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue