parent
5771b6b9e7
commit
671d964f33
7 changed files with 45 additions and 23 deletions
|
@ -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.download=§cDownload from http://www.mod-buildcraft.com/download
|
||||||
bc_update.once=This message only displays once
|
bc_update.once=This message only displays once
|
||||||
bc_update.again=Type '/buildcraft version' if you want to see it again
|
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:
|
||||||
|
|
|
@ -183,7 +183,7 @@ public class BuildCraftEnergy extends BuildCraftMod {
|
||||||
|
|
||||||
// Oil and fuel
|
// Oil and fuel
|
||||||
if (!FluidRegistry.isFluidRegistered("oil")) {
|
if (!FluidRegistry.isFluidRegistered("oil")) {
|
||||||
buildcraftFluidOil = new Fluid("oil").setDensity(800).setViscosity(15000);
|
buildcraftFluidOil = new Fluid("oil").setDensity(800).setViscosity(10000);
|
||||||
FluidRegistry.registerFluid(buildcraftFluidOil);
|
FluidRegistry.registerFluid(buildcraftFluidOil);
|
||||||
} else {
|
} else {
|
||||||
BCLog.logger.warn("Not using BuildCraft oil - issues might occur!");
|
BCLog.logger.warn("Not using BuildCraft oil - issues might occur!");
|
||||||
|
|
|
@ -15,7 +15,7 @@ import net.minecraft.command.ICommand;
|
||||||
import net.minecraft.command.ICommandSender;
|
import net.minecraft.command.ICommandSender;
|
||||||
import net.minecraft.command.WrongUsageException;
|
import net.minecraft.command.WrongUsageException;
|
||||||
import net.minecraft.util.ChatComponentText;
|
import net.minecraft.util.ChatComponentText;
|
||||||
|
import net.minecraft.util.StatCollector;
|
||||||
import buildcraft.core.proxy.CoreProxy;
|
import buildcraft.core.proxy.CoreProxy;
|
||||||
|
|
||||||
public class CommandBuildCraft extends CommandBase {
|
public class CommandBuildCraft extends CommandBase {
|
||||||
|
@ -58,8 +58,8 @@ public class CommandBuildCraft extends CommandBase {
|
||||||
return;
|
return;
|
||||||
} else if (arguments[0].matches("help")) {
|
} else if (arguments[0].matches("help")) {
|
||||||
sender.addChatMessage(new ChatComponentText("Format: '" + this.getCommandName() + " <command> <arguments>'"));
|
sender.addChatMessage(new ChatComponentText("Format: '" + this.getCommandName() + " <command> <arguments>'"));
|
||||||
sender.addChatMessage(new ChatComponentText("Available commands:"));
|
sender.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("command.buildcraft.available")));
|
||||||
sender.addChatMessage(new ChatComponentText("- version : Version information."));
|
sender.addChatMessage(new ChatComponentText(" - version :" + StatCollector.translateToLocal("command.buildcraft.versioninfo")));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ public class CommandBuildCraft extends CommandBase {
|
||||||
private void commandVersion(ICommandSender sender, String[] arguments) {
|
private void commandVersion(ICommandSender sender, String[] arguments) {
|
||||||
String colour = Version.isOutdated() ? "\u00A7c" : "\u00A7a";
|
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())));
|
CoreProxy.proxy.getMinecraftVersion(), Version.getRecommendedVersion())));
|
||||||
|
|
||||||
// TODD This takes too much realstate. See how to improve
|
// TODD This takes too much realstate. See how to improve
|
||||||
|
|
|
@ -16,7 +16,7 @@ public final class DefaultProps {
|
||||||
public static final String DEPENDENCY_TRANSPORT = "required-after:BuildCraft|Transport@" + Version.VERSION;
|
public static final String DEPENDENCY_TRANSPORT = "required-after:BuildCraft|Transport@" + Version.VERSION;
|
||||||
|
|
||||||
public static final String NET_CHANNEL_NAME = "BC";
|
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 int PIPE_CONTENTS_RENDER_DIST = 24;
|
||||||
|
|
||||||
public static String TEXTURE_PATH_GUI = "textures/gui";
|
public static String TEXTURE_PATH_GUI = "textures/gui";
|
||||||
|
|
|
@ -8,12 +8,12 @@
|
||||||
*/
|
*/
|
||||||
package buildcraft.core.recipes;
|
package buildcraft.core.recipes;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
import net.minecraftforge.fluids.FluidStack;
|
import net.minecraftforge.fluids.FluidStack;
|
||||||
|
|
||||||
import buildcraft.BuildCraftCore;
|
import buildcraft.BuildCraftCore;
|
||||||
import buildcraft.api.core.BCLog;
|
import buildcraft.api.core.BCLog;
|
||||||
import buildcraft.api.recipes.IFlexibleRecipe;
|
import buildcraft.api.recipes.IFlexibleRecipe;
|
||||||
|
@ -23,6 +23,8 @@ public final class RefineryRecipeManager implements IRefineryRecipeManager {
|
||||||
|
|
||||||
public static final RefineryRecipeManager INSTANCE = new RefineryRecipeManager();
|
public static final RefineryRecipeManager INSTANCE = new RefineryRecipeManager();
|
||||||
private HashMap<String, IFlexibleRecipe<FluidStack>> recipes = new HashMap<String, IFlexibleRecipe<FluidStack>>();
|
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() {
|
private RefineryRecipeManager() {
|
||||||
}
|
}
|
||||||
|
@ -38,6 +40,7 @@ public final class RefineryRecipeManager implements IRefineryRecipeManager {
|
||||||
|
|
||||||
FlexibleRecipe<FluidStack> recipe = new FlexibleRecipe<FluidStack>(id, result, energy, delay, ingredient);
|
FlexibleRecipe<FluidStack> recipe = new FlexibleRecipe<FluidStack>(id, result, energy, delay, ingredient);
|
||||||
recipes.put(id, recipe);
|
recipes.put(id, recipe);
|
||||||
|
validFluids1.add(ingredient);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -56,6 +59,8 @@ public final class RefineryRecipeManager implements IRefineryRecipeManager {
|
||||||
FlexibleRecipe<FluidStack> recipe = new FlexibleRecipe<FluidStack>(id, result, energy, delay, ingredient1,
|
FlexibleRecipe<FluidStack> recipe = new FlexibleRecipe<FluidStack>(id, result, energy, delay, ingredient1,
|
||||||
ingredient2);
|
ingredient2);
|
||||||
recipes.put(id, recipe);
|
recipes.put(id, recipe);
|
||||||
|
validFluids1.add(ingredient1);
|
||||||
|
validFluids2.add(ingredient2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -77,4 +82,13 @@ public final class RefineryRecipeManager implements IRefineryRecipeManager {
|
||||||
public void removeRecipe(String id) {
|
public void removeRecipe(String id) {
|
||||||
recipes.remove(id);
|
recipes.remove(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ArrayList<FluidStack> getValidFluidStacks1()
|
||||||
|
{
|
||||||
|
return validFluids1;
|
||||||
|
}
|
||||||
|
public ArrayList<FluidStack> getValidFluidStacks2()
|
||||||
|
{
|
||||||
|
return validFluids2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,14 +9,12 @@
|
||||||
package buildcraft.factory;
|
package buildcraft.factory;
|
||||||
|
|
||||||
import io.netty.buffer.ByteBuf;
|
import io.netty.buffer.ByteBuf;
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.inventory.Container;
|
import net.minecraft.inventory.Container;
|
||||||
import net.minecraft.inventory.ICrafting;
|
import net.minecraft.inventory.ICrafting;
|
||||||
import net.minecraft.inventory.IInventory;
|
import net.minecraft.inventory.IInventory;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
import net.minecraftforge.fluids.Fluid;
|
import net.minecraftforge.fluids.Fluid;
|
||||||
import net.minecraftforge.fluids.FluidContainerRegistry;
|
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||||
|
@ -24,8 +22,8 @@ import net.minecraftforge.fluids.FluidRegistry;
|
||||||
import net.minecraftforge.fluids.FluidStack;
|
import net.minecraftforge.fluids.FluidStack;
|
||||||
import net.minecraftforge.fluids.FluidTankInfo;
|
import net.minecraftforge.fluids.FluidTankInfo;
|
||||||
import net.minecraftforge.fluids.IFluidHandler;
|
import net.minecraftforge.fluids.IFluidHandler;
|
||||||
|
|
||||||
import buildcraft.BuildCraftCore;
|
import buildcraft.BuildCraftCore;
|
||||||
|
import buildcraft.BuildCraftEnergy;
|
||||||
import buildcraft.api.core.SafeTimeTracker;
|
import buildcraft.api.core.SafeTimeTracker;
|
||||||
import buildcraft.api.recipes.CraftingResult;
|
import buildcraft.api.recipes.CraftingResult;
|
||||||
import buildcraft.api.recipes.IFlexibleCrafter;
|
import buildcraft.api.recipes.IFlexibleCrafter;
|
||||||
|
@ -62,6 +60,8 @@ public class TileRefinery extends TileBuildCraft implements IFluidHandler, IInve
|
||||||
public TileRefinery() {
|
public TileRefinery() {
|
||||||
super();
|
super();
|
||||||
this.setBattery(new RFBattery(10000, 1500, 0));
|
this.setBattery(new RFBattery(10000, 1500, 0));
|
||||||
|
this.tanks[0].setAcceptedFluid(BuildCraftEnergy.fluidOil);
|
||||||
|
this.tanks[1].setAcceptedFluid(BuildCraftEnergy.fluidOil);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -299,10 +299,14 @@ public class TileRefinery extends TileBuildCraft implements IFluidHandler, IInve
|
||||||
int used = 0;
|
int used = 0;
|
||||||
FluidStack resourceUsing = resource.copy();
|
FluidStack resourceUsing = resource.copy();
|
||||||
|
|
||||||
|
if(RefineryRecipeManager.INSTANCE.getValidFluidStacks1().contains(resource)) {
|
||||||
used += tanks[0].fill(resourceUsing, doFill);
|
used += tanks[0].fill(resourceUsing, doFill);
|
||||||
resourceUsing.amount -= used;
|
resourceUsing.amount -= used;
|
||||||
|
}
|
||||||
|
if(RefineryRecipeManager.INSTANCE.getValidFluidStacks2().contains(resource)) {
|
||||||
used += tanks[1].fill(resourceUsing, doFill);
|
used += tanks[1].fill(resourceUsing, doFill);
|
||||||
|
resourceUsing.amount -= used;
|
||||||
|
}
|
||||||
updateRecipe();
|
updateRecipe();
|
||||||
|
|
||||||
return used;
|
return used;
|
||||||
|
|
Loading…
Reference in a new issue