-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4488822
commit c19c4e1
Showing
22 changed files
with
235 additions
and
39 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
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
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
12 changes: 12 additions & 0 deletions
12
src/main/java/info/loenwind/enderioaddons/machine/drain/filter/FluidFilter.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,12 @@ | ||
package info.loenwind.enderioaddons.machine.drain.filter; | ||
|
||
import net.minecraftforge.fluids.Fluid; | ||
import net.minecraftforge.fluids.FluidStack; | ||
|
||
public interface FluidFilter { | ||
|
||
boolean isFluid(FluidStack fluid); | ||
|
||
boolean isFluid(Fluid fluid); | ||
|
||
} |
46 changes: 46 additions & 0 deletions
46
src/main/java/info/loenwind/enderioaddons/machine/drain/filter/FoodFluidFilter.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,46 @@ | ||
package info.loenwind.enderioaddons.machine.drain.filter; | ||
|
||
import info.loenwind.enderioaddons.fluid.Fluids; | ||
import net.minecraftforge.fluids.Fluid; | ||
import net.minecraftforge.fluids.FluidStack; | ||
|
||
public class FoodFluidFilter implements FluidFilter { | ||
private FluidStack[] foodFluids; | ||
|
||
public FoodFluidFilter() { | ||
} | ||
|
||
public FluidStack[] getFluids() { | ||
if (foodFluids == null) { | ||
// delay this to allow fluids to be initialized | ||
foodFluids = new FluidStack[] { new FluidStack(Fluids.MILK.getFluid(), 0) }; | ||
} | ||
return foodFluids; | ||
} | ||
|
||
@Override | ||
public boolean isFluid(FluidStack fluid) { | ||
if (fluid == null || fluid.getFluid() == null) { | ||
return false; | ||
} | ||
for (FluidStack fluidStack : getFluids()) { | ||
if (fluidStack.isFluidEqual(fluid)) { | ||
return true; | ||
} | ||
} | ||
return false; | ||
} | ||
|
||
@Override | ||
public boolean isFluid(Fluid fluid) { | ||
if (fluid == null) { | ||
return false; | ||
} | ||
for (FluidStack fluidStack : getFluids()) { | ||
if (fluidStack.getFluid() == fluid) { | ||
return true; | ||
} | ||
} | ||
return false; | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
src/main/java/info/loenwind/enderioaddons/machine/drain/filter/NoFilter.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,24 @@ | ||
package info.loenwind.enderioaddons.machine.drain.filter; | ||
|
||
import net.minecraftforge.fluids.Fluid; | ||
import net.minecraftforge.fluids.FluidStack; | ||
|
||
public class NoFilter implements FluidFilter { | ||
|
||
private final boolean value; | ||
|
||
public NoFilter(boolean value) { | ||
this.value = value; | ||
} | ||
|
||
@Override | ||
public boolean isFluid(FluidStack fluid) { | ||
return value; | ||
} | ||
|
||
@Override | ||
public boolean isFluid(Fluid fluid) { | ||
return value; | ||
} | ||
|
||
} |
Oops, something went wrong.