Skip to content

Commit

Permalink
Merge branch 'master' into fix-essentia-level-maintaining
Browse files Browse the repository at this point in the history
  • Loading branch information
Dream-Master authored Dec 26, 2024
2 parents d0005ad + 55f48a9 commit 2876db6
Show file tree
Hide file tree
Showing 9 changed files with 284 additions and 9 deletions.
18 changes: 9 additions & 9 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,31 +34,31 @@
* For more details, see https://docs.gradle.org/8.0.1/userguide/java_library_plugin.html#sec:java_library_configurations_graph
*/
dependencies {
api('com.github.GTNewHorizons:NotEnoughItems:2.6.51-GTNH:dev')
api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-502-GTNH:dev')
api('com.github.GTNewHorizons:NotEnoughItems:2.7.4-GTNH:dev')
api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-507-GTNH:dev')
api('curse.maven:cofh-core-69162:2388751')
api('com.github.GTNewHorizons:waila:1.8.2:dev')

implementation("com.github.GTNewHorizons:WirelessCraftingTerminal:1.11.7:dev") {
exclude group: 'com.github.GTNewHorizons', module: 'Applied-Energistics-2-Unofficial'
}

compileOnly("com.github.GTNewHorizons:GTNHLib:0.5.22:dev") { transitive = false }
compileOnly("com.github.GTNewHorizons:GTNHLib:0.6.0:dev") { transitive = false }
compileOnly('com.github.GTNewHorizons:Baubles-Expanded:2.0.3:dev')
compileOnly('com.github.GTNewHorizons:ExtraCells2:2.5.35:dev') { transitive = false }
compileOnly('com.github.GTNewHorizons:ForestryMC:4.9.19:dev')
compileOnly('com.github.GTNewHorizons:EnderIO:2.8.22:dev')
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.51.10:dev') {
compileOnly('com.github.GTNewHorizons:ForestryMC:4.10.0:dev')
compileOnly('com.github.GTNewHorizons:EnderIO:2.9.0:dev')
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.51.29:dev') {
exclude group: 'com.github.GTNewHorizons', module: 'AE2FluidCraft-Rework'
exclude group: 'com.github.GTNewHorizons', module: 'Applied-Energistics-2-Unofficial'
}

compileOnly('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev')
compileOnly('com.gregoriust.gregtech:gregtech_1.7.10:6.14.23:dev') { transitive = false }
compileOnly('com.github.GTNewHorizons:OpenComputers:1.11.1-GTNH:dev') { transitive = false }
compileOnly('com.github.GTNewHorizons:ThaumicEnergistics:1.6.27-GTNH:dev') { transitive = false }
compileOnly("com.github.GTNewHorizons:Hodgepodge:2.6.2:dev") { transitive = false }
compileOnly('com.github.GTNewHorizons:ThaumicEnergistics:1.7.0-GTNH:dev') { transitive = false }
compileOnly("com.github.GTNewHorizons:Hodgepodge:2.6.6:dev") { transitive = false }

runtimeOnlyNonPublishable("com.github.GTNewHorizons:DuraDisplay:1.3.4:dev")
runtimeOnlyNonPublishable("com.github.GTNewHorizons:GTNHLib:0.5.22:dev")
runtimeOnlyNonPublishable("com.github.GTNewHorizons:GTNHLib:0.6.0:dev")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
package com.glodblock.github.common.item;

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 com.glodblock.github.FluidCraft;
import com.glodblock.github.api.FluidCraftAPI;
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.NameConst;

import appeng.api.AEApi;
import appeng.api.config.FuzzyMode;
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 cpw.mods.fml.common.registry.GameRegistry;

public class ItemFluidVoidStorageCell extends AEBaseItem
implements IStorageFluidCell, IRegister<ItemFluidVoidStorageCell> {

public ItemFluidVoidStorageCell() {
super();
setUnlocalizedName(NameConst.ITEM_FLUID_VOID_CELL);
setTextureName(FluidCraft.resource(NameConst.ITEM_FLUID_VOID_CELL).toString());
this.setFeature(EnumSet.of(AEFeature.StorageCells));
this.setMaxStackSize(1);
}

@Override
public ItemFluidVoidStorageCell register() {
GameRegistry.registerItem(this, NameConst.ITEM_FLUID_VOID_CELL, FluidCraft.MODID);
setCreativeTab(FluidCraftingTabs.INSTANCE);
return this;
}

@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 final IFluidCellInventoryHandler handler) {
lines.add(NameConst.i18n(NameConst.TT_ITEM_FLUID_VOID_CELL));
lines.add(GuiText.VoidCellTooltip.getLocal());
lines.add(0 + " " + GuiText.Of.getLocal() + " \u00A7k9999\u00A77 " + GuiText.BytesUsed.getLocal());
final IFluidCellInventory inv = handler.getCellInv();
if (GuiScreen.isShiftKeyDown()) {
lines.add(GuiText.Filter.getLocal() + ": ");
for (int i = 0; i < inv.getConfigInventory().getSizeInventory(); ++i) {
ItemStack s = inv.getConfigInventory().getStackInSlot(i);
if (s != null) lines.add(s.getDisplayName());
}
}
}
}

@Override
public long getBytes(ItemStack cellItem) {
return 0;
}

@Override
public int getBytesPerType(ItemStack cellItem) {
return 0;
}

@Override
public boolean isBlackListed(ItemStack cellItem, IAEFluidStack requestedAddition) {
return requestedAddition == null || requestedAddition.getFluid() == null
|| FluidCraftAPI.instance().isBlacklistedInStorage(requestedAddition.getFluid().getClass());
}

@Override
public boolean storableInStorageCell() {
return true;
}

@Override
public boolean isStorageCell(ItemStack i) {
return true;
}

@Override
public double getIdleDrain(ItemStack is) {
return 0;
}

@Override
public int getTotalTypes(ItemStack cellItem) {
return 0;
}

@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());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import net.minecraftforge.fluids.FluidStack;

import com.glodblock.github.common.item.ItemBaseInfinityStorageCell;
import com.glodblock.github.common.item.ItemFluidVoidStorageCell;
import com.glodblock.github.crossmod.extracells.storage.ProxyFluidCellInventory;
import com.glodblock.github.crossmod.extracells.storage.ProxyFluidStorageCell;

Expand Down Expand Up @@ -86,6 +87,8 @@ public static IMEInventoryHandler<IAEFluidStack> getCell(final ItemStack o, fina
return new FluidCellInventoryHandler(new CreativeFluidCellInventory(o, container2));
} else if (o.getItem() instanceof ProxyFluidStorageCell) {
return new FluidCellInventoryHandler(new ProxyFluidCellInventory(o, container2));
} else if (o.getItem() instanceof ItemFluidVoidStorageCell) {
return new FluidCellInventoryHandler(new FluidVoidStorageCellInventory(o, container2));
} else {
return new FluidCellInventoryHandler(new FluidCellInventory(o, container2));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
package com.glodblock.github.common.storage;

import java.util.List;

import javax.annotation.Nonnull;

import net.minecraft.item.ItemStack;

import appeng.api.config.Actionable;
import appeng.api.exceptions.AppEngException;
import appeng.api.networking.security.BaseActionSource;
import appeng.api.storage.ISaveProvider;
import appeng.api.storage.data.IAEFluidStack;
import appeng.api.storage.data.IItemList;

public class FluidVoidStorageCellInventory extends FluidCellInventory {

public FluidVoidStorageCellInventory(ItemStack o, ISaveProvider container) throws AppEngException {
super(o, container);
}

@Override
public boolean canHoldNewFluid() {
return true;
}

@Override
public long getTotalBytes() {
return 0;
}

@Override
public long getFreeBytes() {
return 0;
}

@Override
public long getUsedBytes() {
return 0;
}

@Override
public long getTotalFluidTypes() {
return 63;
}

@Override
public long getStoredFluidCount() {
return 0;
}

@Override
public long getStoredFluidTypes() {
return 0;
}

@Override
public long getRemainingFluidTypes() {
return 63;
}

@Override
public long getRemainingFluidCount() {
return Long.MAX_VALUE;
}

@Override
public int getUnusedFluidCount() {
return Integer.MAX_VALUE;
}

@Override
public int getStatusForCell() {
return 1;
}

@Override
protected void loadCellFluids() {}

@Override
protected IItemList<IAEFluidStack> getCellFluids() {
return null;
}

@Override
public IAEFluidStack injectItems(IAEFluidStack input, Actionable mode, BaseActionSource src) {
if (input == null || input.getStackSize() == 0) {
return null;
}
if (this.cellType.isBlackListed(this.cellItem, input)) {
return input;
}
return null;
}

@Override
public IAEFluidStack extractItems(IAEFluidStack request, Actionable mode, BaseActionSource src) {
return null;
}

@Override
public IItemList<IAEFluidStack> getAvailableItems(IItemList<IAEFluidStack> out, int iteration) {
return out;
}

@Override
public IAEFluidStack getAvailableItem(@Nonnull IAEFluidStack request, int iteration) {
return null;
}

@Override
public List<IAEFluidStack> getContents() {
return null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import com.glodblock.github.common.item.ItemFluidPacket;
import com.glodblock.github.common.item.ItemFluidStorageHousing;
import com.glodblock.github.common.item.ItemFluidStorageMonitor;
import com.glodblock.github.common.item.ItemFluidVoidStorageCell;
import com.glodblock.github.common.item.ItemInfinityWaterStorageCell;
import com.glodblock.github.common.item.ItemMultiFluidStorageCell;
import com.glodblock.github.common.item.ItemPartFluidInterface;
Expand Down Expand Up @@ -140,6 +141,7 @@ public static void init() {}
16384,
5,
600000D).register();
public static ItemFluidVoidStorageCell FLUID_VOID_CELL = new ItemFluidVoidStorageCell().register();
public static ItemCreativeFluidStorageCell CREATIVE_CELL = new ItemCreativeFluidStorageCell().register();
public static ItemInfinityWaterStorageCell INFINITY_WATER_CELL = new ItemInfinityWaterStorageCell().register();
public static ItemBasicFluidStoragePart CELL_PART = new ItemBasicFluidStoragePart().register();
Expand Down
15 changes: 15 additions & 0 deletions src/main/java/com/glodblock/github/loader/RecipeLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import static com.glodblock.github.loader.ItemAndBlockHolder.FLUID_TERM;
import static com.glodblock.github.loader.ItemAndBlockHolder.FLUID_TERMINAL;
import static com.glodblock.github.loader.ItemAndBlockHolder.FLUID_TERMINAL_EX;
import static com.glodblock.github.loader.ItemAndBlockHolder.FLUID_VOID_CELL;
import static com.glodblock.github.loader.ItemAndBlockHolder.INFINITY_WATER_CELL;
import static com.glodblock.github.loader.ItemAndBlockHolder.INTERFACE;
import static com.glodblock.github.loader.ItemAndBlockHolder.LARGE_BUFFER;
Expand Down Expand Up @@ -505,6 +506,20 @@ public void run() {
QUANTUM_CELL,
'M',
AE2_MATTER_CONDENSER));
GameRegistry.addRecipe(
new ShapedOreRecipe(
FLUID_VOID_CELL,
"ABA",
"BDB",
"CCC",
'A',
AE2_QUARTZ_GLASS,
'B',
"dustGlowstone",
'C',
"gemDiamond",
'D',
AE2_SINGULARITY));
for (FCBaseItemCell cell : cells) {
if (cell.getHousing().getItemDamage() == 0) {
GameRegistry.addRecipe(
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/glodblock/github/util/NameConst.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public class NameConst {
public static final String ITEM_MULTI_FLUID_STORAGE = "multi_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_FLUID_VOID_CELL = ITEM_FLUID_STORAGE + ".void";
public static final String ITEM_ARTIFICIAL_UNIVERSE_STORAGE = ITEM_FLUID_STORAGE + ".Universe";
public static final String ITEM_INFINITY_FLUID_STORAGE = ITEM_FLUID_STORAGE + ".infinity";
public static final String ITEM_INFINITY_WATER_FLUID_STORAGE = ITEM_INFINITY_FLUID_STORAGE + ".water";
Expand Down Expand Up @@ -103,6 +104,7 @@ public class NameConst {
public static final String TT_ENERGY_CARD_DESC = TT_ENERGY_CARD + ".desc";
public static final String TT_QUANTUM_BRIDGE_CARD = TT_KEY + "quantum_bridge_card";
public static final String TT_QUANTUM_BRIDGE_CARD_DESC = TT_QUANTUM_BRIDGE_CARD + ".desc";
public static final String TT_ITEM_FLUID_VOID_CELL = TT_KEY + ITEM_FLUID_VOID_CELL;

public static final String WAILA_KEY = FluidCraft.MODID + ".waila.";
public static final String WAILA_ENABLE = WAILA_KEY + "enable";
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/assets/ae2fc/lang/en_US.lang
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ item.multi_fluid_storage.4096.name=%s4096k%s ME Multi-Fluid Storage Cell
item.multi_fluid_storage.16384.name=%s16384k%s ME Multi-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_storage.void.name=ME Fluid Void Cell
item.fluid_storage.Universe.name=ME Fluid Artificial Universe Storage Cell
item.fluid_storage.infinity.water.name=ME Fluid Infinity Water Storage Cell
item.fluid_part.0.name=%s1k%s ME Fluid Storage Component
Expand Down Expand Up @@ -114,6 +115,7 @@ ae2fc.tooltip.ultra_terminal=Right click + sneaking to switch mode.
ae2fc.tooltip.ultra_terminal.tips=ToolTips:
ae2fc.tooltip.ultra_terminal.tips.desc=1.You can put it to baubles slot and use hotkey to open.\n2.Interface mode hold §3Shift§7 toggle interface renamer button.\n3.When you are in the crafting plan screen.\nHold §3Shift§7 click cancel button will automatically add missing items to NEI bookmark.
ae2fc.tooltip.infinity_fluid=§aInfinity§r
ae2fc.tooltip.fluid_storage.void=Where nothing is everything, and everything is nothing

ae2fc.tooltip.quantum_bridge_card.desc=Allows wireless terminals to connect to a quantum bridge, allowing for unlimited range
ae2fc.tooltip.energy_card.desc=Infinity Energy for the Wireless Terminal
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2876db6

Please sign in to comment.