Merge branch '6.3.x' of github.com:BuildCraft/BuildCraft into 6.4.x
This commit is contained in:
commit
81fb40883f
|
@ -72,6 +72,7 @@ public class SchematicTile extends SchematicBlock {
|
|||
if (tile != null) {
|
||||
tile.writeToNBT(tileNBT);
|
||||
}
|
||||
tileNBT = (NBTTagCompound) tileNBT.copy();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ apply plugin: 'forge' // adds the forge dependency
|
|||
apply plugin: 'maven' // for uploading to a maven repo
|
||||
apply plugin: 'checkstyle'
|
||||
|
||||
version = "6.3.3"
|
||||
version = "6.3.6"
|
||||
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]
|
||||
|
||||
|
|
|
@ -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:
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 388 B |
Binary file not shown.
After Width: | Height: | Size: 389 B |
5
buildcraft_resources/changelog/6.3.4
Normal file
5
buildcraft_resources/changelog/6.3.4
Normal 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)
|
14
buildcraft_resources/changelog/6.3.5
Normal file
14
buildcraft_resources/changelog/6.3.5
Normal 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
|
||||
|
2
buildcraft_resources/changelog/6.3.6
Normal file
2
buildcraft_resources/changelog/6.3.6
Normal file
|
@ -0,0 +1,2 @@
|
|||
Bugfixes:
|
||||
Revert Auto Workbench behaviour change
|
|
@ -1,3 +1,3 @@
|
|||
1.6.4:BuildCraft:4.2.2
|
||||
1.7.2:BuildCraft:6.0.16
|
||||
1.7.10:BuildCraft:6.3.3
|
||||
1.7.10:BuildCraft:6.3.6
|
||||
|
|
|
@ -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.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.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.dropper, SchematicRotateMeta.class, new int[]{2, 5, 3, 4}, true);
|
||||
|
||||
|
|
|
@ -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 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);
|
||||
|
||||
|
||||
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 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();
|
||||
|
||||
if (oilDesertBiomeId > 0) {
|
||||
|
@ -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!");
|
||||
|
@ -349,7 +349,7 @@ public class BuildCraftEnergy extends BuildCraftMod {
|
|||
NetworkRegistry.INSTANCE.registerGuiHandler(instance, new GuiHandler());
|
||||
|
||||
StatementManager.registerTriggerProvider(new EnergyStatementProvider());
|
||||
|
||||
|
||||
BuilderAPI.schematicRegistry.registerSchematicBlock(engineBlock, SchematicEngine.class);
|
||||
|
||||
if (BuildCraftCore.loadDefaultRecipes) {
|
||||
|
@ -362,7 +362,7 @@ public class BuildCraftEnergy extends BuildCraftMod {
|
|||
|
||||
@Mod.EventHandler
|
||||
public void postInit(FMLPostInitializationEvent evt) {
|
||||
|
||||
|
||||
if (BuildCraftCore.modifyWorld) {
|
||||
MinecraftForge.EVENT_BUS.register(OilPopulate.INSTANCE);
|
||||
MinecraftForge.TERRAIN_GEN_BUS.register(new BiomeInitializer());
|
||||
|
|
|
@ -37,6 +37,7 @@ import net.minecraftforge.common.config.Configuration;
|
|||
import net.minecraftforge.common.config.Property;
|
||||
|
||||
import buildcraft.api.blueprints.BuilderAPI;
|
||||
import buildcraft.api.blueprints.SchematicTile;
|
||||
import buildcraft.builders.schematics.SchematicIgnoreMeta;
|
||||
import buildcraft.compat.CompatHooks;
|
||||
import buildcraft.core.DefaultProps;
|
||||
|
@ -68,9 +69,10 @@ import buildcraft.factory.TileQuarry;
|
|||
import buildcraft.factory.TileRefinery;
|
||||
import buildcraft.factory.TileTank;
|
||||
import buildcraft.factory.network.PacketHandlerFactory;
|
||||
import buildcraft.factory.schematics.SchematicAutoWorkbench;
|
||||
import buildcraft.factory.schematics.SchematicPump;
|
||||
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)
|
||||
public class BuildCraftFactory extends BuildCraftMod {
|
||||
|
@ -160,9 +162,13 @@ public class BuildCraftFactory extends BuildCraftMod {
|
|||
FactoryProxy.proxy.initializeTileEntities();
|
||||
|
||||
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(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) {
|
||||
loadRecipes();
|
||||
|
|
|
@ -506,6 +506,7 @@ public class BuildCraftTransport extends BuildCraftMod {
|
|||
}
|
||||
|
||||
GameRegistry.addRecipe(new PipeColoringRecipe());
|
||||
RecipeSorter.register("buildcraft:pipecoloring", PipeColoringRecipe.class, RecipeSorter.Category.SHAPELESS, "after:minecraft:shapeless");
|
||||
|
||||
CoreProxy.proxy.addCraftingRecipe(new ItemStack(filteredBufferBlock, 1),
|
||||
"wdw", "wcw", "wpw", 'w', "plankWood", 'd',
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -77,14 +77,18 @@ public class ItemList extends ItemBuildCraft {
|
|||
stacks[slot].stackSize = 1;
|
||||
}
|
||||
|
||||
if (FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT && slot == 0) {
|
||||
if (slot == 0) {
|
||||
relatedItems.clear();
|
||||
ores.clear();
|
||||
|
||||
if (stack == null) {
|
||||
isOre = false;
|
||||
} 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);
|
||||
} else {
|
||||
for (ItemStack stack : stacks) {
|
||||
if (stack != null && StackHelper.isMatchingItemOrList(stacks[0], item)) {
|
||||
if (stack != null && StackHelper.isMatchingItemOrList(stack, item)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -98,5 +98,8 @@ public final class InventoryConcatenator implements IInventory {
|
|||
|
||||
@Override
|
||||
public void markDirty() {
|
||||
for (IInventory inv : invMap) {
|
||||
inv.markDirty();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
@ -48,7 +51,7 @@ public final class RefineryRecipeManager implements IRefineryRecipeManager {
|
|||
if (BuildCraftCore.recipesBlacklist.contains(name)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (ingredient1 == null || ingredient2 == null || result == null) {
|
||||
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,
|
||||
ingredient2);
|
||||
recipes.put(id, recipe);
|
||||
validFluids1.add(ingredient1);
|
||||
validFluids2.add(ingredient2);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -67,7 +72,7 @@ public final class RefineryRecipeManager implements IRefineryRecipeManager {
|
|||
public IFlexibleRecipe<FluidStack> getRecipe(String id) {
|
||||
return recipes.get(id);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void removeRecipe(IFlexibleRecipe<FluidStack> recipe) {
|
||||
removeRecipe(recipe.getId());
|
||||
|
@ -77,4 +82,12 @@ 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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -75,7 +75,7 @@ public class BlockMiner {
|
|||
public void invalidate() {
|
||||
world.destroyBlockInWorldPartially(minerId, x, y, z, -1);
|
||||
}
|
||||
|
||||
|
||||
public int acceptEnergy(int offeredAmount) {
|
||||
energyRequired = BlockUtils.computeBlockBreakEnergy(world, x, y, z);
|
||||
|
||||
|
|
|
@ -98,6 +98,12 @@ public class TileAutoWorkbench extends TileBuildCraft implements ISidedInventory
|
|||
return CoreProxy.proxy.getBuildCraftPlayer((WorldServer) worldObj, xCoord, yCoord + 1, zCoord);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void markDirty() {
|
||||
super.markDirty();
|
||||
inv.markDirty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSizeInventory() {
|
||||
return 10;
|
||||
|
@ -214,9 +220,11 @@ public class TileAutoWorkbench extends TileBuildCraft implements ISidedInventory
|
|||
if (craftSlot == null) {
|
||||
craftSlot = new SlotCrafting(getInternalPlayer().get(), craftMatrix, craftResult, 0, 0, 0);
|
||||
}
|
||||
|
||||
if (resultInv.getStackInSlot(SLOT_RESULT) != null) {
|
||||
return;
|
||||
}
|
||||
|
||||
update++;
|
||||
if (update % UPDATE_TIME == 0) {
|
||||
updateCrafting();
|
||||
|
|
|
@ -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,8 +60,10 @@ 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
|
||||
public int getSizeInventory() {
|
||||
return 0;
|
||||
|
@ -178,7 +178,7 @@ public class TileRefinery extends TileBuildCraft implements IFluidHandler, IInve
|
|||
public boolean hasWork() {
|
||||
return isActive;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound data) {
|
||||
super.readFromNBT(data);
|
||||
|
@ -299,10 +299,14 @@ public class TileRefinery extends TileBuildCraft implements IFluidHandler, IInve
|
|||
int used = 0;
|
||||
FluidStack resourceUsing = resource.copy();
|
||||
|
||||
used += tanks[0].fill(resourceUsing, doFill);
|
||||
resourceUsing.amount -= used;
|
||||
used += tanks[1].fill(resourceUsing, doFill);
|
||||
|
||||
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;
|
||||
|
@ -330,8 +334,6 @@ public class TileRefinery extends TileBuildCraft implements IFluidHandler, IInve
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
sendNetworkUpdate();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
|
@ -15,7 +15,7 @@ import net.minecraft.item.ItemStack;
|
|||
import buildcraft.api.blueprints.IBuilderContext;
|
||||
import buildcraft.api.blueprints.SchematicTile;
|
||||
|
||||
public class SchematicTank extends SchematicTile {
|
||||
public class SchematicTileIgnoreState extends SchematicTile {
|
||||
|
||||
@Override
|
||||
public void getRequirementsForPlacement(IBuilderContext context, LinkedList<ItemStack> requirements) {
|
|
@ -46,6 +46,7 @@ public class TileAssemblyTable extends TileLaserTableBase implements IInventory,
|
|||
public String currentRecipeId = "";
|
||||
public IFlexibleRecipe<ItemStack> currentRecipe;
|
||||
private HashSet<String> plannedOutput = new HashSet<String>();
|
||||
private boolean queuedNetworkUpdate = false;
|
||||
|
||||
public List<CraftingResult<ItemStack>> getPotentialOutputs() {
|
||||
List<CraftingResult<ItemStack>> result = new LinkedList<CraftingResult<ItemStack>>();
|
||||
|
@ -61,6 +62,10 @@ public class TileAssemblyTable extends TileLaserTableBase implements IInventory,
|
|||
return result;
|
||||
}
|
||||
|
||||
private void queueNetworkUpdate() {
|
||||
queuedNetworkUpdate = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUpdate() {
|
||||
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()
|
||||
super.updateEntity();
|
||||
|
||||
if (queuedNetworkUpdate) {
|
||||
sendNetworkUpdate();
|
||||
queuedNetworkUpdate = false;
|
||||
}
|
||||
|
||||
if (currentRecipe == null) {
|
||||
return;
|
||||
}
|
||||
|
@ -145,6 +155,8 @@ public class TileAssemblyTable extends TileLaserTableBase implements IInventory,
|
|||
for (int i = 0; i < size; i++) {
|
||||
plannedOutput.add(Utils.readUTF(stream));
|
||||
}
|
||||
|
||||
currentRecipe = AssemblyRecipeManager.INSTANCE.getRecipe(currentRecipeId);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -155,8 +167,6 @@ public class TileAssemblyTable extends TileLaserTableBase implements IInventory,
|
|||
for (String s: plannedOutput) {
|
||||
Utils.writeUTF(stream, s);
|
||||
}
|
||||
|
||||
currentRecipe = AssemblyRecipeManager.INSTANCE.getRecipe(currentRecipeId);
|
||||
}
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
|
@ -220,7 +230,7 @@ public class TileAssemblyTable extends TileLaserTableBase implements IInventory,
|
|||
}
|
||||
|
||||
if (worldObj != null && !worldObj.isRemote) {
|
||||
sendNetworkUpdate();
|
||||
queueNetworkUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -246,6 +256,8 @@ public class TileAssemblyTable extends TileLaserTableBase implements IInventory,
|
|||
if (!isAssembling(currentRecipe) || !isPlanned(currentRecipe)) {
|
||||
setCurrentRecipe(recipe);
|
||||
}
|
||||
|
||||
queueNetworkUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -259,6 +271,8 @@ public class TileAssemblyTable extends TileLaserTableBase implements IInventory,
|
|||
if (!plannedOutput.isEmpty()) {
|
||||
setCurrentRecipe(AssemblyRecipeManager.INSTANCE.getRecipe(plannedOutput.iterator().next()));
|
||||
}
|
||||
|
||||
queueNetworkUpdate();
|
||||
}
|
||||
|
||||
public void setNextCurrentRecipe() {
|
||||
|
@ -319,8 +333,6 @@ public class TileAssemblyTable extends TileLaserTableBase implements IInventory,
|
|||
cancelPlanOutput(recipe);
|
||||
}
|
||||
}
|
||||
|
||||
sendNetworkUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -432,9 +432,9 @@ public class BlockGenericPipe extends BlockBuildCraft {
|
|||
|
||||
pipeRemoved.put(new BlockIndex(x, y, z), pipe);
|
||||
world.removeTileEntity(x, y, z);
|
||||
|
||||
updateNeighbourSignalState(pipe);
|
||||
|
||||
if (pipe != null) {
|
||||
updateNeighbourSignalState(pipe);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -171,7 +171,7 @@ public class ItemFacade extends ItemBuildCraft implements IFacadeItem, IPipePlug
|
|||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean debug) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -230,6 +230,9 @@ public class PipeTransportItems extends PipeTransport {
|
|||
|
||||
if (entity instanceof IPipeTile) {
|
||||
Pipe<?> pipe = (Pipe<?>) ((IPipeTile) entity).getPipe();
|
||||
if (pipe == null || pipe.transport == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (pipe == null || pipe.transport == null) {
|
||||
return false;
|
||||
|
|
|
@ -183,7 +183,7 @@ public class SchematicPipe extends SchematicTile {
|
|||
storedRequirements = new ItemStack[items.size() + 1];
|
||||
items.toArray(storedRequirements);
|
||||
storedRequirements[storedRequirements.length - 1] = new ItemStack(
|
||||
pipe.item);
|
||||
pipe.item, 1, pipe.container.getItemMetadata());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue