Merge pull request #239 from tcooc/patch2

Minor fixes for blueprint library and builder
This commit is contained in:
SirSengir 2012-09-11 01:47:28 -07:00
commit 55184e8625
2 changed files with 29 additions and 0 deletions

View file

@ -12,6 +12,7 @@ package buildcraft.builders;
import java.util.ArrayList;
import net.minecraft.src.BlockContainer;
import net.minecraft.src.CreativeTabs;
import net.minecraft.src.EntityLiving;
import net.minecraft.src.EntityPlayer;
import net.minecraft.src.Item;
@ -41,6 +42,7 @@ public class BlockBuilder extends BlockContainer {
blockTextureTop = 3 * 16 + 6;
blockTextureFront = 3 * 16 + 7;
setHardness(0.7F);
setCreativeTab(CreativeTabs.tabRedstone);
}
@Override

View file

@ -16,6 +16,7 @@ import buildcraft.core.blueprints.BptBase;
import buildcraft.core.gui.BuildCraftContainer;
import net.minecraft.src.EntityPlayer;
import net.minecraft.src.ICrafting;
import net.minecraft.src.IInventory;
import net.minecraft.src.Slot;
@ -25,6 +26,8 @@ public class ContainerBlueprintLibrary extends BuildCraftContainer {
protected IInventory playerInventory;
protected TileBlueprintLibrary library;
private int progressIn, progressOut;
public ContainerBlueprintLibrary(EntityPlayer player, TileBlueprintLibrary library) {
super(library.getSizeInventory());
@ -48,6 +51,30 @@ public class ContainerBlueprintLibrary extends BuildCraftContainer {
addSlotToContainer(new Slot(playerInventory, i1, 8 + i1 * 18, 198));
}
@Override
public void updateCraftingResults() {
super.updateCraftingResults();
for (int i = 0; i < crafters.size(); i++) {
ICrafting icrafting = (ICrafting) crafters.get(i);
if (progressIn != library.progressIn)
icrafting.updateCraftingInventoryInfo(this, 0, library.progressIn);
if (progressOut != library.progressOut)
icrafting.updateCraftingInventoryInfo(this, 1, library.progressOut);
}
progressIn = library.progressIn;
progressOut = library.progressOut;
}
@Override
public void updateProgressBar(int i, int j) {
if (i == 0)
library.progressIn = j;
else if(i == 1)
library.progressOut = j;
}
@Override
public boolean canInteractWith(EntityPlayer entityplayer) {
return library.isUseableByPlayer(entityplayer);