This commit is contained in:
lc-1337 committed 2025-10-25 23:31:24 +03:00
1 parent 24d30ef078
commit ebd42852ff
38 files changed
+211 -2351

No files matched your search

@@ -4,23 +4,30 @@ import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import com.glodblock.github.api.FluidCraftAPI;
import com.glodblock.github.common.storage.IStorageFluidCell;
import com.glodblock.github.crossmod.extracells.ProxyItem;
import com.glodblock.github.inventory.FluidCellConfig;
import appeng.api.config.FuzzyMode;
import appeng.api.implementations.items.IStorageCell;
import appeng.api.storage.StorageChannel;
import appeng.api.storage.data.IAEFluidStack;
import appeng.items.contents.CellConfig;
import appeng.items.contents.CellUpgrades;
import appeng.tile.inventory.IAEStackInventory;
import appeng.util.Platform;
public class ProxyFluidStorageCell extends ProxyItem implements IStorageFluidCell {
public class ProxyFluidStorageCell extends ProxyItem implements IStorageCell<IAEFluidStack> {
public ProxyFluidStorageCell(String ec2itemName) {
super(ec2itemName);
}
@Override
public long getBytes(ItemStack cellItem) {
public int getBytes(ItemStack cellItem) {
return Math.toIntExact(getBytesLong(cellItem));
}
@Override
public long getBytesLong(ItemStack cellItem) {
int meta = cellItem.getItemDamage();
if (replacements.containsKey(meta)) {
ProxyItemEntry entry = replacements.get(meta);
@@ -31,6 +38,11 @@ public class ProxyFluidStorageCell extends ProxyItem implements IStorageFluidCel
return 0;
}
@Override
public int BytePerType(ItemStack cellItem) {
return 0;
}
@Override
public int getBytesPerType(ItemStack cellItem) {
int meta = cellItem.getItemDamage();
@@ -44,7 +56,7 @@ public class ProxyFluidStorageCell extends ProxyItem implements IStorageFluidCel
}
@Override
public boolean isBlackListed(ItemStack cellItem, IAEFluidStack requestedAddition) {
public boolean isBlackListed(IAEFluidStack requestedAddition) {
return requestedAddition == null || requestedAddition.getFluid() == null
|| FluidCraftAPI.instance().isBlacklistedInStorage(requestedAddition.getFluid().getClass());
}
@@ -71,6 +83,16 @@ public class ProxyFluidStorageCell extends ProxyItem implements IStorageFluidCel
return 0;
}
@Override
public double getIdleDrain() {
return 0;
}
@Override
public StorageChannel getStorageChannel() {
return StorageChannel.FLUIDS;
}
@Override
public int getTotalTypes(ItemStack cellItem) {
return 5;
@@ -87,8 +109,8 @@ public class ProxyFluidStorageCell extends ProxyItem implements IStorageFluidCel
}
@Override
public IInventory getConfigInventory(ItemStack is) {
return new FluidCellConfig(is);
public IAEStackInventory getConfigInventory(ItemStack is) {
return new CellConfig(is);
}
@Override
@@ -9,16 +9,18 @@ import com.glodblock.github.crossmod.extracells.ProxyItem;
import appeng.api.config.FuzzyMode;
import appeng.api.implementations.items.IStorageCell;
import appeng.api.storage.StorageChannel;
import appeng.api.storage.data.IAEItemStack;
import appeng.items.contents.CellConfig;
import appeng.items.contents.CellUpgrades;
import appeng.tile.inventory.IAEStackInventory;
import appeng.util.Platform;
/**
* Proxy Item Storage. 256K, 1024K, etc. -> AE2's version. For now its just mirroring AE2's version, will need to
* transition to something better.
*/
public class ProxyItemStorageCell extends ProxyItem implements IStorageCell {
public class ProxyItemStorageCell extends ProxyItem implements IStorageCell<IAEItemStack> {
public ProxyItemStorageCell(String ec2itemName) {
super(ec2itemName);
@@ -90,7 +92,7 @@ public class ProxyItemStorageCell extends ProxyItem implements IStorageCell {
}
@Override
public boolean isBlackListed(ItemStack cellItem, IAEItemStack requestedAddition) {
public boolean isBlackListed(IAEItemStack requestedAddition) {
return false;
}
@@ -124,6 +126,11 @@ public class ProxyItemStorageCell extends ProxyItem implements IStorageCell {
return 0;
}
@Override
public StorageChannel getStorageChannel() {
return StorageChannel.ITEMS;
}
@Override
public boolean isEditable(ItemStack is) {
return true;
@@ -135,7 +142,7 @@ public class ProxyItemStorageCell extends ProxyItem implements IStorageCell {
}
@Override
public IInventory getConfigInventory(ItemStack is) {
public IAEStackInventory getConfigInventory(ItemStack is) {
return new CellConfig(is);
}