forked from AE2-UEL/AE2FluidCraft-Rework
-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add an API to allow other mods to blacklist fluids from this mod. * Removed Thaumic Energistics config setting. This will be handled by Thaumic Energistic's side (which also happens to have a config setting). * Added an API that allows for blacklisting fluids from either the storage or the display individually. * Prevent blacklisted fluids from being discretized * Update API usage - use AE2's new API - use ThE's config setting for aspect -> gas * spotlessApply --------- Co-authored-by: GitHub GTNH Actions <unknown>
- Loading branch information
Showing
19 changed files
with
237 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package com.glodblock.github.api; | ||
|
||
import java.util.HashSet; | ||
import java.util.Set; | ||
|
||
import net.minecraftforge.fluids.Fluid; | ||
|
||
public final class FluidCraftAPI implements IFluidCraftAPI { | ||
|
||
private static final FluidCraftAPI API = new FluidCraftAPI(); | ||
|
||
/** | ||
* These fluids will not be allowed to be stored in fluid storage cells. | ||
*/ | ||
private final Set<Class<? extends Fluid>> blacklistedFluids = new HashSet<>(); | ||
|
||
/** | ||
* These fluids will not be displayed in a fluid terminal. | ||
*/ | ||
private final Set<Class<? extends Fluid>> blacklistedDispFluids = new HashSet<>(); | ||
|
||
public static FluidCraftAPI instance() { | ||
return API; | ||
} | ||
|
||
@Override | ||
public void blacklistFluidInStorage(Class<? extends Fluid> fluid) { | ||
blacklistedFluids.add(fluid); | ||
} | ||
|
||
@Override | ||
public void blacklistFluidInDisplay(Class<? extends Fluid> fluid) { | ||
blacklistedDispFluids.add(fluid); | ||
} | ||
|
||
@Override | ||
public boolean isBlacklistedInStorage(Class<? extends Fluid> fluid) { | ||
return blacklistedFluids.contains(fluid); | ||
} | ||
|
||
@Override | ||
public boolean isBlacklistedInDisplay(Class<? extends Fluid> fluid) { | ||
return blacklistedDispFluids.contains(fluid); | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
src/main/java/com/glodblock/github/api/IFluidCraftAPI.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package com.glodblock.github.api; | ||
|
||
import net.minecraftforge.fluids.Fluid; | ||
|
||
@SuppressWarnings("unused") | ||
public interface IFluidCraftAPI { | ||
|
||
/** | ||
* Blacklisted fluids will not be allowed to be added to a storage cell. | ||
*/ | ||
void blacklistFluidInStorage(Class<? extends Fluid> fluid); | ||
|
||
/** | ||
* Blacklisted fluids will not be displayed in fluid terminals. | ||
*/ | ||
void blacklistFluidInDisplay(Class<? extends Fluid> fluid); | ||
|
||
/** | ||
* Mostly for internal use; queries whether the fluid is blacklisted from storage cells. | ||
*/ | ||
boolean isBlacklistedInStorage(Class<? extends Fluid> fluid); | ||
|
||
/** | ||
* Mostly for internal use; queries whether the fluid is blacklisted from being displayed. | ||
*/ | ||
boolean isBlacklistedInDisplay(Class<? extends Fluid> fluid); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.