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.
* fc terminal add type filter * Update dependencies.gradle --------- Co-authored-by: Raven Szewczyk <[email protected]>
- Loading branch information
1 parent
c92f8bd
commit b9724d9
Showing
10 changed files
with
70 additions
and
1 deletion.
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
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
34 changes: 34 additions & 0 deletions
34
src/main/java/com/glodblock/github/loader/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,34 @@ | ||
package com.glodblock.github.loader.filter; | ||
|
||
import static appeng.api.config.TypeFilter.*; | ||
|
||
import net.minecraft.item.Item; | ||
|
||
import appeng.api.config.TypeFilter; | ||
import appeng.api.storage.data.IAEItemStack; | ||
import appeng.api.storage.data.IAEStack; | ||
import appeng.client.me.ItemRepo; | ||
|
||
import com.glodblock.github.common.item.ItemFluidDrop; | ||
|
||
public class FluidFilter { | ||
|
||
public static void installFilter() { | ||
ItemRepo.registerTypeHandler(FluidFilter::filter, FLUIDS); | ||
} | ||
|
||
private static boolean filter(IAEStack<?> stack, TypeFilter typeFilter) { | ||
if (stack instanceof IAEItemStack) { | ||
Item item = ((IAEItemStack) stack).getItem(); | ||
if (item != null) { | ||
switch (typeFilter) { | ||
case ITEMS: | ||
return !(item instanceof ItemFluidDrop); | ||
case FLUIDS: | ||
return item instanceof ItemFluidDrop; | ||
} | ||
} | ||
} | ||
return true; | ||
} | ||
} |
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