Fix #2426 and #2408. Partially Fix #2345.

This commit is contained in:
Arona Jones 2015-02-02 21:16:17 +00:00
parent 5771b6b9e7
commit 671d964f33
7 changed files with 45 additions and 23 deletions

View file

@ -406,3 +406,7 @@ bc_update.new_version=§cNew version of BuildCraft available: %s for Minecraft %
bc_update.download=§cDownload from http://www.mod-buildcraft.com/download
bc_update.once=This message only displays once
bc_update.again=Type '/buildcraft version' if you want to see it again
command.buildcraft.version=BuildCraft %s for Minecraft %s (Latest: %s).
command.buildcraft.versioninfo=Version information.
command.buildcraft.available=Available Commands:

View file

@ -183,7 +183,7 @@ public class BuildCraftEnergy extends BuildCraftMod {
// Oil and fuel
if (!FluidRegistry.isFluidRegistered("oil")) {
buildcraftFluidOil = new Fluid("oil").setDensity(800).setViscosity(15000);
buildcraftFluidOil = new Fluid("oil").setDensity(800).setViscosity(10000);
FluidRegistry.registerFluid(buildcraftFluidOil);
} else {
BCLog.logger.warn("Not using BuildCraft oil - issues might occur!");

View file

@ -15,7 +15,7 @@ import net.minecraft.command.ICommand;
import net.minecraft.command.ICommandSender;
import net.minecraft.command.WrongUsageException;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.StatCollector;
import buildcraft.core.proxy.CoreProxy;
public class CommandBuildCraft extends CommandBase {
@ -58,8 +58,8 @@ public class CommandBuildCraft extends CommandBase {
return;
} else if (arguments[0].matches("help")) {
sender.addChatMessage(new ChatComponentText("Format: '" + this.getCommandName() + " <command> <arguments>'"));
sender.addChatMessage(new ChatComponentText("Available commands:"));
sender.addChatMessage(new ChatComponentText("- version : Version information."));
sender.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("command.buildcraft.available")));
sender.addChatMessage(new ChatComponentText(" - version :" + StatCollector.translateToLocal("command.buildcraft.versioninfo")));
return;
}
@ -69,7 +69,7 @@ public class CommandBuildCraft extends CommandBase {
private void commandVersion(ICommandSender sender, String[] arguments) {
String colour = Version.isOutdated() ? "\u00A7c" : "\u00A7a";
sender.addChatMessage(new ChatComponentText(String.format(colour + "BuildCraft %s for Minecraft %s (Latest: %s).", Version.getVersion(),
sender.addChatMessage(new ChatComponentText(String.format(colour + StatCollector.translateToLocal("command.buildcraft.version"), Version.getVersion(),
CoreProxy.proxy.getMinecraftVersion(), Version.getRecommendedVersion())));
// TODD This takes too much realstate. See how to improve

View file

@ -16,7 +16,7 @@ public final class DefaultProps {
public static final String DEPENDENCY_TRANSPORT = "required-after:BuildCraft|Transport@" + Version.VERSION;
public static final String NET_CHANNEL_NAME = "BC";
public static int NETWORK_UPDATE_RANGE = 128;
public static int NETWORK_UPDATE_RANGE = 64;
public static int PIPE_CONTENTS_RENDER_DIST = 24;
public static String TEXTURE_PATH_GUI = "textures/gui";

View file

@ -8,12 +8,12 @@
*/
package buildcraft.core.recipes;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import net.minecraftforge.fluids.FluidStack;
import buildcraft.BuildCraftCore;
import buildcraft.api.core.BCLog;
import buildcraft.api.recipes.IFlexibleRecipe;
@ -23,6 +23,8 @@ public final class RefineryRecipeManager implements IRefineryRecipeManager {
public static final RefineryRecipeManager INSTANCE = new RefineryRecipeManager();
private HashMap<String, IFlexibleRecipe<FluidStack>> recipes = new HashMap<String, IFlexibleRecipe<FluidStack>>();
private ArrayList<FluidStack> validFluids1 = new ArrayList();
private ArrayList<FluidStack> validFluids2 = new ArrayList();
private RefineryRecipeManager() {
}
@ -38,6 +40,7 @@ public final class RefineryRecipeManager implements IRefineryRecipeManager {
FlexibleRecipe<FluidStack> recipe = new FlexibleRecipe<FluidStack>(id, result, energy, delay, ingredient);
recipes.put(id, recipe);
validFluids1.add(ingredient);
}
@Override
@ -56,6 +59,8 @@ public final class RefineryRecipeManager implements IRefineryRecipeManager {
FlexibleRecipe<FluidStack> recipe = new FlexibleRecipe<FluidStack>(id, result, energy, delay, ingredient1,
ingredient2);
recipes.put(id, recipe);
validFluids1.add(ingredient1);
validFluids2.add(ingredient2);
}
@Override
@ -77,4 +82,13 @@ public final class RefineryRecipeManager implements IRefineryRecipeManager {
public void removeRecipe(String id) {
recipes.remove(id);
}
public ArrayList<FluidStack> getValidFluidStacks1()
{
return validFluids1;
}
public ArrayList<FluidStack> getValidFluidStacks2()
{
return validFluids2;
}
}

View file

@ -9,14 +9,12 @@
package buildcraft.factory;
import io.netty.buffer.ByteBuf;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.ICrafting;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidContainerRegistry;
@ -24,8 +22,8 @@ import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.FluidTankInfo;
import net.minecraftforge.fluids.IFluidHandler;
import buildcraft.BuildCraftCore;
import buildcraft.BuildCraftEnergy;
import buildcraft.api.core.SafeTimeTracker;
import buildcraft.api.recipes.CraftingResult;
import buildcraft.api.recipes.IFlexibleCrafter;
@ -62,6 +60,8 @@ public class TileRefinery extends TileBuildCraft implements IFluidHandler, IInve
public TileRefinery() {
super();
this.setBattery(new RFBattery(10000, 1500, 0));
this.tanks[0].setAcceptedFluid(BuildCraftEnergy.fluidOil);
this.tanks[1].setAcceptedFluid(BuildCraftEnergy.fluidOil);
}
@Override
@ -299,10 +299,14 @@ public class TileRefinery extends TileBuildCraft implements IFluidHandler, IInve
int used = 0;
FluidStack resourceUsing = resource.copy();
if(RefineryRecipeManager.INSTANCE.getValidFluidStacks1().contains(resource)) {
used += tanks[0].fill(resourceUsing, doFill);
resourceUsing.amount -= used;
}
if(RefineryRecipeManager.INSTANCE.getValidFluidStacks2().contains(resource)) {
used += tanks[1].fill(resourceUsing, doFill);
resourceUsing.amount -= used;
}
updateRecipe();
return used;