Merge pull request #2100 from yueh/fix-2099
Fixes #2099: No neighbor update of Pressure P2P before IAirHandler is validated.
This commit is contained in:
commit
ac45095cb4
1 changed files with 9 additions and 1 deletions
|
@ -58,6 +58,7 @@ public final class PartP2PPressure extends PartP2PTunnel<PartP2PPressure> implem
|
||||||
@Nonnull
|
@Nonnull
|
||||||
private final IAirHandler handler;
|
private final IAirHandler handler;
|
||||||
private boolean isConnected = false;
|
private boolean isConnected = false;
|
||||||
|
private boolean isValid = false;
|
||||||
|
|
||||||
public PartP2PPressure( final ItemStack is )
|
public PartP2PPressure( final ItemStack is )
|
||||||
{
|
{
|
||||||
|
@ -87,14 +88,20 @@ public final class PartP2PPressure extends PartP2PTunnel<PartP2PPressure> implem
|
||||||
public void onNeighborChanged()
|
public void onNeighborChanged()
|
||||||
{
|
{
|
||||||
super.onNeighborChanged();
|
super.onNeighborChanged();
|
||||||
|
|
||||||
|
if( this.isValid )
|
||||||
|
{
|
||||||
this.getInternalHandler().onNeighborChange();
|
this.getInternalHandler().onNeighborChange();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addToWorld()
|
public void addToWorld()
|
||||||
{
|
{
|
||||||
super.addToWorld();
|
super.addToWorld();
|
||||||
|
|
||||||
this.getInternalHandler().validateI( this.getTile() );
|
this.getInternalHandler().validateI( this.getTile() );
|
||||||
|
this.isValid = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -102,6 +109,7 @@ public final class PartP2PPressure extends PartP2PTunnel<PartP2PPressure> implem
|
||||||
{
|
{
|
||||||
super.removeFromWorld();
|
super.removeFromWorld();
|
||||||
|
|
||||||
|
this.isValid = false;
|
||||||
if( this.isOutput() && this.getInput() != null )
|
if( this.isOutput() && this.getInput() != null )
|
||||||
{
|
{
|
||||||
this.getInternalHandler().removeConnection( this.getInput().getInternalHandler() );
|
this.getInternalHandler().removeConnection( this.getInput().getInternalHandler() );
|
||||||
|
|
Loading…
Reference in a new issue