forked from AE2-UEL/NAE2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Dense & Void Gas Cells (MekEng) (AE2-UEL#76)
- Loading branch information
Showing
34 changed files
with
419 additions
and
68 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
25 changes: 25 additions & 0 deletions
25
src/main/java/co/neeve/nae2/common/items/cells/DenseGasCell.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,25 @@ | ||
package co.neeve.nae2.common.items.cells; | ||
|
||
import appeng.core.Api; | ||
import co.neeve.nae2.common.registration.definitions.Materials; | ||
import com.mekeng.github.common.me.data.IAEGasStack; | ||
import com.mekeng.github.common.me.storage.IGasStorageChannel; | ||
import net.minecraft.item.ItemStack; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
public class DenseGasCell extends DenseCell<IAEGasStack> { | ||
public DenseGasCell(Materials.MaterialType whichCell, int kilobytes) { | ||
super(whichCell, kilobytes); | ||
} | ||
|
||
@NotNull | ||
@Override | ||
public IGasStorageChannel getChannel() { | ||
return Api.INSTANCE.storage().getStorageChannel(IGasStorageChannel.class); | ||
} | ||
|
||
@Override | ||
public int getTotalTypes(@NotNull ItemStack cellItem) { | ||
return 15; | ||
} | ||
} |
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/co/neeve/nae2/common/items/cells/vc/VoidGasCell.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 co.neeve.nae2.common.items.cells.vc; | ||
|
||
import appeng.api.AEApi; | ||
import appeng.api.storage.IStorageChannel; | ||
import appeng.items.contents.CellConfig; | ||
import com.mekeng.github.common.item.ItemDummyGas; | ||
import com.mekeng.github.common.me.data.IAEGasStack; | ||
import com.mekeng.github.common.me.data.impl.AEGasStack; | ||
import com.mekeng.github.common.me.storage.IGasStorageChannel; | ||
import com.mekeng.github.util.helpers.GasCellConfig; | ||
import net.minecraft.item.ItemStack; | ||
|
||
import javax.annotation.Nullable; | ||
|
||
public class VoidGasCell extends VoidCell<IAEGasStack> { | ||
@Override | ||
public IStorageChannel<IAEGasStack> getStorageChannel() { | ||
return AEApi.instance().storage().getStorageChannel(IGasStorageChannel.class); | ||
} | ||
|
||
@Override | ||
public CellConfig getCellConfig(ItemStack o) { | ||
return new GasCellConfig(o); | ||
} | ||
|
||
@Override | ||
@Nullable | ||
public IAEGasStack handleConfigStack(ItemStack stack) { | ||
if (stack.getItem() instanceof ItemDummyGas gasItem) { | ||
return AEGasStack.of(gasItem.getGasStack(stack)); | ||
} | ||
return null; | ||
} | ||
} |
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.