Fluid Disk Drive
This commit is contained in:
@@ -51,6 +51,8 @@ public final class RefinedStorage {
|
||||
public int detectorUsage;
|
||||
public int diskDriveUsage;
|
||||
public int diskDrivePerDiskUsage;
|
||||
public int fluidDiskDriveUsage;
|
||||
public int fluidDiskDrivePerDiskUsage;
|
||||
public int externalStorageUsage;
|
||||
public int externalStoragePerStorageUsage;
|
||||
public int exporterUsage;
|
||||
@@ -95,6 +97,8 @@ public final class RefinedStorage {
|
||||
detectorUsage = config.getInt("detector", "energy", 2, 0, Integer.MAX_VALUE, "The energy used by Detectors");
|
||||
diskDriveUsage = config.getInt("diskDrive", "energy", 0, 0, Integer.MAX_VALUE, "The base energy used by Disk Drives");
|
||||
diskDrivePerDiskUsage = config.getInt("diskDrivePerDisk", "energy", 1, 0, Integer.MAX_VALUE, "The additional energy used by Storage Disks in Disk Drives");
|
||||
fluidDiskDriveUsage = config.getInt("fluidDiskDrive", "energy", 0, 0, Integer.MAX_VALUE, "The base energy used by Fluid Disk Drives");
|
||||
fluidDiskDrivePerDiskUsage = config.getInt("fluidDiskDrivePerDisk", "energy", 1, 0, Integer.MAX_VALUE, "The additional energy used by Fluid Storage Disks in Fluid Disk Drives");
|
||||
externalStorageUsage = config.getInt("externalStorage", "energy", 0, 0, Integer.MAX_VALUE, "The base energy used by External Storages");
|
||||
externalStoragePerStorageUsage = config.getInt("externalStoragePerStorage", "energy", 1, 0, Integer.MAX_VALUE, "The additional energy used per connected storage to an External Storage");
|
||||
exporterUsage = config.getInt("exporter", "energy", 1, 0, Integer.MAX_VALUE, "The energy used by Exporters");
|
||||
|
@@ -24,4 +24,5 @@ public final class RefinedStorageBlocks {
|
||||
public static final BlockProcessingPatternEncoder PROCESSING_PATTERN_ENCODER = new BlockProcessingPatternEncoder();
|
||||
public static final BlockNetworkTransmitter NETWORK_TRANSMITTER = new BlockNetworkTransmitter();
|
||||
public static final BlockNetworkReceiver NETWORK_RECEIVER = new BlockNetworkReceiver();
|
||||
}
|
||||
public static final BlockFluidDiskDrive FLUID_DISK_DRIVE = new BlockFluidDiskDrive();
|
||||
}
|
@@ -20,4 +20,5 @@ public final class RefinedStorageGui {
|
||||
public static final int PROCESSING_PATTERN_ENCODER = 16;
|
||||
public static final int GRID_FILTER = 17;
|
||||
public static final int NETWORK_TRANSMITTER = 18;
|
||||
public static final int FLUID_DISK_DRIVE = 19;
|
||||
}
|
||||
|
@@ -1,6 +1,7 @@
|
||||
package refinedstorage.api.storage;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
|
||||
@@ -76,6 +77,36 @@ public final class CompareUtils {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Compares two stacks by the given flags.
|
||||
*
|
||||
* @param left The left stack
|
||||
* @param right The right stack
|
||||
* @param flags The flags to compare with
|
||||
* @return Whether the left and right stack are equal
|
||||
*/
|
||||
public static boolean compareStack(FluidStack left, FluidStack right, int flags) {
|
||||
if (left == null && right == null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if ((left == null && right != null) || (left != null && right == null)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (left.getFluid() != right.getFluid()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((flags & COMPARE_NBT) == COMPARE_NBT) {
|
||||
if (!left.tag.equals(right)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Compares the NBT tags of two stacks.
|
||||
*
|
||||
|
@@ -138,6 +138,7 @@ public abstract class FluidStorageNBT implements IFluidStorage {
|
||||
@Override
|
||||
public FluidStack extractFluid(FluidStack stack, int size, int flags) {
|
||||
for (FluidStack otherStack : stacks) {
|
||||
// @TODO: Use flags everywhere
|
||||
if (otherStack.isFluidEqual(stack)) {
|
||||
if (size > otherStack.amount) {
|
||||
size = otherStack.amount;
|
||||
|
58
src/main/java/refinedstorage/block/BlockFluidDiskDrive.java
Executable file
58
src/main/java/refinedstorage/block/BlockFluidDiskDrive.java
Executable file
@@ -0,0 +1,58 @@
|
||||
package refinedstorage.block;
|
||||
|
||||
import net.minecraft.block.properties.PropertyInteger;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import refinedstorage.RefinedStorage;
|
||||
import refinedstorage.RefinedStorageGui;
|
||||
import refinedstorage.tile.TileFluidDiskDrive;
|
||||
|
||||
public class BlockFluidDiskDrive extends BlockNode {
|
||||
private static final PropertyInteger STORED = PropertyInteger.create("stored", 0, 7);
|
||||
|
||||
public BlockFluidDiskDrive() {
|
||||
super("fluid_disk_drive");
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createTileEntity(World world, IBlockState state) {
|
||||
return new TileFluidDiskDrive();
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockStateContainer createBlockState() {
|
||||
return createBlockStateBuilder()
|
||||
.add(STORED)
|
||||
.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getActualState(IBlockState state, IBlockAccess world, BlockPos pos) {
|
||||
return super.getActualState(state, world, pos)
|
||||
.withProperty(STORED, Math.max(0, ((TileFluidDiskDrive) world.getTileEntity(pos)).getStoredForDisplay()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) {
|
||||
if (!world.isRemote) {
|
||||
player.openGui(RefinedStorage.INSTANCE, RefinedStorageGui.FLUID_DISK_DRIVE, world, pos.getX(), pos.getY(), pos.getZ());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, BlockPos pos, IBlockState state) {
|
||||
((TileFluidDiskDrive) world.getTileEntity(pos)).onBreak();
|
||||
|
||||
super.breakBlock(world, pos, state);
|
||||
}
|
||||
}
|
@@ -18,7 +18,7 @@ public class ContainerDiskDrive extends ContainerStorage {
|
||||
addSlotToContainer(new SlotItemHandler(drive.getDisks(), 4 + i, 98 + (i * 18), 96));
|
||||
}
|
||||
|
||||
addSpecimenAndPlayerInventorySlots(drive.getFilters());
|
||||
addFilterAndPlayerInventorySlots(drive.getFilters());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
50
src/main/java/refinedstorage/container/ContainerFluidDiskDrive.java
Executable file
50
src/main/java/refinedstorage/container/ContainerFluidDiskDrive.java
Executable file
@@ -0,0 +1,50 @@
|
||||
package refinedstorage.container;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.items.SlotItemHandler;
|
||||
import refinedstorage.tile.TileFluidDiskDrive;
|
||||
|
||||
public class ContainerFluidDiskDrive extends ContainerStorage {
|
||||
public ContainerFluidDiskDrive(TileFluidDiskDrive drive, EntityPlayer player) {
|
||||
super(drive, player);
|
||||
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
addSlotToContainer(new SlotItemHandler(drive.getDisks(), i, 98 + (i * 18), 78));
|
||||
}
|
||||
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
addSlotToContainer(new SlotItemHandler(drive.getDisks(), 4 + i, 98 + (i * 18), 96));
|
||||
}
|
||||
|
||||
addFilterAndPlayerInventorySlots(drive.getFilters());
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer player, int index) {
|
||||
ItemStack stack = null;
|
||||
|
||||
Slot slot = getSlot(index);
|
||||
|
||||
if (slot != null && slot.getHasStack()) {
|
||||
stack = slot.getStack();
|
||||
|
||||
if (index < 8) {
|
||||
if (!mergeItemStack(stack, 8 + 9, inventorySlots.size(), false)) {
|
||||
return null;
|
||||
}
|
||||
} else if (!mergeItemStack(stack, 0, 8, false)) {
|
||||
return mergeItemStackToSpecimen(stack, 8, 8 + 9);
|
||||
}
|
||||
|
||||
if (stack.stackSize == 0) {
|
||||
slot.putStack(null);
|
||||
} else {
|
||||
slot.onSlotChanged();
|
||||
}
|
||||
}
|
||||
|
||||
return stack;
|
||||
}
|
||||
}
|
@@ -4,7 +4,9 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
import refinedstorage.container.slot.SlotFluidFilter;
|
||||
import refinedstorage.container.slot.SlotSpecimen;
|
||||
import refinedstorage.inventory.ItemHandlerFluidFilter;
|
||||
import refinedstorage.tile.TileBase;
|
||||
|
||||
public class ContainerStorage extends ContainerBase {
|
||||
@@ -15,12 +17,12 @@ public class ContainerStorage extends ContainerBase {
|
||||
public ContainerStorage(TileBase tile, EntityPlayer player, IItemHandler filters) {
|
||||
this(tile, player);
|
||||
|
||||
addSpecimenAndPlayerInventorySlots(filters);
|
||||
addFilterAndPlayerInventorySlots(filters);
|
||||
}
|
||||
|
||||
protected void addSpecimenAndPlayerInventorySlots(IItemHandler filters) {
|
||||
protected void addFilterAndPlayerInventorySlots(IItemHandler filters) {
|
||||
for (int i = 0; i < 9; ++i) {
|
||||
addSlotToContainer(new SlotSpecimen(filters, i, 8 + (18 * i), 20));
|
||||
addSlotToContainer(filters instanceof ItemHandlerFluidFilter ? new SlotFluidFilter(!getTile().getWorld().isRemote, filters, i, 8 + (18 * i), 20) : new SlotSpecimen(filters, i, 8 + (18 * i), 20));
|
||||
}
|
||||
|
||||
addPlayerInventory(8, 129);
|
||||
|
19
src/main/java/refinedstorage/container/slot/SlotFluidFilter.java
Executable file
19
src/main/java/refinedstorage/container/slot/SlotFluidFilter.java
Executable file
@@ -0,0 +1,19 @@
|
||||
package refinedstorage.container.slot;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
|
||||
public class SlotFluidFilter extends SlotSpecimen {
|
||||
private boolean server;
|
||||
|
||||
public SlotFluidFilter(boolean server, IItemHandler handler, int id, int x, int y) {
|
||||
super(handler, id, x, y);
|
||||
|
||||
this.server = server;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStack() {
|
||||
return server ? super.getStack() : null;
|
||||
}
|
||||
}
|
@@ -1,16 +1,23 @@
|
||||
package refinedstorage.gui;
|
||||
|
||||
import mezz.jei.gui.ingredients.FluidStackRenderer;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fml.client.config.GuiCheckBox;
|
||||
import net.minecraftforge.items.SlotItemHandler;
|
||||
import org.lwjgl.input.Mouse;
|
||||
import refinedstorage.RefinedStorage;
|
||||
import refinedstorage.gui.sidebutton.SideButton;
|
||||
import refinedstorage.inventory.ItemHandlerFluidFilter;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
@@ -18,6 +25,8 @@ import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public abstract class GuiBase extends GuiContainer {
|
||||
public static final FluidStackRenderer FLUID_RENDERER = new FluidStackRenderer(Fluid.BUCKET_VOLUME, false, 16, 16, null);
|
||||
|
||||
protected static final int SIDE_BUTTON_WIDTH = 20;
|
||||
protected static final int SIDE_BUTTON_HEIGHT = 20;
|
||||
|
||||
@@ -116,6 +125,20 @@ public abstract class GuiBase extends GuiContainer {
|
||||
|
||||
drawForeground(mouseX, mouseY);
|
||||
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
|
||||
for (int i = 0; i < inventorySlots.inventorySlots.size(); ++i) {
|
||||
Slot slot = inventorySlots.inventorySlots.get(i);
|
||||
|
||||
if (slot instanceof SlotItemHandler && ((SlotItemHandler) slot).getItemHandler() instanceof ItemHandlerFluidFilter) {
|
||||
FluidStack stack = ((ItemHandlerFluidFilter) ((SlotItemHandler) slot).getItemHandler()).getFilters()[slot.getSlotIndex()];
|
||||
|
||||
if (stack != null) {
|
||||
FLUID_RENDERER.draw(mc, slot.xDisplayPosition, slot.yDisplayPosition, stack);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (sideButtonTooltip != null) {
|
||||
drawTooltip(mouseX, mouseY, sideButtonTooltip);
|
||||
}
|
||||
|
@@ -23,6 +23,8 @@ public class GuiHandler implements IGuiHandler {
|
||||
return new ContainerGrid((TileGrid) tile, player);
|
||||
case RefinedStorageGui.DISK_DRIVE:
|
||||
return new ContainerDiskDrive((TileDiskDrive) tile, player);
|
||||
case RefinedStorageGui.FLUID_DISK_DRIVE:
|
||||
return new ContainerFluidDiskDrive((TileFluidDiskDrive) tile, player);
|
||||
case RefinedStorageGui.IMPORTER:
|
||||
return new ContainerImporter((TileImporter) tile, player);
|
||||
case RefinedStorageGui.EXPORTER:
|
||||
@@ -91,7 +93,9 @@ public class GuiHandler implements IGuiHandler {
|
||||
case RefinedStorageGui.WIRELESS_GRID:
|
||||
return getWirelessGridGui(player, x);
|
||||
case RefinedStorageGui.DISK_DRIVE:
|
||||
return new GuiStorage((ContainerStorage) getContainer(ID, player, tile), (IStorageGui) tile, "gui/disk_drive.png");
|
||||
return new GuiStorage((ContainerDiskDrive) getContainer(ID, player, tile), (IStorageGui) tile, "gui/disk_drive.png");
|
||||
case RefinedStorageGui.FLUID_DISK_DRIVE:
|
||||
return new GuiStorage((ContainerFluidDiskDrive) getContainer(ID, player, tile), (IStorageGui) tile, "gui/fluid_disk_drive.png");
|
||||
case RefinedStorageGui.IMPORTER:
|
||||
return new GuiImporter((ContainerImporter) getContainer(ID, player, tile));
|
||||
case RefinedStorageGui.EXPORTER:
|
||||
|
@@ -45,8 +45,13 @@ public class GuiStorage extends GuiBase {
|
||||
}
|
||||
|
||||
if (gui.getCompareParameter() != null) {
|
||||
addSideButton(new SideButtonCompare(gui.getCompareParameter(), CompareUtils.COMPARE_DAMAGE));
|
||||
addSideButton(new SideButtonCompare(gui.getCompareParameter(), CompareUtils.COMPARE_NBT));
|
||||
if (gui.hasComparisonFor(CompareUtils.COMPARE_DAMAGE)) {
|
||||
addSideButton(new SideButtonCompare(gui.getCompareParameter(), CompareUtils.COMPARE_DAMAGE));
|
||||
}
|
||||
|
||||
if (gui.hasComparisonFor(CompareUtils.COMPARE_NBT)) {
|
||||
addSideButton(new SideButtonCompare(gui.getCompareParameter(), CompareUtils.COMPARE_NBT));
|
||||
}
|
||||
}
|
||||
|
||||
priorityField = new GuiTextField(0, fontRendererObj, x + 98 + 1, y + 54 + 1, 25, fontRendererObj.FONT_HEIGHT);
|
||||
|
@@ -1,8 +1,6 @@
|
||||
package refinedstorage.gui.grid.stack;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import mezz.jei.gui.ingredients.FluidStackRenderer;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fml.common.network.ByteBufUtils;
|
||||
@@ -14,13 +12,10 @@ import java.util.Locale;
|
||||
public class ClientStackFluid implements IClientStack {
|
||||
private int hash;
|
||||
private FluidStack stack;
|
||||
private FluidStackRenderer renderer;
|
||||
|
||||
public ClientStackFluid(ByteBuf buf) {
|
||||
this.hash = buf.readInt();
|
||||
this.stack = new FluidStack(FluidRegistry.getFluid(ByteBufUtils.readUTF8String(buf)), buf.readInt(), ByteBufUtils.readTag(buf));
|
||||
// @TODO: Switch to own implementation
|
||||
this.renderer = new FluidStackRenderer(1000, false, 16, 16, null);
|
||||
}
|
||||
|
||||
public FluidStack getStack() {
|
||||
@@ -54,7 +49,7 @@ public class ClientStackFluid implements IClientStack {
|
||||
|
||||
@Override
|
||||
public void draw(GuiBase gui, int x, int y, boolean isOverWithShift) {
|
||||
renderer.draw(Minecraft.getMinecraft(), x, y, stack);
|
||||
GuiBase.FLUID_RENDERER.draw(gui.mc, x, y, stack);
|
||||
|
||||
gui.drawQuantity(x, y, String.format(Locale.US, "%.1f", (float) stack.amount / 1000).replace(".0", "") + "B");
|
||||
}
|
||||
|
32
src/main/java/refinedstorage/inventory/ItemHandlerFluidFilter.java
Executable file
32
src/main/java/refinedstorage/inventory/ItemHandlerFluidFilter.java
Executable file
@@ -0,0 +1,32 @@
|
||||
package refinedstorage.inventory;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
|
||||
|
||||
public class ItemHandlerFluidFilter extends ItemHandlerBasic {
|
||||
private FluidStack[] filters = new FluidStack[9];
|
||||
|
||||
public ItemHandlerFluidFilter(TileEntity tile) {
|
||||
super(9, tile, (IItemValidator) s -> s.hasCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, null) && s.getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, null).drain(Fluid.BUCKET_VOLUME, false) != null);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onContentsChanged(int slot) {
|
||||
super.onContentsChanged(slot);
|
||||
|
||||
ItemStack stack = getStackInSlot(slot);
|
||||
|
||||
if (stack == null) {
|
||||
filters[slot] = null;
|
||||
} else {
|
||||
filters[slot] = stack.getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, null).drain(Fluid.BUCKET_VOLUME, false);
|
||||
}
|
||||
}
|
||||
|
||||
public FluidStack[] getFilters() {
|
||||
return filters;
|
||||
}
|
||||
}
|
@@ -238,6 +238,7 @@ public class ClientProxy extends CommonProxy {
|
||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RefinedStorageBlocks.IMPORTER), 0, new ModelResourceLocation("refinedstorage:importer", "inventory"));
|
||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RefinedStorageBlocks.EXTERNAL_STORAGE), 0, new ModelResourceLocation("refinedstorage:external_storage", "inventory"));
|
||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RefinedStorageBlocks.DISK_DRIVE), 0, new ModelResourceLocation("refinedstorage:disk_drive", "inventory"));
|
||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RefinedStorageBlocks.FLUID_DISK_DRIVE), 0, new ModelResourceLocation("refinedstorage:disk_drive", "inventory"));
|
||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RefinedStorageBlocks.CONTROLLER), EnumControllerType.NORMAL.getId(), new ModelResourceLocation("refinedstorage:controller", "inventory"));
|
||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RefinedStorageBlocks.CONTROLLER), EnumControllerType.CREATIVE.getId(), new ModelResourceLocation("refinedstorage:creative_controller", "inventory"));
|
||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RefinedStorageBlocks.CONSTRUCTOR), 0, new ModelResourceLocation("refinedstorage:constructor", "inventory"));
|
||||
|
@@ -85,6 +85,7 @@ public class CommonProxy {
|
||||
registerTile(TileCable.class, "cable");
|
||||
registerTile(TileNetworkReceiver.class, "network_receiver");
|
||||
registerTile(TileNetworkTransmitter.class, "network_transmitter");
|
||||
registerTile(TileFluidDiskDrive.class, "fluid_disk_drive");
|
||||
|
||||
registerBlock(RefinedStorageBlocks.CONTROLLER);
|
||||
registerBlock(RefinedStorageBlocks.GRID);
|
||||
@@ -107,6 +108,7 @@ public class CommonProxy {
|
||||
registerBlock(RefinedStorageBlocks.MACHINE_CASING);
|
||||
registerBlock(RefinedStorageBlocks.NETWORK_TRANSMITTER);
|
||||
registerBlock(RefinedStorageBlocks.NETWORK_RECEIVER);
|
||||
registerBlock(RefinedStorageBlocks.FLUID_DISK_DRIVE);
|
||||
|
||||
registerItem(RefinedStorageItems.QUARTZ_ENRICHED_IRON);
|
||||
registerItem(RefinedStorageItems.STORAGE_DISK);
|
||||
@@ -202,6 +204,15 @@ public class CommonProxy {
|
||||
new ItemStack(Blocks.CHEST)
|
||||
));
|
||||
|
||||
// Fluid Disk Drive
|
||||
RefinedStorageAPI.SOLDERER_REGISTRY.addRecipe(new SoldererRecipeBasic(
|
||||
new ItemStack(RefinedStorageBlocks.FLUID_DISK_DRIVE),
|
||||
500,
|
||||
new ItemStack(RefinedStorageItems.PROCESSOR, 1, ItemProcessor.TYPE_ADVANCED),
|
||||
new ItemStack(RefinedStorageBlocks.MACHINE_CASING),
|
||||
new ItemStack(Items.BUCKET)
|
||||
));
|
||||
|
||||
// Cable
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(RefinedStorageBlocks.CABLE, 12),
|
||||
"EEE",
|
||||
|
@@ -12,6 +12,10 @@ public interface IStorageGui {
|
||||
|
||||
TileDataParameter<Integer> getCompareParameter();
|
||||
|
||||
default boolean hasComparisonFor(int compare) {
|
||||
return true;
|
||||
}
|
||||
|
||||
TileDataParameter<Integer> getFilterParameter();
|
||||
|
||||
TileDataParameter<Integer> getPriorityParameter();
|
||||
|
@@ -12,13 +12,9 @@ import net.minecraftforge.items.ItemHandlerHelper;
|
||||
import refinedstorage.RefinedStorage;
|
||||
import refinedstorage.RefinedStorageItems;
|
||||
import refinedstorage.api.network.INetworkMaster;
|
||||
import refinedstorage.api.storage.fluid.IFluidStorage;
|
||||
import refinedstorage.api.storage.fluid.IFluidStorageProvider;
|
||||
import refinedstorage.api.storage.item.IItemStorage;
|
||||
import refinedstorage.api.storage.item.IItemStorageProvider;
|
||||
import refinedstorage.apiimpl.storage.fluid.FluidStorageNBT;
|
||||
import refinedstorage.apiimpl.storage.item.ItemStorageNBT;
|
||||
import refinedstorage.block.EnumFluidStorageType;
|
||||
import refinedstorage.block.EnumItemStorageType;
|
||||
import refinedstorage.inventory.ItemHandlerBasic;
|
||||
import refinedstorage.inventory.ItemValidatorBasic;
|
||||
@@ -29,7 +25,7 @@ import refinedstorage.tile.data.TileDataParameter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class TileDiskDrive extends TileNode implements IItemStorageProvider, IFluidStorageProvider, IStorageGui, IComparable, IFilterable, IPrioritizable {
|
||||
public class TileDiskDrive extends TileNode implements IItemStorageProvider, IStorageGui, IComparable, IFilterable, IPrioritizable {
|
||||
public static final TileDataParameter<Integer> PRIORITY = IPrioritizable.createParameter();
|
||||
public static final TileDataParameter<Integer> COMPARE = IComparable.createParameter();
|
||||
public static final TileDataParameter<Integer> MODE = IFilterable.createParameter();
|
||||
@@ -54,18 +50,6 @@ public class TileDiskDrive extends TileNode implements IItemStorageProvider, IFl
|
||||
}
|
||||
}
|
||||
|
||||
// @TODO: This is only temporary. Add fluid disk drive.
|
||||
class FluidStorage extends FluidStorageNBT {
|
||||
public FluidStorage(ItemStack disk) {
|
||||
super(disk.getTagCompound(), EnumFluidStorageType.getById(disk.getItemDamage()).getCapacity(), TileDiskDrive.this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPriority() {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
private static final String NBT_PRIORITY = "Priority";
|
||||
private static final String NBT_COMPARE = "Compare";
|
||||
private static final String NBT_MODE = "Mode";
|
||||
@@ -76,44 +60,30 @@ public class TileDiskDrive extends TileNode implements IItemStorageProvider, IFl
|
||||
public boolean isValid(ItemStack disk) {
|
||||
return super.isValid(disk) && ItemStorageNBT.isValid(disk);
|
||||
}
|
||||
}, new ItemValidatorBasic(RefinedStorageItems.FLUID_STORAGE_DISK) {
|
||||
@Override
|
||||
public boolean isValid(ItemStack disk) {
|
||||
return super.isValid(disk) && FluidStorageNBT.isValid(disk);
|
||||
}
|
||||
}) {
|
||||
@Override
|
||||
protected void onContentsChanged(int slot) {
|
||||
super.onContentsChanged(slot);
|
||||
|
||||
/**
|
||||
* Can't use {@link net.minecraft.world.World#isRemote} here because when {@link TileDiskDrive#readFromNBT(NBTTagCompound)} is called there is no world set yet.
|
||||
*/
|
||||
if (FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER) {
|
||||
ItemStack disk = getStackInSlot(slot);
|
||||
|
||||
if (disk == null) {
|
||||
itemStorages[slot] = null;
|
||||
fluidStorages[slot] = null;
|
||||
storages[slot] = null;
|
||||
} else {
|
||||
if (disk.getItem() == RefinedStorageItems.STORAGE_DISK) {
|
||||
itemStorages[slot] = new ItemStorage(disk);
|
||||
} else if (disk.getItem() == RefinedStorageItems.FLUID_STORAGE_DISK) {
|
||||
fluidStorages[slot] = new FluidStorage(disk);
|
||||
}
|
||||
storages[slot] = new ItemStorage(disk);
|
||||
}
|
||||
|
||||
if (network != null) {
|
||||
network.getItemStorage().rebuild();
|
||||
network.getFluidStorage().rebuild();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack extractItem(int slot, int amount, boolean simulate) {
|
||||
if (itemStorages[slot] != null) {
|
||||
itemStorages[slot].writeToNBT();
|
||||
if (storages[slot] != null) {
|
||||
storages[slot].writeToNBT();
|
||||
}
|
||||
|
||||
return super.extractItem(slot, amount, simulate);
|
||||
@@ -122,8 +92,7 @@ public class TileDiskDrive extends TileNode implements IItemStorageProvider, IFl
|
||||
|
||||
private ItemHandlerBasic filters = new ItemHandlerBasic(9, this);
|
||||
|
||||
private ItemStorage itemStorages[] = new ItemStorage[8];
|
||||
private FluidStorage fluidStorages[] = new FluidStorage[8];
|
||||
private ItemStorage storages[] = new ItemStorage[8];
|
||||
|
||||
private int priority = 0;
|
||||
private int compare = 0;
|
||||
@@ -167,7 +136,7 @@ public class TileDiskDrive extends TileNode implements IItemStorageProvider, IFl
|
||||
}
|
||||
|
||||
public void onBreak() {
|
||||
for (ItemStorage storage : this.itemStorages) {
|
||||
for (ItemStorage storage : this.storages) {
|
||||
if (storage != null) {
|
||||
storage.writeToNBT();
|
||||
}
|
||||
@@ -179,21 +148,11 @@ public class TileDiskDrive extends TileNode implements IItemStorageProvider, IFl
|
||||
super.onConnectionChange(network, state);
|
||||
|
||||
network.getItemStorage().rebuild();
|
||||
network.getFluidStorage().rebuild();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addItemStorages(List<IItemStorage> storages) {
|
||||
for (IItemStorage storage : this.itemStorages) {
|
||||
if (storage != null) {
|
||||
storages.add(storage);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addFluidStorages(List<IFluidStorage> storages) {
|
||||
for (IFluidStorage storage : this.fluidStorages) {
|
||||
for (IItemStorage storage : this.storages) {
|
||||
if (storage != null) {
|
||||
storages.add(storage);
|
||||
}
|
||||
@@ -225,8 +184,8 @@ public class TileDiskDrive extends TileNode implements IItemStorageProvider, IFl
|
||||
super.write(tag);
|
||||
|
||||
for (int i = 0; i < disks.getSlots(); ++i) {
|
||||
if (itemStorages[i] != null) {
|
||||
itemStorages[i].writeToNBT();
|
||||
if (storages[i] != null) {
|
||||
storages[i].writeToNBT();
|
||||
}
|
||||
}
|
||||
|
||||
|
380
src/main/java/refinedstorage/tile/TileFluidDiskDrive.java
Executable file
380
src/main/java/refinedstorage/tile/TileFluidDiskDrive.java
Executable file
@@ -0,0 +1,380 @@
|
||||
package refinedstorage.tile;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraftforge.common.capabilities.Capability;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.items.CapabilityItemHandler;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
import refinedstorage.RefinedStorage;
|
||||
import refinedstorage.RefinedStorageItems;
|
||||
import refinedstorage.api.network.INetworkMaster;
|
||||
import refinedstorage.api.storage.CompareUtils;
|
||||
import refinedstorage.api.storage.fluid.IFluidStorage;
|
||||
import refinedstorage.api.storage.fluid.IFluidStorageProvider;
|
||||
import refinedstorage.apiimpl.storage.fluid.FluidStorageNBT;
|
||||
import refinedstorage.apiimpl.storage.fluid.FluidUtils;
|
||||
import refinedstorage.block.EnumFluidStorageType;
|
||||
import refinedstorage.inventory.ItemHandlerBasic;
|
||||
import refinedstorage.inventory.ItemHandlerFluidFilter;
|
||||
import refinedstorage.inventory.ItemValidatorBasic;
|
||||
import refinedstorage.tile.config.IComparable;
|
||||
import refinedstorage.tile.config.IFilterable;
|
||||
import refinedstorage.tile.config.IPrioritizable;
|
||||
import refinedstorage.tile.data.TileDataParameter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class TileFluidDiskDrive extends TileNode implements IFluidStorageProvider, IStorageGui, IComparable, IFilterable, IPrioritizable {
|
||||
public static final TileDataParameter<Integer> PRIORITY = IPrioritizable.createParameter();
|
||||
public static final TileDataParameter<Integer> COMPARE = IComparable.createParameter();
|
||||
public static final TileDataParameter<Integer> MODE = IFilterable.createParameter();
|
||||
|
||||
public class FluidStorage extends FluidStorageNBT {
|
||||
public FluidStorage(ItemStack disk) {
|
||||
super(disk.getTagCompound(), EnumFluidStorageType.getById(disk.getItemDamage()).getCapacity(), TileFluidDiskDrive.this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPriority() {
|
||||
return priority;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidStack insertFluid(FluidStack stack, int size, boolean simulate) {
|
||||
if (!IFilterable.canTakeFluids(filters, mode, getCompare(), stack)) {
|
||||
return FluidUtils.copyStackWithSize(stack, size);
|
||||
}
|
||||
|
||||
return super.insertFluid(stack, size, simulate);
|
||||
}
|
||||
}
|
||||
|
||||
private static final String NBT_PRIORITY = "Priority";
|
||||
private static final String NBT_COMPARE = "Compare";
|
||||
private static final String NBT_MODE = "Mode";
|
||||
private static final String NBT_STORED = "Stored";
|
||||
|
||||
private ItemHandlerBasic disks = new ItemHandlerBasic(8, this, new ItemValidatorBasic(RefinedStorageItems.FLUID_STORAGE_DISK) {
|
||||
@Override
|
||||
public boolean isValid(ItemStack disk) {
|
||||
return super.isValid(disk) && FluidStorageNBT.isValid(disk);
|
||||
}
|
||||
}) {
|
||||
@Override
|
||||
protected void onContentsChanged(int slot) {
|
||||
super.onContentsChanged(slot);
|
||||
|
||||
if (FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER) {
|
||||
ItemStack disk = getStackInSlot(slot);
|
||||
|
||||
if (disk == null) {
|
||||
storages[slot] = null;
|
||||
} else {
|
||||
storages[slot] = new FluidStorage(disk);
|
||||
}
|
||||
|
||||
if (network != null) {
|
||||
network.getFluidStorage().rebuild();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack extractItem(int slot, int amount, boolean simulate) {
|
||||
if (storages[slot] != null) {
|
||||
storages[slot].writeToNBT();
|
||||
}
|
||||
|
||||
return super.extractItem(slot, amount, simulate);
|
||||
}
|
||||
};
|
||||
|
||||
private ItemHandlerFluidFilter filters = new ItemHandlerFluidFilter(this);
|
||||
|
||||
private FluidStorage storages[] = new FluidStorage[8];
|
||||
|
||||
private int priority = 0;
|
||||
private int compare = 0;
|
||||
private int mode = IFilterable.WHITELIST;
|
||||
private int stored = 0;
|
||||
|
||||
public TileFluidDiskDrive() {
|
||||
dataManager.addWatchedParameter(PRIORITY);
|
||||
dataManager.addWatchedParameter(COMPARE);
|
||||
dataManager.addWatchedParameter(MODE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
if (!worldObj.isRemote) {
|
||||
if (stored != getStoredForDisplayServer()) {
|
||||
stored = getStoredForDisplayServer();
|
||||
|
||||
updateBlock();
|
||||
}
|
||||
}
|
||||
|
||||
super.update();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getEnergyUsage() {
|
||||
int usage = RefinedStorage.INSTANCE.fluidDiskDriveUsage;
|
||||
|
||||
for (int i = 0; i < disks.getSlots(); ++i) {
|
||||
if (disks.getStackInSlot(i) != null) {
|
||||
usage += RefinedStorage.INSTANCE.fluidDiskDrivePerDiskUsage;
|
||||
}
|
||||
}
|
||||
|
||||
return usage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateNode() {
|
||||
}
|
||||
|
||||
public void onBreak() {
|
||||
for (FluidStorage storage : this.storages) {
|
||||
if (storage != null) {
|
||||
storage.writeToNBT();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConnectionChange(INetworkMaster network, boolean state) {
|
||||
super.onConnectionChange(network, state);
|
||||
|
||||
network.getFluidStorage().rebuild();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addFluidStorages(List<IFluidStorage> storages) {
|
||||
for (IFluidStorage storage : this.storages) {
|
||||
if (storage != null) {
|
||||
storages.add(storage);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(NBTTagCompound tag) {
|
||||
super.read(tag);
|
||||
|
||||
readItems(disks, 0, tag);
|
||||
readItems(filters, 1, tag);
|
||||
|
||||
if (tag.hasKey(NBT_PRIORITY)) {
|
||||
priority = tag.getInteger(NBT_PRIORITY);
|
||||
}
|
||||
|
||||
if (tag.hasKey(NBT_COMPARE)) {
|
||||
compare = tag.getInteger(NBT_COMPARE);
|
||||
}
|
||||
|
||||
if (tag.hasKey(NBT_MODE)) {
|
||||
mode = tag.getInteger(NBT_MODE);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound write(NBTTagCompound tag) {
|
||||
super.write(tag);
|
||||
|
||||
for (int i = 0; i < disks.getSlots(); ++i) {
|
||||
if (storages[i] != null) {
|
||||
storages[i].writeToNBT();
|
||||
}
|
||||
}
|
||||
|
||||
writeItems(disks, 0, tag);
|
||||
writeItems(filters, 1, tag);
|
||||
|
||||
tag.setInteger(NBT_PRIORITY, priority);
|
||||
tag.setInteger(NBT_COMPARE, compare);
|
||||
tag.setInteger(NBT_MODE, mode);
|
||||
|
||||
return tag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound writeUpdate(NBTTagCompound tag) {
|
||||
super.writeUpdate(tag);
|
||||
|
||||
tag.setInteger(NBT_STORED, stored);
|
||||
|
||||
return tag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readUpdate(NBTTagCompound tag) {
|
||||
stored = tag.getInteger(NBT_STORED);
|
||||
|
||||
super.readUpdate(tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCompare() {
|
||||
return compare;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCompare(int compare) {
|
||||
this.compare = compare;
|
||||
|
||||
markDirty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMode() {
|
||||
return mode;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMode(int mode) {
|
||||
this.mode = mode;
|
||||
|
||||
markDirty();
|
||||
}
|
||||
|
||||
public int getStoredForDisplayServer() {
|
||||
float stored = 0;
|
||||
float storedMax = 0;
|
||||
|
||||
for (int i = 0; i < disks.getSlots(); ++i) {
|
||||
ItemStack disk = disks.getStackInSlot(i);
|
||||
|
||||
if (disk != null) {
|
||||
int capacity = EnumFluidStorageType.getById(disk.getItemDamage()).getCapacity();
|
||||
|
||||
if (capacity == -1) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
stored += FluidStorageNBT.getStoredFromNBT(disk.getTagCompound());
|
||||
storedMax += EnumFluidStorageType.getById(disk.getItemDamage()).getCapacity();
|
||||
}
|
||||
}
|
||||
|
||||
if (storedMax == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return (int) Math.floor((stored / storedMax) * 7f);
|
||||
}
|
||||
|
||||
public int getStoredForDisplay() {
|
||||
return stored;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGuiTitle() {
|
||||
return "block.refinedstorage:fluid_disk_drive.name";
|
||||
}
|
||||
|
||||
@Override
|
||||
public IItemHandler getFilters() {
|
||||
return filters;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileDataParameter<Integer> getRedstoneModeParameter() {
|
||||
return REDSTONE_MODE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileDataParameter<Integer> getCompareParameter() {
|
||||
return COMPARE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasComparisonFor(int compare) {
|
||||
return compare == CompareUtils.COMPARE_NBT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileDataParameter<Integer> getFilterParameter() {
|
||||
return MODE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileDataParameter<Integer> getPriorityParameter() {
|
||||
return PRIORITY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPriority() {
|
||||
return priority;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPriority(int priority) {
|
||||
this.priority = priority;
|
||||
|
||||
markDirty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getStored() {
|
||||
int stored = 0;
|
||||
|
||||
for (int i = 0; i < disks.getSlots(); ++i) {
|
||||
ItemStack stack = disks.getStackInSlot(i);
|
||||
|
||||
if (stack != null) {
|
||||
stored += FluidStorageNBT.getStoredFromNBT(stack.getTagCompound());
|
||||
}
|
||||
}
|
||||
|
||||
return stored;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCapacity() {
|
||||
int capacity = 0;
|
||||
|
||||
for (int i = 0; i < disks.getSlots(); ++i) {
|
||||
ItemStack stack = disks.getStackInSlot(i);
|
||||
|
||||
if (stack != null) {
|
||||
int diskCapacity = EnumFluidStorageType.getById(stack.getItemDamage()).getCapacity();
|
||||
|
||||
if (diskCapacity == -1) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
capacity += diskCapacity;
|
||||
}
|
||||
}
|
||||
|
||||
return capacity;
|
||||
}
|
||||
|
||||
public IItemHandler getDisks() {
|
||||
return disks;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IItemHandler getDrops() {
|
||||
return disks;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> T getCapability(Capability<T> capability, EnumFacing facing) {
|
||||
if (capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) {
|
||||
return (T) disks;
|
||||
}
|
||||
|
||||
return super.getCapability(capability, facing);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCapability(Capability<?> capability, EnumFacing facing) {
|
||||
return capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY || super.hasCapability(capability, facing);
|
||||
}
|
||||
}
|
@@ -3,8 +3,10 @@ package refinedstorage.tile.config;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.network.datasync.DataSerializers;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
import refinedstorage.api.storage.CompareUtils;
|
||||
import refinedstorage.inventory.ItemHandlerFluidFilter;
|
||||
import refinedstorage.tile.data.ITileDataConsumer;
|
||||
import refinedstorage.tile.data.ITileDataProducer;
|
||||
import refinedstorage.tile.data.TileDataParameter;
|
||||
@@ -61,6 +63,38 @@ public interface IFilterable {
|
||||
return false;
|
||||
}
|
||||
|
||||
static boolean canTakeFluids(ItemHandlerFluidFilter filters, int mode, int compare, FluidStack stack) {
|
||||
if (mode == WHITELIST) {
|
||||
int slots = 0;
|
||||
|
||||
for (int i = 0; i < filters.getSlots(); ++i) {
|
||||
FluidStack slot = filters.getFilters()[i];
|
||||
|
||||
if (slot != null) {
|
||||
slots++;
|
||||
|
||||
if (CompareUtils.compareStack(slot, stack, compare)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return slots == 0;
|
||||
} else if (mode == BLACKLIST) {
|
||||
for (int i = 0; i < filters.getSlots(); ++i) {
|
||||
FluidStack slot = filters.getFilters()[i];
|
||||
|
||||
if (slot != null && CompareUtils.compareStack(slot, stack, compare)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void setMode(int mode);
|
||||
|
||||
int getMode();
|
||||
|
@@ -39,6 +39,7 @@ gui.refinedstorage:network_transmitter.distance=%d blocks
|
||||
gui.refinedstorage:network_transmitter.dimension=Dimension %d
|
||||
gui.refinedstorage:network_transmitter.missing_card=Missing Network Card
|
||||
gui.refinedstorage:network_transmitter.missing_upgrade=Insert upgrade
|
||||
gui.refinedstorage:fluid_disk_drive=Fluid Disk Drive
|
||||
|
||||
misc.refinedstorage:energy_stored=%d / %d RS
|
||||
misc.refinedstorage:energy_usage=Usage: %d RS/t
|
||||
@@ -126,6 +127,7 @@ block.refinedstorage:crafter.name=Crafter
|
||||
block.refinedstorage:processing_pattern_encoder.name=Processing Pattern Encoder
|
||||
block.refinedstorage:network_receiver.name=Network Receiver
|
||||
block.refinedstorage:network_transmitter.name=Network Transmitter
|
||||
block.refinedstorage:fluid_disk_drive.name=Fluid Disk Drive
|
||||
|
||||
item.refinedstorage:storage_disk.0.name=1k Storage Disk
|
||||
item.refinedstorage:storage_disk.1.name=4k Storage Disk
|
||||
|
Reference in New Issue
Block a user