apply spotless

too lazy to rebase
This commit is contained in:
Firenoo authored and Martin Robertz committed 2023-05-01 19:04:39 +02:00
1 parent 1fd5b9da51
commit eba00218cd
21 files changed
+195 -136

No files matched your search

@@ -1,12 +1,12 @@
package com.glodblock.github;
import com.glodblock.github.crossmod.extracells.EC2Replacer;
import net.minecraft.util.ResourceLocation;
import appeng.api.AEApi;
import com.glodblock.github.common.Config;
import com.glodblock.github.common.storage.FluidCellHandler;
import com.glodblock.github.crossmod.extracells.EC2Replacer;
import com.glodblock.github.crossmod.opencomputers.OCDriverInit;
import com.glodblock.github.crossmod.waila.WailaInit;
import com.glodblock.github.inventory.InventoryHandler;
@@ -20,6 +20,7 @@ public class Config {
public static int packetSize;
public static int packetRate;
public static boolean replaceEC2;
public static void run() {
loadCategory();
loadProperty();
@@ -60,8 +61,11 @@ public class Config {
.get("Fluid Craft for AE2", "packetRate", 50, "Period at which packets are dispatched, in ms.")
.getInt();
if (packetRate <= 0) packetRate = 50;
replaceEC2 = Config.getBoolean("Fluid Craft for AE2", "replaceEC2", true,
"Set true to handle missing item mappings from EC2. Note to work properly, you must have all relevant parts.");
replaceEC2 = Config.getBoolean(
"Fluid Craft for AE2",
"replaceEC2",
true,
"Set true to handle missing item mappings from EC2. Note to work properly, you must have all relevant parts.");
if (Config.hasChanged()) Config.save();
}
@@ -3,8 +3,6 @@ package com.glodblock.github.common.storage;
import java.util.ArrayList;
import java.util.List;
import com.glodblock.github.crossmod.extracells.storage.ProxyFluidCellInventory;
import com.glodblock.github.crossmod.extracells.storage.ProxyFluidStorageCell;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
@@ -25,6 +23,8 @@ import appeng.util.Platform;
import appeng.util.item.AEFluidStack;
import com.glodblock.github.common.item.ItemCreativeFluidStorageCell;
import com.glodblock.github.crossmod.extracells.storage.ProxyFluidCellInventory;
import com.glodblock.github.crossmod.extracells.storage.ProxyFluidStorageCell;
public class FluidCellInventory implements IFluidCellInventory {
@@ -1,17 +1,17 @@
package com.glodblock.github.crossmod.extracells;
import cpw.mods.fml.common.event.FMLMissingMappingsEvent;
import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.item.Item;
import java.util.List;
import net.minecraft.item.Item;
import cpw.mods.fml.common.event.FMLMissingMappingsEvent;
import cpw.mods.fml.common.registry.GameRegistry;
public class EC2Replacer {
/**
* Should be called if and only if replaceEC2 config is true and EC2 not present. Registers proxy
* items for the entire EC2 mod. After running this once, you should set replaceEC2 back to false.
* Should be called if and only if replaceEC2 config is true and EC2 not present. Registers proxy items for the
* entire EC2 mod. After running this once, you should set replaceEC2 back to false.
*/
public static void initReplacer() {
ItemReplacements.init();
@@ -1,17 +1,19 @@
package com.glodblock.github.crossmod.extracells;
import java.util.HashMap;
import java.util.Map;
import java.util.function.Function;
import net.minecraft.item.Item;
import appeng.api.AEApi;
import appeng.api.definitions.IItemDefinition;
import com.glodblock.github.common.item.ItemMultiFluidStorageCell;
import com.glodblock.github.crossmod.extracells.parts.*;
import com.glodblock.github.crossmod.extracells.storage.*;
import com.glodblock.github.loader.ItemAndBlockHolder;
import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.item.Item;
import java.util.HashMap;
import java.util.Map;
import java.util.function.Function;
/**
* Shell class to organize proxy replacements and hide the ugliness
@@ -26,26 +28,19 @@ public class ItemReplacements {
ItemReplacements.proxyItems();
ItemReplacements.proxyPartItems();
}
/**
* Register proxy items (non-parts)
*/
static void proxyItems() {
deprecateFluidStorage("storage.fluid", 0, ItemAndBlockHolder.CELL1KM,
1, 8, 0.5);
deprecateFluidStorage("storage.fluid", 1, ItemAndBlockHolder.CELL4KM,
4, 32, 1.0);
deprecateFluidStorage("storage.fluid", 2, ItemAndBlockHolder.CELL16KM,
16, 128, 1.5);
deprecateFluidStorage("storage.fluid", 3, ItemAndBlockHolder.CELL64KM,
64, 512, 2.0);
deprecateFluidStorage("storage.fluid", 4, ItemAndBlockHolder.CELL256KM,
256, 2048, 2.5);
deprecateFluidStorage("storage.fluid", 5, ItemAndBlockHolder.CELL1024KM,
1024, 8192, 3.0);
deprecateFluidStorage("storage.fluid", 6, ItemAndBlockHolder.CELL4096KM,
4096, 32768, 3.5);
deprecateFluidStorage("storage.fluid", 7, ItemAndBlockHolder.CELL16384KM,
16384, 131072, 4.0);
deprecateFluidStorage("storage.fluid", 0, ItemAndBlockHolder.CELL1KM, 1, 8, 0.5);
deprecateFluidStorage("storage.fluid", 1, ItemAndBlockHolder.CELL4KM, 4, 32, 1.0);
deprecateFluidStorage("storage.fluid", 2, ItemAndBlockHolder.CELL16KM, 16, 128, 1.5);
deprecateFluidStorage("storage.fluid", 3, ItemAndBlockHolder.CELL64KM, 64, 512, 2.0);
deprecateFluidStorage("storage.fluid", 4, ItemAndBlockHolder.CELL256KM, 256, 2048, 2.5);
deprecateFluidStorage("storage.fluid", 5, ItemAndBlockHolder.CELL1024KM, 1024, 8192, 3.0);
deprecateFluidStorage("storage.fluid", 6, ItemAndBlockHolder.CELL4096KM, 4096, 32768, 3.5);
deprecateFluidStorage("storage.fluid", 7, ItemAndBlockHolder.CELL16384KM, 16384, 131072, 4.0);
// Thanks, AEApi.
AEApi.instance().registries().cell().addCellHandler(new ProxyItemCellHandler());
AEApi.instance().registries().cell().addCellHandler(new ProxyVoidCellHandler());
@@ -54,19 +49,28 @@ public class ItemReplacements {
deprecateItemStorage(2, AEApi.instance().definitions().items().cell4096k(), 4096, 32768, 3.5);
deprecateItemStorage(3, AEApi.instance().definitions().items().cell16384k(), 16384, 131072, 4.0);
deprecateItemStorage(4, AEApi.instance().definitions().items().cellContainer(), 65536, 8, 2.0, 1);
deprecateExtremeStorage("storage.physical.advanced.quantum", 0,
AEApi.instance().definitions().items().cellQuantum(), Integer.MAX_VALUE / 16, 4096, 1000.0);
deprecateExtremeStorage("storage.physical.advanced.singularity", 0,
AEApi.instance().definitions().items().cellSingularity(), Long.MAX_VALUE / 16, 4096, 15000.0);
//Deprecate void cell manually
deprecateExtremeStorage(
"storage.physical.advanced.quantum",
0,
AEApi.instance().definitions().items().cellQuantum(),
Integer.MAX_VALUE / 16,
4096,
1000.0);
deprecateExtremeStorage(
"storage.physical.advanced.singularity",
0,
AEApi.instance().definitions().items().cellSingularity(),
Long.MAX_VALUE / 16,
4096,
15000.0);
// Deprecate void cell manually
ProxyVoidStorageCell voidCell = new ProxyVoidStorageCell();
GameRegistry.registerItem(voidCell, "ec2placeholder.storage.physical.void");
registry.put("extracells:storage.physical.void", voidCell);
deprecateItem("pattern.fluid", ItemAndBlockHolder.PATTERN);
deprecateItem("terminal.fluid.wireless", ItemAndBlockHolder.WIRELESS_FLUID_TERM);
/* Storage casings */
deprecateItem("storage.casing", 0,
AEApi.instance().definitions().materials().emptyAdvancedStorageCell());
deprecateItem("storage.casing", 0, AEApi.instance().definitions().materials().emptyAdvancedStorageCell());
deprecateItem("storage.casing", 1, ItemAndBlockHolder.CELL_HOUSING, 2);
/* Storage components (1k component, etc.) */
deprecateItem("storage.component", 0, AEApi.instance().definitions().materials().cell256kPart());
@@ -143,10 +147,11 @@ public class ItemReplacements {
/**
* Deprecate a simple item.
* @param srcName name of the to-be-replaced item without the mod id prefix
* @param srcMeta meta of the to-be-replaced item
*
* @param srcName name of the to-be-replaced item without the mod id prefix
* @param srcMeta meta of the to-be-replaced item
* @param replacement item that will replace src
* @param targetMeta meta of the item that will replace src
* @param targetMeta meta of the item that will replace src
*/
private static void deprecateItem(String srcName, int srcMeta, Item replacement, int targetMeta) {
getOrBuildItem(srcName).addMetaReplacement(srcMeta, replacement, targetMeta);
@@ -162,13 +167,16 @@ public class ItemReplacements {
private static void deprecateItem(String srcName, int srcMeta, IItemDefinition replacement) {
if (replacement.isEnabled()) {
deprecateItem(srcName, srcMeta,
replacement.maybeItem().get(),
replacement.maybeStack(1).get().getItemDamage());
deprecateItem(
srcName,
srcMeta,
replacement.maybeItem().get(),
replacement.maybeStack(1).get().getItemDamage());
}
}
private static void deprecateItemPart(int srcMeta, Item replacement, Function<ProxyPartItem, ProxyPart> partBuilder) {
private static void deprecateItemPart(int srcMeta, Item replacement,
Function<ProxyPartItem, ProxyPart> partBuilder) {
final String fullName = "extracells:part.base";
ProxyPartItem proxyItem = (ProxyPartItem) registry.get(fullName);
if (proxyItem == null) {
@@ -182,51 +190,65 @@ public class ItemReplacements {
/**
* Deprecate a fluid storage item. Note that we can't access the properties directly, so we need to do this
*/
private static void deprecateFluidStorage(String srcName, int srcMeta, ItemMultiFluidStorageCell replacement, long kilobytes, int bytesPerType, double idleDrain) {
private static void deprecateFluidStorage(String srcName, int srcMeta, ItemMultiFluidStorageCell replacement,
long kilobytes, int bytesPerType, double idleDrain) {
ProxyFluidStorageCell proxyItem = getOrBuildFluidStorage(srcName);
ProxyItem.ProxyStorageEntry entry = new ProxyItem.ProxyStorageEntry(replacement, kilobytes, bytesPerType, idleDrain);
ProxyItem.ProxyStorageEntry entry = new ProxyItem.ProxyStorageEntry(
replacement,
kilobytes,
bytesPerType,
idleDrain);
proxyItem.addMetaReplacement(srcMeta, entry);
}
/**
* Deprecate a storage item. This goes through AEAPI, as AE2FC doesn't have any item cells.
* If the item is disabled in AEAPI, the replacement will not be registered!
* Deprecate a storage item. This goes through AEAPI, as AE2FC doesn't have any item cells. If the item is disabled
* in AEAPI, the replacement will not be registered!
*/
private static void deprecateItemStorage(int srcMeta, IItemDefinition replacement, long kilobytes, int bytesPerType, double idleDrain) {
private static void deprecateItemStorage(int srcMeta, IItemDefinition replacement, long kilobytes, int bytesPerType,
double idleDrain) {
if (replacement.isEnabled()) {
ProxyItemStorageCell item = getOrBuildItemStorage();
int meta = replacement.maybeStack(1).get().getItemDamage();
ProxyItem.ProxyItemEntry storage = new ProxyItem.ProxyStorageEntry(
replacement.maybeItem().get(), kilobytes, bytesPerType, idleDrain);
replacement.maybeItem().get(),
kilobytes,
bytesPerType,
idleDrain);
item.addMetaReplacement(srcMeta, storage);
}
}
/**
* Deprecate a storage item. This goes through AEAPI, as AE2FC doesn't have any item cells.
* If the item is disabled in AEAPI, the replacement will not be registered!
* Deprecate a storage item. This goes through AEAPI, as AE2FC doesn't have any item cells. If the item is disabled
* in AEAPI, the replacement will not be registered!
*/
private static void deprecateItemStorage(int srcMeta, IItemDefinition replacement, long kilobytes, int bytesPerType, double idleDrain, int types) {
private static void deprecateItemStorage(int srcMeta, IItemDefinition replacement, long kilobytes, int bytesPerType,
double idleDrain, int types) {
if (replacement.isEnabled()) {
ProxyItemStorageCell item = getOrBuildItemStorage();
int meta = replacement.maybeStack(1).get().getItemDamage();
ProxyItem.ProxyItemEntry storage = new ProxyItem.ProxyStorageEntry(
replacement.maybeItem().get(), kilobytes, bytesPerType, idleDrain, types);
replacement.maybeItem().get(),
kilobytes,
bytesPerType,
idleDrain,
types);
item.addMetaReplacement(srcMeta, storage);
}
}
private static void deprecateExtremeStorage(String srcName, int srcMeta, IItemDefinition replacement, long bytes, int bytesPerType, double idleDrain) {
private static void deprecateExtremeStorage(String srcName, int srcMeta, IItemDefinition replacement, long bytes,
int bytesPerType, double idleDrain) {
if (replacement.isEnabled()) {
ProxyExtremeStorageCell item = getOrBuildItemStorage(srcName);
int meta = replacement.maybeStack(1).get().getItemDamage();
ProxyItem.ProxyItemEntry storage = new ProxyItem.ProxyStorageEntry(
replacement.maybeItem().get(), bytes / 1024, bytesPerType, idleDrain);
replacement.maybeItem().get(),
bytes / 1024,
bytesPerType,
idleDrain);
item.addMetaReplacement(srcMeta, storage);
}
}
}
@@ -1,9 +1,9 @@
package com.glodblock.github.crossmod.extracells;
import com.glodblock.github.FluidCraft;
import com.glodblock.github.common.item.FCBaseItem;
import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.client.resources.I18n;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
@@ -12,9 +12,9 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.glodblock.github.FluidCraft;
import com.glodblock.github.common.item.FCBaseItem;
import cpw.mods.fml.common.registry.GameRegistry;
/**
* EC2ProxyItem - Item that "holds" the data of a missing item.
@@ -27,6 +27,7 @@ public class ProxyItem extends FCBaseItem {
* Maps a metadata value to a replacement.
*/
protected final Map<Integer, ProxyItemEntry> replacements;
public ProxyItem(String ec2itemName) {
this.name = ec2itemName;
this.replacements = new HashMap<>();
@@ -90,9 +91,8 @@ public class ProxyItem extends FCBaseItem {
}
/**
* Base class for a mapping from source (Item, meta) -> replacement (Item, meta).
* Optionally, override the {@link ProxyItemEntry#replaceNBT(NBTTagCompound)}
* method for custom NBT migration.
* Base class for a mapping from source (Item, meta) -> replacement (Item, meta). Optionally, override the
* {@link ProxyItemEntry#replaceNBT(NBTTagCompound)} method for custom NBT migration.
*/
protected static class ProxyItemEntry {
@@ -101,7 +101,8 @@ public class ProxyItem extends FCBaseItem {
/**
* Creates a Proxy Replacement.
* @param replacement Item that will replace the other.
*
* @param replacement Item that will replace the other.
* @param replacementMeta Metadata/damage value of the replacement
*/
protected ProxyItemEntry(Item replacement, int replacementMeta) {
@@ -116,10 +117,12 @@ public class ProxyItem extends FCBaseItem {
}
protected static class ProxyStorageEntry extends ProxyItemEntry {
public final long maxBytes;
public final int bytesPerType;
public final double idleDrain;
public final int types;
protected ProxyStorageEntry(Item replacement, long kilobytes, int bytesPerType, double idleDrain) {
super(replacement, 0);
this.maxBytes = kilobytes * 1024;
@@ -135,6 +138,7 @@ public class ProxyItem extends FCBaseItem {
this.idleDrain = idleDrain;
this.types = types;
}
@Override
NBTTagCompound replaceNBT(NBTTagCompound compound) {
if (compound != null && compound.hasKey("ecc")) {
@@ -1,11 +1,9 @@
package com.glodblock.github.crossmod.extracells;
import appeng.api.networking.IGridNode;
import appeng.api.parts.*;
import appeng.api.storage.data.IAEItemStack;
import appeng.util.item.AEItemStack;
import cpw.mods.fml.common.registry.GameRegistry;
import io.netty.buffer.ByteBuf;
import java.lang.ref.WeakReference;
import java.util.List;
import java.util.Random;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
@@ -22,9 +20,12 @@ import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
import java.lang.ref.WeakReference;
import java.util.List;
import java.util.Random;
import appeng.api.networking.IGridNode;
import appeng.api.parts.*;
import appeng.api.storage.data.IAEItemStack;
import appeng.util.item.AEItemStack;
import cpw.mods.fml.common.registry.GameRegistry;
import io.netty.buffer.ByteBuf;
/**
* ProxyPart is expected to be immediately replaced with the replacement part on load.
@@ -1,18 +1,21 @@
package com.glodblock.github.crossmod.extracells;
import java.util.function.Function;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import org.jetbrains.annotations.Nullable;
import appeng.api.parts.IPart;
import appeng.api.parts.IPartItem;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import org.jetbrains.annotations.Nullable;
import java.util.function.Function;
public class ProxyPartItem extends ProxyItem implements IPartItem {
/**
* Creates a ProxyPartItem associated with the ProxyPart instance. This instance
* is reused on each call to {@link #createPartFromItemStack(ItemStack)}.
* Creates a ProxyPartItem associated with the ProxyPart instance. This instance is reused on each call to
* {@link #createPartFromItemStack(ItemStack)}.
*
* @param ec2itemName extra cells internal name
*/
public ProxyPartItem(String ec2itemName) {
@@ -53,6 +56,3 @@ class PartReplacement extends ProxyItem.ProxyItemEntry {
this.proxyPart = proxyPart;
}
}
@@ -1,18 +1,22 @@
package com.glodblock.github.crossmod.extracells.parts;
import appeng.api.config.RedstoneMode;
import com.glodblock.github.crossmod.extracells.ProxyPart;
import com.glodblock.github.crossmod.extracells.ProxyPartItem;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import static net.minecraftforge.common.util.Constants.NBT.TAG_COMPOUND;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import appeng.api.config.RedstoneMode;
import com.glodblock.github.crossmod.extracells.ProxyPart;
import com.glodblock.github.crossmod.extracells.ProxyPartItem;
public class ProxyFluidBusIO extends ProxyPart {
/**
* Map for converting slots from bus EC2 -> AE2FC
*/
private static int[] FILTER_MAP = null;
public static void init() {
FILTER_MAP = new int[] { 5, 3, 6, 1, 0, 2, 7, 4, 8 };
}
@@ -29,7 +33,7 @@ public class ProxyFluidBusIO extends ProxyPart {
for (int slot = 0; slot < 9; ++slot) {
String oldFilterName = "FilterFluid#" + slot;
fluidFilterNew
.setTag("#" + FILTER_MAP[slot], ProxyPart.createFluidDisplayTag(extra.getString(oldFilterName)));
.setTag("#" + FILTER_MAP[slot], ProxyPart.createFluidDisplayTag(extra.getString(oldFilterName)));
extra.removeTag(oldFilterName);
}
extra.setTag("config", fluidFilterNew);
@@ -1,12 +1,14 @@
package com.glodblock.github.crossmod.extracells.parts;
import com.glodblock.github.crossmod.extracells.ProxyPart;
import com.glodblock.github.crossmod.extracells.ProxyPartItem;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraftforge.common.util.Constants;
import com.glodblock.github.crossmod.extracells.ProxyPart;
import com.glodblock.github.crossmod.extracells.ProxyPartItem;
public class ProxyFluidInterface extends ProxyPart {
public ProxyFluidInterface(ProxyPartItem item) {
super(item);
}
@@ -1,14 +1,17 @@
package com.glodblock.github.crossmod.extracells.parts;
import com.glodblock.github.crossmod.extracells.ProxyPart;
import com.glodblock.github.crossmod.extracells.ProxyPartItem;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import static net.minecraftforge.common.util.Constants.NBT.TAG_COMPOUND;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import com.glodblock.github.crossmod.extracells.ProxyPart;
import com.glodblock.github.crossmod.extracells.ProxyPartItem;
public class ProxyFluidStorage extends ProxyPart {
private static int[] FILTER_MAP = null;
protected static void init() {
// spotless:off
FILTER_MAP = new int[] {
@@ -23,6 +26,7 @@ public class ProxyFluidStorage extends ProxyPart {
8, 17, 26, 35, 44, 53 };
//spotless:on
}
public ProxyFluidStorage(ProxyPartItem item) {
super(item);
}
@@ -35,7 +39,7 @@ public class ProxyFluidStorage extends ProxyPart {
for (int slot = 0; slot < 54; ++slot) {
String oldFilterName = "FilterFluid#" + slot;
fluidFilterNew
.setTag("#" + FILTER_MAP[slot], ProxyPart.createFluidDisplayTag(extra.getString(oldFilterName)));
.setTag("#" + FILTER_MAP[slot], ProxyPart.createFluidDisplayTag(extra.getString(oldFilterName)));
extra.removeTag(oldFilterName);
}
extra.setTag("config", fluidFilterNew);
@@ -1,11 +1,14 @@
package com.glodblock.github.crossmod.extracells.parts;
import appeng.api.config.RedstoneMode;
import com.glodblock.github.crossmod.extracells.ProxyPart;
import com.glodblock.github.crossmod.extracells.ProxyPartItem;
import net.minecraft.nbt.NBTTagCompound;
import appeng.api.config.RedstoneMode;
import com.glodblock.github.crossmod.extracells.ProxyPart;
import com.glodblock.github.crossmod.extracells.ProxyPartItem;
public class ProxyLevelEmitter extends ProxyPart {
public ProxyLevelEmitter(ProxyPartItem item) {
super(item);
}
@@ -1,12 +1,14 @@
package com.glodblock.github.crossmod.extracells.parts;
import com.glodblock.github.crossmod.extracells.ProxyPart;
import com.glodblock.github.crossmod.extracells.ProxyPartItem;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidRegistry;
import com.glodblock.github.crossmod.extracells.ProxyPart;
import com.glodblock.github.crossmod.extracells.ProxyPartItem;
public class ProxyStorageMonitor extends ProxyPart {
public ProxyStorageMonitor(ProxyPartItem item) {
super(item);
}
@@ -3,6 +3,7 @@ package com.glodblock.github.crossmod.extracells.storage;
import net.minecraft.item.ItemStack;
public class ProxyExtremeStorageCell extends ProxyItemStorageCell {
public ProxyExtremeStorageCell(String ec2itemName) {
super(ec2itemName);
}
@@ -1,18 +1,22 @@
package com.glodblock.github.crossmod.extracells.storage;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTBase;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.fluids.FluidStack;
import appeng.api.AEApi;
import appeng.api.exceptions.AppEngException;
import appeng.api.storage.ISaveProvider;
import appeng.api.storage.data.IAEFluidStack;
import appeng.util.item.AEFluidStack;
import com.glodblock.github.common.storage.FluidCellInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTBase;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.fluids.FluidStack;
public class ProxyFluidCellInventory extends FluidCellInventory {
private static final String EC_CONVERTED = "ecc";
public ProxyFluidCellInventory(ItemStack o, ISaveProvider container) throws AppEngException {
super(o, container);
}
@@ -1,16 +1,18 @@
package com.glodblock.github.crossmod.extracells.storage;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import appeng.api.config.FuzzyMode;
import appeng.api.storage.data.IAEFluidStack;
import appeng.items.contents.CellConfig;
import appeng.items.contents.CellUpgrades;
import appeng.util.Platform;
import com.glodblock.github.common.Config;
import com.glodblock.github.common.storage.IStorageFluidCell;
import com.glodblock.github.crossmod.extracells.ProxyItem;
import com.glodblock.github.util.ModAndClassUtil;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
public class ProxyFluidStorageCell extends ProxyItem implements IStorageFluidCell {
@@ -1,8 +1,9 @@
package com.glodblock.github.crossmod.extracells.storage;
import appeng.core.features.registries.entries.BasicCellHandler;
import net.minecraft.item.ItemStack;
import appeng.core.features.registries.entries.BasicCellHandler;
public class ProxyItemCellHandler extends BasicCellHandler {
@Override
@@ -1,20 +1,22 @@
package com.glodblock.github.crossmod.extracells.storage;
import javax.annotation.Nullable;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import appeng.api.config.FuzzyMode;
import appeng.api.implementations.items.IStorageCell;
import appeng.api.storage.data.IAEItemStack;
import appeng.items.contents.CellConfig;
import appeng.items.contents.CellUpgrades;
import appeng.util.Platform;
import com.glodblock.github.crossmod.extracells.ProxyItem;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import javax.annotation.Nullable;
import com.glodblock.github.crossmod.extracells.ProxyItem;
/**
* Proxy Item Storage. 256K, 1024K, etc. -> AE2's version.
* For now its just mirroring AE2's version, will need to transition to something better.
* 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 {
@@ -1,9 +1,11 @@
package com.glodblock.github.crossmod.extracells.storage;
import appeng.core.features.registries.entries.VoidCellHandler;
import net.minecraft.item.ItemStack;
import appeng.core.features.registries.entries.VoidCellHandler;
public class ProxyVoidCellHandler extends VoidCellHandler {
@Override
public boolean isCell(ItemStack is) {
return is != null && is.getItem() != null && is.getItem() instanceof ProxyVoidStorageCell;
@@ -1,23 +1,24 @@
package com.glodblock.github.crossmod.extracells.storage;
import appeng.api.AEApi;
import appeng.core.localization.GuiText;
import appeng.items.storage.ItemVoidStorageCell;
import com.glodblock.github.crossmod.extracells.ProxyItem;
import net.minecraft.client.resources.I18n;
import java.util.List;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
import java.util.List;
import appeng.api.AEApi;
import appeng.items.storage.ItemVoidStorageCell;
public class ProxyVoidStorageCell extends ItemVoidStorageCell {
private final String name = AEApi.instance().definitions().items().cellVoid().maybeStack(1).get().getUnlocalizedName();
private final String name = AEApi.instance().definitions().items().cellVoid().maybeStack(1).get()
.getUnlocalizedName();
@Override
public void addCheckedInformation(ItemStack stack, EntityPlayer player, List<String> info, boolean displayMoreInfo) {
public void addCheckedInformation(ItemStack stack, EntityPlayer player, List<String> info,
boolean displayMoreInfo) {
info.add(EnumChatFormatting.RED + "Extra Cells Placeholder for:");
info.add(EnumChatFormatting.AQUA + name);
info.add(EnumChatFormatting.GOLD + "Put in your inventory to get a replacement.");
@@ -1,6 +1,5 @@
package com.glodblock.github.proxy;
import com.glodblock.github.crossmod.extracells.EC2Replacer;
import net.minecraft.item.ItemStack;
import appeng.api.AEApi;
@@ -10,6 +9,7 @@ import appeng.api.config.Upgrades;
import com.glodblock.github.FluidCraft;
import com.glodblock.github.common.Config;
import com.glodblock.github.common.tile.TileWalrus;
import com.glodblock.github.crossmod.extracells.EC2Replacer;
import com.glodblock.github.inventory.external.AEFluidInterfaceHandler;
import com.glodblock.github.loader.ItemAndBlockHolder;
import com.glodblock.github.network.SPacketMEUpdateBuffer;