This repository has been archived by the owner on Oct 4, 2024. It is now read-only.
generated from GregTech-Intergalactical/ExampleMod
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated antimatter, made drum item be an actual fluid storage item
- Loading branch information
Showing
6 changed files
with
58 additions
and
16 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
37 changes: 37 additions & 0 deletions
37
common/src/main/java/io/github/gregtechintergalactical/gtutility/item/ItemBlockDrum.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,37 @@ | ||
package io.github.gregtechintergalactical.gtutility.item; | ||
|
||
import earth.terrarium.botarium.common.fluid.base.FluidHolder; | ||
import io.github.gregtechintergalactical.gtutility.machine.DrumMachine; | ||
import muramasa.antimatter.block.AntimatterItemBlock; | ||
import muramasa.antimatter.data.AntimatterTags; | ||
import muramasa.antimatter.item.IFluidItem; | ||
import muramasa.antimatter.machine.BlockMachine; | ||
import tesseract.TesseractGraphWrappers; | ||
|
||
import java.util.function.BiPredicate; | ||
|
||
public class ItemBlockDrum extends AntimatterItemBlock implements IFluidItem { | ||
final DrumMachine machine; | ||
public ItemBlockDrum(BlockMachine block) { | ||
super(block); | ||
if (block.getType() instanceof DrumMachine machine){ | ||
this.machine = machine; | ||
} else { | ||
machine = null; | ||
} | ||
} | ||
|
||
@Override | ||
public long getTankSize() { | ||
if (machine != null) return machine.maxCapacity * TesseractGraphWrappers.dropletMultiplier; | ||
return 0; | ||
} | ||
|
||
@Override | ||
public BiPredicate<Integer, FluidHolder> getFilter() { | ||
return (i, f) -> { | ||
if (machine != null && !machine.isAcidProof() && f.getFluid().is(AntimatterTags.ACID)) return false; | ||
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
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