A simple fix for the wire flicker
This commit is contained in:
parent
4a0df69951
commit
ed6499a1fa
2 changed files with 16 additions and 2 deletions
|
@ -54,6 +54,7 @@ import buildcraft.core.BlockIndex;
|
||||||
import buildcraft.core.CoreConstants;
|
import buildcraft.core.CoreConstants;
|
||||||
import buildcraft.core.CreativeTabBuildCraft;
|
import buildcraft.core.CreativeTabBuildCraft;
|
||||||
import buildcraft.core.ItemRobot;
|
import buildcraft.core.ItemRobot;
|
||||||
|
import buildcraft.core.TileBuffer;
|
||||||
import buildcraft.core.robots.EntityRobot;
|
import buildcraft.core.robots.EntityRobot;
|
||||||
import buildcraft.core.robots.RobotAIDocked;
|
import buildcraft.core.robots.RobotAIDocked;
|
||||||
import buildcraft.core.utils.MatrixTranformations;
|
import buildcraft.core.utils.MatrixTranformations;
|
||||||
|
@ -878,7 +879,9 @@ public class BlockGenericPipe extends BlockBuildCraft {
|
||||||
if (!pipe.wireSet[color.ordinal()]) {
|
if (!pipe.wireSet[color.ordinal()]) {
|
||||||
pipe.wireSet[color.ordinal()] = true;
|
pipe.wireSet[color.ordinal()] = true;
|
||||||
pipe.signalStrength[color.ordinal()] = 0;
|
pipe.signalStrength[color.ordinal()] = 0;
|
||||||
pipe.container.scheduleNeighborChange();
|
|
||||||
|
pipe.updateSignalState();
|
||||||
|
pipe.container.scheduleRenderUpdate();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -890,7 +893,19 @@ public class BlockGenericPipe extends BlockBuildCraft {
|
||||||
dropWire(color, pipe);
|
dropWire(color, pipe);
|
||||||
}
|
}
|
||||||
pipe.wireSet[color.ordinal()] = false;
|
pipe.wireSet[color.ordinal()] = false;
|
||||||
|
|
||||||
|
TileBuffer neighbours[] = pipe.container.getTileCache();
|
||||||
|
|
||||||
|
if(neighbours != null) {
|
||||||
|
for(int i = 0; i < 6; i++) {
|
||||||
|
if (neighbours[i] != null && neighbours[i].getTile() instanceof TileGenericPipe && !neighbours[i].getTile().isInvalid()) {
|
||||||
|
((TileGenericPipe) neighbours[i].getTile()).pipe.updateSignalState();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
pipe.container.scheduleRenderUpdate();
|
pipe.container.scheduleRenderUpdate();
|
||||||
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -141,7 +141,6 @@ public abstract class Pipe<T extends PipeTransport> implements IDropControlInven
|
||||||
public void onNeighborBlockChange(int blockId) {
|
public void onNeighborBlockChange(int blockId) {
|
||||||
transport.onNeighborBlockChange(blockId);
|
transport.onNeighborBlockChange(blockId);
|
||||||
|
|
||||||
updateSignalState();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canPipeConnect(TileEntity tile, ForgeDirection side) {
|
public boolean canPipeConnect(TileEntity tile, ForgeDirection side) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue