mirror of
https://github.com/GTNewHorizons/AE2FluidCraft-Rework.git
synced 2026-11-16 18:44:42 +00:00
spotless apply
This commit is contained in:
1 parent
1f6dc04a71
commit
99f8e98017
14 files changed
+190
-147
No files matched your search
@@ -1,17 +1,20 @@
|
||||
package com.glodblock.github.client.gui;
|
||||
|
||||
import appeng.client.gui.AEBaseMEGui;
|
||||
import appeng.core.localization.GuiText;
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.client.gui.container.ContainerFluidAutoFiller;
|
||||
import com.glodblock.github.common.tile.TileFluidAutoFiller;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import appeng.client.gui.AEBaseMEGui;
|
||||
import appeng.core.localization.GuiText;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.client.gui.container.ContainerFluidAutoFiller;
|
||||
import com.glodblock.github.common.tile.TileFluidAutoFiller;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
|
||||
public class GuiFluidAutoFiller extends AEBaseMEGui {
|
||||
|
||||
protected EntityPlayer player;
|
||||
private static final ResourceLocation TEX_BG = FluidCraft.resource("textures/gui/fluid_auto_filler.png");
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@ public abstract class FCGuiEncodeTerminal extends GuiItemMonitor {
|
||||
FluidCraft.proxy.netHandler.sendToServer(
|
||||
new CPacketFluidPatternTermBtns(
|
||||
"PatternTerminal.Prioritize",
|
||||
container.prioritize ? PRIORITY_DISABLE : PRIORITY_ENABLE));
|
||||
isShiftKeyDown() ? "2" : (container.prioritize ? PRIORITY_DISABLE : PRIORITY_ENABLE)));
|
||||
} else if (this.invertBtn == btn) {
|
||||
FluidCraft.proxy.netHandler.sendToServer(
|
||||
new CPacketFluidPatternTermBtns("PatternTerminal.Invert", container.inverted ? "0" : "1"));
|
||||
|
||||
+9
-4
@@ -1,16 +1,21 @@
|
||||
package com.glodblock.github.client.gui.container;
|
||||
|
||||
import appeng.container.AEBaseContainer;
|
||||
import appeng.container.slot.SlotFake;
|
||||
import com.glodblock.github.common.tile.TileFluidAutoFiller;
|
||||
import com.glodblock.github.util.Util;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import org.apache.commons.lang3.tuple.MutablePair;
|
||||
|
||||
import appeng.container.AEBaseContainer;
|
||||
import appeng.container.slot.SlotFake;
|
||||
|
||||
import com.glodblock.github.common.tile.TileFluidAutoFiller;
|
||||
import com.glodblock.github.util.Util;
|
||||
|
||||
public class ContainerFluidAutoFiller extends AEBaseContainer {
|
||||
|
||||
public static class FakeSlot extends SlotFake {
|
||||
|
||||
public FakeSlot(IInventory inv, int idx, int x, int y) {
|
||||
super(inv, idx, x, y);
|
||||
}
|
||||
|
||||
@@ -1,19 +1,5 @@
|
||||
package com.glodblock.github.common.block;
|
||||
|
||||
import appeng.api.implementations.items.IAEWrench;
|
||||
import buildcraft.api.tools.IToolWrench;
|
||||
import buildcraft.factory.BlockTank;
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.common.item.ItemCertusQuartzTank;
|
||||
import com.glodblock.github.common.tabs.FluidCraftingTabs;
|
||||
import com.glodblock.github.common.tile.TileCertusQuartzTank;
|
||||
import com.glodblock.github.loader.IRegister;
|
||||
import com.glodblock.github.loader.ItemAndBlockHolder;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import extracells.tileentity.TileEntityCertusTank;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -26,6 +12,22 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import appeng.api.implementations.items.IAEWrench;
|
||||
import buildcraft.api.tools.IToolWrench;
|
||||
import buildcraft.factory.BlockTank;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.common.item.ItemCertusQuartzTank;
|
||||
import com.glodblock.github.common.tabs.FluidCraftingTabs;
|
||||
import com.glodblock.github.common.tile.TileCertusQuartzTank;
|
||||
import com.glodblock.github.loader.IRegister;
|
||||
import com.glodblock.github.loader.ItemAndBlockHolder;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockCertusQuartzTank extends BlockTank implements IRegister<BlockTank> {
|
||||
|
||||
private IIcon textureStackedSide;
|
||||
@@ -72,16 +74,8 @@ public class BlockCertusQuartzTank extends BlockTank implements IRegister<BlockT
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(
|
||||
World worldObj,
|
||||
int x,
|
||||
int y,
|
||||
int z,
|
||||
EntityPlayer p,
|
||||
int blockID,
|
||||
float offsetX,
|
||||
float offsetY,
|
||||
float offsetZ) {
|
||||
public boolean onBlockActivated(World worldObj, int x, int y, int z, EntityPlayer p, int blockID, float offsetX,
|
||||
float offsetY, float offsetZ) {
|
||||
ItemStack current = p.inventory.getCurrentItem();
|
||||
|
||||
if (p.isSneaking() && current != null) {
|
||||
@@ -106,7 +100,7 @@ public class BlockCertusQuartzTank extends BlockTank implements IRegister<BlockT
|
||||
|
||||
if (current != null) {
|
||||
FluidStack liquid = FluidContainerRegistry.getFluidForFilledItem(current);
|
||||
TileEntityCertusTank tank = (TileEntityCertusTank) worldObj.getTileEntity(x, y, z);
|
||||
TileCertusQuartzTank tank = (TileCertusQuartzTank) worldObj.getTileEntity(x, y, z);
|
||||
|
||||
if (liquid != null) {
|
||||
int amountFilled = tank.fill(ForgeDirection.UNKNOWN, liquid, true);
|
||||
@@ -116,8 +110,8 @@ public class BlockCertusQuartzTank extends BlockTank implements IRegister<BlockT
|
||||
p.inventory.mainInventory[p.inventory.currentItem].stackSize -= 1;
|
||||
p.inventory.addItemStackToInventory(current.getItem().getContainerItem(current));
|
||||
} else {
|
||||
p.inventory.mainInventory[p.inventory.currentItem] =
|
||||
current.getItem().getContainerItem(current);
|
||||
p.inventory.mainInventory[p.inventory.currentItem] = current.getItem()
|
||||
.getContainerItem(current);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,14 @@
|
||||
package com.glodblock.github.common.block;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import appeng.api.config.SecurityPermissions;
|
||||
import appeng.util.Platform;
|
||||
|
||||
import com.glodblock.github.common.item.FCBaseItemBlock;
|
||||
import com.glodblock.github.common.tabs.FluidCraftingTabs;
|
||||
import com.glodblock.github.common.tile.TileFluidAutoFiller;
|
||||
@@ -11,11 +18,6 @@ import com.glodblock.github.util.BlockPos;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
import com.glodblock.github.util.Util;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class BlockFluidAutoFiller extends FCBaseBlock {
|
||||
|
||||
@@ -36,8 +38,8 @@ public class BlockFluidAutoFiller extends FCBaseBlock {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onActivated(
|
||||
World world, int x, int y, int z, EntityPlayer player, int facing, float hitX, float hitY, float hitZ) {
|
||||
public boolean onActivated(World world, int x, int y, int z, EntityPlayer player, int facing, float hitX,
|
||||
float hitY, float hitZ) {
|
||||
if (player.isSneaking()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -2,11 +2,8 @@ package com.glodblock.github.common.item;
|
||||
|
||||
import static com.glodblock.github.common.tile.TileCertusQuartzTank.CAPACITY;
|
||||
|
||||
import com.glodblock.github.common.tile.TileCertusQuartzTank;
|
||||
import com.glodblock.github.crossmod.waila.Tooltip;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
@@ -16,7 +13,14 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.IFluidContainerItem;
|
||||
|
||||
import com.glodblock.github.common.tile.TileCertusQuartzTank;
|
||||
import com.glodblock.github.crossmod.waila.Tooltip;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemCertusQuartzTank extends ItemBlock implements IFluidContainerItem {
|
||||
|
||||
private final String tagKey = "tank";
|
||||
|
||||
private final int capacity = CAPACITY;
|
||||
@@ -25,14 +29,13 @@ public class ItemCertusQuartzTank extends ItemBlock implements IFluidContainerIt
|
||||
super(block);
|
||||
}
|
||||
|
||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) {
|
||||
if (stack != null && stack.hasTagCompound()) {
|
||||
if (FluidStack.loadFluidStackFromNBT(stack.getTagCompound().getCompoundTag(tagKey)) != null) {
|
||||
FluidStack fs =
|
||||
FluidStack.loadFluidStackFromNBT(stack.getTagCompound().getCompoundTag(tagKey));
|
||||
FluidStack fs = FluidStack.loadFluidStackFromNBT(stack.getTagCompound().getCompoundTag(tagKey));
|
||||
list.add(Tooltip.fluidFormat(fs.getFluid().getLocalizedName(fs), fs.amount));
|
||||
}
|
||||
}
|
||||
@@ -40,8 +43,7 @@ public class ItemCertusQuartzTank extends ItemBlock implements IFluidContainerIt
|
||||
|
||||
@Override
|
||||
public FluidStack drain(ItemStack container, int maxDrain, boolean doDrain) {
|
||||
if (container.stackTagCompound == null
|
||||
|| !container.stackTagCompound.hasKey(tagKey)
|
||||
if (container.stackTagCompound == null || !container.stackTagCompound.hasKey(tagKey)
|
||||
|| container.stackTagCompound.getCompoundTag(tagKey).hasKey("Empty")) {
|
||||
return null;
|
||||
}
|
||||
@@ -145,18 +147,8 @@ public class ItemCertusQuartzTank extends ItemBlock implements IFluidContainerIt
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean placeBlockAt(
|
||||
ItemStack stack,
|
||||
EntityPlayer player,
|
||||
World world,
|
||||
int x,
|
||||
int y,
|
||||
int z,
|
||||
int side,
|
||||
float hitX,
|
||||
float hitY,
|
||||
float hitZ,
|
||||
int metadata) {
|
||||
public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side,
|
||||
float hitX, float hitY, float hitZ, int metadata) {
|
||||
if (!world.setBlock(x, y, z, this.field_150939_a, metadata, 3)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.glodblock.github.common.parts.base;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.inventory.IInventory;
|
||||
@@ -9,6 +10,8 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.tile.inventory.AppEngInternalInventory;
|
||||
|
||||
import com.glodblock.github.common.item.ItemFluidPacket;
|
||||
|
||||
public abstract class FCFluidEncodeTerminal extends FCPart {
|
||||
|
||||
protected AppEngInternalInventory crafting;
|
||||
@@ -154,4 +157,34 @@ public abstract class FCFluidEncodeTerminal extends FCPart {
|
||||
|
||||
return super.getInventoryByName(name);
|
||||
}
|
||||
|
||||
public void sortCraftingItems() {
|
||||
List<ItemStack> items = new ArrayList<ItemStack>();
|
||||
List<ItemStack> fluids = new ArrayList<ItemStack>();
|
||||
for (ItemStack is : this.crafting) {
|
||||
if (is == null) continue;
|
||||
if (is.getItem() instanceof ItemFluidPacket) {
|
||||
fluids.add(is);
|
||||
} else {
|
||||
items.add(is);
|
||||
}
|
||||
}
|
||||
if (this.prioritize) {
|
||||
fluids.addAll(items);
|
||||
items.clear();
|
||||
} else {
|
||||
items.addAll(fluids);
|
||||
fluids.clear();
|
||||
}
|
||||
|
||||
for (int i = 0; i < this.crafting.getSizeInventory(); i++) {
|
||||
if (this.crafting.getStackInSlot(i) == null) break;
|
||||
if (items.isEmpty()) {
|
||||
this.crafting.setInventorySlotContents(i, fluids.get(i));
|
||||
} else {
|
||||
this.crafting.setInventorySlotContents(i, items.get(i));
|
||||
}
|
||||
}
|
||||
saveChanges();
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,12 @@
|
||||
package com.glodblock.github.common.tile;
|
||||
|
||||
import buildcraft.factory.TileTank;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||
|
||||
import buildcraft.factory.TileTank;
|
||||
|
||||
public class TileCertusQuartzTank extends TileTank {
|
||||
|
||||
public static final int CAPACITY = FluidContainerRegistry.BUCKET_VOLUME * 32;
|
||||
|
||||
public TileCertusQuartzTank() {
|
||||
|
||||
@@ -2,6 +2,21 @@ package com.glodblock.github.common.tile;
|
||||
|
||||
import static com.glodblock.github.loader.RecipeLoader.BUCKET;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import org.apache.commons.lang3.tuple.MutablePair;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.config.PowerMultiplier;
|
||||
@@ -35,29 +50,18 @@ import appeng.tile.events.TileEventType;
|
||||
import appeng.tile.grid.AENetworkInvTile;
|
||||
import appeng.tile.inventory.AppEngInternalInventory;
|
||||
import appeng.tile.inventory.InvOperation;
|
||||
|
||||
import com.glodblock.github.common.item.ItemFluidDrop;
|
||||
import com.glodblock.github.util.Util;
|
||||
import javax.annotation.Nonnull;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import org.apache.commons.lang3.tuple.MutablePair;
|
||||
|
||||
public class TileFluidAutoFiller extends AENetworkInvTile
|
||||
implements ICraftingProvider, IMEMonitorHandlerReceiver<IAEFluidStack>, IGridTickable {
|
||||
|
||||
private final AppEngInternalInventory inventory = new AppEngInternalInventory(this, 1);
|
||||
private final BaseActionSource source = new MachineSource(this);
|
||||
private IItemList<IAEFluidStack> fluids = AEApi.instance().storage().createFluidList();
|
||||
public ItemStack containerItem;
|
||||
private final Item encodedPattern =
|
||||
AEApi.instance().definitions().items().encodedPattern().maybeItem().orNull();
|
||||
private final Item encodedPattern = AEApi.instance().definitions().items().encodedPattern().maybeItem().orNull();
|
||||
private IAEItemStack returnStack;
|
||||
private boolean isPowered;
|
||||
|
||||
@@ -132,15 +136,15 @@ public class TileFluidAutoFiller extends AENetworkInvTile
|
||||
public void provideCrafting(ICraftingProviderHelper craftingTracker) {
|
||||
IStorageGrid storage = getStorageGrid();
|
||||
if (storage == null) return;
|
||||
IItemList<IAEFluidStack> fluidStorage =
|
||||
this.fluids.isEmpty() ? storage.getFluidInventory().getStorageList() : this.fluids;
|
||||
IItemList<IAEFluidStack> fluidStorage = this.fluids.isEmpty() ? storage.getFluidInventory().getStorageList()
|
||||
: this.fluids;
|
||||
for (IAEFluidStack fluidStack : fluidStorage) {
|
||||
Fluid fluid = fluidStack.getFluid();
|
||||
if (fluid == null) continue;
|
||||
int maxCapacity = Util.FluidUtil.getCapacity(this.containerItem, fluid);
|
||||
if (maxCapacity == 0) continue;
|
||||
MutablePair<Integer, ItemStack> filled =
|
||||
Util.FluidUtil.fillStack(this.containerItem.copy(), new FluidStack(fluid, maxCapacity));
|
||||
MutablePair<Integer, ItemStack> filled = Util.FluidUtil
|
||||
.fillStack(this.containerItem.copy(), new FluidStack(fluid, maxCapacity));
|
||||
if (filled.right == null) continue;
|
||||
ItemStack pattern = getPattern(this.containerItem, filled.right);
|
||||
ICraftingPatternItem patter = (ICraftingPatternItem) pattern.getItem();
|
||||
@@ -175,8 +179,8 @@ public class TileFluidAutoFiller extends AENetworkInvTile
|
||||
|
||||
@Override
|
||||
public boolean pushPattern(ICraftingPatternDetails patternDetails, InventoryCrafting table) {
|
||||
this.returnStack =
|
||||
AEApi.instance().storage().createItemStack(patternDetails.getCondensedOutputs()[0].getItemStack());
|
||||
this.returnStack = AEApi.instance().storage()
|
||||
.createItemStack(patternDetails.getCondensedOutputs()[0].getItemStack());
|
||||
try {
|
||||
this.getProxy().getTick().alertDevice(this.getProxy().getNode());
|
||||
} catch (GridAccessException ignored) {
|
||||
@@ -196,12 +200,11 @@ public class TileFluidAutoFiller extends AENetworkInvTile
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postChange(
|
||||
IBaseMonitor<IAEFluidStack> monitor, Iterable<IAEFluidStack> change, BaseActionSource source) {
|
||||
public void postChange(IBaseMonitor<IAEFluidStack> monitor, Iterable<IAEFluidStack> change,
|
||||
BaseActionSource source) {
|
||||
if (this.getProxy().isActive() && this.getStorageGrid() != null) {
|
||||
boolean hasChanged = false;
|
||||
IItemList<IAEFluidStack> stored = this.getStorageGrid()
|
||||
.getFluidInventory()
|
||||
IItemList<IAEFluidStack> stored = this.getStorageGrid().getFluidInventory()
|
||||
.getAvailableItems(AEApi.instance().storage().createFluidList());
|
||||
for (IAEFluidStack tmp : change) {
|
||||
if (stored.findPrecise(tmp) == null || this.fluids.findPrecise(tmp) == null) {
|
||||
@@ -216,8 +219,7 @@ public class TileFluidAutoFiller extends AENetworkInvTile
|
||||
|
||||
private boolean postEvent() {
|
||||
try {
|
||||
this.getProxy()
|
||||
.getGrid()
|
||||
this.getProxy().getGrid()
|
||||
.postEvent(new MENetworkCraftingPatternChange(this, getGridNode(ForgeDirection.UNKNOWN)));
|
||||
return true;
|
||||
} catch (GridAccessException ignored) {
|
||||
@@ -247,8 +249,7 @@ public class TileFluidAutoFiller extends AENetworkInvTile
|
||||
if (newState != this.isPowered && newState) {
|
||||
this.getProxy().getStorage().getFluidInventory().addListener(this, null);
|
||||
}
|
||||
} catch (final GridAccessException ignored) {
|
||||
}
|
||||
} catch (final GridAccessException ignored) {}
|
||||
if (newState != this.isPowered) {
|
||||
this.isPowered = newState;
|
||||
this.markForUpdate();
|
||||
@@ -259,8 +260,7 @@ public class TileFluidAutoFiller extends AENetworkInvTile
|
||||
public void gridChanged() {
|
||||
try {
|
||||
this.getProxy().getStorage().getFluidInventory().removeListener(this);
|
||||
} catch (final GridAccessException ignored) {
|
||||
}
|
||||
} catch (final GridAccessException ignored) {}
|
||||
super.gridChanged();
|
||||
}
|
||||
|
||||
@@ -274,8 +274,8 @@ public class TileFluidAutoFiller extends AENetworkInvTile
|
||||
if (this.getStorageGrid() == null) {
|
||||
return TickRateModulation.SLOWER;
|
||||
}
|
||||
IAEItemStack nodAdded =
|
||||
getStorageGrid().getItemInventory().injectItems(this.returnStack, Actionable.SIMULATE, this.source);
|
||||
IAEItemStack nodAdded = getStorageGrid().getItemInventory()
|
||||
.injectItems(this.returnStack, Actionable.SIMULATE, this.source);
|
||||
if (nodAdded == null) {
|
||||
getStorageGrid().getItemInventory().injectItems(this.returnStack, Actionable.MODULATE, this.source);
|
||||
this.returnStack = null;
|
||||
|
||||
@@ -27,6 +27,7 @@ import com.google.common.collect.ImmutableList;
|
||||
public enum GuiType {
|
||||
|
||||
FLUID_AUTO_FILLER(new TileGuiFactory<TileFluidAutoFiller>(TileFluidAutoFiller.class) {
|
||||
|
||||
@Override
|
||||
protected Object createServerGui(EntityPlayer player, TileFluidAutoFiller inv) {
|
||||
return new ContainerFluidAutoFiller(player.inventory, inv);
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package com.glodblock.github.inventory.slot;
|
||||
|
||||
import appeng.container.slot.SlotRestrictedInput;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import org.apache.commons.lang3.tuple.MutablePair;
|
||||
|
||||
import appeng.container.slot.SlotRestrictedInput;
|
||||
@@ -13,6 +13,7 @@ public class FCSlotRestrictedInput extends SlotRestrictedInput {
|
||||
|
||||
@FunctionalInterface
|
||||
public interface Filter {
|
||||
|
||||
MutablePair<Boolean, ItemStack> isItemValid(final ItemStack inputItem);
|
||||
}
|
||||
|
||||
@@ -23,9 +24,7 @@ public class FCSlotRestrictedInput extends SlotRestrictedInput {
|
||||
public FCSlotRestrictedInput(ItemStack valid, IInventory i, int slotIndex, int x, int y, InventoryPlayer p) {
|
||||
this(
|
||||
(inputItem) -> new MutablePair<>(
|
||||
valid.getItem()
|
||||
.getClass()
|
||||
.isAssignableFrom(inputItem.getItem().getClass()),
|
||||
valid.getItem().getClass().isAssignableFrom(inputItem.getItem().getClass()),
|
||||
valid),
|
||||
i,
|
||||
slotIndex,
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.glodblock.github.common.item.*;
|
||||
import com.glodblock.github.common.storage.CellType;
|
||||
|
||||
public class ItemAndBlockHolder {
|
||||
|
||||
public static BlockCertusQuartzTank CERTUS_QUARTZ_TANK = new BlockCertusQuartzTank().register();
|
||||
public static BlockFluidAutoFiller FLUID_AUTO_FILLER = new BlockFluidAutoFiller().register();
|
||||
public static BlockFluidDiscretizer DISCRETIZER = new BlockFluidDiscretizer().register();
|
||||
|
||||
@@ -128,50 +128,53 @@ public class RecipeLoader implements Runnable {
|
||||
AE2_INTERFACE));
|
||||
GameRegistry.addShapelessRecipe(FLUID_INTERFACE.stack(), INTERFACE.stack());
|
||||
GameRegistry.addShapelessRecipe(INTERFACE.stack(), FLUID_INTERFACE.stack());
|
||||
GameRegistry.addRecipe(
|
||||
new ShapedOreRecipe(CERTUS_QUARTZ_TANK.stack(), "GGG", "G G", "GGG", 'G', AE2_QUARTZ_GLASS));
|
||||
GameRegistry
|
||||
.addRecipe(new ShapedOreRecipe(CERTUS_QUARTZ_TANK.stack(), "GGG", "G G", "GGG", 'G', AE2_QUARTZ_GLASS));
|
||||
GameRegistry.addShapelessRecipe(FLUID_AUTO_FILLER.stack(), FLUID_TERMINAL, ENCODER);
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||
DISCRETIZER.stack(),
|
||||
"IPI",
|
||||
"TMT",
|
||||
"IPI",
|
||||
'I',
|
||||
"ingotIron",
|
||||
'P',
|
||||
AE2_PROCESS_ENG,
|
||||
'T',
|
||||
AE2_STORAGE_BUS,
|
||||
'M',
|
||||
AE2_CONDENSER));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||
DECODER.stack(),
|
||||
"IHI",
|
||||
"CFC",
|
||||
"IPI",
|
||||
'I',
|
||||
"ingotIron",
|
||||
'H',
|
||||
Blocks.hopper,
|
||||
'C',
|
||||
AE2_GLASS_CABLE,
|
||||
'F',
|
||||
INTERFACE,
|
||||
'P',
|
||||
AE2_PROCESS_CAL));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||
ENCODER.stack(),
|
||||
"LPL",
|
||||
"IWI",
|
||||
"III",
|
||||
'I',
|
||||
"ingotIron",
|
||||
'L',
|
||||
"blockLapis",
|
||||
'P',
|
||||
AE2_PROCESS_ENG,
|
||||
'W',
|
||||
AE2_WORK_BENCH));
|
||||
GameRegistry.addRecipe(
|
||||
new ShapedOreRecipe(
|
||||
DISCRETIZER.stack(),
|
||||
"IPI",
|
||||
"TMT",
|
||||
"IPI",
|
||||
'I',
|
||||
"ingotIron",
|
||||
'P',
|
||||
AE2_PROCESS_ENG,
|
||||
'T',
|
||||
AE2_STORAGE_BUS,
|
||||
'M',
|
||||
AE2_CONDENSER));
|
||||
GameRegistry.addRecipe(
|
||||
new ShapedOreRecipe(
|
||||
DECODER.stack(),
|
||||
"IHI",
|
||||
"CFC",
|
||||
"IPI",
|
||||
'I',
|
||||
"ingotIron",
|
||||
'H',
|
||||
Blocks.hopper,
|
||||
'C',
|
||||
AE2_GLASS_CABLE,
|
||||
'F',
|
||||
INTERFACE,
|
||||
'P',
|
||||
AE2_PROCESS_CAL));
|
||||
GameRegistry.addRecipe(
|
||||
new ShapedOreRecipe(
|
||||
ENCODER.stack(),
|
||||
"LPL",
|
||||
"IWI",
|
||||
"III",
|
||||
'I',
|
||||
"ingotIron",
|
||||
'L',
|
||||
"blockLapis",
|
||||
'P',
|
||||
AE2_PROCESS_ENG,
|
||||
'W',
|
||||
AE2_WORK_BENCH));
|
||||
GameRegistry.addShapelessRecipe(FLUID_STORAGE_BUS.stack(), FLUID_INTERFACE, STICKY_PISTON, PISTON);
|
||||
GameRegistry.addShapelessRecipe(FLUID_STORAGE_BUS.stack(), INTERFACE, STICKY_PISTON, PISTON);
|
||||
GameRegistry.addRecipe(
|
||||
|
||||
@@ -106,7 +106,15 @@ public class CPacketFluidPatternTermBtns implements IMessage {
|
||||
cpt.getPatternTerminal().setActivePage(Integer.parseInt(Value));
|
||||
break;
|
||||
case "PatternTerminal.Prioritize":
|
||||
cpt.getPatternTerminal().setPrioritization(Value.equals("1"));
|
||||
switch (Value) {
|
||||
case "0":
|
||||
case "1":
|
||||
cpt.getPatternTerminal().setPrioritization(Value.equals("1"));
|
||||
break;
|
||||
case "2":
|
||||
cpt.getPatternTerminal().sortCraftingItems();
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
} else if (Name.equals("Terminal.Cpu") && c instanceof ContainerFluidCraftConfirm) {
|
||||
|
||||
Reference in new issue
Block a user