minor tweaks and fixes for server release
This commit is contained in:
parent
1a2bc3a964
commit
89acd880dc
2 changed files with 16 additions and 5 deletions
common/buildcraft/builders
|
@ -111,6 +111,7 @@ public class TileArchitect extends TileBuildCraft implements IInventory, IBoxPro
|
||||||
}
|
}
|
||||||
|
|
||||||
public void createBpt() {
|
public void createBpt() {
|
||||||
|
writingBlueprint.id.name = name;
|
||||||
BuildCraftBuilders.serverDB.add(writingBlueprint);
|
BuildCraftBuilders.serverDB.add(writingBlueprint);
|
||||||
|
|
||||||
setInventorySlotContents(1, ItemBlueprint.getBlueprintItem(writingBlueprint));
|
setInventorySlotContents(1, ItemBlueprint.getBlueprintItem(writingBlueprint));
|
||||||
|
|
|
@ -21,6 +21,7 @@ import net.minecraft.util.AxisAlignedBB;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
import buildcraft.BuildCraftBuilders;
|
import buildcraft.BuildCraftBuilders;
|
||||||
import buildcraft.api.blueprints.SchematicToBuild;
|
import buildcraft.api.blueprints.SchematicToBuild;
|
||||||
|
import buildcraft.api.core.SafeTimeTracker;
|
||||||
import buildcraft.api.gates.IAction;
|
import buildcraft.api.gates.IAction;
|
||||||
import buildcraft.api.power.IPowerReceptor;
|
import buildcraft.api.power.IPowerReceptor;
|
||||||
import buildcraft.api.power.PowerHandler;
|
import buildcraft.api.power.PowerHandler;
|
||||||
|
@ -66,6 +67,8 @@ public class TileBuilder extends TileBuildCraft implements IBuilderInventory,
|
||||||
|
|
||||||
private LinkedList <ItemStack> requiredToBuild;
|
private LinkedList <ItemStack> requiredToBuild;
|
||||||
|
|
||||||
|
private SafeTimeTracker debugBuildTracker = new SafeTimeTracker(5);
|
||||||
|
|
||||||
private class PathIterator {
|
private class PathIterator {
|
||||||
|
|
||||||
public Iterator<BlockIndex> currentIterator;
|
public Iterator<BlockIndex> currentIterator;
|
||||||
|
@ -421,8 +424,12 @@ public class TileBuilder extends TileBuildCraft implements IBuilderInventory,
|
||||||
result = tmp;
|
result = tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i == 0) {
|
if (!worldObj.isRemote) {
|
||||||
iterateBpt();
|
if (i == 0) {
|
||||||
|
RPCHandler.rpcBroadcastPlayers(this, "setItemRequirements",
|
||||||
|
null, null);
|
||||||
|
iterateBpt();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
@ -434,6 +441,7 @@ public class TileBuilder extends TileBuildCraft implements IBuilderInventory,
|
||||||
|
|
||||||
if (!worldObj.isRemote) {
|
if (!worldObj.isRemote) {
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
|
RPCHandler.rpcBroadcastPlayers(this, "setItemRequirements", null, null);
|
||||||
iterateBpt();
|
iterateBpt();
|
||||||
done = false;
|
done = false;
|
||||||
}
|
}
|
||||||
|
@ -609,7 +617,7 @@ public class TileBuilder extends TileBuildCraft implements IBuilderInventory,
|
||||||
|
|
||||||
requiredToBuild = rq;
|
requiredToBuild = rq;
|
||||||
|
|
||||||
if (rq.size() > 0) {
|
if (rq != null && rq.size() > 0) {
|
||||||
Iterator <ItemStack> itStack = rq.iterator();
|
Iterator <ItemStack> itStack = rq.iterator();
|
||||||
Iterator <Integer> size = realSizes.iterator();
|
Iterator <Integer> size = realSizes.iterator();
|
||||||
|
|
||||||
|
@ -664,6 +672,10 @@ public class TileBuilder extends TileBuildCraft implements IBuilderInventory,
|
||||||
}
|
}
|
||||||
|
|
||||||
public void debugForceBlueprintCompletion () {
|
public void debugForceBlueprintCompletion () {
|
||||||
|
if (!debugBuildTracker.markTimeIfDelay(worldObj)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (bluePrintBuilder != null) {
|
if (bluePrintBuilder != null) {
|
||||||
SchematicToBuild slot = bluePrintBuilder.getNextBlock(worldObj, this);
|
SchematicToBuild slot = bluePrintBuilder.getNextBlock(worldObj, this);
|
||||||
|
|
||||||
|
@ -673,8 +685,6 @@ public class TileBuilder extends TileBuildCraft implements IBuilderInventory,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bluePrintBuilder instanceof BptBuilderBlueprint) {
|
if (bluePrintBuilder instanceof BptBuilderBlueprint) {
|
||||||
((BptBuilderBlueprint) bluePrintBuilder).recomputeNeededItems();
|
|
||||||
|
|
||||||
LinkedList <Integer> realSize = new LinkedList<Integer>();
|
LinkedList <Integer> realSize = new LinkedList<Integer>();
|
||||||
|
|
||||||
for (ItemStack stack : ((BptBuilderBlueprint) bluePrintBuilder).neededItems) {
|
for (ItemStack stack : ((BptBuilderBlueprint) bluePrintBuilder).neededItems) {
|
||||||
|
|
Loading…
Reference in a new issue