Fluid Constructor
This commit is contained in:
@@ -44,6 +44,7 @@ public final class RefinedStorage {
|
||||
public int controllerBaseUsage;
|
||||
public int cableUsage;
|
||||
public int constructorUsage;
|
||||
public int fluidConstructorUsage;
|
||||
public int crafterUsage;
|
||||
public int crafterPerPatternUsage;
|
||||
public int craftingMonitorUsage;
|
||||
@@ -91,6 +92,7 @@ public final class RefinedStorage {
|
||||
controllerBaseUsage = config.getInt("controllerBase", "energy", 0, 0, Integer.MAX_VALUE, "The base energy used by the Controller");
|
||||
cableUsage = config.getInt("cable", "energy", 0, 0, Integer.MAX_VALUE, "The energy used by Cables");
|
||||
constructorUsage = config.getInt("constructor", "energy", 1, 0, Integer.MAX_VALUE, "The energy used by Constructors");
|
||||
fluidConstructorUsage = config.getInt("fluidConstructor", "energy", 1, 0, Integer.MAX_VALUE, "The energy used by Fluid Constructors");
|
||||
crafterUsage = config.getInt("crafter", "energy", 2, 0, Integer.MAX_VALUE, "The base energy used by Crafters");
|
||||
crafterPerPatternUsage = config.getInt("crafterPerPattern", "energy", 1, 0, Integer.MAX_VALUE, "The additional energy used per Pattern in a Crafter");
|
||||
craftingMonitorUsage = config.getInt("craftingMonitor", "energy", 2, 0, Integer.MAX_VALUE, "The energy used by Crafting Monitors");
|
||||
|
@@ -25,4 +25,5 @@ public final class RefinedStorageBlocks {
|
||||
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();
|
||||
public static final BlockFluidConstructor FLUID_CONSTRUCTOR = new BlockFluidConstructor();
|
||||
}
|
@@ -21,4 +21,5 @@ public final class RefinedStorageGui {
|
||||
public static final int GRID_FILTER = 17;
|
||||
public static final int NETWORK_TRANSMITTER = 18;
|
||||
public static final int FLUID_DISK_DRIVE = 19;
|
||||
public static final int FLUID_CONSTRUCTOR = 20;
|
||||
}
|
||||
|
@@ -68,6 +68,10 @@ public class BlockCable extends BlockCoverable {
|
||||
setCreativeTab(RefinedStorage.INSTANCE.tab);
|
||||
}
|
||||
|
||||
public BlockCable() {
|
||||
this("cable");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName() {
|
||||
return "block." + RefinedStorage.ID + ":" + name;
|
||||
@@ -77,10 +81,6 @@ public class BlockCable extends BlockCoverable {
|
||||
return name;
|
||||
}
|
||||
|
||||
public BlockCable() {
|
||||
this("cable");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvidePower(IBlockState state) {
|
||||
return false;
|
||||
|
@@ -31,8 +31,12 @@ public class BlockConstructor extends BlockCable {
|
||||
public static final AxisAlignedBB HEAD_DOWN_AABB = createAABB(0, 0, 0, 16, 2, 16);
|
||||
public static final AxisAlignedBB HEAD_UP_AABB = createAABB(0, 14, 0, 16, 16, 16);
|
||||
|
||||
public BlockConstructor(String name) {
|
||||
super(name);
|
||||
}
|
||||
|
||||
public BlockConstructor() {
|
||||
super("constructor");
|
||||
this("constructor");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
37
src/main/java/refinedstorage/block/BlockFluidConstructor.java
Executable file
37
src/main/java/refinedstorage/block/BlockFluidConstructor.java
Executable file
@@ -0,0 +1,37 @@
|
||||
package refinedstorage.block;
|
||||
|
||||
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.World;
|
||||
import refinedstorage.RefinedStorage;
|
||||
import refinedstorage.RefinedStorageGui;
|
||||
import refinedstorage.tile.TileFluidConstructor;
|
||||
|
||||
public class BlockFluidConstructor extends BlockConstructor {
|
||||
public BlockFluidConstructor() {
|
||||
super("fluid_constructor");
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createTileEntity(World world, IBlockState state) {
|
||||
return new TileFluidConstructor();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivatedDefault(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) {
|
||||
if (hitCablePart(state, world, pos, hitX, hitY, hitZ)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!world.isRemote) {
|
||||
player.openGui(RefinedStorage.INSTANCE, RefinedStorageGui.FLUID_CONSTRUCTOR, world, pos.getX(), pos.getY(), pos.getZ());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
49
src/main/java/refinedstorage/container/ContainerFluidConstructor.java
Executable file
49
src/main/java/refinedstorage/container/ContainerFluidConstructor.java
Executable file
@@ -0,0 +1,49 @@
|
||||
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.container.slot.SlotSpecimenFluid;
|
||||
import refinedstorage.tile.TileFluidConstructor;
|
||||
|
||||
public class ContainerFluidConstructor extends ContainerBase {
|
||||
public ContainerFluidConstructor(TileFluidConstructor fluidConstructor, EntityPlayer player) {
|
||||
super(fluidConstructor, player);
|
||||
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
addSlotToContainer(new SlotItemHandler(fluidConstructor.getUpgrades(), i, 187, 6 + (i * 18)));
|
||||
}
|
||||
|
||||
addSlotToContainer(new SlotSpecimenFluid(!fluidConstructor.getWorld().isRemote, fluidConstructor.getFilter(), 0, 80, 20));
|
||||
|
||||
addPlayerInventory(8, 55);
|
||||
}
|
||||
|
||||
@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 < 4) {
|
||||
if (!mergeItemStack(stack, 4, inventorySlots.size(), false)) {
|
||||
return null;
|
||||
}
|
||||
} else if (!mergeItemStack(stack, 0, 4, false)) {
|
||||
return mergeItemStackToSpecimen(stack, 4, 4 + 1);
|
||||
}
|
||||
|
||||
if (stack.stackSize == 0) {
|
||||
slot.putStack(null);
|
||||
} else {
|
||||
slot.onSlotChanged();
|
||||
}
|
||||
}
|
||||
|
||||
return stack;
|
||||
}
|
||||
}
|
@@ -4,8 +4,8 @@ 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.SlotFluid;
|
||||
import refinedstorage.container.slot.SlotSpecimen;
|
||||
import refinedstorage.container.slot.SlotSpecimenFluid;
|
||||
import refinedstorage.inventory.ItemHandlerFluid;
|
||||
import refinedstorage.tile.TileBase;
|
||||
|
||||
@@ -22,7 +22,7 @@ public class ContainerStorage extends ContainerBase {
|
||||
|
||||
protected void addFilterAndPlayerInventorySlots(IItemHandler filters) {
|
||||
for (int i = 0; i < 9; ++i) {
|
||||
addSlotToContainer(filters instanceof ItemHandlerFluid ? new SlotFluid(!getTile().getWorld().isRemote, filters, i, 8 + (18 * i), 20) : new SlotSpecimen(filters, i, 8 + (18 * i), 20));
|
||||
addSlotToContainer(filters instanceof ItemHandlerFluid ? new SlotSpecimenFluid(!getTile().getWorld().isRemote, filters, i, 8 + (18 * i), 20) : new SlotSpecimen(filters, i, 8 + (18 * i), 20));
|
||||
}
|
||||
|
||||
addPlayerInventory(8, 129);
|
||||
|
@@ -3,10 +3,10 @@ package refinedstorage.container.slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
|
||||
public class SlotFluid extends SlotSpecimen {
|
||||
public class SlotSpecimenFluid extends SlotSpecimen {
|
||||
private boolean server;
|
||||
|
||||
public SlotFluid(boolean server, IItemHandler handler, int id, int x, int y) {
|
||||
public SlotSpecimenFluid(boolean server, IItemHandler handler, int id, int x, int y) {
|
||||
super(handler, id, x, y);
|
||||
|
||||
this.server = server;
|
37
src/main/java/refinedstorage/gui/GuiFluidConstructor.java
Executable file
37
src/main/java/refinedstorage/gui/GuiFluidConstructor.java
Executable file
@@ -0,0 +1,37 @@
|
||||
package refinedstorage.gui;
|
||||
|
||||
import refinedstorage.api.storage.CompareUtils;
|
||||
import refinedstorage.container.ContainerFluidConstructor;
|
||||
import refinedstorage.gui.sidebutton.SideButtonCompare;
|
||||
import refinedstorage.gui.sidebutton.SideButtonRedstoneMode;
|
||||
import refinedstorage.tile.TileFluidConstructor;
|
||||
|
||||
public class GuiFluidConstructor extends GuiBase {
|
||||
public GuiFluidConstructor(ContainerFluidConstructor container) {
|
||||
super(container, 211, 137);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(int x, int y) {
|
||||
addSideButton(new SideButtonRedstoneMode(TileFluidConstructor.REDSTONE_MODE));
|
||||
|
||||
addSideButton(new SideButtonCompare(TileFluidConstructor.COMPARE, CompareUtils.COMPARE_NBT));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(int x, int y) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawBackground(int x, int y, int mouseX, int mouseY) {
|
||||
bindTexture("gui/constructor.png");
|
||||
|
||||
drawTexture(x, y, 0, 0, width, height);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawForeground(int mouseX, int mouseY) {
|
||||
drawString(7, 7, t("gui.refinedstorage:fluid_constructor"));
|
||||
drawString(7, 43, t("container.inventory"));
|
||||
}
|
||||
}
|
@@ -23,8 +23,6 @@ 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:
|
||||
@@ -53,6 +51,10 @@ public class GuiHandler implements IGuiHandler {
|
||||
return new ContainerProcessingPatternEncoder((TileProcessingPatternEncoder) tile, player);
|
||||
case RefinedStorageGui.NETWORK_TRANSMITTER:
|
||||
return new ContainerNetworkTransmitter((TileNetworkTransmitter) tile, player);
|
||||
case RefinedStorageGui.FLUID_DISK_DRIVE:
|
||||
return new ContainerFluidDiskDrive((TileFluidDiskDrive) tile, player);
|
||||
case RefinedStorageGui.FLUID_CONSTRUCTOR:
|
||||
return new ContainerFluidConstructor((TileFluidConstructor) tile, player);
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
@@ -94,8 +96,6 @@ public class GuiHandler implements IGuiHandler {
|
||||
return getWirelessGridGui(player, x);
|
||||
case RefinedStorageGui.DISK_DRIVE:
|
||||
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:
|
||||
@@ -126,6 +126,10 @@ public class GuiHandler implements IGuiHandler {
|
||||
return new GuiGridFilter(getGridFilterContainer(player, x));
|
||||
case RefinedStorageGui.NETWORK_TRANSMITTER:
|
||||
return new GuiNetworkTransmitter((ContainerNetworkTransmitter) getContainer(ID, player, tile), (TileNetworkTransmitter) tile);
|
||||
case RefinedStorageGui.FLUID_DISK_DRIVE:
|
||||
return new GuiStorage((ContainerFluidDiskDrive) getContainer(ID, player, tile), (IStorageGui) tile, "gui/disk_drive.png");
|
||||
case RefinedStorageGui.FLUID_CONSTRUCTOR:
|
||||
return new GuiFluidConstructor((ContainerFluidConstructor) getContainer(ID, player, tile));
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
@@ -60,7 +60,7 @@ public class GuiGrid extends GuiBase {
|
||||
}
|
||||
|
||||
public GuiGrid(ContainerGrid container, IGrid grid) {
|
||||
super(container, 227, (grid.getType() == EnumGridType.CRAFTING || grid.getType() == EnumGridType.PATTERN) ? 247 : 208);
|
||||
super(container, grid.getType() == EnumGridType.FLUID ? 193 : 227, (grid.getType() == EnumGridType.CRAFTING || grid.getType() == EnumGridType.PATTERN) ? 247 : 208);
|
||||
|
||||
setScrollbar(new Scrollbar(174, 20, 12, (grid.getType() == EnumGridType.CRAFTING || grid.getType() == EnumGridType.PATTERN || grid.getType() == EnumGridType.FLUID) ? 70 : 88));
|
||||
|
||||
@@ -241,8 +241,6 @@ public class GuiGrid extends GuiBase {
|
||||
bindTexture("gui/crafting_grid.png");
|
||||
} else if (grid.getType() == EnumGridType.PATTERN) {
|
||||
bindTexture("gui/pattern_grid.png");
|
||||
} else if (grid.getType() == EnumGridType.FLUID) {
|
||||
bindTexture("gui/fluid_grid.png");
|
||||
} else {
|
||||
bindTexture("gui/grid.png");
|
||||
}
|
||||
|
@@ -238,7 +238,6 @@ 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"));
|
||||
@@ -258,5 +257,7 @@ public class ClientProxy extends CommonProxy {
|
||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RefinedStorageBlocks.STORAGE), EnumItemStorageType.TYPE_16K.getId(), new ModelResourceLocation("refinedstorage:storage", "type=16k"));
|
||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RefinedStorageBlocks.STORAGE), EnumItemStorageType.TYPE_64K.getId(), new ModelResourceLocation("refinedstorage:storage", "type=64k"));
|
||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RefinedStorageBlocks.STORAGE), EnumItemStorageType.TYPE_CREATIVE.getId(), new ModelResourceLocation("refinedstorage:storage", "type=creative"));
|
||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RefinedStorageBlocks.FLUID_DISK_DRIVE), 0, new ModelResourceLocation("refinedstorage:disk_drive", "inventory"));
|
||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RefinedStorageBlocks.FLUID_CONSTRUCTOR), 0, new ModelResourceLocation("refinedstorage:fluid_constructor", "inventory"));
|
||||
}
|
||||
}
|
||||
|
@@ -86,6 +86,7 @@ public class CommonProxy {
|
||||
registerTile(TileNetworkReceiver.class, "network_receiver");
|
||||
registerTile(TileNetworkTransmitter.class, "network_transmitter");
|
||||
registerTile(TileFluidDiskDrive.class, "fluid_disk_drive");
|
||||
registerTile(TileFluidConstructor.class, "fluid_constructor");
|
||||
|
||||
registerBlock(RefinedStorageBlocks.CONTROLLER);
|
||||
registerBlock(RefinedStorageBlocks.GRID);
|
||||
@@ -109,6 +110,7 @@ public class CommonProxy {
|
||||
registerBlock(RefinedStorageBlocks.NETWORK_TRANSMITTER);
|
||||
registerBlock(RefinedStorageBlocks.NETWORK_RECEIVER);
|
||||
registerBlock(RefinedStorageBlocks.FLUID_DISK_DRIVE);
|
||||
registerBlock(RefinedStorageBlocks.FLUID_CONSTRUCTOR);
|
||||
|
||||
registerItem(RefinedStorageItems.QUARTZ_ENRICHED_IRON);
|
||||
registerItem(RefinedStorageItems.STORAGE_DISK);
|
||||
@@ -358,6 +360,18 @@ public class CommonProxy {
|
||||
'I', new ItemStack(RefinedStorageItems.PROCESSOR, 1, ItemProcessor.TYPE_IMPROVED)
|
||||
);
|
||||
|
||||
// Fluid Constructor
|
||||
GameRegistry.addShapedRecipe(new ItemStack(RefinedStorageBlocks.FLUID_CONSTRUCTOR),
|
||||
"ECE",
|
||||
"RMR",
|
||||
"EIE",
|
||||
'E', new ItemStack(RefinedStorageItems.QUARTZ_ENRICHED_IRON),
|
||||
'C', new ItemStack(RefinedStorageItems.CORE, 1, ItemCore.TYPE_CONSTRUCTION),
|
||||
'R', new ItemStack(Items.BUCKET),
|
||||
'M', new ItemStack(RefinedStorageBlocks.CABLE),
|
||||
'I', new ItemStack(RefinedStorageItems.PROCESSOR, 1, ItemProcessor.TYPE_IMPROVED)
|
||||
);
|
||||
|
||||
// Detector
|
||||
GameRegistry.addRecipe(new ItemStack(RefinedStorageBlocks.DETECTOR),
|
||||
"ECE",
|
||||
|
132
src/main/java/refinedstorage/tile/TileFluidConstructor.java
Executable file
132
src/main/java/refinedstorage/tile/TileFluidConstructor.java
Executable file
@@ -0,0 +1,132 @@
|
||||
package refinedstorage.tile;
|
||||
|
||||
import mcmultipart.microblock.IMicroblock;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraftforge.common.capabilities.Capability;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.items.CapabilityItemHandler;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
import refinedstorage.RefinedStorage;
|
||||
import refinedstorage.inventory.ItemHandlerFluid;
|
||||
import refinedstorage.inventory.ItemHandlerUpgrade;
|
||||
import refinedstorage.item.ItemUpgrade;
|
||||
import refinedstorage.tile.config.IComparable;
|
||||
import refinedstorage.tile.data.TileDataParameter;
|
||||
|
||||
public class TileFluidConstructor extends TileMultipartNode implements IComparable {
|
||||
public static final TileDataParameter<Integer> COMPARE = IComparable.createParameter();
|
||||
|
||||
private static final String NBT_COMPARE = "Compare";
|
||||
|
||||
private static final int BASE_SPEED = 20;
|
||||
|
||||
private ItemHandlerFluid filter = new ItemHandlerFluid(1, this);
|
||||
|
||||
private ItemHandlerUpgrade upgrades = new ItemHandlerUpgrade(4, this, ItemUpgrade.TYPE_SPEED);
|
||||
|
||||
private int compare = 0;
|
||||
|
||||
public TileFluidConstructor() {
|
||||
dataManager.addWatchedParameter(COMPARE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canAddMicroblock(IMicroblock microblock) {
|
||||
return !isBlockingMicroblock(microblock, getDirection());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getEnergyUsage() {
|
||||
return RefinedStorage.INSTANCE.fluidConstructorUsage + upgrades.getEnergyUsage();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateNode() {
|
||||
FluidStack stack = filter.getFluids()[0];
|
||||
|
||||
if (stack != null && ticks % upgrades.getSpeed(BASE_SPEED, 4) == 0) {
|
||||
BlockPos front = pos.offset(getDirection());
|
||||
|
||||
Block block = stack.getFluid().getBlock();
|
||||
|
||||
if (worldObj.isAirBlock(front) && block.canPlaceBlockAt(worldObj, front)) {
|
||||
FluidStack took = network.extractFluid(stack, Fluid.BUCKET_VOLUME, compare);
|
||||
|
||||
if (took != null) {
|
||||
IBlockState state = block.getDefaultState();
|
||||
|
||||
// @TODO: This doesn't cause the block to flow?
|
||||
worldObj.setBlockState(front, state, 1 | 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCompare() {
|
||||
return compare;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCompare(int compare) {
|
||||
this.compare = compare;
|
||||
|
||||
markDirty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(NBTTagCompound tag) {
|
||||
super.read(tag);
|
||||
|
||||
if (tag.hasKey(NBT_COMPARE)) {
|
||||
compare = tag.getInteger(NBT_COMPARE);
|
||||
}
|
||||
|
||||
readItems(filter, 0, tag);
|
||||
readItems(upgrades, 1, tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound write(NBTTagCompound tag) {
|
||||
super.write(tag);
|
||||
|
||||
tag.setInteger(NBT_COMPARE, compare);
|
||||
|
||||
writeItems(filter, 0, tag);
|
||||
writeItems(upgrades, 1, tag);
|
||||
|
||||
return tag;
|
||||
}
|
||||
|
||||
public IItemHandler getUpgrades() {
|
||||
return upgrades;
|
||||
}
|
||||
|
||||
public IItemHandler getFilter() {
|
||||
return filter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IItemHandler getDrops() {
|
||||
return upgrades;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> T getCapability(Capability<T> capability, EnumFacing facing) {
|
||||
if (capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) {
|
||||
return (T) upgrades;
|
||||
}
|
||||
|
||||
return super.getCapability(capability, facing);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCapability(Capability<?> capability, EnumFacing facing) {
|
||||
return capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY || super.hasCapability(capability, facing);
|
||||
}
|
||||
}
|
@@ -5,7 +5,7 @@
|
||||
"all": "refinedstorage:blocks/cable",
|
||||
"particle": "refinedstorage:blocks/cable",
|
||||
"front": "refinedstorage:blocks/constructor",
|
||||
"line": "refinedstorage:blocks/importer_exporter_external_storage"
|
||||
"line": "refinedstorage:blocks/cable_part"
|
||||
},
|
||||
"model": "refinedstorage:cable_core",
|
||||
"uvlock": true
|
||||
|
@@ -5,7 +5,7 @@
|
||||
"all": "refinedstorage:blocks/cable",
|
||||
"particle": "refinedstorage:blocks/cable",
|
||||
"front": "refinedstorage:blocks/destructor",
|
||||
"line": "refinedstorage:blocks/importer_exporter_external_storage"
|
||||
"line": "refinedstorage:blocks/cable_part"
|
||||
},
|
||||
"model": "refinedstorage:cable_core",
|
||||
"uvlock": true
|
||||
|
@@ -4,7 +4,7 @@
|
||||
"textures": {
|
||||
"all": "refinedstorage:blocks/cable",
|
||||
"particle": "refinedstorage:blocks/cable",
|
||||
"line": "refinedstorage:blocks/importer_exporter_external_storage"
|
||||
"line": "refinedstorage:blocks/cable_part"
|
||||
},
|
||||
"model": "refinedstorage:cable_core",
|
||||
"uvlock": true
|
||||
|
@@ -4,7 +4,7 @@
|
||||
"textures": {
|
||||
"all": "refinedstorage:blocks/cable",
|
||||
"particle": "refinedstorage:blocks/cable",
|
||||
"line": "refinedstorage:blocks/importer_exporter_external_storage"
|
||||
"line": "refinedstorage:blocks/cable_part"
|
||||
},
|
||||
"model": "refinedstorage:cable_core",
|
||||
"uvlock": true
|
||||
|
83
src/main/resources/assets/refinedstorage/blockstates/fluid_constructor.json
Executable file
83
src/main/resources/assets/refinedstorage/blockstates/fluid_constructor.json
Executable file
@@ -0,0 +1,83 @@
|
||||
{
|
||||
"forge_marker": 1,
|
||||
"defaults": {
|
||||
"textures": {
|
||||
"all": "refinedstorage:blocks/cable",
|
||||
"particle": "refinedstorage:blocks/cable",
|
||||
"front": "refinedstorage:blocks/fluid_constructor",
|
||||
"line": "refinedstorage:blocks/cable_part"
|
||||
},
|
||||
"model": "refinedstorage:cable_core",
|
||||
"uvlock": true
|
||||
},
|
||||
"variants": {
|
||||
"inventory": [
|
||||
{
|
||||
"model": "refinedstorage:constructor_destructor",
|
||||
"transform": "forge:default-block"
|
||||
}
|
||||
],
|
||||
"direction": {
|
||||
"north": {
|
||||
"submodel": "refinedstorage:constructor_destructor_north"
|
||||
},
|
||||
"east": {
|
||||
"submodel": "refinedstorage:constructor_destructor_east"
|
||||
},
|
||||
"south": {
|
||||
"submodel": "refinedstorage:constructor_destructor_south"
|
||||
},
|
||||
"west": {
|
||||
"submodel": "refinedstorage:constructor_destructor_west"
|
||||
},
|
||||
"up": {
|
||||
"submodel": "refinedstorage:constructor_destructor_up"
|
||||
},
|
||||
"down": {
|
||||
"submodel": "refinedstorage:constructor_destructor_down"
|
||||
}
|
||||
},
|
||||
"north": {
|
||||
"true": {
|
||||
"submodel": "refinedstorage:cable_north"
|
||||
},
|
||||
"false": {
|
||||
}
|
||||
},
|
||||
"east": {
|
||||
"true": {
|
||||
"submodel": "refinedstorage:cable_east"
|
||||
},
|
||||
"false": {
|
||||
}
|
||||
},
|
||||
"south": {
|
||||
"true": {
|
||||
"submodel": "refinedstorage:cable_south"
|
||||
},
|
||||
"false": {
|
||||
}
|
||||
},
|
||||
"west": {
|
||||
"true": {
|
||||
"submodel": "refinedstorage:cable_west"
|
||||
},
|
||||
"false": {
|
||||
}
|
||||
},
|
||||
"up": {
|
||||
"true": {
|
||||
"submodel": "refinedstorage:cable_up"
|
||||
},
|
||||
"false": {
|
||||
}
|
||||
},
|
||||
"down": {
|
||||
"true": {
|
||||
"submodel": "refinedstorage:cable_down"
|
||||
},
|
||||
"false": {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -4,7 +4,7 @@
|
||||
"textures": {
|
||||
"all": "refinedstorage:blocks/cable",
|
||||
"particle": "refinedstorage:blocks/cable",
|
||||
"line": "refinedstorage:blocks/importer_exporter_external_storage"
|
||||
"line": "refinedstorage:blocks/cable_part"
|
||||
},
|
||||
"model": "refinedstorage:cable_core",
|
||||
"uvlock": true
|
||||
|
@@ -40,6 +40,7 @@ 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
|
||||
gui.refinedstorage:fluid_constructor=Fluid Constructor
|
||||
|
||||
misc.refinedstorage:energy_stored=%d / %d RS
|
||||
misc.refinedstorage:energy_usage=Usage: %d RS/t
|
||||
@@ -128,6 +129,7 @@ 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
|
||||
block.refinedstorage:fluid_constructor.name=Fluid Constructor
|
||||
|
||||
item.refinedstorage:storage_disk.0.name=1k Storage Disk
|
||||
item.refinedstorage:storage_disk.1.name=4k Storage Disk
|
||||
|
Before Width: | Height: | Size: 202 B After Width: | Height: | Size: 202 B |
BIN
src/main/resources/assets/refinedstorage/textures/blocks/fluid_constructor.png
Executable file
BIN
src/main/resources/assets/refinedstorage/textures/blocks/fluid_constructor.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 711 B |
Binary file not shown.
Before Width: | Height: | Size: 1.9 KiB |
Reference in New Issue
Block a user