forked from AppliedEnergistics/Applied-Energistics-2
-
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.
large item cells (AppliedEnergistics#234)
* fluid energy and io multiplier * oversight * requst changes * large item cells
- Loading branch information
Showing
23 changed files
with
300 additions
and
50 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
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
63 changes: 63 additions & 0 deletions
63
src/main/java/appeng/items/storage/ItemAdvancedStorageCell.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,63 @@ | ||
package appeng.items.storage; | ||
|
||
import appeng.api.AEApi; | ||
import appeng.api.definitions.IItemDefinition; | ||
import appeng.api.exceptions.MissingDefinition; | ||
import appeng.core.features.AEFeature; | ||
import appeng.items.materials.MaterialType; | ||
import com.google.common.base.Optional; | ||
import java.util.EnumSet; | ||
import net.minecraft.item.ItemStack; | ||
|
||
public class ItemAdvancedStorageCell extends ItemBasicStorageCell { | ||
|
||
@SuppressWarnings("Guava") | ||
public ItemAdvancedStorageCell(final MaterialType whichCell, final int kilobytes) { | ||
super(Optional.of(kilobytes + "k")); | ||
|
||
this.setFeature(EnumSet.of(AEFeature.StorageCells)); | ||
this.setMaxStackSize(1); | ||
this.totalBytes = kilobytes * 1024; | ||
this.component = whichCell; | ||
|
||
switch (this.component) { | ||
case Cell256kPart: | ||
this.idleDrain = 2.5; | ||
this.perType = 2048; | ||
break; | ||
case Cell1024kPart: | ||
this.idleDrain = 3.0; | ||
this.perType = 8192; | ||
break; | ||
case Cell4096kPart: | ||
this.idleDrain = 3.5; | ||
this.perType = 32768; | ||
break; | ||
case Cell16384kPart: | ||
this.idleDrain = 4.0; | ||
this.perType = 131072; | ||
break; | ||
default: | ||
this.idleDrain = 0.0; | ||
this.perType = 8; | ||
} | ||
} | ||
|
||
@Override | ||
protected IItemDefinition getStorageCellCase() { | ||
return AEApi.instance().definitions().materials().emptyAdvancedStorageCell(); | ||
} | ||
|
||
@Override | ||
public ItemStack getContainerItem(final ItemStack itemStack) { | ||
for (final ItemStack stack : AEApi.instance() | ||
.definitions() | ||
.materials() | ||
.emptyAdvancedStorageCell() | ||
.maybeStack(1) | ||
.asSet()) { | ||
return stack; | ||
} | ||
throw new MissingDefinition("Tried to use empty storage cells while basic storage cells are defined."); | ||
} | ||
} |
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.