Revert "Power system re-write, recipe fixes."
This reverts commit d982cc4028
.
# Conflicts:
# src/main/java/techreborn/init/ModRecipes.java
This commit is contained in:
parent
aa05d906f9
commit
d96149fc97
47 changed files with 937 additions and 1361 deletions
|
@ -321,7 +321,6 @@ public class TileAlloyFurnace extends TileMachineBase implements IWrenchable, II
|
|||
public Inventory getInventory() {
|
||||
return inventory;
|
||||
}
|
||||
<<<<<<< HEAD
|
||||
|
||||
@Override
|
||||
public int[] getSlotsForFace(EnumFacing side) {
|
||||
|
@ -338,6 +337,4 @@ public class TileAlloyFurnace extends TileMachineBase implements IWrenchable, II
|
|||
return index == 2;
|
||||
}
|
||||
|
||||
=======
|
||||
>>>>>>> parent of b292fdd... Rewrite to use new RebornCore Power API. Texture fixes.
|
||||
}
|
||||
|
|
|
@ -39,14 +39,8 @@ public class TileAlloySmelter extends TilePowerAcceptor implements IWrenchable,I
|
|||
}
|
||||
|
||||
@Override
|
||||
<<<<<<< HEAD
|
||||
public void update() {
|
||||
super.update();
|
||||
=======
|
||||
public void updateEntity()
|
||||
{
|
||||
super.updateEntity();
|
||||
>>>>>>> parent of b292fdd... Rewrite to use new RebornCore Power API. Texture fixes.
|
||||
crafter.updateEntity();
|
||||
upgrades.tick();
|
||||
charge(3);
|
||||
|
@ -113,22 +107,7 @@ public class TileAlloySmelter extends TilePowerAcceptor implements IWrenchable,I
|
|||
// }
|
||||
// }
|
||||
|
||||
<<<<<<< HEAD
|
||||
@Override
|
||||
public int[] getSlotsForFace(EnumFacing side) {
|
||||
return new int[] {0, 1, 2};
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInsertItem(int index, ItemStack itemStackIn, EnumFacing direction) {
|
||||
return index == 0 || index == 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int index, ItemStack stack, EnumFacing direction) {
|
||||
return index == 2;
|
||||
}
|
||||
=======
|
||||
// ISidedInventory
|
||||
@Override
|
||||
public int[] getSlotsForFace(EnumFacing side)
|
||||
|
@ -149,7 +128,6 @@ public class TileAlloySmelter extends TilePowerAcceptor implements IWrenchable,I
|
|||
{
|
||||
return slotIndex == 2;
|
||||
}
|
||||
>>>>>>> parent of b292fdd... Rewrite to use new RebornCore Power API. Texture fixes.
|
||||
|
||||
public int getProgressScaled(int scale)
|
||||
{
|
||||
|
|
|
@ -1,214 +0,0 @@
|
|||
package techreborn.tiles;
|
||||
|
||||
import reborncore.common.IWrenchable;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import reborncore.api.power.EnumPowerTier;
|
||||
import reborncore.api.recipe.IRecipeCrafterProvider;
|
||||
import reborncore.api.tile.IInventoryProvider;
|
||||
import reborncore.common.misc.Location;
|
||||
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||
import reborncore.common.recipes.RecipeCrafter;
|
||||
import reborncore.common.util.Inventory;
|
||||
import techreborn.api.Reference;
|
||||
import techreborn.blocks.BlockMachineCasing;
|
||||
import techreborn.init.ModBlocks;
|
||||
|
||||
public class TileImplosionCompressor extends TilePowerAcceptor implements IWrenchable,IInventoryProvider, ISidedInventory, IRecipeCrafterProvider
|
||||
{
|
||||
|
||||
public int tickTime;
|
||||
public Inventory inventory = new Inventory(4, "TileImplosionCompressor", 64, this);
|
||||
public RecipeCrafter crafter;
|
||||
|
||||
public TileImplosionCompressor()
|
||||
{
|
||||
super(1);
|
||||
// Input slots
|
||||
int[] inputs = new int[2];
|
||||
inputs[0] = 0;
|
||||
inputs[1] = 1;
|
||||
int[] outputs = new int[2];
|
||||
outputs[0] = 2;
|
||||
outputs[1] = 3;
|
||||
crafter = new RecipeCrafter(Reference.implosionCompressorRecipe, this, 2, 2, inventory, inputs, outputs);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumFacing getFacing()
|
||||
{
|
||||
return getFacingEnum();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wrenchCanRemove(EntityPlayer entityPlayer)
|
||||
{
|
||||
return entityPlayer.isSneaking();
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getWrenchDropRate()
|
||||
{
|
||||
return 1.0F;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer)
|
||||
{
|
||||
return new ItemStack(ModBlocks.ImplosionCompressor, 1);
|
||||
}
|
||||
|
||||
public boolean getMutliBlock()
|
||||
{
|
||||
for (EnumFacing direction : EnumFacing.values())
|
||||
{
|
||||
TileEntity tileEntity = worldObj.getTileEntity(new BlockPos(getPos().getX() + direction.getFrontOffsetX(),
|
||||
getPos().getY() + direction.getFrontOffsetY(), getPos().getZ() + direction.getFrontOffsetZ()));
|
||||
if (tileEntity instanceof TileMachineCasing)
|
||||
{
|
||||
if (!((TileMachineCasing) tileEntity).isConnected())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if ((tileEntity.getBlockType() instanceof BlockMachineCasing))
|
||||
{
|
||||
int heat;
|
||||
BlockMachineCasing machineCasing = (BlockMachineCasing) tileEntity.getBlockType();
|
||||
heat = machineCasing.getHeatFromState(tileEntity.getWorld().getBlockState(tileEntity.getPos()));
|
||||
Location location = new Location(getPos().getX(), getPos().getY(), getPos().getZ(), direction);
|
||||
location.modifyPositionFromSide(direction, 1);
|
||||
if (worldObj.getBlockState(new BlockPos(location.getX(), location.getY(), location.getZ()))
|
||||
.getBlock().getUnlocalizedName().equals("tile.lava"))
|
||||
{
|
||||
heat += 500;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity()
|
||||
{
|
||||
super.updateEntity();
|
||||
if (getMutliBlock())
|
||||
{
|
||||
crafter.updateEntity();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound tagCompound)
|
||||
{
|
||||
super.readFromNBT(tagCompound);
|
||||
crafter.readFromNBT(tagCompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound writeToNBT(NBTTagCompound tagCompound)
|
||||
{
|
||||
super.writeToNBT(tagCompound);
|
||||
crafter.writeToNBT(tagCompound);
|
||||
return tagCompound;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public void addWailaInfo(List<String> info)
|
||||
// {
|
||||
// super.addWailaInfo(info);
|
||||
// info.add("Power Stored " + energy.getEnergyStored() +" EU");
|
||||
// if(crafter.currentRecipe !=null){
|
||||
// info.add("Power Usage " + crafter.currentRecipe.euPerTick() + " EU/t");
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
// ISidedInventory
|
||||
@Override
|
||||
public int[] getSlotsForFace(EnumFacing side)
|
||||
{
|
||||
return side == EnumFacing.DOWN ? new int[] { 0, 1, 2, 3 } : new int[] { 0, 1, 2, 3 };
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInsertItem(int slotIndex, ItemStack itemStack, EnumFacing side)
|
||||
{
|
||||
if (slotIndex >= 2)
|
||||
return false;
|
||||
return isItemValidForSlot(slotIndex, itemStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int slotIndex, ItemStack itemStack, EnumFacing side)
|
||||
{
|
||||
return slotIndex == 2 || slotIndex == 3;
|
||||
}
|
||||
|
||||
public int getProgressScaled(int scale)
|
||||
{
|
||||
if (crafter.currentTickTime != 0)
|
||||
{
|
||||
return crafter.currentTickTime * scale / crafter.currentNeededTicks;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getMaxPower()
|
||||
{
|
||||
return 100000;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canAcceptEnergy(EnumFacing direction)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvideEnergy(EnumFacing direction)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getMaxOutput()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getMaxInput()
|
||||
{
|
||||
return 64;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumPowerTier getTier()
|
||||
{
|
||||
return EnumPowerTier.LOW;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Inventory getInventory() {
|
||||
return inventory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RecipeCrafter getRecipeCrafter() {
|
||||
return crafter;
|
||||
}
|
||||
}
|
|
@ -1,317 +0,0 @@
|
|||
package techreborn.tiles;
|
||||
|
||||
import reborncore.common.IWrenchable;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraftforge.fluids.*;
|
||||
import reborncore.api.IListInfoProvider;
|
||||
import reborncore.api.power.EnumPowerTier;
|
||||
import reborncore.api.recipe.IRecipeCrafterProvider;
|
||||
import reborncore.api.tile.IInventoryProvider;
|
||||
import reborncore.common.misc.Location;
|
||||
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||
import reborncore.common.recipes.RecipeCrafter;
|
||||
import reborncore.common.util.FluidUtils;
|
||||
import reborncore.common.util.Inventory;
|
||||
import reborncore.common.util.Tank;
|
||||
import techreborn.api.Reference;
|
||||
import techreborn.api.recipe.ITileRecipeHandler;
|
||||
import techreborn.api.recipe.machines.IndustrialSawmillRecipe;
|
||||
import techreborn.blocks.BlockMachineCasing;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.init.ModFluids;
|
||||
|
||||
public class TileIndustrialSawmill extends TilePowerAcceptor
|
||||
implements IWrenchable, IFluidHandler,IInventoryProvider, ISidedInventory, IListInfoProvider, ITileRecipeHandler<IndustrialSawmillRecipe>, IRecipeCrafterProvider
|
||||
{
|
||||
public static final int TANK_CAPACITY = 16000;
|
||||
|
||||
public int tickTime;
|
||||
public Inventory inventory = new Inventory(5, "TileIndustrialSawmill", 64, this);
|
||||
public Tank tank = new Tank("TileSawmill", TANK_CAPACITY, this);
|
||||
public RecipeCrafter crafter;
|
||||
|
||||
public TileIndustrialSawmill()
|
||||
{
|
||||
super(2);
|
||||
// TODO configs
|
||||
// Input slots
|
||||
int[] inputs = new int[2];
|
||||
inputs[0] = 0;
|
||||
inputs[1] = 1;
|
||||
int[] outputs = new int[3];
|
||||
outputs[0] = 2;
|
||||
outputs[1] = 3;
|
||||
outputs[2] = 4;
|
||||
crafter = new RecipeCrafter(Reference.industrialSawmillRecipe, this, 2, 3, inventory, inputs, outputs);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity()
|
||||
{
|
||||
super.updateEntity();
|
||||
if (getMutliBlock())
|
||||
{
|
||||
crafter.updateEntity();
|
||||
}
|
||||
FluidUtils.drainContainers(this, inventory, 0, 4);
|
||||
FluidUtils.drainContainers(this, inventory, 1, 4);
|
||||
}
|
||||
|
||||
public boolean getMutliBlock()
|
||||
{
|
||||
for (EnumFacing direction : EnumFacing.values())
|
||||
{
|
||||
TileEntity tileEntity = worldObj.getTileEntity(new BlockPos(getPos().getX() + direction.getFrontOffsetX(),
|
||||
getPos().getY() + direction.getFrontOffsetY(), getPos().getZ() + direction.getFrontOffsetZ()));
|
||||
if (tileEntity instanceof TileMachineCasing)
|
||||
{
|
||||
if ((tileEntity.getBlockType() instanceof BlockMachineCasing))
|
||||
{
|
||||
int heat;
|
||||
BlockMachineCasing blockMachineCasing = (BlockMachineCasing) tileEntity.getBlockType();
|
||||
heat = blockMachineCasing
|
||||
.getHeatFromState(tileEntity.getWorld().getBlockState(tileEntity.getPos()));
|
||||
Location location = new Location(getPos().getX(), getPos().getY(), getPos().getZ(), direction);
|
||||
location.modifyPositionFromSide(direction, 1);
|
||||
if (worldObj.getBlockState(location.getBlockPos()).getBlock().getUnlocalizedName()
|
||||
.equals("tile.lava"))
|
||||
{
|
||||
heat += 500;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumFacing getFacing()
|
||||
{
|
||||
return getFacingEnum();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wrenchCanRemove(EntityPlayer entityPlayer)
|
||||
{
|
||||
return entityPlayer.isSneaking();
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getWrenchDropRate()
|
||||
{
|
||||
return 1.0F;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer)
|
||||
{
|
||||
return new ItemStack(ModBlocks.industrialSawmill, 1);
|
||||
}
|
||||
|
||||
public boolean isComplete()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound tagCompound)
|
||||
{
|
||||
super.readFromNBT(tagCompound);
|
||||
tank.readFromNBT(tagCompound);
|
||||
crafter.readFromNBT(tagCompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound writeToNBT(NBTTagCompound tagCompound)
|
||||
{
|
||||
super.writeToNBT(tagCompound);
|
||||
tank.writeToNBT(tagCompound);
|
||||
crafter.writeToNBT(tagCompound);
|
||||
return tagCompound;
|
||||
}
|
||||
|
||||
/* IFluidHandler */
|
||||
@Override
|
||||
public int fill(EnumFacing from, FluidStack resource, boolean doFill)
|
||||
{
|
||||
if (resource.getFluid() == FluidRegistry.WATER || resource.getFluid() == ModFluids.fluidMercury
|
||||
|| resource.getFluid() == ModFluids.fluidSodiumpersulfate)
|
||||
{
|
||||
int filled = tank.fill(resource, doFill);
|
||||
tank.compareAndUpdate();
|
||||
return filled;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidStack drain(EnumFacing from, FluidStack resource, boolean doDrain)
|
||||
{
|
||||
if (resource == null || !resource.isFluidEqual(tank.getFluid()))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
FluidStack fluidStack = tank.drain(resource.amount, doDrain);
|
||||
tank.compareAndUpdate();
|
||||
return fluidStack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidStack drain(EnumFacing from, int maxDrain, boolean doDrain)
|
||||
{
|
||||
FluidStack drained = tank.drain(maxDrain, doDrain);
|
||||
tank.compareAndUpdate();
|
||||
return drained;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canFill(EnumFacing from, Fluid fluid)
|
||||
{
|
||||
return fluid == FluidRegistry.WATER;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canDrain(EnumFacing from, Fluid fluid)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTankInfo[] getTankInfo(EnumFacing from)
|
||||
{
|
||||
return new FluidTankInfo[] { tank.getInfo() };
|
||||
}
|
||||
|
||||
// ISidedInventory
|
||||
@Override
|
||||
public int[] getSlotsForFace(EnumFacing side)
|
||||
{
|
||||
return side == EnumFacing.DOWN ? new int[] { 0, 1, 2, 3, 4 } : new int[] { 0, 1, 2, 3, 4 };
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInsertItem(int slotIndex, ItemStack itemStack, EnumFacing side)
|
||||
{
|
||||
if (slotIndex >= 2)
|
||||
return false;
|
||||
return isItemValidForSlot(slotIndex, itemStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int slotIndex, ItemStack itemStack, EnumFacing side)
|
||||
{
|
||||
return slotIndex == 2 || slotIndex == 3 || slotIndex == 4;
|
||||
}
|
||||
|
||||
public int getProgressScaled(int scale)
|
||||
{
|
||||
if (crafter.currentTickTime != 0)
|
||||
{
|
||||
return crafter.currentTickTime * scale / crafter.currentNeededTicks;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getMaxPower()
|
||||
{
|
||||
return 10000;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canAcceptEnergy(EnumFacing direction)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvideEnergy(EnumFacing direction)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getMaxOutput()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getMaxInput()
|
||||
{
|
||||
return 64;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumPowerTier getTier()
|
||||
{
|
||||
return EnumPowerTier.LOW;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canCraft(TileEntity tile, IndustrialSawmillRecipe recipe) {
|
||||
if (recipe.fluidStack == null) {
|
||||
return true;
|
||||
}
|
||||
if (tile instanceof TileIndustrialSawmill) {
|
||||
TileIndustrialSawmill sawmill = (TileIndustrialSawmill) tile;
|
||||
if (sawmill.tank.getFluid() == null) {
|
||||
return false;
|
||||
}
|
||||
if (sawmill.tank.getFluid() == recipe.fluidStack) {
|
||||
if (sawmill.tank.getFluidAmount() >= recipe.fluidStack.amount) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCraft(TileEntity tile, IndustrialSawmillRecipe recipe) {
|
||||
if (recipe.fluidStack == null) {
|
||||
return true;
|
||||
}
|
||||
if (tile instanceof TileIndustrialSawmill) {
|
||||
TileIndustrialSawmill sawmill = (TileIndustrialSawmill) tile;
|
||||
if (sawmill.tank.getFluid() == null) {
|
||||
return false;
|
||||
}
|
||||
if (sawmill.tank.getFluid() == recipe.fluidStack) {
|
||||
if (sawmill.tank.getFluidAmount() >= recipe.fluidStack.amount) {
|
||||
if (sawmill.tank.getFluidAmount() > 0) {
|
||||
sawmill.tank.setFluid(new FluidStack(recipe.fluidStack.getFluid(),
|
||||
sawmill.tank.getFluidAmount() - recipe.fluidStack.amount));
|
||||
} else {
|
||||
sawmill.tank.setFluid(null);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Inventory getInventory() {
|
||||
return inventory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RecipeCrafter getRecipeCrafter() {
|
||||
return crafter;
|
||||
}
|
||||
}
|
|
@ -1,212 +0,0 @@
|
|||
package techreborn.tiles;
|
||||
|
||||
import reborncore.common.IWrenchable;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import reborncore.api.power.EnumPowerTier;
|
||||
import reborncore.api.recipe.IRecipeCrafterProvider;
|
||||
import reborncore.api.tile.IInventoryProvider;
|
||||
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||
import reborncore.common.recipes.RecipeCrafter;
|
||||
import reborncore.common.util.Inventory;
|
||||
import techreborn.api.Reference;
|
||||
import techreborn.api.recipe.ITileRecipeHandler;
|
||||
import techreborn.api.recipe.machines.VacuumFreezerRecipe;
|
||||
import techreborn.blocks.BlockMachineCasing;
|
||||
import techreborn.init.ModBlocks;
|
||||
|
||||
public class TileVacuumFreezer extends TilePowerAcceptor implements IWrenchable,IInventoryProvider, ITileRecipeHandler<VacuumFreezerRecipe>, IRecipeCrafterProvider
|
||||
{
|
||||
|
||||
public int tickTime;
|
||||
public Inventory inventory = new Inventory(3, "TileVacuumFreezer", 64, this);
|
||||
public RecipeCrafter crafter;
|
||||
public int multiBlockStatus = 0;
|
||||
|
||||
public TileVacuumFreezer()
|
||||
{
|
||||
super(2);
|
||||
// Input slots
|
||||
int[] inputs = new int[1];
|
||||
inputs[0] = 0;
|
||||
int[] outputs = new int[1];
|
||||
outputs[0] = 1;
|
||||
crafter = new RecipeCrafter(Reference.vacuumFreezerRecipe, this, 2, 1, inventory, inputs, outputs);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity()
|
||||
{
|
||||
super.updateEntity();
|
||||
crafter.updateEntity();
|
||||
|
||||
if (worldObj.getTotalWorldTime() % 20 == 0)
|
||||
{
|
||||
multiBlockStatus = checkMachine() ? 1 : 0;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getMaxPower()
|
||||
{
|
||||
return 10000;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canAcceptEnergy(EnumFacing direction)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvideEnergy(EnumFacing direction)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getMaxOutput()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getMaxInput()
|
||||
{
|
||||
return 128;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumPowerTier getTier()
|
||||
{
|
||||
return EnumPowerTier.MEDIUM;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumFacing getFacing()
|
||||
{
|
||||
return getFacingEnum();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wrenchCanRemove(EntityPlayer entityPlayer)
|
||||
{
|
||||
return entityPlayer.isSneaking();
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getWrenchDropRate()
|
||||
{
|
||||
return 1.0F;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer)
|
||||
{
|
||||
return new ItemStack(ModBlocks.AlloySmelter, 1);
|
||||
}
|
||||
|
||||
public boolean isComplete()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound tagCompound)
|
||||
{
|
||||
super.readFromNBT(tagCompound);
|
||||
crafter.readFromNBT(tagCompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound writeToNBT(NBTTagCompound tagCompound)
|
||||
{
|
||||
super.writeToNBT(tagCompound);
|
||||
crafter.writeToNBT(tagCompound);
|
||||
return tagCompound;
|
||||
}
|
||||
|
||||
public int getProgressScaled(int scale)
|
||||
{
|
||||
if (crafter.currentTickTime != 0)
|
||||
{
|
||||
return crafter.currentTickTime * scale / crafter.currentNeededTicks;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public boolean checkMachine()
|
||||
{
|
||||
int xDir = EnumFacing.UP.getFrontOffsetX() * 2;
|
||||
int yDir = EnumFacing.UP.getFrontOffsetY() * 2;
|
||||
int zDir = EnumFacing.UP.getFrontOffsetZ() * 2;
|
||||
for (int i = -1; i < 2; i++)
|
||||
{
|
||||
for (int j = -1; j < 2; j++)
|
||||
{
|
||||
for (int k = -1; k < 2; k++)
|
||||
{
|
||||
if ((i != 0) || (j != 0) || (k != 0))
|
||||
{
|
||||
if (worldObj.getBlockState(new BlockPos(getPos().getX() - xDir + i, getPos().getY() - yDir + j,
|
||||
getPos().getZ() - zDir + k)).getBlock() != ModBlocks.MachineCasing)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
IBlockState BlockStateContainer = worldObj.getBlockState(new BlockPos(
|
||||
getPos().getX() - xDir + i, getPos().getY() - yDir + j, getPos().getZ() - zDir + k));
|
||||
BlockMachineCasing blockMachineCasing = (BlockMachineCasing) BlockStateContainer.getBlock();
|
||||
if (blockMachineCasing
|
||||
.getMetaFromState(BlockStateContainer) != (((i == 0) && (j == 0) && (k != 0))
|
||||
|| ((i == 0) && (j != 0) && (k == 0)) || ((i != 0) && (j == 0) && (k == 0)) ? 2
|
||||
: 1))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
} else if (!worldObj.isAirBlock(new BlockPos(getPos().getX() - xDir + i, getPos().getY() - yDir + j,
|
||||
getPos().getZ() - zDir + k)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canCraft(TileEntity tile, VacuumFreezerRecipe recipe) {
|
||||
if (tile instanceof TileVacuumFreezer) {
|
||||
if (((TileVacuumFreezer) tile).multiBlockStatus == 1) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCraft(TileEntity tile, VacuumFreezerRecipe recipe) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Inventory getInventory() {
|
||||
return inventory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RecipeCrafter getRecipeCrafter() {
|
||||
return crafter;
|
||||
}
|
||||
}
|
|
@ -13,7 +13,6 @@ import reborncore.common.util.ItemUtils;
|
|||
import techreborn.api.reactor.FusionReactorRecipe;
|
||||
import techreborn.api.reactor.FusionReactorRecipeHelper;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.power.PowerNet;
|
||||
|
||||
public class TileEntityFusionController extends TilePowerAcceptor implements IInventoryProvider
|
||||
{
|
||||
|
@ -37,7 +36,8 @@ public class TileEntityFusionController extends TilePowerAcceptor implements IIn
|
|||
}
|
||||
|
||||
@Override
|
||||
public double getMaxPower() {
|
||||
public double getMaxPower()
|
||||
{
|
||||
return 100000000;
|
||||
}
|
||||
|
||||
|
@ -64,8 +64,10 @@ public class TileEntityFusionController extends TilePowerAcceptor implements IIn
|
|||
}
|
||||
|
||||
@Override
|
||||
public double getMaxInput() {
|
||||
if (hasStartedCrafting) {
|
||||
public double getMaxInput()
|
||||
{
|
||||
if (hasStartedCrafting)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return 8192;
|
||||
|
@ -273,12 +275,6 @@ public class TileEntityFusionController extends TilePowerAcceptor implements IIn
|
|||
{
|
||||
inventory.hasChanged = false;
|
||||
}
|
||||
|
||||
if (!worldObj.isRemote && getEnergy() > 0 && hasStartedCrafting) {
|
||||
double maxOutput = getEnergy() > getMaxOutput() ? getMaxOutput() : getEnergy();
|
||||
useEnergy(PowerNet.dispatchEnergyPacket(worldObj, getPos(), maxOutput));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private boolean validateRecipe()
|
||||
|
|
|
@ -18,7 +18,6 @@ import reborncore.common.util.Inventory;
|
|||
import reborncore.common.util.Tank;
|
||||
import techreborn.config.ConfigTechReborn;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.power.PowerNet;
|
||||
|
||||
public class TileDieselGenerator extends TilePowerAcceptor implements IWrenchable, IFluidHandler, IInventoryProvider
|
||||
{
|
||||
|
@ -132,33 +131,35 @@ public class TileDieselGenerator extends TilePowerAcceptor implements IWrenchabl
|
|||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
public void updateEntity()
|
||||
{
|
||||
super.updateEntity();
|
||||
if (!worldObj.isRemote) {
|
||||
if (!worldObj.isRemote)
|
||||
{
|
||||
FluidUtils.drainContainers(this, inventory, 0, 1);
|
||||
FluidUtils.fillContainers(this, inventory, 0, 1, tank.getFluidType());
|
||||
if (tank.getFluidType() != null && getStackInSlot(2) == null) {
|
||||
if (tank.getFluidType() != null && getStackInSlot(2) == null)
|
||||
{
|
||||
inventory.setInventorySlotContents(2, new ItemStack(tank.getFluidType().getBlock()));
|
||||
syncWithAll();
|
||||
} else if (tank.getFluidType() == null && getStackInSlot(2) != null) {
|
||||
} else if (tank.getFluidType() == null && getStackInSlot(2) != null)
|
||||
{
|
||||
setInventorySlotContents(2, null);
|
||||
syncWithAll();
|
||||
}
|
||||
|
||||
if (!tank.isEmpty() && tank.getFluidType() != null
|
||||
&& FluidPowerManager.fluidPowerValues.containsKey(tank.getFluidType())) {
|
||||
&& FluidPowerManager.fluidPowerValues.containsKey(tank.getFluidType()))
|
||||
{
|
||||
double powerIn = FluidPowerManager.fluidPowerValues.get(tank.getFluidType());
|
||||
if (getFreeSpace() >= powerIn) {
|
||||
if (getFreeSpace() >= powerIn)
|
||||
{
|
||||
addEnergy(powerIn, false);
|
||||
tank.drain(1, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!worldObj.isRemote && getEnergy() > 0) {
|
||||
double maxOutput = getEnergy() > getMaxOutput() ? getMaxOutput() : getEnergy();
|
||||
useEnergy(PowerNet.dispatchEnergyPacket(worldObj, getPos(), maxOutput));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -12,7 +12,6 @@ import reborncore.common.powerSystem.TilePowerAcceptor;
|
|||
import reborncore.common.util.Inventory;
|
||||
import techreborn.config.ConfigTechReborn;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.power.PowerNet;
|
||||
|
||||
public class TileDragonEggSiphoner extends TilePowerAcceptor implements IWrenchable,IInventoryProvider
|
||||
{
|
||||
|
@ -26,20 +25,18 @@ public class TileDragonEggSiphoner extends TilePowerAcceptor implements IWrencha
|
|||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
public void updateEntity()
|
||||
{
|
||||
super.updateEntity();
|
||||
|
||||
if (!worldObj.isRemote) {
|
||||
if (!worldObj.isRemote)
|
||||
{
|
||||
if (worldObj.getBlockState(new BlockPos(getPos().getX(), getPos().getY() + 1, getPos().getZ()))
|
||||
.getBlock() == Blocks.DRAGON_EGG) {
|
||||
.getBlock() == Blocks.DRAGON_EGG)
|
||||
{
|
||||
addEnergy(euTick);
|
||||
}
|
||||
}
|
||||
|
||||
if (!worldObj.isRemote && getEnergy() > 0) {
|
||||
double maxOutput = getEnergy() > getMaxOutput() ? getMaxOutput() : getEnergy();
|
||||
useEnergy(PowerNet.dispatchEnergyPacket(worldObj, getPos(), maxOutput));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -17,7 +17,6 @@ import reborncore.common.util.Inventory;
|
|||
import reborncore.common.util.Tank;
|
||||
import techreborn.config.ConfigTechReborn;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.power.PowerNet;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
@ -145,14 +144,17 @@ public class TileGasTurbine extends TilePowerAcceptor implements IWrenchable, IF
|
|||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
public void updateEntity()
|
||||
{
|
||||
super.updateEntity();
|
||||
if (!worldObj.isRemote) {
|
||||
if (!worldObj.isRemote)
|
||||
{
|
||||
FluidUtils.drainContainers(this, inventory, 0, 1);
|
||||
tank.compareAndUpdate();
|
||||
}
|
||||
|
||||
if (tank.getFluidAmount() > 0 && getMaxPower() - getEnergy() >= euTick) {
|
||||
if (tank.getFluidAmount() > 0 && getMaxPower() - getEnergy() >= euTick)
|
||||
{
|
||||
Integer euPerBucket = fluids.get(tank.getFluidType().getName());
|
||||
// float totalTicks = (float)euPerBucket / 8f; //x eu per bucket / 8
|
||||
// eu per tick
|
||||
|
@ -161,23 +163,20 @@ public class TileGasTurbine extends TilePowerAcceptor implements IWrenchable, IF
|
|||
pendingWithdraw += millibucketsPerTick;
|
||||
|
||||
int currentWithdraw = (int) pendingWithdraw; // float --> int
|
||||
// conversion floors
|
||||
// the float
|
||||
// conversion floors
|
||||
// the float
|
||||
pendingWithdraw -= currentWithdraw;
|
||||
|
||||
tank.drain(currentWithdraw, true);
|
||||
addEnergy(euTick);
|
||||
}
|
||||
if (tank.getFluidType() != null && getStackInSlot(2) == null) {
|
||||
if (tank.getFluidType() != null && getStackInSlot(2) == null)
|
||||
{
|
||||
inventory.setInventorySlotContents(2, new ItemStack(tank.getFluidType().getBlock()));
|
||||
} else if (tank.getFluidType() == null && getStackInSlot(2) != null) {
|
||||
} else if (tank.getFluidType() == null && getStackInSlot(2) != null)
|
||||
{
|
||||
setInventorySlotContents(2, null);
|
||||
}
|
||||
|
||||
if (!worldObj.isRemote && getEnergy() > 0) {
|
||||
double maxOutput = getEnergy() > getMaxOutput() ? getMaxOutput() : getEnergy();
|
||||
useEnergy(PowerNet.dispatchEnergyPacket(worldObj, getPos(), maxOutput));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -12,7 +12,6 @@ import reborncore.common.blocks.BlockMachineBase;
|
|||
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||
import reborncore.common.util.Inventory;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.power.PowerNet;
|
||||
|
||||
public class TileGenerator extends TilePowerAcceptor implements IWrenchable,IInventoryProvider
|
||||
{
|
||||
|
@ -38,41 +37,45 @@ public class TileGenerator extends TilePowerAcceptor implements IWrenchable,IInv
|
|||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
public void updateEntity()
|
||||
{
|
||||
super.updateEntity();
|
||||
if (worldObj.isRemote) {
|
||||
if (worldObj.isRemote)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (getEnergy() < getMaxPower()) {
|
||||
if (burnTime > 0) {
|
||||
if (getEnergy() < getMaxPower())
|
||||
{
|
||||
if (burnTime > 0)
|
||||
{
|
||||
burnTime--;
|
||||
addEnergy(outputAmount);
|
||||
isBurning = true;
|
||||
}
|
||||
} else {
|
||||
} else
|
||||
{
|
||||
isBurning = false;
|
||||
}
|
||||
|
||||
if (burnTime == 0) {
|
||||
if (burnTime == 0)
|
||||
{
|
||||
updateState();
|
||||
burnTime = totalBurnTime = getItemBurnTime(getStackInSlot(fuelSlot));
|
||||
if (burnTime > 0) {
|
||||
if (burnTime > 0)
|
||||
{
|
||||
updateState();
|
||||
burnItem = getStackInSlot(fuelSlot);
|
||||
if (getStackInSlot(fuelSlot).stackSize == 1) {
|
||||
if (getStackInSlot(fuelSlot).stackSize == 1)
|
||||
{
|
||||
setInventorySlotContents(fuelSlot, null);
|
||||
} else {
|
||||
} else
|
||||
{
|
||||
decrStackSize(fuelSlot, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
lastTickBurning = isBurning;
|
||||
|
||||
if (!worldObj.isRemote && getEnergy() > 0) {
|
||||
double maxOutput = getEnergy() > getMaxOutput() ? getMaxOutput() : getEnergy();
|
||||
useEnergy(PowerNet.dispatchEnergyPacket(worldObj, getPos(), maxOutput));
|
||||
}
|
||||
}
|
||||
|
||||
public void updateState()
|
||||
|
|
|
@ -10,7 +10,6 @@ import reborncore.api.power.EnumPowerTier;
|
|||
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||
import techreborn.config.ConfigTechReborn;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.power.PowerNet;
|
||||
|
||||
public class TileHeatGenerator extends TilePowerAcceptor implements IWrenchable
|
||||
{
|
||||
|
@ -23,33 +22,35 @@ public class TileHeatGenerator extends TilePowerAcceptor implements IWrenchable
|
|||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
public void updateEntity()
|
||||
{
|
||||
super.updateEntity();
|
||||
|
||||
if (!worldObj.isRemote) {
|
||||
if (!worldObj.isRemote)
|
||||
{
|
||||
if (worldObj.getBlockState(new BlockPos(getPos().getX() + 1, getPos().getY(), getPos().getZ()))
|
||||
.getBlock() == Blocks.LAVA) {
|
||||
.getBlock() == Blocks.LAVA)
|
||||
{
|
||||
addEnergy(euTick);
|
||||
} else if (worldObj.getBlockState(new BlockPos(getPos().getX(), getPos().getY(), getPos().getZ() + 1))
|
||||
.getBlock() == Blocks.LAVA) {
|
||||
.getBlock() == Blocks.LAVA)
|
||||
{
|
||||
addEnergy(euTick);
|
||||
} else if (worldObj.getBlockState(new BlockPos(getPos().getX(), getPos().getY(), getPos().getZ() - 1))
|
||||
.getBlock() == Blocks.LAVA) {
|
||||
.getBlock() == Blocks.LAVA)
|
||||
{
|
||||
addEnergy(euTick);
|
||||
} else if (worldObj.getBlockState(new BlockPos(getPos().getX() - 1, getPos().getY(), getPos().getZ()))
|
||||
.getBlock() == Blocks.LAVA) {
|
||||
.getBlock() == Blocks.LAVA)
|
||||
{
|
||||
addEnergy(euTick);
|
||||
} else if (worldObj.getBlockState(new BlockPos(getPos().getX(), getPos().getY() - 1, getPos().getZ()))
|
||||
.getBlock() == Blocks.LAVA) {
|
||||
.getBlock() == Blocks.LAVA)
|
||||
{
|
||||
addEnergy(euTick);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (!worldObj.isRemote && getEnergy() > 0) {
|
||||
double maxOutput = getEnergy() > getMaxOutput() ? getMaxOutput() : getEnergy();
|
||||
useEnergy(PowerNet.dispatchEnergyPacket(worldObj, getPos(), maxOutput));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -10,7 +10,6 @@ import reborncore.api.power.EnumPowerTier;
|
|||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||
import techreborn.config.ConfigTechReborn;
|
||||
import techreborn.power.PowerNet;
|
||||
|
||||
public class TileLightningRod extends TilePowerAcceptor {
|
||||
|
||||
|
@ -24,17 +23,17 @@ public class TileLightningRod extends TilePowerAcceptor {
|
|||
public void update() {
|
||||
super.update();
|
||||
|
||||
if (onStatusHoldTicks > 0)
|
||||
if(onStatusHoldTicks > 0)
|
||||
--onStatusHoldTicks;
|
||||
|
||||
if (onStatusHoldTicks == 0 || getEnergy() <= 0) {
|
||||
if (getBlockType() instanceof BlockMachineBase)
|
||||
if(onStatusHoldTicks == 0 || getEnergy() <= 0) {
|
||||
if(getBlockType() instanceof BlockMachineBase)
|
||||
((BlockMachineBase) getBlockType()).setActive(false, worldObj, pos);
|
||||
onStatusHoldTicks = -1;
|
||||
}
|
||||
|
||||
float weatherStrength = worldObj.getThunderStrength(1.0F);
|
||||
if (weatherStrength > 0.2F) {
|
||||
if(weatherStrength > 0.2F) {
|
||||
//lightStrikeChance = (MAX - (CHANCE * WEATHER_STRENGTH)
|
||||
float lightStrikeChance = ((100F - ConfigTechReborn.LightningRodChance) * 20F);
|
||||
float totalChance = lightStrikeChance * getLightningStrikeMultiplier() * ((1.1F - weatherStrength));
|
||||
|
@ -51,10 +50,6 @@ public class TileLightningRod extends TilePowerAcceptor {
|
|||
}
|
||||
}
|
||||
|
||||
if (!worldObj.isRemote && getEnergy() > 0) {
|
||||
double maxOutput = getEnergy() > getMaxOutput() ? getMaxOutput() : getEnergy();
|
||||
useEnergy(PowerNet.dispatchEnergyPacket(worldObj, getPos(), maxOutput));
|
||||
}
|
||||
}
|
||||
|
||||
public float getLightningStrikeMultiplier() {
|
||||
|
|
|
@ -17,7 +17,6 @@ import reborncore.common.util.Inventory;
|
|||
import reborncore.common.util.Tank;
|
||||
import techreborn.config.ConfigTechReborn;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.power.PowerNet;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
@ -151,12 +150,14 @@ public class TileSemifluidGenerator extends TilePowerAcceptor implements IWrench
|
|||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
public void updateEntity()
|
||||
{
|
||||
super.updateEntity();
|
||||
if (!worldObj.isRemote)
|
||||
FluidUtils.drainContainers(this, inventory, 0, 1);
|
||||
|
||||
if (tank.getFluidAmount() > 0 && getMaxPower() - getEnergy() >= euTick) {
|
||||
if (tank.getFluidAmount() > 0 && getMaxPower() - getEnergy() >= euTick)
|
||||
{
|
||||
Integer euPerBucket = fluids.get(tank.getFluidType().getName());
|
||||
// float totalTicks = (float)euPerBucket / 8f; //x eu per bucket / 8
|
||||
// eu per tick
|
||||
|
@ -165,23 +166,20 @@ public class TileSemifluidGenerator extends TilePowerAcceptor implements IWrench
|
|||
pendingWithdraw += millibucketsPerTick;
|
||||
|
||||
int currentWithdraw = (int) pendingWithdraw; // float --> int
|
||||
// conversion floors
|
||||
// the float
|
||||
// conversion floors
|
||||
// the float
|
||||
pendingWithdraw -= currentWithdraw;
|
||||
|
||||
tank.drain(currentWithdraw, true);
|
||||
addEnergy(euTick);
|
||||
}
|
||||
if (tank.getFluidType() != null && getStackInSlot(2) == null) {
|
||||
if (tank.getFluidType() != null && getStackInSlot(2) == null)
|
||||
{
|
||||
inventory.setInventorySlotContents(2, new ItemStack(tank.getFluidType().getBlock()));
|
||||
} else if (tank.getFluidType() == null && getStackInSlot(2) != null) {
|
||||
} else if (tank.getFluidType() == null && getStackInSlot(2) != null)
|
||||
{
|
||||
setInventorySlotContents(2, null);
|
||||
}
|
||||
|
||||
if (!worldObj.isRemote && getEnergy() > 0) {
|
||||
double maxOutput = getEnergy() > getMaxOutput() ? getMaxOutput() : getEnergy();
|
||||
useEnergy(PowerNet.dispatchEnergyPacket(worldObj, getPos(), maxOutput));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -5,7 +5,6 @@ import net.minecraft.util.ITickable;
|
|||
import reborncore.api.power.EnumPowerTier;
|
||||
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||
import techreborn.blocks.generator.BlockSolarPanel;
|
||||
import techreborn.power.PowerNet;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -26,26 +25,27 @@ public class TileSolarPanel extends TilePowerAcceptor implements ITickable
|
|||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
public void updateEntity()
|
||||
{
|
||||
super.updateEntity();
|
||||
if (!worldObj.isRemote) {
|
||||
if (worldObj.getTotalWorldTime() % 60 == 0) {
|
||||
shouldMakePower = isSunOut();
|
||||
if(!worldObj.isRemote){
|
||||
if (worldObj.getTotalWorldTime() % 60 == 0)
|
||||
{
|
||||
shouldMakePower = isSunOut();
|
||||
|
||||
}
|
||||
if (shouldMakePower) {
|
||||
powerToAdd = 10;
|
||||
addEnergy(powerToAdd);
|
||||
} else {
|
||||
powerToAdd = 0;
|
||||
}
|
||||
worldObj.setBlockState(getPos(), worldObj.getBlockState(this.getPos()).withProperty(BlockSolarPanel.ACTIVE, isSunOut()));
|
||||
}
|
||||
if (shouldMakePower)
|
||||
{
|
||||
powerToAdd = 10;
|
||||
addEnergy(powerToAdd);
|
||||
} else
|
||||
{
|
||||
powerToAdd = 0;
|
||||
}
|
||||
|
||||
if (!worldObj.isRemote && getEnergy() > 0) {
|
||||
double maxOutput = getEnergy() > getMaxOutput() ? getMaxOutput() : getEnergy();
|
||||
useEnergy(PowerNet.dispatchEnergyPacket(worldObj, getPos(), maxOutput));
|
||||
}
|
||||
worldObj.setBlockState(getPos(),
|
||||
worldObj.getBlockState(this.getPos()).withProperty(BlockSolarPanel.ACTIVE, isSunOut()));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -20,7 +20,6 @@ import reborncore.common.util.Inventory;
|
|||
import reborncore.common.util.Tank;
|
||||
import techreborn.config.ConfigTechReborn;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.power.PowerNet;
|
||||
|
||||
public class TileThermalGenerator extends TilePowerAcceptor implements IWrenchable, IFluidHandler,IInventoryProvider
|
||||
{
|
||||
|
@ -138,46 +137,51 @@ public class TileThermalGenerator extends TilePowerAcceptor implements IWrenchab
|
|||
|
||||
@Override
|
||||
// TODO optimise this code
|
||||
public void updateEntity() {
|
||||
public void updateEntity()
|
||||
{
|
||||
super.updateEntity();
|
||||
if (!worldObj.isRemote) {
|
||||
if (!worldObj.isRemote)
|
||||
{
|
||||
FluidUtils.drainContainers(this, inventory, 0, 1);
|
||||
for (EnumFacing direction : EnumFacing.values()) {
|
||||
for (EnumFacing direction : EnumFacing.values())
|
||||
{
|
||||
if (worldObj.getBlockState(new BlockPos(getPos().getX() + direction.getFrontOffsetX(),
|
||||
getPos().getY() + direction.getFrontOffsetY(), getPos().getZ() + direction.getFrontOffsetZ()))
|
||||
.getBlock() == Blocks.LAVA) {
|
||||
.getBlock() == Blocks.LAVA)
|
||||
{
|
||||
addEnergy(1);
|
||||
}
|
||||
}
|
||||
|
||||
if (worldObj.getTotalWorldTime() % 40 == 0) {
|
||||
if (worldObj.getTotalWorldTime() % 40 == 0)
|
||||
{
|
||||
BlockMachineBase bmb = (BlockMachineBase) worldObj.getBlockState(pos).getBlock();
|
||||
boolean didFindLava = false;
|
||||
for (EnumFacing direction : EnumFacing.values()) {
|
||||
for (EnumFacing direction : EnumFacing.values())
|
||||
{
|
||||
if (worldObj.getBlockState(new BlockPos(getPos().getX() + direction.getFrontOffsetX(),
|
||||
getPos().getY() + direction.getFrontOffsetY(),
|
||||
getPos().getZ() + direction.getFrontOffsetZ())).getBlock() == Blocks.LAVA) {
|
||||
getPos().getZ() + direction.getFrontOffsetZ())).getBlock() == Blocks.LAVA)
|
||||
{
|
||||
didFindLava = true;
|
||||
}
|
||||
}
|
||||
bmb.setActive(didFindLava, worldObj, pos);
|
||||
}
|
||||
}
|
||||
if (tank.getFluidAmount() > 0 && getMaxPower() - getEnergy() >= euTick) {
|
||||
if (tank.getFluidAmount() > 0 && getMaxPower() - getEnergy() >= euTick)
|
||||
{
|
||||
tank.drain(1, true);
|
||||
addEnergy(euTick);
|
||||
}
|
||||
if (tank.getFluidType() != null && getStackInSlot(2) == null) {
|
||||
if (tank.getFluidType() != null && getStackInSlot(2) == null)
|
||||
{
|
||||
// inventory.setInventorySlotContents(2, new ItemStack(tank
|
||||
// .getFluidType().getBlock()));
|
||||
} else if (tank.getFluidType() == null && getStackInSlot(2) != null) {
|
||||
} else if (tank.getFluidType() == null && getStackInSlot(2) != null)
|
||||
{
|
||||
setInventorySlotContents(2, null);
|
||||
}
|
||||
|
||||
if (!worldObj.isRemote && getEnergy() > 0) {
|
||||
double maxOutput = getEnergy() > getMaxOutput() ? getMaxOutput() : getEnergy();
|
||||
useEnergy(PowerNet.dispatchEnergyPacket(worldObj, getPos(), maxOutput));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -4,7 +4,6 @@ import net.minecraft.init.Blocks;
|
|||
import net.minecraft.util.EnumFacing;
|
||||
import reborncore.api.power.EnumPowerTier;
|
||||
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||
import techreborn.power.PowerNet;
|
||||
|
||||
/**
|
||||
* Created by modmuss50 on 25/02/2016.
|
||||
|
@ -20,19 +19,17 @@ public class TileWaterMill extends TilePowerAcceptor
|
|||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
public void updateEntity()
|
||||
{
|
||||
super.updateEntity();
|
||||
if (worldObj.getTotalWorldTime() % 20 == 0) {
|
||||
if (worldObj.getTotalWorldTime() % 20 == 0)
|
||||
{
|
||||
checkForWater();
|
||||
}
|
||||
if (waterblocks > 0) {
|
||||
if (waterblocks > 0)
|
||||
{
|
||||
addEnergy(waterblocks);
|
||||
}
|
||||
|
||||
if (!worldObj.isRemote && getEnergy() > 0) {
|
||||
double maxOutput = getEnergy() > getMaxOutput() ? getMaxOutput() : getEnergy();
|
||||
useEnergy(PowerNet.dispatchEnergyPacket(worldObj, getPos(), maxOutput));
|
||||
}
|
||||
}
|
||||
|
||||
public void checkForWater()
|
||||
|
|
|
@ -3,7 +3,6 @@ package techreborn.tiles.generator;
|
|||
import net.minecraft.util.EnumFacing;
|
||||
import reborncore.api.power.EnumPowerTier;
|
||||
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||
import techreborn.power.PowerNet;
|
||||
|
||||
/**
|
||||
* Created by modmuss50 on 25/02/2016.
|
||||
|
@ -19,16 +18,19 @@ public class TileWindMill extends TilePowerAcceptor
|
|||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
public void updateEntity()
|
||||
{
|
||||
super.updateEntity();
|
||||
if (pos.getY() > 64) {
|
||||
double actualPower = basePower + basePower * worldObj.getThunderStrength(1.0F);
|
||||
addEnergy(actualPower);
|
||||
}
|
||||
|
||||
if (!worldObj.isRemote && getEnergy() > 0) {
|
||||
double maxOutput = getEnergy() > getMaxOutput() ? getMaxOutput() : getEnergy();
|
||||
useEnergy(PowerNet.dispatchEnergyPacket(worldObj, getPos(), maxOutput));
|
||||
if (pos.getY() > 64)
|
||||
{
|
||||
int actualPower = basePower;
|
||||
if (worldObj.isThundering())
|
||||
{
|
||||
actualPower *= 1.25;
|
||||
}
|
||||
addEnergy(actualPower); // Value taken from
|
||||
// http://wiki.industrial-craft.net/?title=Wind_Mill
|
||||
// Not worth making more complicated
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -10,7 +10,6 @@ import reborncore.api.power.EnumPowerTier;
|
|||
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||
import techreborn.config.ConfigTechReborn;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.power.PowerNet;
|
||||
|
||||
public class TileIDSU extends TilePowerAcceptor implements IWrenchable
|
||||
{
|
||||
|
@ -126,26 +125,32 @@ public class TileIDSU extends TilePowerAcceptor implements IWrenchable
|
|||
return nbttagcompound;
|
||||
}
|
||||
|
||||
public void updateEntity() {
|
||||
public void updateEntity()
|
||||
{
|
||||
super.updateEntity();
|
||||
|
||||
if (ticks == ConfigTechReborn.AverageEuOutTickTime) {
|
||||
if (ticks == ConfigTechReborn.AverageEuOutTickTime)
|
||||
{
|
||||
euChange = -1;
|
||||
ticks = 0;
|
||||
|
||||
} else {
|
||||
} else
|
||||
{
|
||||
ticks++;
|
||||
euChange += getEnergy() - euLastTick;
|
||||
if (euLastTick == getEnergy()) {
|
||||
if (euLastTick == getEnergy())
|
||||
{
|
||||
euChange = 0;
|
||||
}
|
||||
}
|
||||
|
||||
euLastTick = getEnergy();
|
||||
|
||||
if (!worldObj.isRemote && getEnergy() > 0) {
|
||||
double maxOutput = getEnergy() > getMaxOutput() ? getMaxOutput() : getEnergy();
|
||||
useEnergy(PowerNet.dispatchEnergyPacket(worldObj, getPos(), maxOutput));
|
||||
boolean needsInvUpdate = false;
|
||||
|
||||
if (needsInvUpdate)
|
||||
{
|
||||
this.markDirty();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -6,7 +6,6 @@ import reborncore.api.power.EnumPowerTier;
|
|||
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||
import reborncore.common.util.Inventory;
|
||||
import techreborn.config.ConfigTechReborn;
|
||||
import techreborn.power.PowerNet;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
|
@ -28,25 +27,32 @@ public class TileLesu extends TilePowerAcceptor
|
|||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
public void updateEntity()
|
||||
{
|
||||
super.updateEntity();
|
||||
if (worldObj.isRemote) {
|
||||
if (worldObj.isRemote)
|
||||
{
|
||||
return;
|
||||
}
|
||||
countedNetworks.clear();
|
||||
connectedBlocks = 0;
|
||||
for (EnumFacing dir : EnumFacing.values()) {
|
||||
for (EnumFacing dir : EnumFacing.values())
|
||||
{
|
||||
if (worldObj.getTileEntity(
|
||||
new BlockPos(getPos().getX() + dir.getFrontOffsetX(), getPos().getY() + dir.getFrontOffsetY(),
|
||||
getPos().getZ() + dir.getFrontOffsetZ())) instanceof TileLesuStorage) {
|
||||
getPos().getZ() + dir.getFrontOffsetZ())) instanceof TileLesuStorage)
|
||||
{
|
||||
if (((TileLesuStorage) worldObj.getTileEntity(
|
||||
new BlockPos(getPos().getX() + dir.getFrontOffsetX(), getPos().getY() + dir.getFrontOffsetY(),
|
||||
getPos().getZ() + dir.getFrontOffsetZ()))).network != null) {
|
||||
getPos().getZ() + dir.getFrontOffsetZ()))).network != null)
|
||||
{
|
||||
LesuNetwork network = ((TileLesuStorage) worldObj.getTileEntity(new BlockPos(
|
||||
getPos().getX() + dir.getFrontOffsetX(), getPos().getY() + dir.getFrontOffsetY(),
|
||||
getPos().getZ() + dir.getFrontOffsetZ()))).network;
|
||||
if (!countedNetworks.contains(network)) {
|
||||
if (network.master == null || network.master == this) {
|
||||
if (!countedNetworks.contains(network))
|
||||
{
|
||||
if (network.master == null || network.master == this)
|
||||
{
|
||||
connectedBlocks += network.storages.size();
|
||||
countedNetworks.add(network);
|
||||
network.master = this;
|
||||
|
@ -59,27 +65,25 @@ public class TileLesu extends TilePowerAcceptor
|
|||
maxStorage = ((connectedBlocks + 1) * ConfigTechReborn.LesuStoragePerBlock);
|
||||
output = (connectedBlocks * ConfigTechReborn.ExtraOutputPerLesuBlock) + ConfigTechReborn.BaseLesuOutput;
|
||||
|
||||
if (ticks == ConfigTechReborn.AverageEuOutTickTime) {
|
||||
if (ticks == ConfigTechReborn.AverageEuOutTickTime)
|
||||
{
|
||||
euChange = -1;
|
||||
ticks = 0;
|
||||
} else {
|
||||
} else
|
||||
{
|
||||
ticks++;
|
||||
if (euChange == -1) {
|
||||
if (euChange == -1)
|
||||
{
|
||||
euChange = 0;
|
||||
}
|
||||
euChange += getEnergy() - euLastTick;
|
||||
if (euLastTick == getEnergy()) {
|
||||
if (euLastTick == getEnergy())
|
||||
{
|
||||
euChange = 0;
|
||||
}
|
||||
}
|
||||
|
||||
euLastTick = getEnergy();
|
||||
|
||||
if (!worldObj.isRemote && getEnergy() > 0) {
|
||||
double maxOutput = getEnergy() > getMaxOutput() ? getMaxOutput() : getEnergy();
|
||||
useEnergy(PowerNet.dispatchEnergyPacket(worldObj, getPos(), maxOutput));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public double getEuChange()
|
||||
|
|
|
@ -22,6 +22,7 @@ import techreborn.api.Reference;
|
|||
import techreborn.api.recipe.ITileRecipeHandler;
|
||||
import techreborn.api.recipe.machines.BlastFurnaceRecipe;
|
||||
import techreborn.blocks.BlockMachineCasing;
|
||||
import techreborn.config.ConfigTechReborn;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.multiblocks.MultiBlockCasing;
|
||||
import techreborn.tiles.TileMachineCasing;
|
||||
|
@ -158,22 +159,6 @@ public class TileBlastFurnace extends TilePowerAcceptor implements IWrenchable,I
|
|||
tagCompound.setInteger("tickTime", tickTime);
|
||||
}
|
||||
|
||||
<<<<<<< HEAD:src/main/java/techreborn/tiles/multiblock/TileBlastFurnace.java
|
||||
@Override
|
||||
public int[] getSlotsForFace(EnumFacing side) {
|
||||
return new int[] {0, 1, 2, 3};
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInsertItem(int index, ItemStack itemStackIn, EnumFacing direction) {
|
||||
return index == 0 || index == 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int index, ItemStack stack, EnumFacing direction) {
|
||||
return index == 2 || index == 3;
|
||||
}
|
||||
=======
|
||||
// ISidedInventory
|
||||
@Override
|
||||
public int[] getSlotsForFace(EnumFacing side)
|
||||
|
@ -194,7 +179,6 @@ public class TileBlastFurnace extends TilePowerAcceptor implements IWrenchable,I
|
|||
{
|
||||
return slotIndex == 2 || slotIndex == 3;
|
||||
}
|
||||
>>>>>>> parent of b292fdd... Rewrite to use new RebornCore Power API. Texture fixes.:src/main/java/techreborn/tiles/TileBlastFurnace.java
|
||||
|
||||
public int getProgressScaled(int scale)
|
||||
{
|
||||
|
|
|
@ -15,6 +15,7 @@ import reborncore.api.IListInfoProvider;
|
|||
import reborncore.api.power.EnumPowerTier;
|
||||
import reborncore.api.tile.IInventoryProvider;
|
||||
import reborncore.common.IWrenchable;
|
||||
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||
import reborncore.common.util.FluidUtils;
|
||||
import reborncore.common.util.Inventory;
|
||||
import reborncore.common.util.Tank;
|
||||
|
@ -36,6 +37,10 @@ public class TileIndustrialSawmill extends TilePowerAcceptor implements IWrencha
|
|||
public int tickTime;
|
||||
public MultiblockChecker multiblockChecker;
|
||||
|
||||
public TileIndustrialSawmill() {
|
||||
super(2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
super.update();
|
||||
|
@ -214,6 +219,26 @@ public class TileIndustrialSawmill extends TilePowerAcceptor implements IWrencha
|
|||
return 64000;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canAcceptEnergy(EnumFacing direction) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvideEnergy(EnumFacing direction) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getMaxOutput() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getMaxInput() {
|
||||
return 64;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumPowerTier getTier() {
|
||||
return EnumPowerTier.MEDIUM;
|
||||
|
|
|
@ -25,6 +25,7 @@ public class TileVacuumFreezer extends TilePowerAcceptor implements IWrenchable,
|
|||
public RecipeCrafter crafter;
|
||||
|
||||
public TileVacuumFreezer() {
|
||||
super(2);
|
||||
int[] inputs = new int[] {0};
|
||||
int[] outputs = new int[] {1};
|
||||
crafter = new RecipeCrafter(Reference.vacuumFreezerRecipe, this, 2, 1, inventory, inputs, outputs);
|
||||
|
@ -52,6 +53,26 @@ public class TileVacuumFreezer extends TilePowerAcceptor implements IWrenchable,
|
|||
return 64000;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canAcceptEnergy(EnumFacing direction) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvideEnergy(EnumFacing direction) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getMaxOutput() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getMaxInput() {
|
||||
return 64;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumPowerTier getTier() {
|
||||
return EnumPowerTier.MEDIUM;
|
||||
|
|
|
@ -13,7 +13,6 @@ import reborncore.common.powerSystem.PoweredItem;
|
|||
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||
import reborncore.common.util.Inventory;
|
||||
import techreborn.blocks.storage.BlockEnergyStorage;
|
||||
import techreborn.power.PowerNet;
|
||||
|
||||
/**
|
||||
* Created by Rushmead
|
||||
|
@ -55,39 +54,40 @@ public class TileEnergyStorage extends TilePowerAcceptor implements IWrenchable,
|
|||
return entityPlayer.isSneaking();
|
||||
}
|
||||
|
||||
@Override public void updateEntity() {
|
||||
if (inventory.getStackInSlot(0) != null) {
|
||||
@Override public void updateEntity()
|
||||
{
|
||||
if (inventory.getStackInSlot(0) != null)
|
||||
{
|
||||
ItemStack stack = inventory.getStackInSlot(0);
|
||||
if (!(stack.getItem() instanceof IEnergyItemInfo)) {
|
||||
if(!(stack.getItem() instanceof IEnergyItemInfo)){
|
||||
return;
|
||||
}
|
||||
IEnergyItemInfo item = (IEnergyItemInfo) inventory.getStackInSlot(0).getItem();
|
||||
if (PoweredItem.getEnergy(stack) != PoweredItem.getMaxPower(stack)) {
|
||||
if (canUseEnergy(item.getMaxTransfer(stack))) {
|
||||
if (PoweredItem.getEnergy(stack) != PoweredItem.getMaxPower(stack))
|
||||
{
|
||||
if (canUseEnergy(item.getMaxTransfer(stack)))
|
||||
{
|
||||
useEnergy(item.getMaxTransfer(stack));
|
||||
PoweredItem.setEnergy(PoweredItem.getEnergy(stack) + item.getMaxTransfer(stack), stack);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (inventory.getStackInSlot(1) != null) {
|
||||
if (inventory.getStackInSlot(1) != null)
|
||||
{
|
||||
ItemStack stack = inventory.getStackInSlot(1);
|
||||
if (!(stack.getItem() instanceof IEnergyItemInfo)) {
|
||||
if(!(stack.getItem() instanceof IEnergyItemInfo)){
|
||||
return;
|
||||
}
|
||||
IEnergyItemInfo item = (IEnergyItemInfo) stack.getItem();
|
||||
if (item.canProvideEnergy(stack)) {
|
||||
if (getEnergy() != getMaxPower()) {
|
||||
if (item.canProvideEnergy(stack))
|
||||
{
|
||||
if (getEnergy() != getMaxPower())
|
||||
{
|
||||
addEnergy(item.getMaxTransfer(stack));
|
||||
PoweredItem.setEnergy(PoweredItem.getEnergy(stack) - item.getMaxTransfer(stack), stack);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!worldObj.isRemote && getEnergy() > 0) {
|
||||
double maxOutput = getEnergy() > getMaxOutput() ? getMaxOutput() : getEnergy();
|
||||
useEnergy(PowerNet.dispatchEnergyPacket(worldObj, getPos(), maxOutput));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -150,7 +150,6 @@ public class TileEnergyStorage extends TilePowerAcceptor implements IWrenchable,
|
|||
public Inventory getInventory() {
|
||||
return inventory;
|
||||
}
|
||||
<<<<<<< HEAD
|
||||
|
||||
@Override
|
||||
public int[] getSlotsForFace(EnumFacing side) {
|
||||
|
@ -167,6 +166,4 @@ public class TileEnergyStorage extends TilePowerAcceptor implements IWrenchable,
|
|||
return true;
|
||||
}
|
||||
|
||||
=======
|
||||
>>>>>>> parent of 6f54e38... Wires now transfer energy from all mods and manages it as EU. (#686)
|
||||
}
|
|
@ -1,10 +1,6 @@
|
|||
package techreborn.tiles.teir1;
|
||||
|
||||
<<<<<<< HEAD
|
||||
import ic2.core.upgrade.IUpgradeItem;
|
||||
=======
|
||||
import reborncore.common.IWrenchable;
|
||||
>>>>>>> parent of b292fdd... Rewrite to use new RebornCore Power API. Texture fixes.
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
|
@ -14,12 +10,9 @@ import net.minecraft.util.EnumFacing;
|
|||
import reborncore.api.power.EnumPowerTier;
|
||||
import reborncore.api.tile.IInventoryProvider;
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
<<<<<<< HEAD
|
||||
import reborncore.common.recipes.RecipeCrafter;
|
||||
import reborncore.common.tile.TilePowerAcceptor;
|
||||
=======
|
||||
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||
>>>>>>> parent of b292fdd... Rewrite to use new RebornCore Power API. Texture fixes.
|
||||
import reborncore.common.recipes.RecipeCrafter;
|
||||
|
||||
import reborncore.common.util.Inventory;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.utils.upgrade.UpgradeHandler;
|
||||
|
@ -49,15 +42,8 @@ public class TileElectricFurnace extends TilePowerAcceptor implements IWrenchabl
|
|||
}
|
||||
|
||||
@Override
|
||||
<<<<<<< HEAD
|
||||
public void update() {
|
||||
super.update();
|
||||
//charge(3); TODO
|
||||
|
||||
=======
|
||||
public void updateEntity()
|
||||
{
|
||||
>>>>>>> parent of b292fdd... Rewrite to use new RebornCore Power API. Texture fixes.
|
||||
boolean burning = isBurning();
|
||||
boolean updateInventory = false;
|
||||
if (isBurning() && canSmelt())
|
||||
|
@ -193,22 +179,6 @@ public class TileElectricFurnace extends TilePowerAcceptor implements IWrenchabl
|
|||
}
|
||||
|
||||
// ISidedInventory
|
||||
<<<<<<< HEAD
|
||||
@Override
|
||||
public int[] getSlotsForFace(EnumFacing side) {
|
||||
return new int[] {0, 1};
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInsertItem(int index, ItemStack itemStackIn, EnumFacing direction) {
|
||||
return index == 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int index, ItemStack stack, EnumFacing direction) {
|
||||
return index == 1;
|
||||
}
|
||||
=======
|
||||
@Override
|
||||
public int[] getSlotsForFace(EnumFacing side)
|
||||
{
|
||||
|
@ -228,7 +198,6 @@ public class TileElectricFurnace extends TilePowerAcceptor implements IWrenchabl
|
|||
{
|
||||
return slotIndex == 2;
|
||||
}
|
||||
>>>>>>> parent of b292fdd... Rewrite to use new RebornCore Power API. Texture fixes.
|
||||
|
||||
@Override
|
||||
public double getMaxPower()
|
||||
|
|
|
@ -43,20 +43,11 @@ public class TileExtractor extends TilePowerAcceptor implements IWrenchable,IInv
|
|||
}
|
||||
|
||||
@Override
|
||||
<<<<<<< HEAD
|
||||
public void update() {
|
||||
super.update();
|
||||
crafter.updateEntity();
|
||||
upgradeHandler.tick();
|
||||
//charge(3); TODO
|
||||
=======
|
||||
public void updateEntity()
|
||||
{
|
||||
super.updateEntity();
|
||||
crafter.updateEntity();
|
||||
// upgrades.tick();
|
||||
charge(3);
|
||||
>>>>>>> parent of b292fdd... Rewrite to use new RebornCore Power API. Texture fixes.
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue