mirror of
https://github.com/GTNewHorizons/AE2FluidCraft-Rework.git
synced 2026-11-16 10:34:40 +00:00
[ci skip] spotlessApply with the new settings
This commit is contained in:
1 parent
ab0b8f11d4
commit
69a5c0e6ee
221 files changed
+3125
-2632
No files matched your search
@@ -1,5 +1,12 @@
|
||||
package com.glodblock.github.common.tile;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.config.PowerMultiplier;
|
||||
import appeng.api.implementations.IPowerChannelState;
|
||||
@@ -15,16 +22,11 @@ import appeng.tile.TileEvent;
|
||||
import appeng.tile.events.TileEventType;
|
||||
import appeng.tile.grid.AENetworkTile;
|
||||
import appeng.util.item.AEFluidStack;
|
||||
|
||||
import com.glodblock.github.inventory.AEFluidInventory;
|
||||
import com.glodblock.github.inventory.IAEFluidInventory;
|
||||
import com.glodblock.github.inventory.IAEFluidTank;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
|
||||
public class TileFluidBuffer extends AENetworkTile implements IAEFluidInventory, IFluidHandler, IPowerChannelState {
|
||||
|
||||
@@ -44,10 +46,7 @@ public class TileFluidBuffer extends AENetworkTile implements IAEFluidInventory,
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
IAEFluidStack ias = this.getProxy()
|
||||
.getStorage()
|
||||
.getFluidInventory()
|
||||
.getStorageList()
|
||||
IAEFluidStack ias = this.getProxy().getStorage().getFluidInventory().getStorageList()
|
||||
.findPrecise(AEFluidStack.create(fs));
|
||||
this.invFluids.setFluidInSlot(0, ias);
|
||||
if (ias != null) return true;
|
||||
@@ -62,13 +61,10 @@ public class TileFluidBuffer extends AENetworkTile implements IAEFluidInventory,
|
||||
IAEFluidStack ifs = this.getAEFluidStack();
|
||||
if (ifs != null && ifs.getFluid() == fluidStack.getFluid()) {
|
||||
try {
|
||||
IAEFluidStack notInserted = this.getProxy()
|
||||
.getStorage()
|
||||
.getFluidInventory()
|
||||
.injectItems(
|
||||
AEFluidStack.create(fluidStack),
|
||||
b ? Actionable.MODULATE : Actionable.SIMULATE,
|
||||
this.source);
|
||||
IAEFluidStack notInserted = this.getProxy().getStorage().getFluidInventory().injectItems(
|
||||
AEFluidStack.create(fluidStack),
|
||||
b ? Actionable.MODULATE : Actionable.SIMULATE,
|
||||
this.source);
|
||||
if (notInserted != null) return fluidStack.amount -= notInserted.getStackSize();
|
||||
return fluidStack.amount;
|
||||
} catch (final GridAccessException e) {
|
||||
@@ -92,8 +88,8 @@ public class TileFluidBuffer extends AENetworkTile implements IAEFluidInventory,
|
||||
if (fs == null || fs.amount <= 0) return null;
|
||||
try {
|
||||
IAEFluidStack ias = AEFluidStack.create(fs);
|
||||
IAEFluidStack extracted =
|
||||
this.getProxy().getStorage().getFluidInventory().extractItems(ias, actionable, this.source);
|
||||
IAEFluidStack extracted = this.getProxy().getStorage().getFluidInventory()
|
||||
.extractItems(ias, actionable, this.source);
|
||||
if (extracted == null) return null;
|
||||
return extracted.getFluidStack();
|
||||
} catch (final GridAccessException e) {
|
||||
@@ -115,10 +111,7 @@ public class TileFluidBuffer extends AENetworkTile implements IAEFluidInventory,
|
||||
|
||||
public IAEFluidStack getAEStoreFluidStack() {
|
||||
try {
|
||||
return this.getProxy()
|
||||
.getStorage()
|
||||
.getFluidInventory()
|
||||
.getStorageList()
|
||||
return this.getProxy().getStorage().getFluidInventory().getStorageList()
|
||||
.findPrecise(this.getAEFluidStack());
|
||||
} catch (final GridAccessException e) {
|
||||
// :P
|
||||
@@ -205,8 +198,7 @@ public class TileFluidBuffer extends AENetworkTile implements IAEFluidInventory,
|
||||
newState = this.getProxy().isActive()
|
||||
&& this.getProxy().getEnergy().extractAEPower(1, Actionable.SIMULATE, PowerMultiplier.CONFIG)
|
||||
> 0.0001;
|
||||
} catch (final GridAccessException ignored) {
|
||||
}
|
||||
} catch (final GridAccessException ignored) {}
|
||||
if (newState != this.isPowered) {
|
||||
this.isPowered = newState;
|
||||
this.markForUpdate();
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
package com.glodblock.github.common.tile;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.networking.GridFlags;
|
||||
@@ -20,10 +24,8 @@ import appeng.me.GridAccessException;
|
||||
import appeng.me.cache.CraftingGridCache;
|
||||
import appeng.me.storage.MEInventoryHandler;
|
||||
import appeng.tile.grid.AENetworkTile;
|
||||
|
||||
import com.glodblock.github.common.item.ItemFluidDrop;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class TileFluidDiscretizer extends AENetworkTile implements IPriorityHost, ICellContainer {
|
||||
|
||||
@@ -87,10 +89,7 @@ public class TileFluidDiscretizer extends AENetworkTile implements IPriorityHost
|
||||
|
||||
private IMEMonitor<IAEFluidStack> getFluidGrid() {
|
||||
try {
|
||||
return getProxy()
|
||||
.getGrid()
|
||||
.<IStorageGrid>getCache(IStorageGrid.class)
|
||||
.getFluidInventory();
|
||||
return getProxy().getGrid().<IStorageGrid>getCache(IStorageGrid.class).getFluidInventory();
|
||||
} catch (GridAccessException e) {
|
||||
return null;
|
||||
}
|
||||
@@ -211,12 +210,12 @@ public class TileFluidDiscretizer extends AENetworkTile implements IPriorityHost
|
||||
@Override
|
||||
public boolean isValid(Object verificationToken) {
|
||||
IMEMonitor<IAEFluidStack> fluidGrid = getFluidGrid();
|
||||
return fluidGrid != null && fluidGrid == verificationToken /*&& !conflict*/;
|
||||
return fluidGrid != null && fluidGrid == verificationToken /* && !conflict */;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postChange(
|
||||
IBaseMonitor<IAEFluidStack> monitor, Iterable<IAEFluidStack> change, BaseActionSource actionSource) {
|
||||
public void postChange(IBaseMonitor<IAEFluidStack> monitor, Iterable<IAEFluidStack> change,
|
||||
BaseActionSource actionSource) {
|
||||
itemCache = null;
|
||||
try {
|
||||
List<IAEItemStack> mappedChanges = new ArrayList<>();
|
||||
@@ -226,9 +225,7 @@ public class TileFluidDiscretizer extends AENetworkTile implements IPriorityHost
|
||||
mappedChanges.add(itemStack);
|
||||
}
|
||||
}
|
||||
getProxy()
|
||||
.getGrid()
|
||||
.<IStorageGrid>getCache(IStorageGrid.class)
|
||||
getProxy().getGrid().<IStorageGrid>getCache(IStorageGrid.class)
|
||||
.postAlterationOfStoredItems(getChannel(), mappedChanges, ownActionSource);
|
||||
} catch (GridAccessException e) {
|
||||
// NO-OP
|
||||
|
||||
@@ -1,5 +1,16 @@
|
||||
package com.glodblock.github.common.tile;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
|
||||
import appeng.api.config.Settings;
|
||||
import appeng.api.config.SidelessMode;
|
||||
import appeng.api.config.Upgrades;
|
||||
@@ -15,6 +26,7 @@ import appeng.tile.TileEvent;
|
||||
import appeng.tile.events.TileEventType;
|
||||
import appeng.tile.inventory.AppEngInternalAEInventory;
|
||||
import appeng.tile.misc.TileInterface;
|
||||
|
||||
import com.glodblock.github.common.item.ItemFluidPacket;
|
||||
import com.glodblock.github.inventory.AEFluidInventory;
|
||||
import com.glodblock.github.inventory.IAEFluidTank;
|
||||
@@ -22,22 +34,16 @@ import com.glodblock.github.inventory.IDualHost;
|
||||
import com.glodblock.github.loader.ItemAndBlockHolder;
|
||||
import com.glodblock.github.util.DualityFluidInterface;
|
||||
import com.glodblock.github.util.Util;
|
||||
|
||||
import cpw.mods.fml.common.network.ByteBufUtils;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import java.io.IOException;
|
||||
import javax.annotation.Nullable;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
|
||||
public class TileFluidInterface extends TileInterface implements IDualHost {
|
||||
|
||||
private final IConfigManager dualityConfigManager = getInterfaceDuality().getConfigManager();
|
||||
|
||||
private final DualityFluidInterface fluidDuality = new DualityFluidInterface(this.getProxy(), this) {
|
||||
|
||||
@Override
|
||||
public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) {
|
||||
SidelessMode mode = (SidelessMode) dualityConfigManager.getSetting(Settings.SIDELESS_MODE);
|
||||
@@ -201,7 +207,8 @@ public class TileFluidInterface extends TileInterface implements IDualHost {
|
||||
public void setConfig(int id, IAEFluidStack fluid) {
|
||||
if (id >= 0 && id < 6) {
|
||||
config.setInventorySlotContents(
|
||||
id, ItemFluidPacket.newDisplayStack(fluid == null ? null : fluid.getFluidStack()));
|
||||
id,
|
||||
ItemFluidPacket.newDisplayStack(fluid == null ? null : fluid.getFluidStack()));
|
||||
fluidDuality.getConfig().setFluidInSlot(id, fluidDuality.getStandardFluid(fluid));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
package com.glodblock.github.common.tile;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import appeng.api.networking.GridFlags;
|
||||
import appeng.api.networking.IGridNode;
|
||||
import appeng.api.networking.energy.IEnergyGrid;
|
||||
@@ -21,12 +27,8 @@ import appeng.tile.inventory.IAEAppEngInventory;
|
||||
import appeng.tile.inventory.InvOperation;
|
||||
import appeng.util.Platform;
|
||||
import appeng.util.item.AEFluidStack;
|
||||
|
||||
import com.glodblock.github.common.item.ItemFluidPacket;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
public class TileFluidPacketDecoder extends AENetworkTile implements IGridTickable, IAEAppEngInventory, IInventory {
|
||||
|
||||
@@ -66,8 +68,8 @@ public class TileFluidPacketDecoder extends AENetworkTile implements IGridTickab
|
||||
}
|
||||
IAEFluidStack aeFluid = AEFluidStack.create(fluid.copy());
|
||||
IEnergyGrid energyGrid = node.getGrid().getCache(IEnergyGrid.class);
|
||||
IMEMonitor<IAEFluidStack> fluidGrid =
|
||||
node.getGrid().<IStorageGrid>getCache(IStorageGrid.class).getFluidInventory();
|
||||
IMEMonitor<IAEFluidStack> fluidGrid = node.getGrid().<IStorageGrid>getCache(IStorageGrid.class)
|
||||
.getFluidInventory();
|
||||
IAEFluidStack remaining = Platform.poweredInsert(energyGrid, fluidGrid, aeFluid, ownActionSource);
|
||||
if (remaining != null) {
|
||||
if (remaining.getStackSize() == aeFluid.getStackSize()) {
|
||||
@@ -83,8 +85,8 @@ public class TileFluidPacketDecoder extends AENetworkTile implements IGridTickab
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChangeInventory(
|
||||
IInventory inv, int slot, InvOperation mc, ItemStack removedStack, ItemStack newStack) {
|
||||
public void onChangeInventory(IInventory inv, int slot, InvOperation mc, ItemStack removedStack,
|
||||
ItemStack newStack) {
|
||||
try {
|
||||
getProxy().getTick().alertDevice(getProxy().getNode());
|
||||
} catch (GridAccessException e) {
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
package com.glodblock.github.common.tile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import appeng.api.storage.StorageChannel;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.tile.AEBaseTile;
|
||||
@@ -8,19 +15,17 @@ import appeng.tile.events.TileEventType;
|
||||
import appeng.tile.inventory.AppEngInternalInventory;
|
||||
import appeng.tile.inventory.IAEAppEngInventory;
|
||||
import appeng.tile.inventory.InvOperation;
|
||||
|
||||
import com.glodblock.github.inventory.AeStackInventory;
|
||||
import com.glodblock.github.inventory.AeStackInventoryImpl;
|
||||
import java.util.List;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class TileFluidPatternEncoder extends AEBaseTile implements IAEAppEngInventory {
|
||||
|
||||
private final AppEngInternalInventory patternInv = new AppEngInternalInventory(this, 2);
|
||||
private final AeStackInventoryImpl<IAEItemStack> crafting =
|
||||
new AeStackInventoryImpl<>(StorageChannel.ITEMS, 9, this);
|
||||
private final AeStackInventoryImpl<IAEItemStack> crafting = new AeStackInventoryImpl<>(
|
||||
StorageChannel.ITEMS,
|
||||
9,
|
||||
this);
|
||||
private final AeStackInventoryImpl<IAEItemStack> output = new AeStackInventoryImpl<>(StorageChannel.ITEMS, 3, this);
|
||||
|
||||
public IInventory getInventory() {
|
||||
@@ -65,6 +70,6 @@ public class TileFluidPatternEncoder extends AEBaseTile implements IAEAppEngInve
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChangeInventory(
|
||||
IInventory inv, int slot, InvOperation mc, ItemStack removedStack, ItemStack newStack) {}
|
||||
public void onChangeInventory(IInventory inv, int slot, InvOperation mc, ItemStack removedStack,
|
||||
ItemStack newStack) {}
|
||||
}
|
||||
@@ -1,17 +1,9 @@
|
||||
package com.glodblock.github.common.tile;
|
||||
|
||||
import appeng.tile.AEBaseInvTile;
|
||||
import appeng.tile.TileEvent;
|
||||
import appeng.tile.events.TileEventType;
|
||||
import appeng.tile.inventory.AppEngInternalInventory;
|
||||
import appeng.tile.inventory.InvOperation;
|
||||
import com.glodblock.github.inventory.AEFluidInventory;
|
||||
import com.glodblock.github.inventory.IAEFluidInventory;
|
||||
import com.glodblock.github.inventory.IAEFluidTank;
|
||||
import cpw.mods.fml.common.network.ByteBufUtils;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
@@ -21,6 +13,19 @@ import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
|
||||
import appeng.tile.AEBaseInvTile;
|
||||
import appeng.tile.TileEvent;
|
||||
import appeng.tile.events.TileEventType;
|
||||
import appeng.tile.inventory.AppEngInternalInventory;
|
||||
import appeng.tile.inventory.InvOperation;
|
||||
|
||||
import com.glodblock.github.inventory.AEFluidInventory;
|
||||
import com.glodblock.github.inventory.IAEFluidInventory;
|
||||
import com.glodblock.github.inventory.IAEFluidTank;
|
||||
|
||||
import cpw.mods.fml.common.network.ByteBufUtils;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
public class TileIngredientBuffer extends AEBaseInvTile implements IAEFluidInventory, IFluidHandler {
|
||||
|
||||
protected AppEngInternalInventory invItems;
|
||||
@@ -49,7 +54,7 @@ public class TileIngredientBuffer extends AEBaseInvTile implements IAEFluidInven
|
||||
|
||||
@Override
|
||||
public int[] getAccessibleSlotsBySide(ForgeDirection whichSide) {
|
||||
return new int[] {0, 1, 2, 3, 4, 5, 6, 7, 8};
|
||||
return new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8 };
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
package com.glodblock.github.common.tile;
|
||||
|
||||
import appeng.tile.inventory.AppEngInternalInventory;
|
||||
import com.glodblock.github.inventory.AEFluidInventory;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import appeng.tile.inventory.AppEngInternalInventory;
|
||||
|
||||
import com.glodblock.github.inventory.AEFluidInventory;
|
||||
|
||||
public class TileLargeIngredientBuffer extends TileIngredientBuffer {
|
||||
|
||||
public TileLargeIngredientBuffer() {
|
||||
@@ -13,9 +15,8 @@ public class TileLargeIngredientBuffer extends TileIngredientBuffer {
|
||||
|
||||
@Override
|
||||
public int[] getAccessibleSlotsBySide(ForgeDirection whichSide) {
|
||||
return new int[] {
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26
|
||||
};
|
||||
return new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
|
||||
26 };
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
package com.glodblock.github.common.tile;
|
||||
|
||||
import java.util.concurrent.Future;
|
||||
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.config.PowerMultiplier;
|
||||
@@ -34,16 +40,13 @@ import appeng.tile.grid.AENetworkTile;
|
||||
import appeng.tile.inventory.IAEAppEngInventory;
|
||||
import appeng.tile.inventory.InvOperation;
|
||||
import appeng.util.item.AEItemStack;
|
||||
|
||||
import com.glodblock.github.common.item.ItemFluidDrop;
|
||||
import com.glodblock.github.inventory.AeItemStackHandler;
|
||||
import com.glodblock.github.inventory.AeStackInventory;
|
||||
import com.glodblock.github.inventory.AeStackInventoryImpl;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import java.util.concurrent.Future;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
public class TileLevelMaintainer extends AENetworkTile
|
||||
implements IAEAppEngInventory, IGridTickable, ICraftingRequester, IPowerChannelState {
|
||||
@@ -83,13 +86,11 @@ public class TileLevelMaintainer extends AENetworkTile
|
||||
try {
|
||||
if (this.getProxy().isActive()) {
|
||||
final IEnergyGrid energy = this.getProxy().getEnergy();
|
||||
final double power = Math.ceil(
|
||||
ItemFluidDrop.isFluidStack(items) ? items.getStackSize() / 1000D : items.getStackSize());
|
||||
final double power = Math
|
||||
.ceil(ItemFluidDrop.isFluidStack(items) ? items.getStackSize() / 1000D : items.getStackSize());
|
||||
if (energy.extractAEPower(power, mode, PowerMultiplier.CONFIG) > power - 0.01) {
|
||||
if (ItemFluidDrop.isFluidStack(items)) {
|
||||
IAEFluidStack notInserted = this.getProxy()
|
||||
.getStorage()
|
||||
.getFluidInventory()
|
||||
IAEFluidStack notInserted = this.getProxy().getStorage().getFluidInventory()
|
||||
.injectItems(ItemFluidDrop.getAeFluidStack(items), mode, this.source);
|
||||
if (notInserted != null) {
|
||||
items.setStackSize(notInserted.getStackSize());
|
||||
@@ -140,19 +141,18 @@ public class TileLevelMaintainer extends AENetworkTile
|
||||
try {
|
||||
ICraftingGrid cg = this.getProxy().getCrafting();
|
||||
IGrid grid = this.getProxy().getGrid();
|
||||
final IItemList<IAEItemStack> inv =
|
||||
this.getProxy().getStorage().getItemInventory().getStorageList();
|
||||
final IItemList<IAEItemStack> inv = this.getProxy().getStorage().getItemInventory().getStorageList();
|
||||
for (int i = 0; i < REQ_COUNT; i++) {
|
||||
IAEItemStack is = requests.getRequestQtyStack(i);
|
||||
if (is != null && requests.getBatchSize(i) > 0) {
|
||||
IAEItemStack craftItem = requests.getCraftItem(i);
|
||||
if (this.requests.isDone(i)) this.requests.setState(i, State.Idling);
|
||||
if (cg.canEmitFor(craftItem)
|
||||
|| cg.isRequesting(craftItem)
|
||||
if (cg.canEmitFor(craftItem) || cg.isRequesting(craftItem)
|
||||
|| inv.findPrecise(is) == null
|
||||
|| !inv.findPrecise(is).isCraftable()
|
||||
|| inv.findPrecise(is).getStackSize() >= is.getStackSize()
|
||||
|| !this.requests.isDone(i)) continue;
|
||||
|| !this.requests.isDone(i))
|
||||
continue;
|
||||
// do crafting
|
||||
Future<ICraftingJob> jobTask = requests.getJobs()[i];
|
||||
if (jobTask == null) {
|
||||
@@ -176,8 +176,7 @@ public class TileLevelMaintainer extends AENetworkTile
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (final GridAccessException ignore) {
|
||||
}
|
||||
} catch (final GridAccessException ignore) {}
|
||||
return didSomething ? TickRateModulation.FASTER : TickRateModulation.SLOWER;
|
||||
}
|
||||
|
||||
@@ -187,8 +186,8 @@ public class TileLevelMaintainer extends AENetworkTile
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChangeInventory(
|
||||
IInventory inv, int slot, InvOperation mc, ItemStack removedStack, ItemStack newStack) {
|
||||
public void onChangeInventory(IInventory inv, int slot, InvOperation mc, ItemStack removedStack,
|
||||
ItemStack newStack) {
|
||||
try {
|
||||
getProxy().getTick().alertDevice(getProxy().getNode());
|
||||
} catch (GridAccessException e) {
|
||||
@@ -244,8 +243,7 @@ public class TileLevelMaintainer extends AENetworkTile
|
||||
if (!this.requests.isDone(i)) this.requests.setState(i, State.Crafting);
|
||||
}
|
||||
}
|
||||
} catch (Exception ignore) {
|
||||
}
|
||||
} catch (Exception ignore) {}
|
||||
}
|
||||
|
||||
private NBTTagCompound writeLinkToNBT(NBTTagCompound data) {
|
||||
@@ -322,6 +320,7 @@ public class TileLevelMaintainer extends AENetworkTile
|
||||
}
|
||||
|
||||
public static class InventoryRequest {
|
||||
|
||||
private final AeStackInventoryImpl<IAEItemStack> requestStacks;
|
||||
private final AeStackInventoryImpl<IAEItemStack> requestBatches;
|
||||
private final AeStackInventoryImpl<IAEItemStack> requestQtys;
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
package com.glodblock.github.common.tile;
|
||||
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import appeng.items.misc.ItemEncodedPattern;
|
||||
import appeng.tile.AEBaseInvTile;
|
||||
import appeng.tile.inventory.AppEngInternalInventory;
|
||||
import appeng.tile.inventory.InvOperation;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileOCPatternEditor extends AEBaseInvTile {
|
||||
|
||||
@@ -24,7 +25,7 @@ public class TileOCPatternEditor extends AEBaseInvTile {
|
||||
|
||||
@Override
|
||||
public int[] getAccessibleSlotsBySide(ForgeDirection whichSide) {
|
||||
return new int[] {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15};
|
||||
return new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user