mirror of
https://github.com/GTNewHorizons/AE2FluidCraft-Rework.git
synced 2026-11-12 00:07:29 +00:00
16 files changed
+383
-228
No files matched your search
+2
-2
@@ -2,10 +2,10 @@
|
||||
|
||||
dependencies {
|
||||
compile('com.github.GTNewHorizons:NotEnoughItems:2.3.21-GTNH:dev')
|
||||
compile('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-149-GTNH:dev')
|
||||
compile('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-156-GTNH:dev')
|
||||
compile('curse.maven:cofh-core-69162:2388751')
|
||||
compile('com.github.GTNewHorizons:waila:1.5.22:dev')
|
||||
compileOnly('com.github.GTNewHorizons:ExtraCells2:2.5.25:dev') { transitive = false }
|
||||
compileOnly('com.github.GTNewHorizons:ExtraCells2:2.5.32:dev') { transitive = false }
|
||||
compileOnly("com.github.GTNewHorizons:WirelessCraftingTerminal:1.8.9.2:dev")
|
||||
|
||||
compileOnly('com.github.GTNewHorizons:ForestryMC:4.5.6:dev')
|
||||
|
||||
+5
@@ -16,6 +16,7 @@ import com.glodblock.github.inventory.InventoryHandler;
|
||||
import com.glodblock.github.inventory.gui.GuiType;
|
||||
import com.glodblock.github.inventory.item.IWirelessTerminal;
|
||||
import com.glodblock.github.inventory.item.WirelessFluidTerminalInventory;
|
||||
import com.glodblock.github.inventory.item.WirelessInterfaceTerminalInventory;
|
||||
import com.glodblock.github.inventory.item.WirelessPatternTerminalInventory;
|
||||
import com.glodblock.github.loader.ItemAndBlockHolder;
|
||||
import com.glodblock.github.util.Ae2ReflectClient;
|
||||
@@ -44,6 +45,8 @@ public class GuiFluidPatternTerminalCraftingStatus extends GuiCraftingStatus {
|
||||
Ae2ReflectClient.rewriteIcon(this, new ItemStack(ItemAndBlockHolder.WIRELESS_FLUID_TERM, 1));
|
||||
} else if (host instanceof WirelessPatternTerminalInventory) {
|
||||
Ae2ReflectClient.rewriteIcon(this, new ItemStack(ItemAndBlockHolder.WIRELESS_PATTERN_TERM, 1));
|
||||
} else if (host instanceof WirelessInterfaceTerminalInventory) {
|
||||
Ae2ReflectClient.rewriteIcon(this, new ItemStack(ItemAndBlockHolder.WIRELESS_INTERFACE_TERM, 1));
|
||||
}
|
||||
super.initGui();
|
||||
originalGuiBtn = Ae2ReflectClient.getOriginalGuiButton(this);
|
||||
@@ -62,6 +65,8 @@ public class GuiFluidPatternTerminalCraftingStatus extends GuiCraftingStatus {
|
||||
InventoryHandler.switchGui(GuiType.WIRELESS_FLUID_TERMINAL);
|
||||
else if (host instanceof WirelessPatternTerminalInventory)
|
||||
InventoryHandler.switchGui(GuiType.WIRELESS_FLUID_PATTERN_TERMINAL);
|
||||
else if (host instanceof WirelessInterfaceTerminalInventory)
|
||||
InventoryHandler.switchGui(GuiType.WIRELESS_INTERFACE_TERMINAL);
|
||||
} else {
|
||||
super.actionPerformed(btn);
|
||||
}
|
||||
|
||||
@@ -15,16 +15,10 @@ import org.lwjgl.input.Mouse;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.ActionItems;
|
||||
import appeng.api.config.Settings;
|
||||
import appeng.api.config.TerminalStyle;
|
||||
import appeng.api.config.YesNo;
|
||||
import appeng.api.config.*;
|
||||
import appeng.api.util.DimensionalCoord;
|
||||
import appeng.api.util.WorldCoord;
|
||||
import appeng.client.gui.widgets.GuiImgButton;
|
||||
import appeng.client.gui.widgets.GuiScrollbar;
|
||||
import appeng.client.gui.widgets.IDropToFillTextField;
|
||||
import appeng.client.gui.widgets.MEGuiTextField;
|
||||
import appeng.client.gui.widgets.*;
|
||||
import appeng.client.me.ClientDCInternalInv;
|
||||
import appeng.client.me.SlotDisconnected;
|
||||
import appeng.client.render.BlockPosHighlighter;
|
||||
@@ -43,6 +37,8 @@ import appeng.util.Platform;
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.client.gui.base.FCBaseMEGui;
|
||||
import com.glodblock.github.client.gui.container.ContainerInterfaceWireless;
|
||||
import com.glodblock.github.inventory.InventoryHandler;
|
||||
import com.glodblock.github.inventory.gui.GuiType;
|
||||
import com.glodblock.github.inventory.item.IWirelessTerminal;
|
||||
import com.glodblock.github.network.CPacketRenamer;
|
||||
import com.glodblock.github.util.ModAndClassUtil;
|
||||
@@ -78,6 +74,7 @@ public class GuiInterfaceTerminalWireless extends FCBaseMEGui implements IDropTo
|
||||
private boolean refreshList = false;
|
||||
protected static boolean onlyMolecularAssemblers = false;
|
||||
protected static boolean onlyBrokenRecipes = false;
|
||||
protected GuiTabButton craftingStatusBtn;
|
||||
|
||||
// private final IConfigManager configSrc;
|
||||
private int rows = 3;
|
||||
@@ -179,6 +176,14 @@ public class GuiInterfaceTerminalWireless extends FCBaseMEGui implements IDropTo
|
||||
|
||||
terminalStyleBox.xPosition = guiLeft - 18;
|
||||
terminalStyleBox.yPosition = guiTop + 8;
|
||||
this.buttonList.add(
|
||||
this.craftingStatusBtn = new GuiTabButton(
|
||||
this.guiLeft + this.xSize - 24,
|
||||
this.guiTop - 4,
|
||||
2 + 11 * 16,
|
||||
GuiText.CraftingStatus.getLocal(),
|
||||
itemRender));
|
||||
this.craftingStatusBtn.setHideEdge(13); // GuiTabButton implementation //
|
||||
|
||||
if (ModAndClassUtil.isSearchBar && (AEConfig.instance.preserveSearchBar || this.isSubGui())) {
|
||||
setSearchString();
|
||||
@@ -296,6 +301,7 @@ public class GuiInterfaceTerminalWireless extends FCBaseMEGui implements IDropTo
|
||||
|
||||
buttonList.add(terminalStyleBox);
|
||||
buttonList.add(searchStringSave);
|
||||
buttonList.add(craftingStatusBtn);
|
||||
addSwitchGuiBtns();
|
||||
|
||||
int offset = 51;
|
||||
@@ -391,6 +397,8 @@ public class GuiInterfaceTerminalWireless extends FCBaseMEGui implements IDropTo
|
||||
AEConfig.instance.settings.putSetting(Settings.SAVE_SEARCH, next);
|
||||
this.searchStringSave.set(next);
|
||||
|
||||
} else if (btn == craftingStatusBtn) {
|
||||
InventoryHandler.switchGui(GuiType.CRAFTING_STATUS);
|
||||
} else if (btn instanceof GuiImgButton) {
|
||||
final GuiImgButton iBtn = (GuiImgButton) btn;
|
||||
if (iBtn.getSetting() != Settings.ACTIONS) {
|
||||
|
||||
@@ -0,0 +1,249 @@
|
||||
package com.glodblock.github.common.item;
|
||||
|
||||
import java.text.NumberFormat;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.FuzzyMode;
|
||||
import appeng.api.config.IncludeExclude;
|
||||
import appeng.api.storage.IMEInventoryHandler;
|
||||
import appeng.api.storage.StorageChannel;
|
||||
import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.items.AEBaseItem;
|
||||
import appeng.items.contents.CellConfig;
|
||||
import appeng.items.contents.CellUpgrades;
|
||||
import appeng.util.Platform;
|
||||
import appeng.util.ReadableNumberConverter;
|
||||
|
||||
import com.glodblock.github.common.Config;
|
||||
import com.glodblock.github.common.storage.CellType;
|
||||
import com.glodblock.github.common.storage.IFluidCellInventory;
|
||||
import com.glodblock.github.common.storage.IFluidCellInventoryHandler;
|
||||
import com.glodblock.github.common.storage.IStorageFluidCell;
|
||||
import com.glodblock.github.util.ModAndClassUtil;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
import com.google.common.base.Optional;
|
||||
|
||||
public abstract class FCBaseItemCell extends AEBaseItem implements IStorageFluidCell {
|
||||
|
||||
protected final CellType component;
|
||||
protected final long totalBytes;
|
||||
protected final int perType;
|
||||
protected final double idleDrain;
|
||||
private final ReadableNumberConverter format = ReadableNumberConverter.INSTANCE;
|
||||
|
||||
@SuppressWarnings("Guava")
|
||||
public FCBaseItemCell(long bytes, int perType, double drain) {
|
||||
super(Optional.of(bytes / 1024 + "k"));
|
||||
this.setFeature(EnumSet.of(AEFeature.StorageCells));
|
||||
this.setMaxStackSize(1);
|
||||
this.totalBytes = bytes;
|
||||
this.perType = perType;
|
||||
this.idleDrain = drain;
|
||||
this.component = null;
|
||||
}
|
||||
|
||||
@SuppressWarnings("Guava")
|
||||
public FCBaseItemCell(final CellType whichCell, final long 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 Cell1kPart:
|
||||
this.idleDrain = 0.5;
|
||||
this.perType = 8;
|
||||
break;
|
||||
case Cell4kPart:
|
||||
this.idleDrain = 1.0;
|
||||
this.perType = 8;
|
||||
break;
|
||||
case Cell16kPart:
|
||||
this.idleDrain = 1.5;
|
||||
this.perType = 8;
|
||||
break;
|
||||
case Cell64kPart:
|
||||
this.idleDrain = 2.0;
|
||||
this.perType = 8;
|
||||
break;
|
||||
case Cell256kPart:
|
||||
this.idleDrain = 2.5;
|
||||
this.perType = 8;
|
||||
break;
|
||||
case Cell1024kPart:
|
||||
this.idleDrain = 3.0;
|
||||
this.perType = 8;
|
||||
break;
|
||||
case Cell4096kPart:
|
||||
this.idleDrain = 3.5;
|
||||
this.perType = 8;
|
||||
break;
|
||||
case Cell16384kPart:
|
||||
this.idleDrain = 4.0;
|
||||
this.perType = 8;
|
||||
break;
|
||||
default:
|
||||
this.idleDrain = 0.0;
|
||||
this.perType = 8;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getBytes(ItemStack cellItem) {
|
||||
return this.totalBytes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBytesPerType(ItemStack cellItem) {
|
||||
return this.perType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBlackListed(ItemStack cellItem, IAEFluidStack requestedAddition) {
|
||||
if (Config.blacklistEssentiaGas && ModAndClassUtil.ThE && requestedAddition != null) {
|
||||
return ModAndClassUtil.essentiaGas.isInstance(requestedAddition.getFluid());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCheckedInformation(final ItemStack stack, final EntityPlayer player, final List<String> lines,
|
||||
final boolean displayMoreInfo) {
|
||||
final IMEInventoryHandler<?> inventory = AEApi.instance().registries().cell()
|
||||
.getCellInventory(stack, null, StorageChannel.FLUIDS);
|
||||
|
||||
if (inventory instanceof IFluidCellInventoryHandler) {
|
||||
final IFluidCellInventoryHandler handler = (IFluidCellInventoryHandler) inventory;
|
||||
final IFluidCellInventory cellInventory = handler.getCellInv();
|
||||
|
||||
if (cellInventory != null) {
|
||||
lines.add(
|
||||
EnumChatFormatting.WHITE + String.valueOf(cellInventory.getUsedBytes())
|
||||
+ EnumChatFormatting.GRAY
|
||||
+ " "
|
||||
+ GuiText.Of.getLocal()
|
||||
+ " "
|
||||
+ EnumChatFormatting.DARK_GREEN
|
||||
+ NumberFormat.getInstance().format(cellInventory.getTotalBytes())
|
||||
+ " "
|
||||
+ EnumChatFormatting.GRAY
|
||||
+ GuiText.BytesUsed.getLocal());
|
||||
lines.add(
|
||||
EnumChatFormatting.WHITE + String.valueOf(cellInventory.getStoredFluidTypes())
|
||||
+ EnumChatFormatting.GRAY
|
||||
+ " "
|
||||
+ GuiText.Of.getLocal()
|
||||
+ " "
|
||||
+ EnumChatFormatting.DARK_GREEN
|
||||
+ cellInventory.getTotalFluidTypes()
|
||||
+ " "
|
||||
+ EnumChatFormatting.GRAY
|
||||
+ GuiText.Types.getLocal());
|
||||
|
||||
if (GuiScreen.isCtrlKeyDown()) {
|
||||
if (cellInventory.getStoredFluidTypes() > 0) {
|
||||
lines.add(StatCollector.translateToLocal(NameConst.TT_CELL_CONTENTS));
|
||||
for (IAEFluidStack fluid : cellInventory.getContents()) {
|
||||
if (fluid != null) {
|
||||
lines.add(
|
||||
String.format(
|
||||
" %s x%s mB",
|
||||
fluid.getFluidStack().getLocalizedName(),
|
||||
format.toWideReadableForm(fluid.getStackSize())));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
lines.add(StatCollector.translateToLocal(NameConst.TT_CELL_EMPTY));
|
||||
}
|
||||
} else {
|
||||
lines.add(StatCollector.translateToLocal(NameConst.TT_CTRL_FOR_MORE));
|
||||
}
|
||||
|
||||
if (handler.isPreformatted()) {
|
||||
final String list = (handler.getIncludeExcludeMode() == IncludeExclude.WHITELIST ? GuiText.Included
|
||||
: GuiText.Excluded).getLocal();
|
||||
lines.add(GuiText.Partitioned.getLocal() + " - " + list + ' ' + GuiText.Precise.getLocal());
|
||||
|
||||
if (GuiScreen.isShiftKeyDown()) {
|
||||
lines.add(GuiText.Filter.getLocal() + ": ");
|
||||
for (IAEFluidStack aeFluidStack : handler.getPartitionInv()) {
|
||||
if (aeFluidStack != null) lines.add(" " + aeFluidStack.getFluidStack().getLocalizedName());
|
||||
}
|
||||
} else {
|
||||
lines.add(StatCollector.translateToLocal(NameConst.TT_SHIFT_FOR_MORE));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean storableInStorageCell() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isStorageCell(ItemStack i) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getIdleDrain() {
|
||||
return this.idleDrain;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTotalTypes(final ItemStack cellItem) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEditable(ItemStack is) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IInventory getUpgradesInventory(ItemStack is) {
|
||||
return new CellUpgrades(is, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IInventory getConfigInventory(ItemStack is) {
|
||||
return new CellConfig(is);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FuzzyMode getFuzzyMode(ItemStack is) {
|
||||
final String fz = Platform.openNbtData(is).getString("FuzzyMode");
|
||||
try {
|
||||
return FuzzyMode.valueOf(fz);
|
||||
} catch (final Throwable t) {
|
||||
return FuzzyMode.IGNORE_ALL;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFuzzyMode(ItemStack is, FuzzyMode fzMode) {
|
||||
Platform.openNbtData(is).setString("FuzzyMode", fzMode.name());
|
||||
}
|
||||
|
||||
public ItemStack stack(int size) {
|
||||
return new ItemStack(this, size);
|
||||
}
|
||||
|
||||
public ItemStack stack() {
|
||||
return new ItemStack(this, 1);
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,7 @@
|
||||
package com.glodblock.github.common.item;
|
||||
|
||||
import java.util.EnumSet;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
@@ -18,8 +15,6 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.event.ForgeEventFactory;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.FuzzyMode;
|
||||
import appeng.api.config.IncludeExclude;
|
||||
import appeng.api.exceptions.MissingDefinition;
|
||||
import appeng.api.implementations.items.IUpgradeModule;
|
||||
import appeng.api.storage.IMEInventoryHandler;
|
||||
@@ -28,86 +23,29 @@ import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.api.storage.data.IItemList;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.items.AEBaseItem;
|
||||
import appeng.items.contents.CellConfig;
|
||||
import appeng.items.contents.CellUpgrades;
|
||||
import appeng.util.InventoryAdaptor;
|
||||
import appeng.util.Platform;
|
||||
import appeng.util.ReadableNumberConverter;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.common.Config;
|
||||
import com.glodblock.github.common.storage.CellType;
|
||||
import com.glodblock.github.common.storage.IFluidCellInventory;
|
||||
import com.glodblock.github.common.storage.IFluidCellInventoryHandler;
|
||||
import com.glodblock.github.common.storage.IStorageFluidCell;
|
||||
import com.glodblock.github.common.tabs.FluidCraftingTabs;
|
||||
import com.glodblock.github.loader.IRegister;
|
||||
import com.glodblock.github.util.ModAndClassUtil;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
import com.google.common.base.Optional;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemBasicFluidStorageCell extends AEBaseItem
|
||||
public class ItemBasicFluidStorageCell extends FCBaseItemCell
|
||||
implements IStorageFluidCell, IRegister<ItemBasicFluidStorageCell> {
|
||||
|
||||
private final CellType component;
|
||||
private final int totalBytes;
|
||||
private final int perType;
|
||||
private final double idleDrain;
|
||||
private final ReadableNumberConverter format = ReadableNumberConverter.INSTANCE;
|
||||
private static final HashMap<Integer, IIcon> icon = new HashMap<>();
|
||||
|
||||
@SuppressWarnings("Guava")
|
||||
public ItemBasicFluidStorageCell(final CellType whichCell, final int kilobytes) {
|
||||
super(Optional.of(kilobytes + "k"));
|
||||
public ItemBasicFluidStorageCell(final CellType whichCell, final long kilobytes) {
|
||||
super(whichCell, kilobytes);
|
||||
setUnlocalizedName(NameConst.ITEM_FLUID_STORAGE + kilobytes);
|
||||
this.setFeature(EnumSet.of(AEFeature.StorageCells));
|
||||
this.setMaxStackSize(1);
|
||||
this.totalBytes = kilobytes * 1024;
|
||||
this.component = whichCell;
|
||||
|
||||
switch (this.component) {
|
||||
case Cell1kPart:
|
||||
this.idleDrain = 0.5;
|
||||
this.perType = 8;
|
||||
break;
|
||||
case Cell4kPart:
|
||||
this.idleDrain = 1.0;
|
||||
this.perType = 8;
|
||||
break;
|
||||
case Cell16kPart:
|
||||
this.idleDrain = 1.5;
|
||||
this.perType = 8;
|
||||
break;
|
||||
case Cell64kPart:
|
||||
this.idleDrain = 2.0;
|
||||
this.perType = 8;
|
||||
break;
|
||||
case Cell256kPart:
|
||||
this.idleDrain = 2.5;
|
||||
this.perType = 8;
|
||||
break;
|
||||
case Cell1024kPart:
|
||||
this.idleDrain = 3.0;
|
||||
this.perType = 8;
|
||||
break;
|
||||
case Cell4096kPart:
|
||||
this.idleDrain = 3.5;
|
||||
this.perType = 8;
|
||||
break;
|
||||
case Cell16384kPart:
|
||||
this.idleDrain = 4.0;
|
||||
this.perType = 8;
|
||||
break;
|
||||
default:
|
||||
this.idleDrain = 0.0;
|
||||
this.perType = 8;
|
||||
}
|
||||
}
|
||||
|
||||
public ItemStack getComponent() {
|
||||
@@ -126,7 +64,7 @@ public class ItemBasicFluidStorageCell extends AEBaseItem
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
icon.put(
|
||||
this.totalBytes / 1024,
|
||||
(int) (this.totalBytes / 1024),
|
||||
iconRegister
|
||||
.registerIcon(NameConst.RES_KEY + NameConst.ITEM_FLUID_STORAGE + "." + this.totalBytes / 1024));
|
||||
}
|
||||
@@ -134,149 +72,10 @@ public class ItemBasicFluidStorageCell extends AEBaseItem
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int meta) {
|
||||
int id = this.totalBytes / 1024;
|
||||
int id = (int) (this.totalBytes / 1024);
|
||||
return icon.get(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCheckedInformation(final ItemStack stack, final EntityPlayer player, final List<String> lines,
|
||||
final boolean displayMoreInfo) {
|
||||
final IMEInventoryHandler<?> inventory = AEApi.instance().registries().cell()
|
||||
.getCellInventory(stack, null, StorageChannel.FLUIDS);
|
||||
|
||||
if (inventory instanceof IFluidCellInventoryHandler) {
|
||||
final IFluidCellInventoryHandler handler = (IFluidCellInventoryHandler) inventory;
|
||||
final IFluidCellInventory cellInventory = handler.getCellInv();
|
||||
|
||||
if (cellInventory != null) {
|
||||
lines.add(
|
||||
EnumChatFormatting.WHITE + String.valueOf(cellInventory.getUsedBytes())
|
||||
+ EnumChatFormatting.GRAY
|
||||
+ " "
|
||||
+ GuiText.Of.getLocal()
|
||||
+ " "
|
||||
+ EnumChatFormatting.DARK_GREEN
|
||||
+ cellInventory.getTotalBytes()
|
||||
+ " "
|
||||
+ EnumChatFormatting.GRAY
|
||||
+ GuiText.BytesUsed.getLocal());
|
||||
lines.add(
|
||||
EnumChatFormatting.WHITE + String.valueOf(cellInventory.getStoredFluidTypes())
|
||||
+ EnumChatFormatting.GRAY
|
||||
+ " "
|
||||
+ GuiText.Of.getLocal()
|
||||
+ " "
|
||||
+ EnumChatFormatting.DARK_GREEN
|
||||
+ cellInventory.getTotalFluidTypes()
|
||||
+ " "
|
||||
+ EnumChatFormatting.GRAY
|
||||
+ GuiText.Types.getLocal());
|
||||
|
||||
if (GuiScreen.isCtrlKeyDown()) {
|
||||
if (cellInventory.getStoredFluidTypes() > 0) {
|
||||
lines.add(StatCollector.translateToLocal(NameConst.TT_CELL_CONTENTS));
|
||||
for (IAEFluidStack fluid : cellInventory.getContents()) {
|
||||
if (fluid != null) {
|
||||
lines.add(
|
||||
String.format(
|
||||
" %s x%s mB",
|
||||
fluid.getFluidStack().getLocalizedName(),
|
||||
format.toWideReadableForm(fluid.getStackSize())));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
lines.add(StatCollector.translateToLocal(NameConst.TT_CELL_EMPTY));
|
||||
}
|
||||
} else {
|
||||
lines.add(StatCollector.translateToLocal(NameConst.TT_CTRL_FOR_MORE));
|
||||
}
|
||||
|
||||
if (handler.isPreformatted()) {
|
||||
final String list = (handler.getIncludeExcludeMode() == IncludeExclude.WHITELIST ? GuiText.Included
|
||||
: GuiText.Excluded).getLocal();
|
||||
lines.add(GuiText.Partitioned.getLocal() + " - " + list + ' ' + GuiText.Precise.getLocal());
|
||||
|
||||
if (GuiScreen.isShiftKeyDown()) {
|
||||
lines.add(GuiText.Filter.getLocal() + ": ");
|
||||
for (IAEFluidStack aeFluidStack : handler.getPartitionInv()) {
|
||||
if (aeFluidStack != null) lines.add(" " + aeFluidStack.getFluidStack().getLocalizedName());
|
||||
}
|
||||
} else {
|
||||
lines.add(StatCollector.translateToLocal(NameConst.TT_SHIFT_FOR_MORE));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBytes(final ItemStack cellItem) {
|
||||
return this.totalBytes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBytesPerType(final ItemStack cellItem) {
|
||||
return this.perType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBlackListed(ItemStack cellItem, IAEFluidStack requestedAddition) {
|
||||
if (Config.blacklistEssentiaGas && ModAndClassUtil.ThE && requestedAddition != null) {
|
||||
return ModAndClassUtil.essentiaGas.isInstance(requestedAddition.getFluid());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTotalTypes(final ItemStack cellItem) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean storableInStorageCell() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isStorageCell(final ItemStack i) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getIdleDrain() {
|
||||
return this.idleDrain;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEditable(final ItemStack is) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IInventory getUpgradesInventory(final ItemStack is) {
|
||||
return new CellUpgrades(is, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IInventory getConfigInventory(final ItemStack is) {
|
||||
return new CellConfig(is);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FuzzyMode getFuzzyMode(final ItemStack is) {
|
||||
final String fz = Platform.openNbtData(is).getString("FuzzyMode");
|
||||
try {
|
||||
return FuzzyMode.valueOf(fz);
|
||||
} catch (final Throwable t) {
|
||||
return FuzzyMode.IGNORE_ALL;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFuzzyMode(final ItemStack is, final FuzzyMode fzMode) {
|
||||
Platform.openNbtData(is).setString("FuzzyMode", fzMode.name());
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(final ItemStack stack, final World world, final EntityPlayer player) {
|
||||
this.disassembleDrive(stack, world, player);
|
||||
@@ -360,12 +159,4 @@ public class ItemBasicFluidStorageCell extends AEBaseItem
|
||||
setCreativeTab(FluidCraftingTabs.INSTANCE);
|
||||
return this;
|
||||
}
|
||||
|
||||
public ItemStack stack(int size) {
|
||||
return new ItemStack(this, size);
|
||||
}
|
||||
|
||||
public ItemStack stack() {
|
||||
return new ItemStack(this, 1);
|
||||
}
|
||||
}
|
||||
@@ -43,7 +43,7 @@ public class ItemCreativeFluidStorageCell extends AEBaseItem
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBytes(ItemStack cellItem) {
|
||||
public long getBytes(ItemStack cellItem) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.glodblock.github.common.item;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.common.Config;
|
||||
import com.glodblock.github.common.storage.IStorageFluidCell;
|
||||
import com.glodblock.github.common.tabs.FluidCraftingTabs;
|
||||
import com.glodblock.github.loader.IRegister;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
public class ItemFluidExtremeStorageCell extends FCBaseItemCell
|
||||
implements IStorageFluidCell, IRegister<ItemFluidExtremeStorageCell> {
|
||||
|
||||
private final String name;
|
||||
|
||||
public ItemFluidExtremeStorageCell(String name, long bytes, int perType, double drain) {
|
||||
super(bytes, perType, drain);
|
||||
setUnlocalizedName(name);
|
||||
this.name = name;
|
||||
setTextureName(FluidCraft.resource(name).toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(final ItemStack stack, final World world, final EntityPlayer player) {
|
||||
return stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side,
|
||||
float hitX, float hitY, float hitZ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getContainerItem(final ItemStack itemStack) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasContainerItem(final ItemStack stack) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemFluidExtremeStorageCell register() {
|
||||
if (!Config.fluidCells) return null;
|
||||
GameRegistry.registerItem(this, this.name, FluidCraft.MODID);
|
||||
setCreativeTab(FluidCraftingTabs.INSTANCE);
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -117,7 +117,7 @@ public class ItemPortableFluidCell extends AEBasePoweredItem
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBytes(final ItemStack cellItem) {
|
||||
public long getBytes(final ItemStack cellItem) {
|
||||
return 256;
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import appeng.api.storage.data.IAEFluidStack;
|
||||
|
||||
public interface IStorageFluidCell extends ICellWorkbenchItem {
|
||||
|
||||
int getBytes(ItemStack cellItem);
|
||||
long getBytes(ItemStack cellItem);
|
||||
|
||||
int getBytesPerType(ItemStack cellItem);
|
||||
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
package com.glodblock.github.loader;
|
||||
|
||||
import static com.glodblock.github.common.storage.FluidCellInventory.singleByteAmount;
|
||||
|
||||
import com.glodblock.github.common.Config;
|
||||
import com.glodblock.github.common.block.*;
|
||||
import com.glodblock.github.common.item.*;
|
||||
import com.glodblock.github.common.storage.CellType;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
|
||||
public class ItemAndBlockHolder {
|
||||
|
||||
@@ -52,6 +55,16 @@ public class ItemAndBlockHolder {
|
||||
.register();
|
||||
public static ItemBasicFluidStorageCell CELL16384K = new ItemBasicFluidStorageCell(CellType.Cell16384kPart, 16384)
|
||||
.register();
|
||||
public static ItemFluidExtremeStorageCell QUANTUM_CELL = new ItemFluidExtremeStorageCell(
|
||||
NameConst.ITEM_QUANTUM_FLUID_STORAGE,
|
||||
Integer.MAX_VALUE / 16,
|
||||
8,
|
||||
4.5).register();
|
||||
public static ItemFluidExtremeStorageCell SINGULARITY_CELL = new ItemFluidExtremeStorageCell(
|
||||
NameConst.ITEM_SINGULARITY_FLUID_STORAGE,
|
||||
Long.MAX_VALUE / (singleByteAmount * 2),
|
||||
8,
|
||||
5).register();
|
||||
public static ItemCreativeFluidStorageCell CREATIVE_CELL = new ItemCreativeFluidStorageCell().register();
|
||||
public static ItemBasicFluidStoragePart CELL_PART = new ItemBasicFluidStoragePart().register();
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.glodblock.github.loader;
|
||||
|
||||
import static com.glodblock.github.common.storage.CellType.Cell16384kPart;
|
||||
import static com.glodblock.github.loader.ItemAndBlockHolder.*;
|
||||
import static net.minecraft.init.Blocks.redstone_torch;
|
||||
import static net.minecraft.init.Items.fish;
|
||||
@@ -109,6 +110,12 @@ public class RecipeLoader implements Runnable {
|
||||
.findItemStack("appliedenergistics2", "tile.BlockChest", 1);
|
||||
public static final ItemStack AE2_ENERGY_CELL = GameRegistry
|
||||
.findItemStack("appliedenergistics2", "tile.BlockEnergyCell", 1);
|
||||
public static final ItemStack AE2_MATTER_CONDENSER = GameRegistry
|
||||
.findItemStack("appliedenergistics2", "tile.BlockCondenser", 1);
|
||||
public static final ItemStack AE2_QUANTUM_RING = GameRegistry
|
||||
.findItemStack("appliedenergistics2", "tile.BlockQuantumRing", 1);
|
||||
public static final ItemStack AE2_DENSE_ENERGY_CELL = GameRegistry
|
||||
.findItemStack("appliedenergistics2", "tile.BlockDenseEnergyCell", 1);
|
||||
public static final ItemStack THE_WIRELESS_TERM = GameRegistry
|
||||
.findItemStack("thaumicenergistics", "wireless.essentia.terminal", 1);
|
||||
private static final ItemStack WCT_WIRELESS_TERM = GameRegistry
|
||||
@@ -392,7 +399,28 @@ public class RecipeLoader implements Runnable {
|
||||
|
||||
ItemBasicFluidStorageCell[] cells = new ItemBasicFluidStorageCell[] { CELL1K, CELL4K, CELL16K, CELL64K,
|
||||
CELL256K, CELL1024K, CELL4096K, CELL16384K };
|
||||
|
||||
GameRegistry.addRecipe(
|
||||
new ShapedOreRecipe(
|
||||
QUANTUM_CELL.stack(),
|
||||
"RCR",
|
||||
"CEC",
|
||||
"RCR",
|
||||
'C',
|
||||
Cell16384kPart.stack(1),
|
||||
'E',
|
||||
AE2_DENSE_ENERGY_CELL,
|
||||
'R',
|
||||
AE2_QUANTUM_RING));
|
||||
GameRegistry.addRecipe(
|
||||
new ShapedOreRecipe(
|
||||
SINGULARITY_CELL.stack(),
|
||||
"CCC",
|
||||
"CMC",
|
||||
"CCC",
|
||||
'C',
|
||||
QUANTUM_CELL,
|
||||
'M',
|
||||
AE2_MATTER_CONDENSER));
|
||||
for (ItemBasicFluidStorageCell cell : cells) {
|
||||
GameRegistry.addRecipe(
|
||||
new ShapedOreRecipe(
|
||||
|
||||
@@ -35,6 +35,8 @@ public class NameConst {
|
||||
public static final String ITEM_PART_FLUID_LEVEL_EMITTER = "part_fluid_level_emitter";
|
||||
public static final String ITEM_FLUID_PACKET = "fluid_packet";
|
||||
public static final String ITEM_FLUID_STORAGE = "fluid_storage";
|
||||
public static final String ITEM_QUANTUM_FLUID_STORAGE = ITEM_FLUID_STORAGE + ".quantum";
|
||||
public static final String ITEM_SINGULARITY_FLUID_STORAGE = ITEM_FLUID_STORAGE + ".singularity";
|
||||
public static final String ITEM_CREATIVE_FLUID_STORAGE = "creative_" + ITEM_FLUID_STORAGE;
|
||||
public static final String ITEM_FLUID_PORTABLE_CELL = "portable_fluid_cell";
|
||||
public static final String ITEM_WIRELESS_FLUID_TERMINAL = "wireless_fluid_terminal";
|
||||
|
||||
@@ -30,6 +30,8 @@ item.fluid_storage.256.name=%s256k%s ME Fluid Storage Cell
|
||||
item.fluid_storage.1024.name=%s1024k%s ME Fluid Storage Cell
|
||||
item.fluid_storage.4096.name=%s4096k%s ME Fluid Storage Cell
|
||||
item.fluid_storage.16384.name=%s16384k%s ME Fluid Storage Cell
|
||||
item.fluid_storage.quantum.name=ME Fluid Quantum Storage Cell
|
||||
item.fluid_storage.singularity.name=ME Fluid Digital Singularity Storage Cell
|
||||
item.fluid_part.0.name=%s1k%s ME Fluid Storage Component
|
||||
item.fluid_part.1.name=%s4k%s ME Fluid Storage Component
|
||||
item.fluid_part.2.name=%s16k%s ME Fluid Storage Component
|
||||
|
||||
@@ -30,6 +30,8 @@ item.fluid_storage.256.name=%s256k%s-ME流体存储元件
|
||||
item.fluid_storage.1024.name=%s1024k%s-ME流体存储元件
|
||||
item.fluid_storage.4096.name=%s4096k%s-ME流体存储元件
|
||||
item.fluid_storage.16384.name=%s16384k%s-ME流体存储元件
|
||||
item.fluid_storage.quantum.name=ME流体量子存储元件
|
||||
item.fluid_storage.singularity.name=ME流体数字奇点元件
|
||||
item.fluid_part.0.name=%s1k%s-ME流体存储组件
|
||||
item.fluid_part.1.name=%s4k%s-ME流体存储组件
|
||||
item.fluid_part.2.name=%s16k%s-ME流体存储组件
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 605 B |
Binary file not shown.
|
After Width: | Height: | Size: 641 B |
Reference in new issue
Block a user