Merge branch 'master' of github.com:SirSengir/BuildCraft

This commit is contained in:
SirSengir 2012-09-08 09:49:09 +02:00
commit 9e7e30bcfc
4 changed files with 49 additions and 25 deletions

View file

@ -8,8 +8,8 @@ gui.inventory=Inventar
gui.lock=Sperren
gui.needed=Ben\u00f6tigt
gui.unlock=\u00d6ffnen
item.bucketFuel=Eimer Benzin
item.bucketOil=Eimer \u00d6l
item.bucketFuel=Benzineimer
item.bucketOil=\u00d6l Eimer
item.woodenGearItem=Holzzahnrad
item.stoneGearItem=Steinzahnrad
item.ironGearItem=Eisenzahnrad
@ -43,28 +43,28 @@ item.redstoneChipset.2=Goldener Redstone Chipsatz
item.redstoneChipset.3=Diamantener Redstone Chipsatz
item.redstoneChipset.4=Pulsierender Chipsatz
item.blueprintItem=Blaupause
item.PipeItemsWood=Transportrohr (Holz)
item.PipeItemsCobblestone=Transportrohr (Pflasterstein)
item.PipeItemsStone=Transportrohr (Stein)
item.PipeItemsIron=Transportrohr (Eisen)
item.PipeItemsGold=Transportrohr (Gold)
item.PipeItemsDiamond=Transportrohr (Diamant)
item.PipeItemsObsidian=Transportrohr (Obsidian)
item.PipeLiquidsWood=Rohrleitung (Holz)
item.PipeLiquidsCobblestone=Rohrleitung (Pflasterstein)
item.PipeLiquidsStone=Rohrleitung (Stein)
item.PipeLiquidsIron=Rohrleitung (Eisen)
item.PipeLiquidsGold=Rohrleitung (Gold)
item.PipePowerWood=Energieleitung (Holz)
item.PipePowerStone=Energieleitung (Stein)
item.PipePowerGold=Energieleitung (Gold)
item.PipeItemsWood=H\u00d6lzernes Transportrohr
item.PipeItemsCobblestone=Pflasterstein Transportrohr
item.PipeItemsStone=Steineres Transportrohr
item.PipeItemsIron=Eisernes Transportrohr
item.PipeItemsGold=Goldenes Transportrohr
item.PipeItemsDiamond=Diamantenes Transportrohr
item.PipeItemsObsidian=Obsidian Transportrohr
item.PipeLiquidsWood=H\u00d6lzerne Rohrleitung
item.PipeLiquidsCobblestone=Pflasterstein Rohrleitung
item.PipeLiquidsStone=Steinere Rohrleitung
item.PipeLiquidsIron=Eiserne Rohrleitung
item.PipeLiquidsGold=Goldene Rohrleitung
item.PipePowerWood=H\u00d6lzerne Energieleitung
item.PipePowerStone=Steinere Energieleitung
item.PipePowerGold=Goldene Energieleitung
item.PipeItemsStripes=Gestreiftes Rohr
item.PipeStructureCobblestone=Strukturrohr
tile.miningWellBlock=Minenschacht
tile.plainPipeBlock=Minenrohr
tile.autoWorkbenchBlock=Automatische Werkbank
tile.machineBlock=Steinbruch
tile.markerBlock=Markstein
tile.markerBlock=Markierungsstein
tile.fillerBlock=F\u00fcller
tile.builderBlock=Konstrukteur
tile.architectBlock=Architektentisch

View file

@ -393,6 +393,18 @@ public abstract class Pipe implements IPipe, IDropControlInventory {
public boolean hasGate() {
return gate != null;
}
protected void updateNeighbors(boolean needSelf) {
if (needSelf) {
worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, BuildCraftTransport.genericPipeBlock.blockID);
}
worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord - 1, zCoord, BuildCraftTransport.genericPipeBlock.blockID);
worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord + 1, zCoord, BuildCraftTransport.genericPipeBlock.blockID);
worldObj.notifyBlocksOfNeighborChange(xCoord - 1, yCoord, zCoord, BuildCraftTransport.genericPipeBlock.blockID);
worldObj.notifyBlocksOfNeighborChange(xCoord + 1, yCoord, zCoord, BuildCraftTransport.genericPipeBlock.blockID);
worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord - 1, BuildCraftTransport.genericPipeBlock.blockID);
worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord + 1, BuildCraftTransport.genericPipeBlock.blockID);
}
public void onBlockRemoval() {
if (wireSet[IPipe.WireColor.Red.ordinal()])
@ -415,6 +427,10 @@ public abstract class Pipe implements IPipe, IDropControlInventory {
container.dropFacade(direction);
}
}
if (broadcastRedstone) {
updateNeighbors(false); // self will update due to block id changing
}
}
public void setTrigger(int position, ITrigger trigger) {
@ -474,10 +490,12 @@ public abstract class Pipe implements IPipe, IDropControlInventory {
triggerParameters = new ITriggerParameter[triggerParameters.length];
activatedActions = new Action[activatedActions.length];
broadcastSignal = new boolean[] { false, false, false, false };
if (broadcastRedstone) {
updateNeighbors(true);
}
broadcastRedstone = false;
//worldObj.markBlockNeedsUpdate(xCoord, yCoord, zCoord);
container.scheduleRenderUpdate();
//worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, BuildCraftTransport.genericPipeBlock.blockID);
}
private void resolveActions() {
@ -534,8 +552,7 @@ public abstract class Pipe implements IPipe, IDropControlInventory {
if (oldBroadcastRedstone != broadcastRedstone) {
container.scheduleRenderUpdate();
//worldObj.markBlockNeedsUpdate(xCoord, yCoord, zCoord);
worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, BuildCraftTransport.genericPipeBlock.blockID);
updateNeighbors(true);
}
for (int i = 0; i < oldBroadcastSignal.length; ++i)

View file

@ -36,7 +36,7 @@ public class PipeItemsGold extends Pipe implements IPipeTransportItemsHook {
@Override
public int getTextureIndex(Orientations direction) {
if (worldObj != null && worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord))
if (broadcastRedstone || worldObj != null && worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord))
return 1 * 16 + 14;
else
return 1 * 16 + 4;
@ -66,7 +66,7 @@ public class PipeItemsGold extends Pipe implements IPipeTransportItemsHook {
@Override
public void entityEntered(IPipedItem item, Orientations orientation) {
if (worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord))
if (broadcastRedstone || worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord))
item.setSpeed(Utils.pipeNormalSpeed * 20F);
}

View file

@ -127,8 +127,15 @@ public class PipeItemsWood extends Pipe implements IPowerReceptor {
public ItemStack[] checkExtract(IInventory inventory, boolean doRemove, Orientations from) {
/// ISPECIALINVENTORY
if (inventory instanceof ISpecialInventory)
return ((ISpecialInventory) inventory).extractItem(doRemove, from, 1);
if (inventory instanceof ISpecialInventory) {
ItemStack[] stacks = ((ISpecialInventory) inventory).extractItem(doRemove, from, (int)powerProvider.getEnergyStored());
if (stacks != null && doRemove) {
for (ItemStack stack : stacks) {
powerProvider.useEnergy(stack.stackSize, stack.stackSize, true);
}
}
return stacks;
}
if (inventory instanceof ISidedInventory) {
ISidedInventory sidedInv = (ISidedInventory) inventory;