Fix some bugs with LogiTransporters

This commit is contained in:
Ben Spiers 2015-04-06 02:18:45 +01:00
parent 16ce88f09a
commit c13b3b240f
3 changed files with 8 additions and 9 deletions

View file

@ -88,7 +88,7 @@ public abstract class DynamicNetwork<A, N extends DynamicNetwork<A, N>> implemen
}
updateCapacity();
clampBuffer();
queueClientUpdate((Collection<IGridTransmitter<A, N>>)transmittersToAdd.clone());
queueClientUpdate(new ArrayList<>(transmittersToAdd));
transmittersToAdd.clear();
}

View file

@ -639,7 +639,7 @@ public abstract class PartSidedPipe extends TMultiPart implements TSlottedPart,
protected void onModeChange(ForgeDirection side)
{
refreshConnections();
markDirtyAcceptor(side);
}
protected void markDirtyTransmitters()
@ -773,7 +773,7 @@ public abstract class PartSidedPipe extends TMultiPart implements TSlottedPart,
connectionTypes[hit.subHit] = connectionTypes[hit.subHit].next();
sendDesc = true;
onModeChange(ForgeDirection.getOrientation(side));
onModeChange(ForgeDirection.getOrientation(hit.subHit));
player.addChatMessage(new ChatComponentText("Connection type changed to " + connectionTypes[hit.subHit].toString()));
return true;

View file

@ -64,12 +64,6 @@ public abstract class PartTransmitter<A, N extends DynamicNetwork<A, N>> extends
super.preRemove();
}
@Override
protected void onModeChange(ForgeDirection side)
{
super.onModeChange(side);
}
@Override
public void onNeighborTileChanged(int side, boolean weak)
{
@ -98,6 +92,11 @@ public abstract class PartTransmitter<A, N extends DynamicNetwork<A, N>> extends
public A getCachedAcceptor(ForgeDirection side)
{
ConnectionType type = connectionTypes[side.ordinal()];
if(type == ConnectionType.PULL || type == ConnectionType.NONE)
{
return null;
}
return connectionMapContainsSide(currentAcceptorConnections, side) ? (A)cachedAcceptors[side.ordinal()] : null;
}