n-to-n p2p

network monitor checks nesting by action source
This commit is contained in:
PrototypeTrousers
2021-10-28 23:49:16 -03:00
parent 3db8d0185f
commit 5e21101619
12 changed files with 268 additions and 96 deletions
@@ -74,10 +74,19 @@ public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements IItemHa
public void onNeighborChanged( IBlockAccess w, BlockPos pos, BlockPos neighbor )
{
this.cachedInv = null;
final PartP2PItems input = this.getInput();
if( input != null && this.isOutput() )
try
{
input.onTunnelNetworkChange();
for( PartP2PItems input : this.getInputs() )
{
if( input != null && this.isOutput() )
{
input.onTunnelNetworkChange();
}
}
}
catch( GridAccessException e )
{
e.printStackTrace();
}
}
@@ -222,10 +231,19 @@ public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements IItemHa
}
else
{
final PartP2PItems input = this.getInput();
if( input != null )
try
{
input.getHost().notifyNeighbors();
for( PartP2PItems input : this.getInputs() )
{
if( input != null )
{
input.getHost().notifyNeighbors();
}
}
}
catch( GridAccessException e )
{
e.printStackTrace();
}
}
}