Merge branch '6.5.x' of github.com:BuildCraft/BuildCraft
This commit is contained in:
commit
977b2ee6e6
23 changed files with 225 additions and 141 deletions
|
@ -22,12 +22,12 @@ apply plugin: 'forge' // adds the forge dependency
|
|||
apply plugin: 'maven' // for uploading to a maven repo
|
||||
apply plugin: 'checkstyle'
|
||||
|
||||
version = "7.0.15"
|
||||
version = "7.0.16"
|
||||
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]
|
||||
|
||||
minecraft {
|
||||
version = "1.7.10-10.13.3.1388-1.7.10" // McVersion-ForgeVersion this variable is later changed to contain only the MC version, while the apiVersion variable is used for the forge version. Yeah its stupid, and will be changed eentually.
|
||||
version = "1.7.10-10.13.4.1490-1.7.10" // McVersion-ForgeVersion this variable is later changed to contain only the MC version, while the apiVersion variable is used for the forge version. Yeah its stupid, and will be changed eentually.
|
||||
|
||||
runDir = "run" // the directory for ForgeGradle to run Minecraft in
|
||||
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 165 B After Width: | Height: | Size: 233 B |
10
buildcraft_resources/changelog/7.0.16
Normal file
10
buildcraft_resources/changelog/7.0.16
Normal file
|
@ -0,0 +1,10 @@
|
|||
Bugs fixed:
|
||||
|
||||
* [#2890] Integration Table messy extraction behaviour (asie)
|
||||
* [#2889] Fix robots movement desync when going through fluids (hea3ven)
|
||||
* Fix potential crash with invalid recipe in Stamping Table (asie)
|
||||
* Fix the work in area and load/unload area allowing non map locations items as parameters (hea3ven)
|
||||
* Fluid pipe behaviour regression (asie)
|
||||
* Integrated hollow facade becoming non-hollow (asie)
|
||||
* Rotating pipe orientation not working well in blueprints (asie)
|
||||
* Void fluid pipe having wrong colours (asie)
|
|
@ -1,3 +1,3 @@
|
|||
1.6.4:BuildCraft:4.2.2
|
||||
1.7.2:BuildCraft:6.0.16
|
||||
1.7.10:BuildCraft:7.0.15
|
||||
1.7.10:BuildCraft:7.0.16
|
||||
|
|
|
@ -17,6 +17,7 @@ import net.minecraft.init.Blocks;
|
|||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import cpw.mods.fml.client.event.ConfigChangedEvent;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
|
@ -32,6 +33,7 @@ import cpw.mods.fml.common.network.NetworkRegistry;
|
|||
import cpw.mods.fml.common.registry.EntityRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import net.minecraftforge.client.event.TextureStitchEvent;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
@ -141,6 +143,7 @@ import buildcraft.robotics.statements.ActionStationRequestItems;
|
|||
import buildcraft.robotics.statements.ActionStationRequestItemsMachine;
|
||||
import buildcraft.robotics.statements.RobotsActionProvider;
|
||||
import buildcraft.robotics.statements.RobotsTriggerProvider;
|
||||
import buildcraft.robotics.statements.StatementParameterMapLocation;
|
||||
import buildcraft.robotics.statements.StatementParameterRobot;
|
||||
import buildcraft.robotics.statements.TriggerRobotInStation;
|
||||
import buildcraft.robotics.statements.TriggerRobotLinked;
|
||||
|
@ -246,6 +249,7 @@ public class BuildCraftRobotics extends BuildCraftMod {
|
|||
}
|
||||
|
||||
StatementManager.registerParameterClass(StatementParameterRobot.class);
|
||||
StatementManager.registerParameterClass(StatementParameterMapLocation.class);
|
||||
StatementManager.registerActionProvider(new RobotsActionProvider());
|
||||
StatementManager.registerTriggerProvider(new RobotsTriggerProvider());
|
||||
}
|
||||
|
|
|
@ -70,6 +70,7 @@ import buildcraft.core.proxy.CoreProxy;
|
|||
import buildcraft.transport.BlockFilteredBuffer;
|
||||
import buildcraft.transport.BlockGenericPipe;
|
||||
import buildcraft.transport.FacadePluggable;
|
||||
import buildcraft.transport.IDiamondPipe;
|
||||
import buildcraft.transport.IMCHandlerTransport;
|
||||
import buildcraft.transport.ItemFacade;
|
||||
import buildcraft.transport.ItemGateCopier;
|
||||
|
@ -142,9 +143,8 @@ import buildcraft.transport.pluggable.ItemPlug;
|
|||
import buildcraft.transport.pluggable.LensPluggable;
|
||||
import buildcraft.transport.pluggable.PlugPluggable;
|
||||
import buildcraft.transport.render.PipeRendererTESR;
|
||||
import buildcraft.transport.schematics.BptItemPipeFilters;
|
||||
import buildcraft.transport.schematics.BptPipeIron;
|
||||
import buildcraft.transport.schematics.BptPipeWooden;
|
||||
import buildcraft.transport.schematics.BptPipeFiltered;
|
||||
import buildcraft.transport.schematics.BptPipeRotatable;
|
||||
import buildcraft.transport.schematics.SchematicPipe;
|
||||
import buildcraft.transport.statements.ActionEnergyPulsar;
|
||||
import buildcraft.transport.statements.ActionExtractionPreset;
|
||||
|
@ -458,16 +458,23 @@ public class BuildCraftTransport extends BuildCraftMod {
|
|||
|
||||
BuilderAPI.schematicRegistry.registerSchematicBlock(genericPipeBlock, SchematicPipe.class);
|
||||
|
||||
new BptPipeIron(pipeItemsIron);
|
||||
new BptPipeIron(pipeFluidsIron);
|
||||
new BptPipeIron(pipePowerIron);
|
||||
new BptPipeRotatable(pipeItemsWood);
|
||||
new BptPipeRotatable(pipeFluidsWood);
|
||||
new BptPipeRotatable(pipeItemsIron);
|
||||
new BptPipeRotatable(pipeFluidsIron);
|
||||
new BptPipeRotatable(pipeItemsEmerald);
|
||||
new BptPipeRotatable(pipeFluidsEmerald);
|
||||
|
||||
new BptPipeWooden(pipeItemsWood);
|
||||
new BptPipeWooden(pipeFluidsWood);
|
||||
new BptPipeWooden(pipePowerWood);
|
||||
new BptPipeWooden(pipeItemsEmerald);
|
||||
new BptPipeRotatable(pipeItemsDaizuli);
|
||||
new BptPipeRotatable(pipeItemsEmzuli);
|
||||
|
||||
new BptItemPipeFilters(pipeItemsDiamond);
|
||||
for (Item itemPipe : BlockGenericPipe.pipes.keySet()) {
|
||||
Class<? extends Pipe> klazz = BlockGenericPipe.pipes.get(itemPipe);
|
||||
|
||||
if (IDiamondPipe.class.isAssignableFrom(klazz)) {
|
||||
new BptPipeFiltered(itemPipe);
|
||||
}
|
||||
}
|
||||
|
||||
BCCreativeTab.get("pipes").setIcon(new ItemStack(BuildCraftTransport.pipeItemsDiamond, 1));
|
||||
BCCreativeTab.get("facades").setIcon(facadeItem.getFacadeForBlock(Blocks.brick_block, 0));
|
||||
|
|
|
@ -8,12 +8,12 @@
|
|||
*/
|
||||
package buildcraft.core.lib.utils;
|
||||
|
||||
public class Average {
|
||||
public class AverageDouble {
|
||||
private double[] data;
|
||||
private int pos, precise;
|
||||
private double averageRaw, tickValue;
|
||||
|
||||
public Average(int precise) {
|
||||
public AverageDouble(int precise) {
|
||||
this.precise = precise;
|
||||
this.data = new double[precise];
|
||||
this.pos = 0;
|
53
common/buildcraft/core/lib/utils/AverageInt.java
Normal file
53
common/buildcraft/core/lib/utils/AverageInt.java
Normal file
|
@ -0,0 +1,53 @@
|
|||
/**
|
||||
* Copyright (c) 2011-2015, 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.core.lib.utils;
|
||||
|
||||
public class AverageInt {
|
||||
private int[] data;
|
||||
private int pos, precise;
|
||||
private int averageRaw, tickValue;
|
||||
|
||||
public AverageInt(int precise) {
|
||||
this.precise = precise;
|
||||
this.data = new int[precise];
|
||||
this.pos = 0;
|
||||
}
|
||||
|
||||
public double getAverage() {
|
||||
return (double) averageRaw / precise;
|
||||
}
|
||||
|
||||
public void tick(int value) {
|
||||
internalTick(tickValue + value);
|
||||
tickValue = 0;
|
||||
}
|
||||
|
||||
public void tick() {
|
||||
internalTick(tickValue);
|
||||
tickValue = 0;
|
||||
}
|
||||
|
||||
private void internalTick(int value) {
|
||||
pos = ++pos % precise;
|
||||
int oldValue = data[pos];
|
||||
data[pos] = value;
|
||||
if (pos == 0) {
|
||||
averageRaw = 0;
|
||||
for (int iValue : data) {
|
||||
averageRaw += iValue;
|
||||
}
|
||||
} else {
|
||||
averageRaw = averageRaw - oldValue + value;
|
||||
}
|
||||
}
|
||||
|
||||
public void push(int value) {
|
||||
tickValue += value;
|
||||
}
|
||||
}
|
|
@ -33,6 +33,7 @@ import net.minecraftforge.common.util.ForgeDirection;
|
|||
import buildcraft.api.core.IAreaProvider;
|
||||
import buildcraft.api.core.Position;
|
||||
import buildcraft.api.power.IEngine;
|
||||
import buildcraft.api.power.ILaserTarget;
|
||||
import buildcraft.api.tiles.ITileAreaProvider;
|
||||
import buildcraft.api.transport.IInjectable;
|
||||
import buildcraft.api.transport.IPipeTile;
|
||||
|
@ -91,7 +92,7 @@ public final class Utils {
|
|||
|
||||
TileEntity tileInventory = BlockUtils.getTileEntity(world, (int) pos.x, (int) pos.y, (int) pos.z);
|
||||
ITransactor transactor = Transactor.getTransactorFor(tileInventory);
|
||||
if (transactor != null && !(tileInventory instanceof IEngine) && transactor.add(stack, orientation.getOpposite(), false).stackSize > 0) {
|
||||
if (transactor != null && !(tileInventory instanceof IEngine) && !(tileInventory instanceof ILaserTarget) && transactor.add(stack, orientation.getOpposite(), false).stackSize > 0) {
|
||||
return transactor.add(stack, orientation.getOpposite(), true).stackSize;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -363,6 +363,11 @@ public class EntityRobot extends EntityRobotBase implements
|
|||
protected void updateEntityActionState() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handleWaterMovement() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private void updateEnergyFX() {
|
||||
energyFX += energySpendPerCycle;
|
||||
|
|
|
@ -16,7 +16,6 @@ import buildcraft.api.items.IMapLocation;
|
|||
import buildcraft.api.statements.IActionInternal;
|
||||
import buildcraft.api.statements.IStatementContainer;
|
||||
import buildcraft.api.statements.IStatementParameter;
|
||||
import buildcraft.api.statements.StatementParameterItemStack;
|
||||
import buildcraft.api.statements.StatementSlot;
|
||||
import buildcraft.core.lib.utils.StringUtils;
|
||||
import buildcraft.core.statements.BCStatement;
|
||||
|
@ -91,7 +90,7 @@ public class ActionRobotWorkInArea extends BCStatement implements IActionInterna
|
|||
|
||||
@Override
|
||||
public IStatementParameter createParameter(int index) {
|
||||
return new StatementParameterItemStack();
|
||||
return new StatementParameterMapLocation();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
package buildcraft.robotics.statements;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import buildcraft.api.items.IMapLocation;
|
||||
import buildcraft.api.statements.IStatement;
|
||||
import buildcraft.api.statements.IStatementContainer;
|
||||
import buildcraft.api.statements.StatementMouseClick;
|
||||
import buildcraft.api.statements.StatementParameterItemStack;
|
||||
|
||||
public class StatementParameterMapLocation extends StatementParameterItemStack {
|
||||
@Override
|
||||
public String getUniqueTag() {
|
||||
return "buildcraft:maplocation";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(IStatementContainer source, IStatement stmt, ItemStack stackIn, StatementMouseClick mouse) {
|
||||
ItemStack stack = stackIn;
|
||||
if (stack != null && !(stack.getItem() instanceof IMapLocation)) {
|
||||
stack = null;
|
||||
}
|
||||
super.onClick(source, stmt, stack, mouse);
|
||||
}
|
||||
}
|
|
@ -15,7 +15,6 @@ import java.util.List;
|
|||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
@ -24,7 +23,6 @@ import net.minecraft.nbt.NBTTagString;
|
|||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import net.minecraftforge.common.util.Constants;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import buildcraft.BuildCraftCore;
|
||||
|
@ -37,7 +35,6 @@ import buildcraft.core.lib.network.command.ICommandReceiver;
|
|||
import buildcraft.core.lib.network.command.PacketCommand;
|
||||
import buildcraft.core.lib.utils.NetworkUtils;
|
||||
import buildcraft.core.lib.utils.StringUtils;
|
||||
import buildcraft.core.lib.utils.Utils;
|
||||
import buildcraft.core.recipes.AssemblyRecipeManager;
|
||||
|
||||
public class TileAssemblyTable extends TileLaserTableBase implements IInventory, IFlexibleCrafter, ICommandReceiver {
|
||||
|
@ -95,23 +92,7 @@ public class TileAssemblyTable extends TileLaserTableBase implements IInventory,
|
|||
setEnergy(0);
|
||||
|
||||
if (currentRecipe.canBeCrafted(this)) {
|
||||
ItemStack remaining = currentRecipe.craft(this, false).crafted.copy();
|
||||
|
||||
if (remaining != null && remaining.stackSize > 0) {
|
||||
remaining.stackSize -= Utils
|
||||
.addToRandomInventoryAround(worldObj, xCoord, yCoord, zCoord, remaining);
|
||||
}
|
||||
|
||||
if (remaining != null && remaining.stackSize > 0) {
|
||||
remaining.stackSize -= Utils.addToRandomInjectableAround(worldObj, xCoord, yCoord, zCoord, ForgeDirection.UNKNOWN, remaining);
|
||||
}
|
||||
|
||||
if (remaining != null && remaining.stackSize > 0) {
|
||||
EntityItem entityitem = new EntityItem(worldObj, xCoord + 0.5, yCoord + 0.7, zCoord + 0.5,
|
||||
remaining);
|
||||
|
||||
worldObj.spawnEntityInWorld(entityitem);
|
||||
}
|
||||
outputStack(currentRecipe.craft(this, false).crafted.copy(), true);
|
||||
|
||||
setNextCurrentRecipe();
|
||||
}
|
||||
|
|
|
@ -13,24 +13,22 @@ import java.util.List;
|
|||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import buildcraft.api.recipes.BuildcraftRecipeRegistry;
|
||||
import buildcraft.api.recipes.IIntegrationRecipe;
|
||||
import buildcraft.core.lib.inventory.ITransactor;
|
||||
import buildcraft.core.lib.inventory.InventoryMapper;
|
||||
import buildcraft.core.lib.inventory.StackHelper;
|
||||
import buildcraft.core.lib.inventory.Transactor;
|
||||
import buildcraft.core.lib.utils.StringUtils;
|
||||
import buildcraft.core.lib.utils.Utils;
|
||||
|
||||
public class TileIntegrationTable extends TileLaserTableBase {
|
||||
public class TileIntegrationTable extends TileLaserTableBase implements ISidedInventory {
|
||||
public static final int SLOT_OUTPUT = 9;
|
||||
private static final int CYCLE_LENGTH = 16;
|
||||
private static final int[] SLOTS = Utils.createSlotArray(0, 10);
|
||||
private int tick = 0;
|
||||
private IIntegrationRecipe activeRecipe;
|
||||
private boolean activeRecipeValid = false;
|
||||
private InventoryMapper mappedOutput = new InventoryMapper(this, SLOT_OUTPUT, 1, false);
|
||||
private int maxExpCountClient;
|
||||
|
||||
@Override
|
||||
|
@ -72,9 +70,6 @@ public class TileIntegrationTable extends TileLaserTableBase {
|
|||
output = activeRecipe.craft(getStackInSlot(0), getExpansions(), false);
|
||||
|
||||
if (output != null) {
|
||||
ITransactor trans = Transactor.getTransactorFor(mappedOutput);
|
||||
trans.add(output, ForgeDirection.UP, true);
|
||||
|
||||
ItemStack input = getStackInSlot(0);
|
||||
|
||||
if (input.stackSize > output.stackSize) {
|
||||
|
@ -83,6 +78,8 @@ public class TileIntegrationTable extends TileLaserTableBase {
|
|||
setInventorySlotContents(0, null);
|
||||
}
|
||||
|
||||
outputStack(output, this, 9, false);
|
||||
|
||||
for (int i = 1; i < 9; i++) {
|
||||
if (getStackInSlot(i) != null && getStackInSlot(i).stackSize == 0) {
|
||||
setInventorySlotContents(i, null);
|
||||
|
@ -184,10 +181,9 @@ public class TileIntegrationTable extends TileLaserTableBase {
|
|||
} else if (activeRecipe == null) {
|
||||
return false;
|
||||
} else if (slot < 9) {
|
||||
if (activeRecipe.getMaximumExpansionCount(getStackInSlot(0)) > 0) {
|
||||
if (slot > activeRecipe.getMaximumExpansionCount(getStackInSlot(0))) {
|
||||
return false;
|
||||
}
|
||||
int expansionCount = activeRecipe.getMaximumExpansionCount(getStackInSlot(0));
|
||||
if (expansionCount > 0 && slot > expansionCount) {
|
||||
return false;
|
||||
}
|
||||
return activeRecipe.isValidExpansion(getStackInSlot(0), stack);
|
||||
} else {
|
||||
|
@ -250,4 +246,31 @@ public class TileIntegrationTable extends TileLaserTableBase {
|
|||
private void updateRecipe() {
|
||||
setNewActiveRecipe();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getAccessibleSlotsFromSide(int side) {
|
||||
return SLOTS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInsertItem(int slot, ItemStack stack, int side) {
|
||||
if (slot == 0) {
|
||||
return true;
|
||||
} else if (activeRecipe == null) {
|
||||
return false;
|
||||
} else if (slot < 9) {
|
||||
int expansionCount = activeRecipe.getMaximumExpansionCount(getStackInSlot(0));
|
||||
if (expansionCount > 0 && slot > expansionCount) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int slot, ItemStack stack, int side) {
|
||||
return slot == 9;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,26 +8,29 @@
|
|||
*/
|
||||
package buildcraft.silicon;
|
||||
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
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 buildcraft.api.power.ILaserTarget;
|
||||
import buildcraft.api.tiles.IHasWork;
|
||||
import buildcraft.core.lib.block.TileBuildCraft;
|
||||
import buildcraft.core.lib.inventory.SimpleInventory;
|
||||
import buildcraft.core.lib.utils.Average;
|
||||
import buildcraft.core.lib.inventory.StackHelper;
|
||||
import buildcraft.core.lib.utils.AverageInt;
|
||||
import buildcraft.core.lib.utils.Utils;
|
||||
|
||||
public abstract class TileLaserTableBase extends TileBuildCraft implements ILaserTarget, IInventory, IHasWork {
|
||||
|
||||
public int clientRequiredEnergy = 0;
|
||||
protected SimpleInventory inv = new SimpleInventory(getSizeInventory(), "inv", 64);
|
||||
private int energy = 0;
|
||||
private int recentEnergyAverage;
|
||||
private Average recentEnergyAverageUtil = new Average(20);
|
||||
private AverageInt recentEnergyAverageUtil = new AverageInt(20);
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
|
@ -112,7 +115,7 @@ public abstract class TileLaserTableBase extends TileBuildCraft implements ILase
|
|||
|
||||
@Override
|
||||
public ItemStack getStackInSlotOnClosing(int slot) {
|
||||
return null;
|
||||
return inv.getStackInSlotOnClosing(slot);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -152,6 +155,41 @@ public abstract class TileLaserTableBase extends TileBuildCraft implements ILase
|
|||
energy = nbt.getInteger("energy");
|
||||
}
|
||||
|
||||
protected void outputStack(ItemStack remaining, boolean autoEject) {
|
||||
outputStack(remaining, null, 0, autoEject);
|
||||
}
|
||||
|
||||
protected void outputStack(ItemStack remaining, IInventory inv, int slot, boolean autoEject) {
|
||||
if (autoEject) {
|
||||
if (remaining != null && remaining.stackSize > 0) {
|
||||
remaining.stackSize -= Utils
|
||||
.addToRandomInventoryAround(worldObj, xCoord, yCoord, zCoord, remaining);
|
||||
}
|
||||
|
||||
if (remaining != null && remaining.stackSize > 0) {
|
||||
remaining.stackSize -= Utils.addToRandomInjectableAround(worldObj, xCoord, yCoord, zCoord, ForgeDirection.UNKNOWN, remaining);
|
||||
}
|
||||
}
|
||||
|
||||
if (inv != null && remaining != null && remaining.stackSize > 0) {
|
||||
ItemStack inside = inv.getStackInSlot(slot);
|
||||
|
||||
if (inside == null || inside.stackSize <= 0) {
|
||||
inv.setInventorySlotContents(slot, remaining);
|
||||
return;
|
||||
} else if (StackHelper.canStacksMerge(inside, remaining)) {
|
||||
remaining.stackSize -= StackHelper.mergeStacks(remaining, inside, true);
|
||||
}
|
||||
}
|
||||
|
||||
if (remaining != null && remaining.stackSize > 0) {
|
||||
EntityItem entityitem = new EntityItem(worldObj, xCoord + 0.5, yCoord + 0.7, zCoord + 0.5,
|
||||
remaining);
|
||||
|
||||
worldObj.spawnEntityInWorld(entityitem);
|
||||
}
|
||||
}
|
||||
|
||||
public void getGUINetworkData(int id, int data) {
|
||||
int currentStored = energy;
|
||||
int requiredEnergy = clientRequiredEnergy;
|
||||
|
|
|
@ -18,7 +18,6 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import buildcraft.BuildCraftCore;
|
||||
import buildcraft.api.recipes.BuildcraftRecipeRegistry;
|
||||
|
@ -28,7 +27,6 @@ import buildcraft.core.lib.network.command.ICommandReceiver;
|
|||
import buildcraft.core.lib.network.command.PacketCommand;
|
||||
import buildcraft.core.lib.utils.NetworkUtils;
|
||||
import buildcraft.core.lib.utils.StringUtils;
|
||||
import buildcraft.core.lib.utils.Utils;
|
||||
|
||||
public class TileProgrammingTable extends TileLaserTableBase implements IInventory, ISidedInventory, ICommandReceiver {
|
||||
public static final int WIDTH = 6;
|
||||
|
@ -67,27 +65,13 @@ public class TileProgrammingTable extends TileLaserTableBase implements IInvento
|
|||
return;
|
||||
}
|
||||
|
||||
if (optionId >= 0 && this.getStackInSlot(1) == null && getEnergy() >= currentRecipe.getEnergyCost(options.get(optionId))) {
|
||||
if (optionId >= 0 && getEnergy() >= currentRecipe.getEnergyCost(options.get(optionId))) {
|
||||
if (currentRecipe.canCraft(this.getStackInSlot(0))) {
|
||||
ItemStack remaining = currentRecipe.craft(this.getStackInSlot(0), options.get(optionId));
|
||||
if (remaining != null && remaining.stackSize > 0) {
|
||||
setEnergy(0);
|
||||
this.decrStackSize(0, remaining.stackSize);
|
||||
|
||||
if (remaining.stackSize > 0) {
|
||||
remaining.stackSize -= Utils
|
||||
.addToRandomInventoryAround(worldObj, xCoord, yCoord, zCoord, remaining);
|
||||
}
|
||||
|
||||
if (remaining.stackSize > 0) {
|
||||
remaining.stackSize -= Utils.addToRandomInjectableAround(worldObj, xCoord, yCoord, zCoord, ForgeDirection.UNKNOWN, remaining);
|
||||
}
|
||||
|
||||
if (remaining.stackSize > 0) {
|
||||
this.setInventorySlotContents(1, remaining);
|
||||
} else {
|
||||
this.setInventorySlotContents(1, null);
|
||||
}
|
||||
decrStackSize(0, remaining.stackSize);
|
||||
outputStack(remaining, this, 1, false);
|
||||
}
|
||||
}
|
||||
findRecipe();
|
||||
|
|
|
@ -134,33 +134,23 @@ public class TileStampingTable extends TileLaserTableBase implements IHasWork, I
|
|||
|
||||
IRecipe recipe = crafting.findRecipe();
|
||||
ItemStack result = recipe != null ? recipe.getCraftingResult(crafting).copy() : null;
|
||||
ItemStack resultInto = this.getStackInSlot(1);
|
||||
|
||||
if (recipe == null || result == null || result.stackSize <= 0) {
|
||||
if (resultInto == null || StackHelper.canStacksMerge(input, resultInto)) {
|
||||
this.setInventorySlotContents(0, null);
|
||||
this.setInventorySlotContents(1, input);
|
||||
}
|
||||
return;
|
||||
} else if (resultInto != null &&
|
||||
(!StackHelper.canStacksMerge(result, resultInto) ||
|
||||
resultInto.stackSize + result.stackSize > result.getMaxStackSize())) {
|
||||
return;
|
||||
}
|
||||
|
||||
addEnergy(-getRequiredEnergy());
|
||||
|
||||
craftSlot.onPickupFromSlot(internalPlayer, result);
|
||||
handleLeftoverItems(crafting);
|
||||
handleLeftoverItems(internalPlayer.inventory);
|
||||
if (result != null) {
|
||||
craftSlot.onPickupFromSlot(internalPlayer, result);
|
||||
handleLeftoverItems(crafting);
|
||||
handleLeftoverItems(internalPlayer.inventory);
|
||||
|
||||
if (resultInto == null) {
|
||||
setInventorySlotContents(1, result);
|
||||
outputStack(result, this, 1, false);
|
||||
decrStackSize(0, 1);
|
||||
} else {
|
||||
resultInto.stackSize += result.stackSize;
|
||||
ItemStack outputSlot = getStackInSlot(1);
|
||||
if (outputSlot == null) {
|
||||
setInventorySlotContents(1, getStackInSlot(0));
|
||||
setInventorySlotContents(0, null);
|
||||
}
|
||||
}
|
||||
|
||||
decrStackSize(0, 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -181,7 +181,7 @@ public class PipeTransportFluids extends PipeTransport implements IFluidHandler
|
|||
public void initFromPipe(Class<? extends Pipe> pipeClass) {
|
||||
capacity = LIQUID_IN_PIPE;
|
||||
flowRate = fluidCapacities.get(pipeClass);
|
||||
travelDelay = MathUtils.clamp(Math.round(16F / (flowRate / 10)), 1, MAX_TRAVEL_DELAY);
|
||||
travelDelay = MathUtils.clamp(Math.round(16F / (flowRate / BuildCraftTransport.pipeFluidsBaseFlowRate)), 1, MAX_TRAVEL_DELAY);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -272,9 +272,10 @@ public class PipeTransportFluids extends PipeTransport implements IFluidHandler
|
|||
|
||||
if (liquidToPush.amount > 0) {
|
||||
int filled = ((IFluidHandler) target).fill(o.getOpposite(), liquidToPush, true);
|
||||
section.drain(filled, true);
|
||||
if (filled <= 0) {
|
||||
outputTTL[o.ordinal()]--;
|
||||
} else {
|
||||
section.drain(filled, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -362,12 +363,6 @@ public class PipeTransportFluids extends PipeTransport implements IFluidHandler
|
|||
|
||||
if (outputCooldown[i] > 0) {
|
||||
outputCooldown[i]--;
|
||||
} else {
|
||||
if (outputTTL[i] > 0) {
|
||||
outputTTL[i]--;
|
||||
} else {
|
||||
transferState[i] = TransferState.None;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -428,7 +428,7 @@ public class TileGenericPipe extends TileEntity implements IFluidHandler,
|
|||
for (Object o : world.playerEntities) {
|
||||
EntityPlayerMP player = (EntityPlayerMP) o;
|
||||
|
||||
if (world.getPlayerManager().isPlayerWatchingChunk (player, xCoord >> 4, zCoord >> 4)) {
|
||||
if (world.getPlayerManager().isPlayerWatchingChunk(player, xCoord >> 4, zCoord >> 4)) {
|
||||
BuildCraftCore.instance.sendToPlayer(player, updatePacket);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -89,7 +89,7 @@ public class AdvancedFacadeRecipe extends IntegrationRecipeBC {
|
|||
additionalState = ItemFacade.FacadeState.createTransparent(wire);
|
||||
} else {
|
||||
additionalState = ItemFacade.getFacadeStates(facade)[0];
|
||||
additionalState = ItemFacade.FacadeState.create(additionalState.block, additionalState.metadata, wire);
|
||||
additionalState = new ItemFacade.FacadeState(additionalState.block, additionalState.metadata, wire, additionalState.hollow);
|
||||
}
|
||||
|
||||
// if in states array exists state with the same wire just override it
|
||||
|
|
|
@ -15,9 +15,9 @@ import buildcraft.api.blueprints.IBuilderContext;
|
|||
import buildcraft.api.blueprints.SchematicTile;
|
||||
import buildcraft.core.lib.inventory.SimpleInventory;
|
||||
|
||||
public class BptItemPipeFilters extends BptPipeExtension {
|
||||
public class BptPipeFiltered extends BptPipeExtension {
|
||||
|
||||
public BptItemPipeFilters(Item i) {
|
||||
public BptPipeFiltered(Item i) {
|
||||
super (i);
|
||||
}
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
/**
|
||||
* Copyright (c) 2011-2015, 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.transport.schematics;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import buildcraft.api.blueprints.IBuilderContext;
|
||||
import buildcraft.api.blueprints.SchematicTile;
|
||||
|
||||
public class BptPipeIron extends BptPipeExtension {
|
||||
|
||||
public BptPipeIron(Item i) {
|
||||
super(i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void rotateLeft(SchematicTile slot, IBuilderContext context) {
|
||||
int orientation = slot.meta & 7;
|
||||
int others = slot.meta - orientation;
|
||||
|
||||
slot.meta = ForgeDirection.values()[orientation].getRotation(ForgeDirection.UP).ordinal() + others;
|
||||
}
|
||||
|
||||
}
|
|
@ -14,9 +14,9 @@ import net.minecraftforge.common.util.ForgeDirection;
|
|||
import buildcraft.api.blueprints.IBuilderContext;
|
||||
import buildcraft.api.blueprints.SchematicTile;
|
||||
|
||||
public class BptPipeWooden extends BptPipeExtension {
|
||||
public class BptPipeRotatable extends BptPipeExtension {
|
||||
|
||||
public BptPipeWooden(Item i) {
|
||||
public BptPipeRotatable(Item i) {
|
||||
super (i);
|
||||
}
|
||||
|
Loading…
Reference in a new issue