Merge branch '6.3.x' of github.com:BuildCraft/BuildCraft into 6.4.x

This commit is contained in:
asiekierka 2015-02-11 16:51:46 +01:00
commit 81fb40883f
28 changed files with 204 additions and 43 deletions

View file

@ -72,6 +72,7 @@ public class SchematicTile extends SchematicBlock {
if (tile != null) { if (tile != null) {
tile.writeToNBT(tileNBT); tile.writeToNBT(tileNBT);
} }
tileNBT = (NBTTagCompound) tileNBT.copy();
} }
} }

View file

@ -22,7 +22,7 @@ apply plugin: 'forge' // adds the forge dependency
apply plugin: 'maven' // for uploading to a maven repo apply plugin: 'maven' // for uploading to a maven repo
apply plugin: 'checkstyle' apply plugin: 'checkstyle'
version = "6.3.3" version = "6.3.6"
group= "com.mod-buildcraft" group= "com.mod-buildcraft"
archivesBaseName = "buildcraft" // the name that all artifacts will use as a base. artifacts names follow this pattern: [baseName]-[appendix]-[version]-[classifier].[extension] archivesBaseName = "buildcraft" // the name that all artifacts will use as a base. artifacts names follow this pattern: [baseName]-[appendix]-[version]-[classifier].[extension]

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.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:

Binary file not shown.

After

Width:  |  Height:  |  Size: 388 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 389 B

View file

@ -0,0 +1,5 @@
Bugfixes:
[#2425] Crash with Artifice (asie)
[#2423] Builders use uncolored pipes for colored pipes (asie)
[#2419] No RecipeSorter configuration for PipeColoringRecipe (asie)
[#2418] Searchbar crash in creative mode (asie)

View file

@ -0,0 +1,14 @@
Additions:
[#2430] Support for most BuildCraft Factory blocks in the Builder (hea3ven)
Polish localization update (nister6000)
Bugfixes:
[#2445] Edge case bugs in Auto Workbenches
[#2428] Massive Refinery bandwidth usage
[#2426] Refinery accepts fuel as input (warlordjones)
[#2422] Lists only use the first stack in each line (hea3ven)
[#2411] Accept Equivalents button does not sync properly in Lists (hea3ven)
[#2408] Too high oil viscosity (warlordjones)
[#2345] Partial localization for BC commands (warlordjones)
Assembly Table GUI synchronization broken

View file

@ -0,0 +1,2 @@
Bugfixes:
Revert Auto Workbench behaviour change

View file

@ -1,3 +1,3 @@
1.6.4:BuildCraft:4.2.2 1.6.4:BuildCraft:4.2.2
1.7.2:BuildCraft:6.0.16 1.7.2:BuildCraft:6.0.16
1.7.10:BuildCraft:6.3.3 1.7.10:BuildCraft:6.3.6

View file

@ -325,6 +325,7 @@ public class BuildCraftBuilders extends BuildCraftMod {
schemes.registerSchematicBlock(Blocks.furnace, SchematicRotateMeta.class, new int[]{2, 5, 3, 4}, true); schemes.registerSchematicBlock(Blocks.furnace, SchematicRotateMeta.class, new int[]{2, 5, 3, 4}, true);
schemes.registerSchematicBlock(Blocks.lit_furnace, SchematicRotateMeta.class, new int[]{2, 5, 3, 4}, true); schemes.registerSchematicBlock(Blocks.lit_furnace, SchematicRotateMeta.class, new int[]{2, 5, 3, 4}, true);
schemes.registerSchematicBlock(Blocks.chest, SchematicRotateMeta.class, new int[]{2, 5, 3, 4}, true); schemes.registerSchematicBlock(Blocks.chest, SchematicRotateMeta.class, new int[]{2, 5, 3, 4}, true);
schemes.registerSchematicBlock(Blocks.trapped_chest, SchematicRotateMeta.class, new int[]{2, 5, 3, 4}, true);
schemes.registerSchematicBlock(Blocks.dispenser, SchematicRotateMeta.class, new int[]{2, 5, 3, 4}, true); schemes.registerSchematicBlock(Blocks.dispenser, SchematicRotateMeta.class, new int[]{2, 5, 3, 4}, true);
schemes.registerSchematicBlock(Blocks.dropper, SchematicRotateMeta.class, new int[]{2, 5, 3, 4}, true); schemes.registerSchematicBlock(Blocks.dropper, SchematicRotateMeta.class, new int[]{2, 5, 3, 4}, true);

View file

@ -151,11 +151,11 @@ public class BuildCraftEnergy extends BuildCraftMod {
double fuelLavaMultiplier = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "fuel.lava.combustion", 1.0F, "adjust energy value of Lava in Combustion Engines").getDouble(1.0F); double fuelLavaMultiplier = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "fuel.lava.combustion", 1.0F, "adjust energy value of Lava in Combustion Engines").getDouble(1.0F);
double fuelOilMultiplier = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "fuel.oil.combustion", 1.0F, "adjust energy value of Oil in Combustion Engines").getDouble(1.0F); double fuelOilMultiplier = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "fuel.oil.combustion", 1.0F, "adjust energy value of Oil in Combustion Engines").getDouble(1.0F);
double fuelFuelMultiplier = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "fuel.fuel.combustion", 1.0F, "adjust energy value of Fuel in Combustion Engines").getDouble(1.0F); double fuelFuelMultiplier = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "fuel.fuel.combustion", 1.0F, "adjust energy value of Fuel in Combustion Engines").getDouble(1.0F);
int fuelLavaEnergyOutput = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "fuel.lava.combustion.energyOutput", 20, "adjust output energy by Lava in Combustion Engines").getInt(20); int fuelLavaEnergyOutput = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "fuel.lava.combustion.energyOutput", 20, "adjust output energy by Lava in Combustion Engines").getInt(20);
int fuelOilEnergyOutput = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "fuel.oil.combustion.energyOutput", 30, "adjust output energy by Oil in Combustion Engines").getInt(30); int fuelOilEnergyOutput = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "fuel.oil.combustion.energyOutput", 30, "adjust output energy by Oil in Combustion Engines").getInt(30);
int fuelFuelEnergyOutput = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "fuel.fuel.combustion.energyOutput", 60, "adjust output energy by Fuel in Combustion Engines").getInt(60); int fuelFuelEnergyOutput = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "fuel.fuel.combustion.energyOutput", 60, "adjust output energy by Fuel in Combustion Engines").getInt(60);
BuildCraftCore.mainConfiguration.save(); BuildCraftCore.mainConfiguration.save();
if (oilDesertBiomeId > 0) { if (oilDesertBiomeId > 0) {
@ -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!");
@ -349,7 +349,7 @@ public class BuildCraftEnergy extends BuildCraftMod {
NetworkRegistry.INSTANCE.registerGuiHandler(instance, new GuiHandler()); NetworkRegistry.INSTANCE.registerGuiHandler(instance, new GuiHandler());
StatementManager.registerTriggerProvider(new EnergyStatementProvider()); StatementManager.registerTriggerProvider(new EnergyStatementProvider());
BuilderAPI.schematicRegistry.registerSchematicBlock(engineBlock, SchematicEngine.class); BuilderAPI.schematicRegistry.registerSchematicBlock(engineBlock, SchematicEngine.class);
if (BuildCraftCore.loadDefaultRecipes) { if (BuildCraftCore.loadDefaultRecipes) {
@ -362,7 +362,7 @@ public class BuildCraftEnergy extends BuildCraftMod {
@Mod.EventHandler @Mod.EventHandler
public void postInit(FMLPostInitializationEvent evt) { public void postInit(FMLPostInitializationEvent evt) {
if (BuildCraftCore.modifyWorld) { if (BuildCraftCore.modifyWorld) {
MinecraftForge.EVENT_BUS.register(OilPopulate.INSTANCE); MinecraftForge.EVENT_BUS.register(OilPopulate.INSTANCE);
MinecraftForge.TERRAIN_GEN_BUS.register(new BiomeInitializer()); MinecraftForge.TERRAIN_GEN_BUS.register(new BiomeInitializer());

View file

@ -37,6 +37,7 @@ import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.common.config.Property; import net.minecraftforge.common.config.Property;
import buildcraft.api.blueprints.BuilderAPI; import buildcraft.api.blueprints.BuilderAPI;
import buildcraft.api.blueprints.SchematicTile;
import buildcraft.builders.schematics.SchematicIgnoreMeta; import buildcraft.builders.schematics.SchematicIgnoreMeta;
import buildcraft.compat.CompatHooks; import buildcraft.compat.CompatHooks;
import buildcraft.core.DefaultProps; import buildcraft.core.DefaultProps;
@ -68,9 +69,10 @@ import buildcraft.factory.TileQuarry;
import buildcraft.factory.TileRefinery; import buildcraft.factory.TileRefinery;
import buildcraft.factory.TileTank; import buildcraft.factory.TileTank;
import buildcraft.factory.network.PacketHandlerFactory; import buildcraft.factory.network.PacketHandlerFactory;
import buildcraft.factory.schematics.SchematicAutoWorkbench;
import buildcraft.factory.schematics.SchematicPump; import buildcraft.factory.schematics.SchematicPump;
import buildcraft.factory.schematics.SchematicRefinery; import buildcraft.factory.schematics.SchematicRefinery;
import buildcraft.factory.schematics.SchematicTank; import buildcraft.factory.schematics.SchematicTileIgnoreState;
@Mod(name = "BuildCraft Factory", version = Version.VERSION, useMetadata = false, modid = "BuildCraft|Factory", dependencies = DefaultProps.DEPENDENCY_CORE) @Mod(name = "BuildCraft Factory", version = Version.VERSION, useMetadata = false, modid = "BuildCraft|Factory", dependencies = DefaultProps.DEPENDENCY_CORE)
public class BuildCraftFactory extends BuildCraftMod { public class BuildCraftFactory extends BuildCraftMod {
@ -160,9 +162,13 @@ public class BuildCraftFactory extends BuildCraftMod {
FactoryProxy.proxy.initializeTileEntities(); FactoryProxy.proxy.initializeTileEntities();
BuilderAPI.schematicRegistry.registerSchematicBlock(refineryBlock, SchematicRefinery.class); BuilderAPI.schematicRegistry.registerSchematicBlock(refineryBlock, SchematicRefinery.class);
BuilderAPI.schematicRegistry.registerSchematicBlock(tankBlock, SchematicTank.class); BuilderAPI.schematicRegistry.registerSchematicBlock(tankBlock, SchematicTileIgnoreState.class);
BuilderAPI.schematicRegistry.registerSchematicBlock(frameBlock, SchematicIgnoreMeta.class); BuilderAPI.schematicRegistry.registerSchematicBlock(frameBlock, SchematicIgnoreMeta.class);
BuilderAPI.schematicRegistry.registerSchematicBlock(pumpBlock, SchematicPump.class); BuilderAPI.schematicRegistry.registerSchematicBlock(pumpBlock, SchematicPump.class);
BuilderAPI.schematicRegistry.registerSchematicBlock(miningWellBlock, SchematicTileIgnoreState.class);
BuilderAPI.schematicRegistry.registerSchematicBlock(floodGateBlock, SchematicTileIgnoreState.class);
BuilderAPI.schematicRegistry.registerSchematicBlock(autoWorkbenchBlock, SchematicAutoWorkbench.class);
BuilderAPI.schematicRegistry.registerSchematicBlock(hopperBlock, SchematicTile.class);
if (BuildCraftCore.loadDefaultRecipes) { if (BuildCraftCore.loadDefaultRecipes) {
loadRecipes(); loadRecipes();

View file

@ -506,6 +506,7 @@ public class BuildCraftTransport extends BuildCraftMod {
} }
GameRegistry.addRecipe(new PipeColoringRecipe()); GameRegistry.addRecipe(new PipeColoringRecipe());
RecipeSorter.register("buildcraft:pipecoloring", PipeColoringRecipe.class, RecipeSorter.Category.SHAPELESS, "after:minecraft:shapeless");
CoreProxy.proxy.addCraftingRecipe(new ItemStack(filteredBufferBlock, 1), CoreProxy.proxy.addCraftingRecipe(new ItemStack(filteredBufferBlock, 1),
"wdw", "wcw", "wpw", 'w', "plankWood", 'd', "wdw", "wcw", "wpw", 'w', "plankWood", 'd',

View file

@ -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

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 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";

View file

@ -77,14 +77,18 @@ public class ItemList extends ItemBuildCraft {
stacks[slot].stackSize = 1; stacks[slot].stackSize = 1;
} }
if (FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT && slot == 0) { if (slot == 0) {
relatedItems.clear(); relatedItems.clear();
ores.clear(); ores.clear();
if (stack == null) { if (stack == null) {
isOre = false; isOre = false;
} else { } else {
setClientPreviewLists(); if (FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT) {
setClientPreviewLists();
} else {
isOre = OreDictionary.getOreIDs(stacks[0]).length > 0;
}
} }
} }
} }
@ -199,7 +203,7 @@ public class ItemList extends ItemBuildCraft {
return oreMatch(stacks[0], item); return oreMatch(stacks[0], item);
} else { } else {
for (ItemStack stack : stacks) { for (ItemStack stack : stacks) {
if (stack != null && StackHelper.isMatchingItemOrList(stacks[0], item)) { if (stack != null && StackHelper.isMatchingItemOrList(stack, item)) {
return true; return true;
} }
} }

View file

@ -98,5 +98,8 @@ public final class InventoryConcatenator implements IInventory {
@Override @Override
public void markDirty() { public void markDirty() {
for (IInventory inv : invMap) {
inv.markDirty();
}
} }
} }

View file

@ -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
@ -48,7 +51,7 @@ public final class RefineryRecipeManager implements IRefineryRecipeManager {
if (BuildCraftCore.recipesBlacklist.contains(name)) { if (BuildCraftCore.recipesBlacklist.contains(name)) {
return; return;
} }
if (ingredient1 == null || ingredient2 == null || result == null) { if (ingredient1 == null || ingredient2 == null || result == null) {
BCLog.logger.warn("Rejected refinery recipe " + id + " due to a null FluidStack!"); BCLog.logger.warn("Rejected refinery recipe " + id + " due to a null FluidStack!");
} }
@ -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
@ -67,7 +72,7 @@ public final class RefineryRecipeManager implements IRefineryRecipeManager {
public IFlexibleRecipe<FluidStack> getRecipe(String id) { public IFlexibleRecipe<FluidStack> getRecipe(String id) {
return recipes.get(id); return recipes.get(id);
} }
@Override @Override
public void removeRecipe(IFlexibleRecipe<FluidStack> recipe) { public void removeRecipe(IFlexibleRecipe<FluidStack> recipe) {
removeRecipe(recipe.getId()); removeRecipe(recipe.getId());
@ -77,4 +82,12 @@ 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;
}
} }

View file

@ -75,7 +75,7 @@ public class BlockMiner {
public void invalidate() { public void invalidate() {
world.destroyBlockInWorldPartially(minerId, x, y, z, -1); world.destroyBlockInWorldPartially(minerId, x, y, z, -1);
} }
public int acceptEnergy(int offeredAmount) { public int acceptEnergy(int offeredAmount) {
energyRequired = BlockUtils.computeBlockBreakEnergy(world, x, y, z); energyRequired = BlockUtils.computeBlockBreakEnergy(world, x, y, z);

View file

@ -98,6 +98,12 @@ public class TileAutoWorkbench extends TileBuildCraft implements ISidedInventory
return CoreProxy.proxy.getBuildCraftPlayer((WorldServer) worldObj, xCoord, yCoord + 1, zCoord); return CoreProxy.proxy.getBuildCraftPlayer((WorldServer) worldObj, xCoord, yCoord + 1, zCoord);
} }
@Override
public void markDirty() {
super.markDirty();
inv.markDirty();
}
@Override @Override
public int getSizeInventory() { public int getSizeInventory() {
return 10; return 10;
@ -214,9 +220,11 @@ public class TileAutoWorkbench extends TileBuildCraft implements ISidedInventory
if (craftSlot == null) { if (craftSlot == null) {
craftSlot = new SlotCrafting(getInternalPlayer().get(), craftMatrix, craftResult, 0, 0, 0); craftSlot = new SlotCrafting(getInternalPlayer().get(), craftMatrix, craftResult, 0, 0, 0);
} }
if (resultInv.getStackInSlot(SLOT_RESULT) != null) { if (resultInv.getStackInSlot(SLOT_RESULT) != null) {
return; return;
} }
update++; update++;
if (update % UPDATE_TIME == 0) { if (update % UPDATE_TIME == 0) {
updateCrafting(); updateCrafting();

View file

@ -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,8 +60,10 @@ 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
public int getSizeInventory() { public int getSizeInventory() {
return 0; return 0;
@ -178,7 +178,7 @@ public class TileRefinery extends TileBuildCraft implements IFluidHandler, IInve
public boolean hasWork() { public boolean hasWork() {
return isActive; return isActive;
} }
@Override @Override
public void readFromNBT(NBTTagCompound data) { public void readFromNBT(NBTTagCompound data) {
super.readFromNBT(data); super.readFromNBT(data);
@ -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();
used += tanks[0].fill(resourceUsing, doFill); if (RefineryRecipeManager.INSTANCE.getValidFluidStacks1().contains(resource)) {
resourceUsing.amount -= used; used += tanks[0].fill(resourceUsing, doFill);
used += tanks[1].fill(resourceUsing, doFill); resourceUsing.amount -= used;
}
if (RefineryRecipeManager.INSTANCE.getValidFluidStacks2().contains(resource)) {
used += tanks[1].fill(resourceUsing, doFill);
resourceUsing.amount -= used;
}
updateRecipe(); updateRecipe();
return used; return used;
@ -330,8 +334,6 @@ public class TileRefinery extends TileBuildCraft implements IFluidHandler, IInve
break; break;
} }
} }
sendNetworkUpdate();
} }
@Override @Override

View file

@ -0,0 +1,82 @@
/**
* Copyright (c) 2011-2014, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
*
* BuildCraft is distributed under the terms of the Minecraft Mod Public
* License 1.0, or MMPL. Please check the contents of the license located in
* http://www.mod-buildcraft.com/MMPL-1.0.txt
*/
package buildcraft.factory.schematics;
import java.util.ArrayList;
import java.util.LinkedList;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.ForgeDirection;
import buildcraft.BuildCraftFactory;
import buildcraft.api.blueprints.IBuilderContext;
import buildcraft.api.blueprints.SchematicTile;
import buildcraft.api.core.IInvSlot;
import buildcraft.api.core.JavaTools;
import buildcraft.core.inventory.InventoryIterator;
import buildcraft.factory.TileAutoWorkbench;
public class SchematicAutoWorkbench extends SchematicTile {
@Override
public void storeRequirements(IBuilderContext context, int x, int y, int z) {
TileAutoWorkbench autoWb = getTile(context, x, y, z);
if (autoWb != null) {
ArrayList<ItemStack> rqs = new ArrayList<ItemStack>();
rqs.add(new ItemStack(BuildCraftFactory.autoWorkbenchBlock));
for (IInvSlot slot : InventoryIterator.getIterable(autoWb.craftMatrix, ForgeDirection.UP)) {
ItemStack stack = slot.getStackInSlot();
if (stack != null) {
stack = stack.copy();
stack.stackSize = 1;
rqs.add(stack);
}
}
storedRequirements = JavaTools.concat(storedRequirements, rqs
.toArray(new ItemStack[rqs.size()]));
}
}
@Override
public void initializeFromObjectAt(IBuilderContext context, int x, int y, int z) {
super.initializeFromObjectAt(context, x, y, z);
tileNBT.removeTag("Items");
}
@Override
public void placeInWorld(IBuilderContext context, int x, int y, int z, LinkedList<ItemStack> stacks) {
super.placeInWorld(context, x, y, z, stacks);
TileAutoWorkbench autoWb = getTile(context, x, y, z);
if (autoWb != null) {
for (IInvSlot slot : InventoryIterator.getIterable(autoWb.craftMatrix, ForgeDirection.UP)) {
ItemStack stack = slot.getStackInSlot();
if (stack != null) {
stack.stackSize = 1;
}
}
}
}
@Override
public BuildingStage getBuildStage() {
return BuildingStage.STANDALONE;
}
private TileAutoWorkbench getTile(IBuilderContext context, int x, int y, int z) {
TileEntity tile = context.world().getTileEntity(x, y, z);
if (tile != null && tile instanceof TileAutoWorkbench) {
return (TileAutoWorkbench) tile;
}
return null;
}
}

View file

@ -15,7 +15,7 @@ import net.minecraft.item.ItemStack;
import buildcraft.api.blueprints.IBuilderContext; import buildcraft.api.blueprints.IBuilderContext;
import buildcraft.api.blueprints.SchematicTile; import buildcraft.api.blueprints.SchematicTile;
public class SchematicTank extends SchematicTile { public class SchematicTileIgnoreState extends SchematicTile {
@Override @Override
public void getRequirementsForPlacement(IBuilderContext context, LinkedList<ItemStack> requirements) { public void getRequirementsForPlacement(IBuilderContext context, LinkedList<ItemStack> requirements) {

View file

@ -46,6 +46,7 @@ public class TileAssemblyTable extends TileLaserTableBase implements IInventory,
public String currentRecipeId = ""; public String currentRecipeId = "";
public IFlexibleRecipe<ItemStack> currentRecipe; public IFlexibleRecipe<ItemStack> currentRecipe;
private HashSet<String> plannedOutput = new HashSet<String>(); private HashSet<String> plannedOutput = new HashSet<String>();
private boolean queuedNetworkUpdate = false;
public List<CraftingResult<ItemStack>> getPotentialOutputs() { public List<CraftingResult<ItemStack>> getPotentialOutputs() {
List<CraftingResult<ItemStack>> result = new LinkedList<CraftingResult<ItemStack>>(); List<CraftingResult<ItemStack>> result = new LinkedList<CraftingResult<ItemStack>>();
@ -61,6 +62,10 @@ public class TileAssemblyTable extends TileLaserTableBase implements IInventory,
return result; return result;
} }
private void queueNetworkUpdate() {
queuedNetworkUpdate = true;
}
@Override @Override
public boolean canUpdate() { public boolean canUpdate() {
return !FMLCommonHandler.instance().getEffectiveSide().isClient(); return !FMLCommonHandler.instance().getEffectiveSide().isClient();
@ -70,6 +75,11 @@ public class TileAssemblyTable extends TileLaserTableBase implements IInventory,
public void updateEntity() { // WARNING: run only server-side, see canUpdate() public void updateEntity() { // WARNING: run only server-side, see canUpdate()
super.updateEntity(); super.updateEntity();
if (queuedNetworkUpdate) {
sendNetworkUpdate();
queuedNetworkUpdate = false;
}
if (currentRecipe == null) { if (currentRecipe == null) {
return; return;
} }
@ -145,6 +155,8 @@ public class TileAssemblyTable extends TileLaserTableBase implements IInventory,
for (int i = 0; i < size; i++) { for (int i = 0; i < size; i++) {
plannedOutput.add(Utils.readUTF(stream)); plannedOutput.add(Utils.readUTF(stream));
} }
currentRecipe = AssemblyRecipeManager.INSTANCE.getRecipe(currentRecipeId);
} }
@Override @Override
@ -155,8 +167,6 @@ public class TileAssemblyTable extends TileLaserTableBase implements IInventory,
for (String s: plannedOutput) { for (String s: plannedOutput) {
Utils.writeUTF(stream, s); Utils.writeUTF(stream, s);
} }
currentRecipe = AssemblyRecipeManager.INSTANCE.getRecipe(currentRecipeId);
} }
@Override @Override
public void readFromNBT(NBTTagCompound nbt) { public void readFromNBT(NBTTagCompound nbt) {
@ -220,7 +230,7 @@ public class TileAssemblyTable extends TileLaserTableBase implements IInventory,
} }
if (worldObj != null && !worldObj.isRemote) { if (worldObj != null && !worldObj.isRemote) {
sendNetworkUpdate(); queueNetworkUpdate();
} }
} }
@ -246,6 +256,8 @@ public class TileAssemblyTable extends TileLaserTableBase implements IInventory,
if (!isAssembling(currentRecipe) || !isPlanned(currentRecipe)) { if (!isAssembling(currentRecipe) || !isPlanned(currentRecipe)) {
setCurrentRecipe(recipe); setCurrentRecipe(recipe);
} }
queueNetworkUpdate();
} }
} }
@ -259,6 +271,8 @@ public class TileAssemblyTable extends TileLaserTableBase implements IInventory,
if (!plannedOutput.isEmpty()) { if (!plannedOutput.isEmpty()) {
setCurrentRecipe(AssemblyRecipeManager.INSTANCE.getRecipe(plannedOutput.iterator().next())); setCurrentRecipe(AssemblyRecipeManager.INSTANCE.getRecipe(plannedOutput.iterator().next()));
} }
queueNetworkUpdate();
} }
public void setNextCurrentRecipe() { public void setNextCurrentRecipe() {
@ -319,8 +333,6 @@ public class TileAssemblyTable extends TileLaserTableBase implements IInventory,
cancelPlanOutput(recipe); cancelPlanOutput(recipe);
} }
} }
sendNetworkUpdate();
} }
} }

View file

@ -432,9 +432,9 @@ public class BlockGenericPipe extends BlockBuildCraft {
pipeRemoved.put(new BlockIndex(x, y, z), pipe); pipeRemoved.put(new BlockIndex(x, y, z), pipe);
world.removeTileEntity(x, y, z); world.removeTileEntity(x, y, z);
if (pipe != null) {
updateNeighbourSignalState(pipe); updateNeighbourSignalState(pipe);
}
} }
@Override @Override

View file

@ -171,7 +171,7 @@ public class ItemFacade extends ItemBuildCraft implements IFacadeItem, IPipePlug
@Override @Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean debug) { public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean debug) {
for (FacadeState state : getFacadeStates(stack)) { for (FacadeState state : getFacadeStates(stack)) {
if (!state.transparent && state.block != null) { if (state != null && !state.transparent && state.block != null && Item.getItemFromBlock(state.block) != null) {
Item.getItemFromBlock(state.block).addInformation(new ItemStack(state.block, 1, state.metadata), player, list, debug); Item.getItemFromBlock(state.block).addInformation(new ItemStack(state.block, 1, state.metadata), player, list, debug);
} }
} }

View file

@ -230,6 +230,9 @@ public class PipeTransportItems extends PipeTransport {
if (entity instanceof IPipeTile) { if (entity instanceof IPipeTile) {
Pipe<?> pipe = (Pipe<?>) ((IPipeTile) entity).getPipe(); Pipe<?> pipe = (Pipe<?>) ((IPipeTile) entity).getPipe();
if (pipe == null || pipe.transport == null) {
return false;
}
if (pipe == null || pipe.transport == null) { if (pipe == null || pipe.transport == null) {
return false; return false;

View file

@ -183,7 +183,7 @@ public class SchematicPipe extends SchematicTile {
storedRequirements = new ItemStack[items.size() + 1]; storedRequirements = new ItemStack[items.size() + 1];
items.toArray(storedRequirements); items.toArray(storedRequirements);
storedRequirements[storedRequirements.length - 1] = new ItemStack( storedRequirements[storedRequirements.length - 1] = new ItemStack(
pipe.item); pipe.item, 1, pipe.container.getItemMetadata());
} }
} }