Fixed a few bugs.

This commit is contained in:
brad-c committed 2013-08-12 21:13:45 +08:00
1 parent 0e893e449f
commit e6230dd33a
8 files changed
+24 -12

No files matched your search

+1 -1
View File
@@ -2,7 +2,7 @@
<classpath>
<classpathentry kind="src" path="common"/>
<classpathentry kind="src" path="resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
<classpathentry exported="true" kind="lib" path="lib/cglib-nodep-2.2.3.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/Minecraft"/>
<classpathentry kind="output" path="bin"/>
+1
View File
@@ -1,3 +1,4 @@
/bin
/build
/download
/.settings/org.eclipse.jdt.core.prefs
+1 -1
View File
@@ -18,7 +18,7 @@
<property name="mcpsrc.dir" value="${mcp.dir}/src"/>
<property name="mc.version" value="1.6.2"/>
<property name="forge.version" value="9.10.0.800"/>
<property name="forge.version" value="9.10.0.828"/>
<property name="project.version" value="0.1.0"/>
<property name="forge.name" value="minecraftforge-src-${mc.version}-${forge.version}.zip"/>
@@ -27,5 +27,7 @@ public interface ILiquidConduit extends IConduit, IFluidHandler {
boolean isExtractingFromDir(ForgeDirection dir);
void setExtractingFromDir(ForgeDirection dir, boolean extracting);
int fill(ForgeDirection from, FluidStack resource, boolean doFill, boolean doPush);
}
@@ -261,9 +261,14 @@ public class LiquidConduit extends AbstractConduit implements ILiquidConduit {
}
tank.setLiquid(liquidType);
}
@Override
public int fill(ForgeDirection from, FluidStack resource, boolean doFill) {
return fill(from, resource, doFill, true);
}
@Override
public int fill(ForgeDirection from, FluidStack resource, boolean doFill, boolean doPush) {
if (network == null) {
return 0;
}
@@ -276,10 +281,13 @@ public class LiquidConduit extends AbstractConduit implements ILiquidConduit {
if (recieveAmount <= 0) {
return 0;
}
// int maxPush = Math.min(recieveAmount, tank.getFluidAmount());
int maxPush = Math.max(0, recieveAmount + tank.getFluidAmount() - tank.getCapacity());
int pushedVolume = pushLiquid(from, maxPush, doFill);
int pushedVolume = 0;
if(doPush) {
int maxPush = Math.max(0, recieveAmount + tank.getFluidAmount() - tank.getCapacity());
pushedVolume = pushLiquid(from, maxPush, doFill);
}
if (doFill) {
tank.drain(pushedVolume, doFill);
return tank.fill(resource, doFill);
@@ -148,8 +148,8 @@ public class LiquidConduitNetwork extends AbstractConduitNetwork<ILiquidConduit>
if (con.getConduitConnections().contains(ForgeDirection.DOWN)) {
BlockCoord loc = con.getLocation().getLocation(ForgeDirection.DOWN);
ILiquidConduit downCon = ConduitUtil.getConduit(con.getBundle().getEntity().worldObj, loc.x, loc.y, loc.z, ILiquidConduit.class);
int filled = downCon.fill(ForgeDirection.UP, tank.getFluid().copy(), false);
tank.addAmount(-filled);
int filled = downCon.fill(ForgeDirection.UP, tank.getFluid().copy(), false, false);
tank.addAmount(-filled);
downCon.getTank().addAmount(filled);
}
@@ -34,9 +34,9 @@ public class PowerConduit extends AbstractConduit implements IPowerConduit {
static final Map<String, Icon> ICONS = new HashMap<String, Icon>();
static final ICapacitor[] CAPACITORS = new BasicCapacitor[] {
new BasicCapacitor(0, 64, 64, 0, 0, 0, 64),
new BasicCapacitor(0, 128, 128, 0, 0, 0, 128),
new BasicCapacitor(0, 1024, 1024, 0, 0, 0, 1024)
new BasicCapacitor(0, 64, 128, 0, 0, 0, 256),
new BasicCapacitor(0, 128, 256, 0, 0, 0, 1024),
new BasicCapacitor(0, 1024, 1024, 0, 0, 0, 2048)
};
static final String[] POSTFIX = new String[] { "", "Enhanced", "Ender" };
@@ -35,7 +35,8 @@ public class TileEntityPainter extends AbstractPoweredTaskEntity implements ISid
if (inventory[0] == null) {
return BasicPainterTemplate.isValidSourceDefault(itemStack);
}
return MachineRecipeRegistry.instance.getRecipeForInputs(getMachineName(), targetInput(), paintSource()) != null;
return MachineRecipeRegistry.instance.getRecipeForInputs(getMachineName(),
i == 0 ? RecipeInput.create(0, itemStack) : targetInput(), i == 1 ? RecipeInput.create(1, itemStack) : paintSource()) != null;
}
@Override