Skip to content

Commit

Permalink
Merge pull request #28 from GTNewHorizons/fix/wonky-storage-bus-inver…
Browse files Browse the repository at this point in the history
…ted-mode

fix wonky storage bus under inverted mode
  • Loading branch information
Dream-Master authored Dec 6, 2022
2 parents fd25673 + 237fb48 commit d2aa73f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ buildscript {
}
}
dependencies {
classpath 'com.github.GTNewHorizons:ForgeGradle:1.2.7'
classpath 'com.github.GTNewHorizons:ForgeGradle:1.2.11'
}
}

Expand Down Expand Up @@ -745,4 +745,4 @@ def checkPropertyExists(String propertyName) {

def getFile(String relativePath) {
return new File(projectDir, relativePath)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ protected boolean canTransferGas( final GaseousEssentia essentiaGas )
* Validate based on if the aspect is filtered and the storage bus is
* inverted. See explanation below.
*/
return( this.filteredAspects.contains( essentiaGas.getAspect() ) == !this.inverted );
return( this.filteredAspects.contains( essentiaGas.getAspect() ) != this.inverted );

/*
* Truth 'table' ---- Conditions: * isFiltered = true * inverted = false
Expand Down Expand Up @@ -339,6 +339,12 @@ public final boolean isPrioritized( final IAEFluidStack fluidStack )
return false;
}

if( this.inverted )
{
// no prioritization under blacklist mode
return false;
}

// Is the aspect prioritized?
try
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ private List<IAspectStack> getContainerEssentia()
for( IAspectStack essentiaStack : containerStacks )
{
// Is the aspect in the filter?
if( skipFilterCheck || ( this.filteredAspects.contains( essentiaStack.getAspect() ) ) )
if( skipFilterCheck || ( this.filteredAspects.contains( essentiaStack.getAspect() ) != this.inverted ) )
{
// Convert to fluid
GaseousEssentia gas = GaseousEssentia.getGasFromAspect( essentiaStack.getAspect() );
Expand Down Expand Up @@ -577,12 +577,12 @@ public boolean validForPass( final int pass )
// Is this the priority pass?
if( pass == 1 )
{
// Valid if has filters or container has something in it
return( hasFilters || hasStored );
// Valid if has whitelist or container has something in it
return( ( hasFilters && !this.inverted ) || hasStored );
}

// Valid if has no filters.
return( !hasFilters );
// Valid if has no filters or is blacklist.
return( !hasFilters || this.inverted );

}

Expand Down

0 comments on commit d2aa73f

Please sign in to comment.