mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-18 19:39:14 +00:00
It compiles.
This commit is contained in:
1 parent
2866f4dd10
commit
e568e1cfbf
26 files changed
+310
-349
No files matched your search
@@ -31,7 +31,7 @@ sand/cobble/wood=0.1
|
||||
|
||||
<recipeGroup name="EnderIO"> <!-- Required for EnderIO to function correctly. -->
|
||||
|
||||
<recipe name="Electrical Steel" energyCost="1000">
|
||||
<recipe name="Electrical Steel" energyCost="10000">
|
||||
<input>
|
||||
<itemStack modID="minecraft" itemName="iron_ingot"/>
|
||||
<itemStack oreDictionary="dustCoal" />
|
||||
@@ -42,7 +42,7 @@ sand/cobble/wood=0.1
|
||||
</output>
|
||||
</recipe>
|
||||
|
||||
<recipe name="Energetic Alloy" energyCost="1000">
|
||||
<recipe name="Energetic Alloy" energyCost="10000">
|
||||
<input>
|
||||
<itemStack modID="minecraft" itemName="redstone"/>
|
||||
<itemStack modID="minecraft" itemName="gold_ingot"/>
|
||||
@@ -53,7 +53,7 @@ sand/cobble/wood=0.1
|
||||
</output>
|
||||
</recipe>
|
||||
|
||||
<recipe name="Vibrant Alloy" energyCost="1000">
|
||||
<recipe name="Vibrant Alloy" energyCost="10000">
|
||||
<input>
|
||||
<itemStack modID="EnderIO" itemName="itemAlloy" itemMeta="1"/> <!-- Energetic Alloy -->
|
||||
<itemStack modID="minecraft" itemName="ender_pearl"/>
|
||||
@@ -63,7 +63,7 @@ sand/cobble/wood=0.1
|
||||
</output>
|
||||
</recipe>
|
||||
|
||||
<recipe name="Redstone Alloy" energyCost="1000">
|
||||
<recipe name="Redstone Alloy" energyCost="10000">
|
||||
<input>
|
||||
<itemStack modID="minecraft" itemName="redstone"/>
|
||||
<itemStack modID="EnderIO" itemName="itemMaterial" itemMeta="0" /> <!-- Silicon -->
|
||||
@@ -73,7 +73,7 @@ sand/cobble/wood=0.1
|
||||
</output>
|
||||
</recipe>
|
||||
|
||||
<recipe name="Conductive Iron" energyCost="1000">
|
||||
<recipe name="Conductive Iron" energyCost="10000">
|
||||
<input>
|
||||
<itemStack modID="minecraft" itemName="redstone"/>
|
||||
<itemStack modID="minecraft" itemName="iron_ingot"/>
|
||||
@@ -83,7 +83,7 @@ sand/cobble/wood=0.1
|
||||
</output>
|
||||
</recipe>
|
||||
|
||||
<recipe name="Pulsating Iron" energyCost="1000">
|
||||
<recipe name="Pulsating Iron" energyCost="10000">
|
||||
<input>
|
||||
<itemStack modID="minecraft" itemName="iron_ingot"/>
|
||||
<itemStack modID="minecraft" itemName="ender_pearl"/>
|
||||
@@ -104,7 +104,7 @@ sand/cobble/wood=0.1
|
||||
</output>
|
||||
</recipe>
|
||||
|
||||
<recipe name="Soularium" energyCost="1000">
|
||||
<recipe name="Soularium" energyCost="10000">
|
||||
<input>
|
||||
<itemStack modID="minecraft" itemName="soul_sand"/>
|
||||
<itemStack modID="minecraft" itemName="gold_ingot"/>
|
||||
@@ -114,7 +114,7 @@ sand/cobble/wood=0.1
|
||||
</output>
|
||||
</recipe>
|
||||
|
||||
<recipe name="Fused Quartz" energyCost="500">
|
||||
<recipe name="Fused Quartz" energyCost="5000">
|
||||
<input>
|
||||
<itemStack modID="minecraft" itemName="quartz" number="4"/>
|
||||
</input>
|
||||
@@ -123,7 +123,7 @@ sand/cobble/wood=0.1
|
||||
</output>
|
||||
</recipe>
|
||||
|
||||
<recipe name="Fused Glass" energyCost="250">
|
||||
<recipe name="Fused Glass" energyCost="2500">
|
||||
<input>
|
||||
<itemStack oreDictionary="sand" />
|
||||
</input>
|
||||
@@ -132,7 +132,7 @@ sand/cobble/wood=0.1
|
||||
</output>
|
||||
</recipe>
|
||||
|
||||
<recipe name="Enlightened Fused Quartz" energyCost="500">
|
||||
<recipe name="Enlightened Fused Quartz" energyCost="5000">
|
||||
<input>
|
||||
<itemStack modID="minecraft" itemName="quartz" number="4"/>
|
||||
<itemStack modID="minecraft" itemName="glowstone_dust" number="4"/>
|
||||
@@ -142,7 +142,7 @@ sand/cobble/wood=0.1
|
||||
</output>
|
||||
</recipe>
|
||||
|
||||
<recipe name="Enlightened Fused Quartz 2" energyCost="500">
|
||||
<recipe name="Enlightened Fused Quartz 2" energyCost="5000">
|
||||
<input>
|
||||
<itemStack modID="EnderIO" itemName="blockFusedQuartz" itemMeta="0"/>
|
||||
<itemStack modID="minecraft" itemName="glowstone_dust" number="4"/>
|
||||
@@ -152,7 +152,7 @@ sand/cobble/wood=0.1
|
||||
</output>
|
||||
</recipe>
|
||||
|
||||
<recipe name="Enlightened Fused Glass" energyCost="250">
|
||||
<recipe name="Enlightened Fused Glass" energyCost="2500">
|
||||
<input>
|
||||
<itemStack oreDictionary="sand" />
|
||||
<itemStack modID="minecraft" itemName="glowstone_dust" number="4"/>
|
||||
@@ -162,7 +162,7 @@ sand/cobble/wood=0.1
|
||||
</output>
|
||||
</recipe>
|
||||
|
||||
<recipe name="Enlightened Fused Glass 2" energyCost="250">
|
||||
<recipe name="Enlightened Fused Glass 2" energyCost="2500">
|
||||
<input>
|
||||
<itemStack modID="EnderIO" itemName="blockFusedQuartz" itemMeta="1"/>
|
||||
<itemStack modID="minecraft" itemName="glowstone_dust" number="4"/>
|
||||
@@ -178,7 +178,7 @@ sand/cobble/wood=0.1
|
||||
|
||||
<recipeGroup name="Thermal Expansion">
|
||||
|
||||
<recipe name="Electrum Ingot" energyCost="500">
|
||||
<recipe name="Electrum Ingot" energyCost="5000">
|
||||
<input>
|
||||
<itemStack oreDictionary="ingotGold"/>
|
||||
<itemStack oreDictionary="ingotSilver"/>
|
||||
@@ -188,7 +188,7 @@ sand/cobble/wood=0.1
|
||||
</output>
|
||||
</recipe>
|
||||
|
||||
<recipe name="Invar Ingot" energyCost="750">
|
||||
<recipe name="Invar Ingot" energyCost="7500">
|
||||
<input>
|
||||
<itemStack oreDictionary="ingotNickel" />
|
||||
<itemStack oreDictionary="ingotIron" number="2"/>
|
||||
@@ -198,7 +198,7 @@ sand/cobble/wood=0.1
|
||||
</output>
|
||||
</recipe>
|
||||
|
||||
<recipe name="Hardened Glass" energyCost="400">
|
||||
<recipe name="Hardened Glass" energyCost="4000">
|
||||
<input>
|
||||
<itemStack oreDictionary="dustObsidian" number="8"/>
|
||||
<itemStack oreDictionary="ingotLead" />
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -7,6 +7,7 @@ import java.util.Set;
|
||||
import mekanism.api.gas.IGasHandler;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
import cofh.api.transport.IItemDuct;
|
||||
@@ -90,5 +91,7 @@ public interface IConduitBundle extends IInternalPowerReceptor, IFluidHandler, I
|
||||
void setFacadeMetadata(int meta);
|
||||
|
||||
int getFacadeMetadata();
|
||||
|
||||
World getWorldObj();
|
||||
|
||||
}
|
||||
@@ -12,13 +12,10 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
import buildcraft.api.power.PowerHandler;
|
||||
import buildcraft.api.power.PowerHandler.PowerReceiver;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.EnderIO;
|
||||
@@ -635,27 +632,6 @@ public class TileConduitBundle extends TileEntityEio implements IConduitBundle {
|
||||
|
||||
// ------------ Power -----------------------------
|
||||
|
||||
@Override
|
||||
public void doWork(PowerHandler workProvider) {
|
||||
IPowerConduit pc = getConduit(IPowerConduit.class);
|
||||
if(pc != null) {
|
||||
pc.doWork(workProvider);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public PowerReceiver getPowerReceiver(ForgeDirection side) {
|
||||
IPowerConduit pc = getConduit(IPowerConduit.class);
|
||||
if(pc != null) {
|
||||
return pc.getPowerReceiver(side);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public World getWorld() {
|
||||
return worldObj;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int receiveEnergy(ForgeDirection from, int maxReceive, boolean simulate) {
|
||||
@@ -702,8 +678,44 @@ public class TileConduitBundle extends TileEntityEio implements IConduitBundle {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// ------- Liquids -----------------------------
|
||||
@Override
|
||||
public int getMaxEnergyRecieved(ForgeDirection dir) {
|
||||
IPowerConduit pc = getConduit(IPowerConduit.class);
|
||||
if(pc != null) {
|
||||
return pc.getMaxEnergyRecieved(dir);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getEnergyStored() {
|
||||
IPowerConduit pc = getConduit(IPowerConduit.class);
|
||||
if(pc != null) {
|
||||
return pc.getEnergyStored();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxEnergyStored() {
|
||||
IPowerConduit pc = getConduit(IPowerConduit.class);
|
||||
if(pc != null) {
|
||||
return pc.getMaxEnergyStored();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setEnergyStored(int stored) {
|
||||
IPowerConduit pc = getConduit(IPowerConduit.class);
|
||||
if(pc != null) {
|
||||
pc.setEnergyStored(stored);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//------- Liquids -----------------------------
|
||||
|
||||
@Override
|
||||
public int fill(ForgeDirection from, FluidStack resource, boolean doFill) {
|
||||
ILiquidConduit lc = getConduit(ILiquidConduit.class);
|
||||
|
||||
@@ -29,12 +29,12 @@ public abstract class AbstractGasConduit extends AbstractConduit implements IGas
|
||||
protected boolean redstoneStateDirty = true;
|
||||
|
||||
public IGasHandler getExternalHandler(ForgeDirection direction) {
|
||||
IGasHandler con = GasUtil.getExternalGasHandler(getBundle().getWorld(), getLocation().getLocation(direction));
|
||||
IGasHandler con = GasUtil.getExternalGasHandler(getBundle().getWorldObj(), getLocation().getLocation(direction));
|
||||
return (con != null && !(con instanceof IConduitBundle)) ? con : null;
|
||||
}
|
||||
|
||||
public IGasHandler getTankContainer(BlockCoord bc) {
|
||||
return GasUtil.getGasHandler(getBundle().getWorld(), bc);
|
||||
return GasUtil.getGasHandler(getBundle().getWorldObj(), bc);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -280,7 +280,7 @@ public class GasConduitNetwork extends AbstractGasTankConduitNetwork<GasConduit>
|
||||
if(conduits.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
return conduits.get(0).getBundle().getWorld();
|
||||
return conduits.get(0).getBundle().getWorldObj();
|
||||
}
|
||||
|
||||
public void removeInput(GasOutput lo) {
|
||||
|
||||
@@ -418,7 +418,7 @@ public class ItemConduit extends AbstractConduit implements IItemConduit {
|
||||
|
||||
@Override
|
||||
public IInventory getExternalInventory(ForgeDirection direction) {
|
||||
World world = getBundle().getWorld();
|
||||
World world = getBundle().getWorldObj();
|
||||
if(world == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ public class NetworkedInventory {
|
||||
this.con = con;
|
||||
this.conDir = conDir;
|
||||
this.location = location;
|
||||
world = con.getBundle().getWorld();
|
||||
world = con.getBundle().getWorldObj();
|
||||
|
||||
TileEntity te = world.getTileEntity(location.x, location.y, location.z);
|
||||
if(te.getClass().getName().equals("tconstruct.tools.logic.CraftingStationLogic")) {
|
||||
|
||||
@@ -30,12 +30,12 @@ public abstract class AbstractLiquidConduit extends AbstractConduit implements I
|
||||
protected boolean redstoneStateDirty = true;
|
||||
|
||||
public IFluidHandler getExternalHandler(ForgeDirection direction) {
|
||||
IFluidHandler con = FluidUtil.getExternalFluidHandler(getBundle().getWorld(), getLocation().getLocation(direction));
|
||||
IFluidHandler con = FluidUtil.getExternalFluidHandler(getBundle().getWorldObj(), getLocation().getLocation(direction));
|
||||
return (con != null && !(con instanceof IConduitBundle)) ? con : null;
|
||||
}
|
||||
|
||||
public IFluidHandler getTankContainer(BlockCoord bc) {
|
||||
return FluidUtil.getFluidHandler(getBundle().getWorld(), bc);
|
||||
return FluidUtil.getFluidHandler(getBundle().getWorldObj(), bc);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -303,7 +303,7 @@ public class AdvancedLiquidConduitNetwork extends AbstractTankConduitNetwork<Adv
|
||||
if(conduits.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
return conduits.get(0).getBundle().getWorld();
|
||||
return conduits.get(0).getBundle().getWorldObj();
|
||||
}
|
||||
|
||||
public void removeInput(LiquidOutput lo) {
|
||||
|
||||
@@ -198,7 +198,7 @@ public class EnderLiquidConduitNetwork extends AbstractConduitNetwork<ILiquidCon
|
||||
this.conDir = conDir;
|
||||
conduitLoc = con.getLocation();
|
||||
tankDir = conDir.getOpposite();
|
||||
externalTank = FluidUtil.getExternalFluidHandler(con.getBundle().getWorld(), conduitLoc.getLocation(conDir));
|
||||
externalTank = FluidUtil.getExternalFluidHandler(con.getBundle().getWorldObj(), conduitLoc.getLocation(conDir));
|
||||
acceptsOuput = con.getConectionMode(conDir).acceptsOutput();
|
||||
}
|
||||
|
||||
|
||||
@@ -32,14 +32,8 @@ public interface IPowerConduit extends IConduit, IInternalPowerReceptor, IExtrac
|
||||
|
||||
//called from NetworkPowerManager
|
||||
void onTick();
|
||||
|
||||
|
||||
int getEnergyStored();
|
||||
|
||||
void setEnergyStored(float give);
|
||||
|
||||
boolean getConnectionsDirty();
|
||||
|
||||
int getMaxEnergyStored();
|
||||
|
||||
}
|
||||
@@ -237,7 +237,7 @@ public class NetworkPowerManager {
|
||||
}
|
||||
}
|
||||
|
||||
private void trackerSend(IPowerConduit con, float sent, boolean fromBank) {
|
||||
private void trackerSend(IPowerConduit con, int sent, boolean fromBank) {
|
||||
if(!fromBank) {
|
||||
networkPowerTracker.powerSent(sent);
|
||||
}
|
||||
@@ -247,7 +247,7 @@ public class NetworkPowerManager {
|
||||
getOrCreateTracker(con).powerSent(sent);
|
||||
}
|
||||
|
||||
private void trackerRecieve(IPowerConduit con, float recieved, boolean fromBank) {
|
||||
private void trackerRecieve(IPowerConduit con, int recieved, boolean fromBank) {
|
||||
if(!fromBank) {
|
||||
networkPowerTracker.powerRecieved(recieved);
|
||||
}
|
||||
@@ -331,14 +331,14 @@ public class NetworkPowerManager {
|
||||
}
|
||||
|
||||
float filledRatio = energyStored / maxEnergyStored;
|
||||
float energyLeft = energyStored;
|
||||
float given = 0;
|
||||
int energyLeft = energyStored;
|
||||
int given = 0;
|
||||
for (IPowerConduit con : network.getConduits()) {
|
||||
if(energyLeft >= 0) {
|
||||
// NB: use ceil to ensure we dont through away any energy due to
|
||||
// rounding
|
||||
// errors
|
||||
float give = (float) Math.ceil(con.getCapacitor().getMaxEnergyStored() * filledRatio);
|
||||
int give = (int)Math.ceil(con.getCapacitor().getMaxEnergyStored() * filledRatio);
|
||||
give = Math.min(give, con.getCapacitor().getMaxEnergyStored());
|
||||
give = Math.min(give, energyLeft);
|
||||
con.setEnergyStored(give);
|
||||
@@ -537,7 +537,7 @@ public class NetworkPowerManager {
|
||||
use = Math.min(use, amount);
|
||||
use = Math.min(use, entry.canExtract);
|
||||
entry.capBank.addEnergy(-use);
|
||||
trackerRecieve(entry.emmiter, (float) use, true);
|
||||
trackerRecieve(entry.emmiter, use, true);
|
||||
amount -= use;
|
||||
if(amount == 0) {
|
||||
return;
|
||||
|
||||
@@ -17,9 +17,6 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import buildcraft.api.power.PowerHandler;
|
||||
import buildcraft.api.power.PowerHandler.PowerReceiver;
|
||||
import buildcraft.api.power.PowerHandler.Type;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.conduit.AbstractConduit;
|
||||
import crazypants.enderio.conduit.AbstractConduitNetwork;
|
||||
@@ -91,10 +88,7 @@ public class PowerConduit extends AbstractConduit implements IPowerConduit {
|
||||
|
||||
protected PowerConduitNetwork network;
|
||||
|
||||
private PowerHandler powerHandler;
|
||||
private PowerHandler noInputPH;
|
||||
|
||||
private float energyStored;
|
||||
private int energyStoredRF;
|
||||
|
||||
private int subtype;
|
||||
|
||||
@@ -112,7 +106,6 @@ public class PowerConduit extends AbstractConduit implements IPowerConduit {
|
||||
|
||||
public PowerConduit(int meta) {
|
||||
this.subtype = meta;
|
||||
//powerHandler = createPowerHandlerForType();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -165,10 +158,6 @@ public class PowerConduit extends AbstractConduit implements IPowerConduit {
|
||||
return CAPACITORS[subtype];
|
||||
}
|
||||
|
||||
private PowerHandler createPowerHandlerForType() {
|
||||
return PowerHandlerUtil.createHandler(CAPACITORS[subtype], this, Type.PIPE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setExtractionRedstoneMode(RedstoneControlMode mode, ForgeDirection dir) {
|
||||
rsModes.put(dir, mode);
|
||||
@@ -203,7 +192,7 @@ public class PowerConduit extends AbstractConduit implements IPowerConduit {
|
||||
public void writeToNBT(NBTTagCompound nbtRoot) {
|
||||
super.writeToNBT(nbtRoot);
|
||||
nbtRoot.setShort("subtype", (short) subtype);
|
||||
nbtRoot.setFloat("energyStored", energyStored);
|
||||
nbtRoot.setInteger("energyStoredRF", energyStoredRF);
|
||||
|
||||
for (Entry<ForgeDirection, RedstoneControlMode> entry : rsModes.entrySet()) {
|
||||
if(entry.getValue() != null) {
|
||||
@@ -225,7 +214,11 @@ public class PowerConduit extends AbstractConduit implements IPowerConduit {
|
||||
super.readFromNBT(nbtRoot, nbtVersion);
|
||||
subtype = nbtRoot.getShort("subtype");
|
||||
|
||||
energyStored = Math.min(getCapacitor().getMaxEnergyStored(), nbtRoot.getFloat("energyStored"));
|
||||
if(nbtRoot.hasKey("energyStored")) {
|
||||
nbtRoot.setInteger("energyStored", (int)(nbtRoot.getFloat("energyStored") * 10));
|
||||
|
||||
}
|
||||
energyStoredRF = Math.min(getCapacitor().getMaxEnergyStored(), nbtRoot.getInteger("energyStoredRF"));
|
||||
|
||||
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
|
||||
String key = "pRsMode." + dir.name();
|
||||
@@ -246,43 +239,20 @@ public class PowerConduit extends AbstractConduit implements IPowerConduit {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTick() {
|
||||
if(powerHandler != null && powerHandler.getEnergyStored() > 0) {
|
||||
energyStored = (float) Math.min(energyStored + powerHandler.getEnergyStored(), getCapacitor().getMaxEnergyStored());
|
||||
powerHandler.setEnergy(0);
|
||||
}
|
||||
public void onTick() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getEnergyStored() {
|
||||
return energyStored;
|
||||
public int getEnergyStored() {
|
||||
return energyStoredRF;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setEnergyStored(float energyStored) {
|
||||
this.energyStored = energyStored;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PowerReceiver getPowerReceiver(ForgeDirection side) {
|
||||
ConnectionMode mode = getConectionMode(side);
|
||||
if(side == null || mode == ConnectionMode.OUTPUT || mode == ConnectionMode.DISABLED || !isRedstoneEnabled(side)) {
|
||||
if(noInputPH == null) {
|
||||
noInputPH = new PowerHandler(this, Type.PIPE);
|
||||
noInputPH.configure(0, 0, 0, getOrCreatePowerHandler().getMaxEnergyStored());
|
||||
}
|
||||
return noInputPH.getPowerReceiver();
|
||||
}
|
||||
return getOrCreatePowerHandler().getPowerReceiver();
|
||||
}
|
||||
|
||||
private PowerHandler getOrCreatePowerHandler() {
|
||||
if(powerHandler == null) {
|
||||
powerHandler = createPowerHandlerForType();
|
||||
}
|
||||
return powerHandler;
|
||||
public void setEnergyStored(int energyStored) {
|
||||
this.energyStoredRF = energyStored;
|
||||
}
|
||||
|
||||
|
||||
private boolean isRedstoneEnabled(ForgeDirection dir) {
|
||||
boolean result;
|
||||
RedstoneControlMode mode = getExtractionRedstoneMode(dir);
|
||||
@@ -327,7 +297,7 @@ public class PowerConduit extends AbstractConduit implements IPowerConduit {
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getMaxEnergyRecieved(ForgeDirection dir) {
|
||||
public int getMaxEnergyRecieved(ForgeDirection dir) {
|
||||
ConnectionMode mode = getConectionMode(dir);
|
||||
if(mode == ConnectionMode.OUTPUT || mode == ConnectionMode.DISABLED || !isRedstoneEnabled(dir)) {
|
||||
return 0;
|
||||
@@ -336,7 +306,7 @@ public class PowerConduit extends AbstractConduit implements IPowerConduit {
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getMaxEnergyExtracted(ForgeDirection dir) {
|
||||
public int getMaxEnergyExtracted(ForgeDirection dir) {
|
||||
ConnectionMode mode = getConectionMode(dir);
|
||||
if(mode == ConnectionMode.INPUT || mode == ConnectionMode.DISABLED || !isRedstoneEnabled(dir)) {
|
||||
return 0;
|
||||
@@ -348,11 +318,11 @@ public class PowerConduit extends AbstractConduit implements IPowerConduit {
|
||||
}
|
||||
|
||||
private boolean recievedRfThisTick(ForgeDirection dir) {
|
||||
if(recievedTicks == null || dir == null || recievedTicks.get(dir) == null || getBundle() == null || getBundle().getWorld() == null) {
|
||||
if(recievedTicks == null || dir == null || recievedTicks.get(dir) == null || getBundle() == null || getBundle().getWorldObj() == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
long curTick = getBundle().getWorld().getTotalWorldTime();
|
||||
long curTick = getBundle().getWorldObj().getTotalWorldTime();
|
||||
long recT = recievedTicks.get(dir);
|
||||
if(curTick - recT <= 5) {
|
||||
return true;
|
||||
@@ -360,15 +330,6 @@ public class PowerConduit extends AbstractConduit implements IPowerConduit {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doWork(PowerHandler workProvider) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public World getWorld() {
|
||||
return getBundle().getEntity().getWorldObj();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onNeighborBlockChange(Block blockId) {
|
||||
redstoneStateDirty = true;
|
||||
@@ -389,20 +350,20 @@ public class PowerConduit extends AbstractConduit implements IPowerConduit {
|
||||
if(getMaxEnergyRecieved(from) == 0 || maxReceive <= 0) {
|
||||
return 0;
|
||||
}
|
||||
float freeSpace = getCapacitor().getMaxEnergyStored() - energyStored;
|
||||
int result = (int) Math.min(maxReceive / 10, freeSpace);
|
||||
float freeSpace = getCapacitor().getMaxEnergyStored() - energyStoredRF;
|
||||
int result = (int) Math.min(maxReceive, freeSpace);
|
||||
if(!simulate && result > 0) {
|
||||
energyStored += result;
|
||||
energyStoredRF += result;
|
||||
|
||||
if(getBundle() != null) {
|
||||
if(recievedTicks == null) {
|
||||
recievedTicks = new EnumMap<ForgeDirection, Long>(ForgeDirection.class);
|
||||
}
|
||||
recievedTicks.put(from, getBundle().getWorld().getTotalWorldTime());
|
||||
recievedTicks.put(from, getBundle().getWorldObj().getTotalWorldTime());
|
||||
}
|
||||
|
||||
}
|
||||
return result * 10;
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -417,7 +378,7 @@ public class PowerConduit extends AbstractConduit implements IPowerConduit {
|
||||
|
||||
@Override
|
||||
public int getEnergyStored(ForgeDirection from) {
|
||||
return (int) (energyStored * 10);
|
||||
return energyStoredRF;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -533,7 +494,7 @@ public class PowerConduit extends AbstractConduit implements IPowerConduit {
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getMaxEnergyStored() {
|
||||
public int getMaxEnergyStored() {
|
||||
return CAPACITORS[subtype].getMaxEnergyStored();
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,6 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import buildcraft.api.power.IPowerEmitter;
|
||||
import cofh.api.tileentity.IRedstoneControl;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@@ -284,8 +283,7 @@ public class InsulatedRedstoneConduit extends RedstoneConduit implements IInsula
|
||||
|
||||
private static Collection<Class<?>> getConectableInterfaces() {
|
||||
if(CONNECTABLE_CLASSES == null) {
|
||||
CONNECTABLE_CLASSES = new HashSet<Class<?>>();
|
||||
CONNECTABLE_CLASSES.add(IPowerEmitter.class);
|
||||
CONNECTABLE_CLASSES = new HashSet<Class<?>>();
|
||||
CONNECTABLE_CLASSES.add(IRedstoneControl.class);
|
||||
CONNECTABLE_CLASSES.add(AbstractMachineEntity.class);
|
||||
try{
|
||||
|
||||
@@ -204,9 +204,9 @@ public final class Config {
|
||||
public static boolean addFurnaceFuelTootip = true;
|
||||
public static boolean addDurabilityTootip = true;
|
||||
|
||||
public static float farmContinuousEnergyUse = 4;
|
||||
public static float farmActionEnergyUse = 50;
|
||||
public static float farmAxeActionEnergyUse = 100;
|
||||
public static int farmContinuousEnergyUseRF = 40;
|
||||
public static int farmActionEnergyUseRF = 500;
|
||||
public static int farmAxeActionEnergyUseRF = 1000;
|
||||
|
||||
public static int farmDefaultSize = 3;
|
||||
public static boolean farmAxeDamageOnLeafBreak = false;
|
||||
@@ -219,7 +219,7 @@ public final class Config {
|
||||
|
||||
public static boolean useCombustionGenModel = false;
|
||||
|
||||
public static int crafterMjPerCraft = 250;
|
||||
public static int crafterRfPerCraft = 2500;
|
||||
|
||||
public static int capacitorBankMaxIoRF = 5000;
|
||||
public static int capacitorBankMaxStorageRF = 5000000;
|
||||
@@ -624,13 +624,12 @@ public final class Config {
|
||||
addFurnaceFuelTootip = config.get(sectionPersonal.name, "addFurnaceFuelTootip", addFuelTooltipsToAllFluidContainers,
|
||||
"If true, adds burn duration tooltips to furnace fuels").getBoolean(addFurnaceFuelTootip);
|
||||
|
||||
farmContinuousEnergyUse = (float) config.get(sectionFarm.name, "farmContinuousEnergyUse", farmContinuousEnergyUse,
|
||||
"The amount of power used by a farm per tick ").getDouble(farmContinuousEnergyUse);
|
||||
farmActionEnergyUse = (float) config.get(sectionFarm.name, "farmActionEnergyUse", farmActionEnergyUse,
|
||||
"The amount of power used by a farm per action (eg plant, till, harvest) ").getDouble(farmActionEnergyUse);
|
||||
|
||||
farmAxeActionEnergyUse= (float) config.get(sectionFarm.name, "farmAxeActionEnergyUse", farmAxeActionEnergyUse,
|
||||
"The amount of power used by a farm per wood block 'chopped'").getDouble(farmAxeActionEnergyUse);
|
||||
farmContinuousEnergyUseRF = config.get(sectionFarm.name, "farmContinuousEnergyUseRF", farmContinuousEnergyUseRF,
|
||||
"The amount of power used by a farm per tick ").getInt(farmContinuousEnergyUseRF);
|
||||
farmActionEnergyUseRF = config.get(sectionFarm.name, "farmActionEnergyUseRF", farmActionEnergyUseRF,
|
||||
"The amount of power used by a farm per action (eg plant, till, harvest) ").getInt(farmActionEnergyUseRF);
|
||||
farmAxeActionEnergyUseRF= config.get(sectionFarm.name, "farmAxeActionEnergyUseRF", farmAxeActionEnergyUseRF,
|
||||
"The amount of power used by a farm per wood block 'chopped'").getInt(farmAxeActionEnergyUseRF);
|
||||
|
||||
farmDefaultSize = config.get(sectionFarm.name, "farmDefaultSize", farmDefaultSize,
|
||||
"The number of blocks a farm will extend from its center").getInt(farmDefaultSize);
|
||||
@@ -657,8 +656,8 @@ public final class Config {
|
||||
useCombustionGenModel = config.get(sectionAesthetic.name, "useCombustionGenModel", useCombustionGenModel,
|
||||
"If set to true: WIP Combustion Generator model will be used").getBoolean(useCombustionGenModel);
|
||||
|
||||
crafterMjPerCraft = config.get("AutoCrafter Settings", "crafterMjPerCraft", crafterMjPerCraft,
|
||||
"MJ used per autocrafted recipe").getInt(crafterMjPerCraft);
|
||||
crafterRfPerCraft = config.get("AutoCrafter Settings", "crafterRfPerCraft", crafterRfPerCraft,
|
||||
"RF used per autocrafted recipe").getInt(crafterRfPerCraft);
|
||||
|
||||
poweredSpawnerMinDelayTicks = config.get(sectionSpawner.name, "poweredSpawnerMinDelayTicks", poweredSpawnerMinDelayTicks,
|
||||
"Min tick delay between spawns for a non-upgraded spawner").getInt(poweredSpawnerMinDelayTicks);
|
||||
|
||||
@@ -115,7 +115,7 @@ public class TooltipAddera {
|
||||
if(fuel != null) {
|
||||
if(showAdvancedTooltips()) {
|
||||
list.add(Lang.localize("fuel.tooltip.heading"));
|
||||
list.add(EnumChatFormatting.ITALIC + " " + PowerDisplayUtil.formatPowerPerTick(fuel.powerPerCycle));
|
||||
list.add(EnumChatFormatting.ITALIC + " " + PowerDisplayUtil.formatPowerPerTick( (int)(fuel.powerPerCycle * 10) ));
|
||||
list.add(EnumChatFormatting.ITALIC + " " + fuel.totalBurningTime + " " + Lang.localize("fuel.tooltip.burnTime"));
|
||||
} else {
|
||||
addShowDetailsTooltip(list);
|
||||
|
||||
@@ -20,7 +20,6 @@ import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.gui.IResourceTooltipProvider;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil.PowerType;
|
||||
import crazypants.util.ItemUtil;
|
||||
|
||||
public class ItemMagnet extends ItemEnergyContainer implements IResourceTooltipProvider {
|
||||
@@ -99,8 +98,8 @@ public class ItemMagnet extends ItemEnergyContainer implements IResourceTooltipP
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack itemStack, EntityPlayer par2EntityPlayer, List list, boolean par4) {
|
||||
super.addInformation(itemStack, par2EntityPlayer, list, par4);
|
||||
String str = PowerDisplayUtil.formatPower(PowerType.RF, getEnergyStored(itemStack)) + "/"
|
||||
+ PowerDisplayUtil.formatPower(PowerType.RF, getMaxEnergyStored(itemStack)) + " " + PowerDisplayUtil.abrevation();
|
||||
String str = PowerDisplayUtil.formatPower(getEnergyStored(itemStack)) + "/"
|
||||
+ PowerDisplayUtil.formatPower(getMaxEnergyStored(itemStack)) + " " + PowerDisplayUtil.abrevation();
|
||||
list.add(str);
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ public class BasicAlloyRecipe implements IAlloyRecipe {
|
||||
|
||||
public static final int DEFAULT_ENERGY_USE = 1200;
|
||||
|
||||
private float energyRequired = DEFAULT_ENERGY_USE;
|
||||
private int energyRequired = DEFAULT_ENERGY_USE;
|
||||
private ItemStack output;
|
||||
|
||||
private float expPerItem;
|
||||
@@ -196,7 +196,7 @@ public class BasicAlloyRecipe implements IAlloyRecipe {
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getEnergyRequired() {
|
||||
public int getEnergyRequired() {
|
||||
return energyRequired;
|
||||
}
|
||||
|
||||
|
||||
@@ -21,9 +21,9 @@ import crazypants.enderio.machine.recipe.RecipeOutput;
|
||||
public class VanillaSmeltingRecipe implements IMachineRecipe {
|
||||
|
||||
// We will use the same energy as per a standard furnace.
|
||||
// To do the conversion between fuel burning and MJ, use the Stirling Gen
|
||||
// which produces one MJ per tick of burn time
|
||||
private static float MJ_PER_ITEM = TileEntityFurnace.getItemBurnTime(new ItemStack(Items.coal, 1, 0)) / 8;
|
||||
// To do the conversion between fuel burning and RF, use the Stirling Gen
|
||||
// which produces ten RF per tick of burn time
|
||||
private static int RF_PER_ITEM = TileEntityFurnace.getItemBurnTime(new ItemStack(Items.coal, 1, 0)) * 10 / 8 ;
|
||||
|
||||
private boolean enabled = true;
|
||||
|
||||
@@ -43,9 +43,9 @@ public class VanillaSmeltingRecipe implements IMachineRecipe {
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getEnergyRequired(MachineRecipeInput... inputs) {
|
||||
public int getEnergyRequired(MachineRecipeInput... inputs) {
|
||||
int numInputs = getNumInputs(inputs);
|
||||
return numInputs * MJ_PER_ITEM;
|
||||
return numInputs * RF_PER_ITEM;
|
||||
}
|
||||
|
||||
private int getNumInputs(MachineRecipeInput[] inputs) {
|
||||
@@ -165,7 +165,7 @@ public class VanillaSmeltingRecipe implements IMachineRecipe {
|
||||
List<IRecipe> result = new ArrayList<IRecipe>();
|
||||
Map<ItemStack, ItemStack> metaList = FurnaceRecipes.smelting().getSmeltingList();
|
||||
for (Entry<ItemStack, ItemStack> entry : metaList.entrySet()) {
|
||||
result.add(new Recipe(new RecipeInput(entry.getKey()), MJ_PER_ITEM, new RecipeOutput(entry.getValue())));
|
||||
result.add(new Recipe(new RecipeInput(entry.getKey()), RF_PER_ITEM, new RecipeOutput(entry.getValue())));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -84,8 +84,8 @@ public class TileCrafter extends AbstractMachineEntity {
|
||||
craftingGrid.copyRequiredInputs(required);
|
||||
if(hasRequiredInput(required)) {
|
||||
craftRecipe();
|
||||
double used = Math.min(powerHandler.getEnergyStored(), Config.crafterMjPerCraft);
|
||||
powerHandler.setEnergy(powerHandler.getEnergyStored() - used);
|
||||
int used = Math.min(getEnergyStored(), Config.crafterRfPerCraft);
|
||||
setEnergyStored(getEnergyStored() - used);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -180,11 +180,11 @@ public class CrusherRecipeManager {
|
||||
Log.info("Finished processing Alloy Smelter recipes. " + recipes.size() + " recipes avaliable.");
|
||||
}
|
||||
|
||||
public void addRecipe(ItemStack input, float energyCost, ItemStack output) {
|
||||
public void addRecipe(ItemStack input, int energyCost, ItemStack output) {
|
||||
addRecipe(input, energyCost, new RecipeOutput(output, 1));
|
||||
}
|
||||
|
||||
public void addRecipe(ItemStack input, float energyCost, RecipeOutput... output) {
|
||||
public void addRecipe(ItemStack input, int energyCost, RecipeOutput... output) {
|
||||
if(input == null || output == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -13,7 +13,6 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import buildcraft.api.power.PowerHandler.Type;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.ModObject;
|
||||
@@ -30,7 +29,6 @@ import crazypants.enderio.network.PacketHandler;
|
||||
import crazypants.enderio.power.BasicCapacitor;
|
||||
import crazypants.enderio.power.Capacitors;
|
||||
import crazypants.enderio.power.ICapacitor;
|
||||
import crazypants.enderio.power.PowerHandlerUtil;
|
||||
import crazypants.util.BlockCoord;
|
||||
import crazypants.util.Lang;
|
||||
import crazypants.util.Util;
|
||||
@@ -64,9 +62,7 @@ public class TileFarmStation extends AbstractPoweredTaskEntity /*
|
||||
|
||||
public TileFarmStation() {
|
||||
super(new SlotDefinition(6, 4, 1));
|
||||
currentTask = createTask();
|
||||
powerHandler = PowerHandlerUtil.createHandler(cap, this, Type.MACHINE);
|
||||
|
||||
currentTask = createTask();
|
||||
}
|
||||
|
||||
public int getFarmSize() {
|
||||
@@ -75,9 +71,9 @@ public class TileFarmStation extends AbstractPoweredTaskEntity /*
|
||||
|
||||
public void actionPerformed(boolean isAxe) {
|
||||
if(isAxe) {
|
||||
usePower(Config.farmAxeActionEnergyUse);
|
||||
usePower(Config.farmAxeActionEnergyUseRF);
|
||||
} else {
|
||||
usePower(Config.farmActionEnergyUse);
|
||||
usePower(Config.farmActionEnergyUseRF);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -521,7 +517,6 @@ public class TileFarmStation extends AbstractPoweredTaskEntity /*
|
||||
break;
|
||||
}
|
||||
tier = capacitorType.ordinal();
|
||||
powerHandler.configure(cap.getMinEnergyReceived(), cap.getMaxEnergyReceived(), cap.getMinActivationEnergy(), cap.getMaxEnergyStored());
|
||||
currentTask = createTask();
|
||||
}
|
||||
|
||||
@@ -531,8 +526,8 @@ public class TileFarmStation extends AbstractPoweredTaskEntity /*
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getPowerUsePerTick() {
|
||||
return Math.round(Config.farmContinuousEnergyUse * (getFarmSize()/(float)Config.farmDefaultSize ));
|
||||
public int getPowerUsePerTick() {
|
||||
return Math.round(Config.farmContinuousEnergyUseRF * (getFarmSize()/(float)Config.farmDefaultSize ));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -59,7 +59,7 @@ public class PlantableFarmer implements IFarmerJoe {
|
||||
}
|
||||
|
||||
IPlantable plantable = (IPlantable) seedStack.getItem();
|
||||
EnumPlantType type = plantable.getPlantType(farm.getWorld(), bc.x, bc.y, bc.z);
|
||||
EnumPlantType type = plantable.getPlantType(farm.getWorldObj(), bc.x, bc.y, bc.z);
|
||||
if(type == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -48,16 +48,16 @@ public class StemFarmer extends CustomSeedFarmer {
|
||||
harvestCoord = harvestCoord.getLocation(ForgeDirection.UP);
|
||||
if(plantedBlock == farm.getBlock(harvestCoord) && farm.hasDefaultHarvestTool()) {
|
||||
res.harvestedBlocks.add(harvestCoord);
|
||||
ArrayList<ItemStack> drops = plantedBlock.getDrops(farm.getWorld(), harvestCoord.x, harvestCoord.y, harvestCoord.z, meta, farm.getMaxLootingValue());
|
||||
ArrayList<ItemStack> drops = plantedBlock.getDrops(farm.getWorldObj(), harvestCoord.x, harvestCoord.y, harvestCoord.z, meta, farm.getMaxLootingValue());
|
||||
if(drops != null) {
|
||||
for(ItemStack drop : drops) {
|
||||
res.drops.add(new EntityItem(farm.getWorld(), bc.x + 0.5, bc.y + 0.5, bc.z + 0.5, drop.copy()));
|
||||
res.drops.add(new EntityItem(farm.getWorldObj(), bc.x + 0.5, bc.y + 0.5, bc.z + 0.5, drop.copy()));
|
||||
}
|
||||
|
||||
}
|
||||
farm.damageMaxLootingItem(1, harvestCoord, farm.getBlock(harvestCoord));
|
||||
farm.actionPerformed(false);
|
||||
farm.getWorld().setBlockToAir(harvestCoord.x, harvestCoord.y, harvestCoord.z);
|
||||
farm.getWorldObj().setBlockToAir(harvestCoord.x, harvestCoord.y, harvestCoord.z);
|
||||
} else {
|
||||
done = true;
|
||||
}
|
||||
|
||||
@@ -107,10 +107,10 @@ public class TreeFarmer implements IFarmerJoe {
|
||||
BlockCoord coord = res.harvestedBlocks.get(i);
|
||||
Block blk = farm.getBlock(coord);
|
||||
|
||||
ArrayList<ItemStack> drops = blk.getDrops(farm.getWorld(), bc.x, bc.y, bc.z, farm.getBlockMeta(coord), farm.getAxeLootingValue());
|
||||
ArrayList<ItemStack> drops = blk.getDrops(farm.getWorldObj(), bc.x, bc.y, bc.z, farm.getBlockMeta(coord), farm.getAxeLootingValue());
|
||||
if(drops != null) {
|
||||
for (ItemStack drop : drops) {
|
||||
res.drops.add(new EntityItem(farm.getWorld(), bc.x + 0.5, bc.y + 0.5, bc.z + 0.5, drop.copy()));
|
||||
res.drops.add(new EntityItem(farm.getWorldObj(), bc.x + 0.5, bc.y + 0.5, bc.z + 0.5, drop.copy()));
|
||||
}
|
||||
}
|
||||
boolean isWood = true;
|
||||
@@ -123,7 +123,7 @@ public class TreeFarmer implements IFarmerJoe {
|
||||
|
||||
if(canDropApple) {
|
||||
if(farm.getWorldObj().rand.nextInt(200) == 0) {
|
||||
res.drops.add(new EntityItem(farm.getWorld(), bc.x + 0.5, bc.y + 0.5, bc.z + 0.5, new ItemStack(Items.apple)));
|
||||
res.drops.add(new EntityItem(farm.getWorldObj(), bc.x + 0.5, bc.y + 0.5, bc.z + 0.5, new ItemStack(Items.apple)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user