Remove CompareUtils - it's now in IComparer
This commit is contained in:
@@ -3,6 +3,7 @@ package refinedstorage.api;
|
||||
import refinedstorage.api.autocrafting.craftingmonitor.ICraftingMonitorElementRegistry;
|
||||
import refinedstorage.api.autocrafting.registry.ICraftingTaskRegistry;
|
||||
import refinedstorage.api.solderer.ISoldererRegistry;
|
||||
import refinedstorage.api.util.IComparer;
|
||||
import refinedstorage.api.util.IItemStackList;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
@@ -11,6 +12,12 @@ import javax.annotation.Nonnull;
|
||||
* Represents a Refined Storage API implementation.
|
||||
*/
|
||||
public interface IAPI {
|
||||
/**
|
||||
* @return the comparer
|
||||
*/
|
||||
@Nonnull
|
||||
IComparer getComparer();
|
||||
|
||||
/**
|
||||
* @return the solderer registry
|
||||
*/
|
||||
|
||||
@@ -10,7 +10,6 @@ import refinedstorage.api.autocrafting.ICraftingPattern;
|
||||
import refinedstorage.api.autocrafting.task.ICraftingTask;
|
||||
import refinedstorage.api.network.grid.IFluidGridHandler;
|
||||
import refinedstorage.api.network.grid.IItemGridHandler;
|
||||
import refinedstorage.api.storage.CompareUtils;
|
||||
import refinedstorage.api.storage.fluid.IGroupedFluidStorage;
|
||||
import refinedstorage.api.storage.item.IGroupedItemStorage;
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ import refinedstorage.api.autocrafting.ICraftingPatternContainer;
|
||||
import refinedstorage.api.autocrafting.ICraftingPatternProvider;
|
||||
import refinedstorage.api.autocrafting.registry.ICraftingTaskFactory;
|
||||
import refinedstorage.api.autocrafting.task.ICraftingTask;
|
||||
import refinedstorage.api.storage.CompareUtils;
|
||||
import refinedstorage.api.util.IComparer;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
@@ -25,15 +25,15 @@ import javax.annotation.Nullable;
|
||||
*/
|
||||
public final class NetworkUtils {
|
||||
public static ItemStack extractItem(INetworkMaster network, ItemStack stack, int size) {
|
||||
return network.extractItem(stack, size, CompareUtils.COMPARE_DAMAGE | CompareUtils.COMPARE_NBT);
|
||||
return network.extractItem(stack, size, IComparer.COMPARE_DAMAGE | IComparer.COMPARE_NBT);
|
||||
}
|
||||
|
||||
public static FluidStack extractFluid(INetworkMaster network, FluidStack stack, int size) {
|
||||
return network.extractFluid(stack, size, CompareUtils.COMPARE_NBT);
|
||||
return network.extractFluid(stack, size, IComparer.COMPARE_NBT);
|
||||
}
|
||||
|
||||
public static ICraftingPattern getPattern(INetworkMaster network, ItemStack stack) {
|
||||
return network.getPattern(stack, CompareUtils.COMPARE_DAMAGE | CompareUtils.COMPARE_NBT);
|
||||
return network.getPattern(stack, IComparer.COMPARE_DAMAGE | IComparer.COMPARE_NBT);
|
||||
}
|
||||
|
||||
public static ICraftingTask createCraftingTask(INetworkMaster network, @Nullable ItemStack stack, ICraftingPattern pattern, int quantity) {
|
||||
@@ -61,7 +61,7 @@ public final class NetworkUtils {
|
||||
|
||||
for (ICraftingTask task : network.getCraftingTasks()) {
|
||||
for (ItemStack output : task.getPattern().getOutputs()) {
|
||||
if (CompareUtils.compareStack(output, stack, compare)) {
|
||||
if (RSAPI.instance().getComparer().isEqual(output, stack, compare)) {
|
||||
alreadyScheduled++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package refinedstorage.api.storage.fluid;
|
||||
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import refinedstorage.api.storage.CompareUtils;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
@@ -2,14 +2,14 @@ package refinedstorage.api.storage.fluid;
|
||||
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import refinedstorage.api.network.INetworkMaster;
|
||||
import refinedstorage.api.storage.CompareUtils;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**e
|
||||
/**
|
||||
* e
|
||||
* This holds all fluids from all the connected storages from a {@link INetworkMaster}.
|
||||
* <p>
|
||||
* Refined Storage uses this class mainly for use in Grids and Detectors to avoid querying
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package refinedstorage.api.storage.item;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import refinedstorage.api.storage.CompareUtils;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
73
src/main/java/refinedstorage/api/util/IComparer.java
Executable file
73
src/main/java/refinedstorage/api/util/IComparer.java
Executable file
@@ -0,0 +1,73 @@
|
||||
package refinedstorage.api.util;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
/**
|
||||
* Utilities for comparing item and fluid stacks.
|
||||
*/
|
||||
public interface IComparer {
|
||||
int COMPARE_DAMAGE = 1;
|
||||
int COMPARE_NBT = 2;
|
||||
int COMPARE_QUANTITY = 4;
|
||||
|
||||
/**
|
||||
* Compares two stacks by NBT, damage and quantity.
|
||||
*
|
||||
* @param left the left stack
|
||||
* @param right the right stack
|
||||
* @return true if the left and right stack are the same, false otherwise
|
||||
*/
|
||||
default boolean isEqual(ItemStack left, ItemStack right) {
|
||||
return isEqual(left, right, COMPARE_NBT | COMPARE_DAMAGE | COMPARE_QUANTITY);
|
||||
}
|
||||
|
||||
/**
|
||||
* Compares two stacks by NBT and damage.
|
||||
*
|
||||
* @param left the left stack
|
||||
* @param right the right stack
|
||||
* @return true if the left and right stack are the same, false otherwise
|
||||
*/
|
||||
default boolean isEqualNoQuantity(ItemStack left, ItemStack right) {
|
||||
return isEqual(left, right, COMPARE_NBT | COMPARE_DAMAGE);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 true if the left and right stack are the same, false otherwise
|
||||
*/
|
||||
boolean isEqual(ItemStack left, ItemStack right, int flags);
|
||||
|
||||
/**
|
||||
* 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 true if the left and right stack are the same, false otherwise
|
||||
*/
|
||||
boolean isEqual(FluidStack left, FluidStack right, int flags);
|
||||
|
||||
/**
|
||||
* Compares the NBT tags of two stacks.
|
||||
*
|
||||
* @param left the left stack
|
||||
* @param right the right stack
|
||||
* @return true if the NBT tags of the two stacks are the same, false otherwise
|
||||
*/
|
||||
boolean isEqualNBT(ItemStack left, ItemStack right);
|
||||
|
||||
/**
|
||||
* Compares two stacks and checks if they share the same ore dictionary entry.
|
||||
*
|
||||
* @param left the left stack
|
||||
* @param right the right stack
|
||||
* @return true if the two stacks share the same ore dictionary entry
|
||||
*/
|
||||
boolean isEqualOredict(ItemStack left, ItemStack right);
|
||||
}
|
||||
@@ -4,10 +4,12 @@ import refinedstorage.api.IAPI;
|
||||
import refinedstorage.api.autocrafting.craftingmonitor.ICraftingMonitorElementRegistry;
|
||||
import refinedstorage.api.autocrafting.registry.ICraftingTaskRegistry;
|
||||
import refinedstorage.api.solderer.ISoldererRegistry;
|
||||
import refinedstorage.api.util.IComparer;
|
||||
import refinedstorage.api.util.IItemStackList;
|
||||
import refinedstorage.apiimpl.autocrafting.craftingmonitor.CraftingMonitorElementRegistry;
|
||||
import refinedstorage.apiimpl.autocrafting.registry.CraftingTaskRegistry;
|
||||
import refinedstorage.apiimpl.solderer.SoldererRegistry;
|
||||
import refinedstorage.apiimpl.util.Comparer;
|
||||
import refinedstorage.apiimpl.util.ItemStackList;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
@@ -15,10 +17,17 @@ import javax.annotation.Nonnull;
|
||||
public class API implements IAPI {
|
||||
public static final IAPI INSTANCE = new API();
|
||||
|
||||
private IComparer comparer = new Comparer();
|
||||
private ISoldererRegistry soldererRegistry = new SoldererRegistry();
|
||||
private ICraftingTaskRegistry craftingTaskRegistry = new CraftingTaskRegistry();
|
||||
private ICraftingMonitorElementRegistry craftingMonitorElementRegistry = new CraftingMonitorElementRegistry();
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IComparer getComparer() {
|
||||
return comparer;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nonnull
|
||||
public ISoldererRegistry getSoldererRegistry() {
|
||||
|
||||
@@ -7,9 +7,9 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.CraftingManager;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.items.ItemHandlerHelper;
|
||||
import refinedstorage.api.RSAPI;
|
||||
import refinedstorage.api.autocrafting.ICraftingPattern;
|
||||
import refinedstorage.api.autocrafting.ICraftingPatternContainer;
|
||||
import refinedstorage.api.storage.CompareUtils;
|
||||
import refinedstorage.apiimpl.autocrafting.registry.CraftingTaskFactoryNormal;
|
||||
import refinedstorage.item.ItemPattern;
|
||||
|
||||
@@ -108,7 +108,7 @@ public class CraftingPattern implements ICraftingPattern {
|
||||
int quantity = 0;
|
||||
|
||||
for (ItemStack output : outputs) {
|
||||
if (CompareUtils.compareStackNoQuantity(requested, output)) {
|
||||
if (RSAPI.instance().getComparer().isEqualNoQuantity(requested, output)) {
|
||||
quantity += output.stackSize;
|
||||
|
||||
if (!ItemPattern.isProcessing(stack)) {
|
||||
@@ -123,10 +123,10 @@ public class CraftingPattern implements ICraftingPattern {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "CraftingPattern{" +
|
||||
"container=" + container +
|
||||
", inputs=" + inputs +
|
||||
", outputs=" + outputs +
|
||||
", byproducts=" + byproducts +
|
||||
'}';
|
||||
"container=" + container +
|
||||
", inputs=" + inputs +
|
||||
", outputs=" + outputs +
|
||||
", byproducts=" + byproducts +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import refinedstorage.api.autocrafting.task.ICraftingTask;
|
||||
import refinedstorage.api.autocrafting.task.IProcessable;
|
||||
import refinedstorage.api.network.INetworkMaster;
|
||||
import refinedstorage.api.network.NetworkUtils;
|
||||
import refinedstorage.api.storage.CompareUtils;
|
||||
import refinedstorage.api.util.IComparer;
|
||||
import refinedstorage.api.util.IItemStackList;
|
||||
import refinedstorage.apiimpl.autocrafting.craftingmonitor.CraftingMonitorElementRoot;
|
||||
import refinedstorage.apiimpl.autocrafting.craftingmonitor.CraftingMonitorElementToTake;
|
||||
@@ -56,10 +56,10 @@ public class CraftingTaskNormal implements ICraftingTask {
|
||||
}
|
||||
|
||||
for (ItemStack input : pattern.getInputs()) {
|
||||
ItemStack inputInNetwork = list.get(input, CompareUtils.COMPARE_DAMAGE | CompareUtils.COMPARE_NBT);
|
||||
ItemStack inputInNetwork = list.get(input, IComparer.COMPARE_DAMAGE | IComparer.COMPARE_NBT);
|
||||
|
||||
if (inputInNetwork == null || inputInNetwork.stackSize == 0) {
|
||||
if (extras.get(input, CompareUtils.COMPARE_DAMAGE | CompareUtils.COMPARE_NBT) != null) {
|
||||
if (extras.get(input, IComparer.COMPARE_DAMAGE | IComparer.COMPARE_NBT) != null) {
|
||||
decrOrRemoveExtras(input);
|
||||
} else {
|
||||
ICraftingPattern inputPattern = NetworkUtils.getPattern(network, input);
|
||||
@@ -95,11 +95,11 @@ public class CraftingTaskNormal implements ICraftingTask {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "\nCraftingTask{quantity=" + quantity +
|
||||
"\n, toTake=" + toTake +
|
||||
"\n, toCraft=" + toCraft +
|
||||
"\n, toProcess=" + toProcess +
|
||||
"\n, missing=" + missing +
|
||||
'}';
|
||||
"\n, toTake=" + toTake +
|
||||
"\n, toCraft=" + toCraft +
|
||||
"\n, toProcess=" + toProcess +
|
||||
"\n, missing=" + missing +
|
||||
'}';
|
||||
}
|
||||
|
||||
public boolean update() {
|
||||
@@ -155,9 +155,9 @@ public class CraftingTaskNormal implements ICraftingTask {
|
||||
List<ICraftingMonitorElement> elements = new ArrayList<>();
|
||||
|
||||
elements.add(new CraftingMonitorElementRoot(
|
||||
network.getCraftingTasks().indexOf(this),
|
||||
pattern.getOutputs().get(0),
|
||||
quantity
|
||||
network.getCraftingTasks().indexOf(this),
|
||||
pattern.getOutputs().get(0),
|
||||
quantity
|
||||
));
|
||||
|
||||
if (!toTake.isEmpty()) {
|
||||
@@ -188,8 +188,8 @@ public class CraftingTaskNormal implements ICraftingTask {
|
||||
|
||||
private void addExtras(ICraftingPattern pattern) {
|
||||
pattern.getOutputs().stream()
|
||||
.filter(o -> o.stackSize > 1)
|
||||
.forEach(o -> extras.add(ItemHandlerHelper.copyStackWithSize(o, o.stackSize - 1)));
|
||||
.filter(o -> o.stackSize > 1)
|
||||
.forEach(o -> extras.add(ItemHandlerHelper.copyStackWithSize(o, o.stackSize - 1)));
|
||||
}
|
||||
|
||||
private void decrOrRemoveExtras(ItemStack stack) {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package refinedstorage.apiimpl.autocrafting.task;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import refinedstorage.api.RSAPI;
|
||||
import refinedstorage.api.autocrafting.ICraftingPattern;
|
||||
import refinedstorage.api.autocrafting.task.IProcessable;
|
||||
import refinedstorage.api.storage.CompareUtils;
|
||||
|
||||
public class Processable implements IProcessable {
|
||||
private ICraftingPattern pattern;
|
||||
@@ -51,7 +51,7 @@ public class Processable implements IProcessable {
|
||||
if (!satisfied[i]) {
|
||||
ItemStack item = pattern.getOutputs().get(i);
|
||||
|
||||
if (CompareUtils.compareStackNoQuantity(stack, item)) {
|
||||
if (RSAPI.instance().getComparer().isEqualNoQuantity(stack, item)) {
|
||||
satisfied[i] = true;
|
||||
|
||||
return true;
|
||||
|
||||
@@ -6,10 +6,10 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
|
||||
import refinedstorage.api.RSAPI;
|
||||
import refinedstorage.api.network.INetworkMaster;
|
||||
import refinedstorage.api.network.NetworkUtils;
|
||||
import refinedstorage.api.network.grid.IFluidGridHandler;
|
||||
import refinedstorage.api.storage.CompareUtils;
|
||||
import refinedstorage.apiimpl.storage.fluid.FluidUtils;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
@@ -32,7 +32,7 @@ public class FluidGridHandler implements IFluidGridHandler {
|
||||
for (int i = 0; i < player.inventory.getSizeInventory(); ++i) {
|
||||
ItemStack slot = player.inventory.getStackInSlot(i);
|
||||
|
||||
if (CompareUtils.compareStackNoQuantity(FluidUtils.EMPTY_BUCKET, slot)) {
|
||||
if (RSAPI.instance().getComparer().isEqualNoQuantity(FluidUtils.EMPTY_BUCKET, slot)) {
|
||||
bucket = FluidUtils.EMPTY_BUCKET.copy();
|
||||
|
||||
player.inventory.decrStackSize(i, 1);
|
||||
|
||||
@@ -6,11 +6,11 @@ import net.minecraft.util.EnumFacing;
|
||||
import net.minecraftforge.items.CapabilityItemHandler;
|
||||
import net.minecraftforge.items.ItemHandlerHelper;
|
||||
import refinedstorage.RS;
|
||||
import refinedstorage.api.RSAPI;
|
||||
import refinedstorage.api.autocrafting.task.ICraftingTask;
|
||||
import refinedstorage.api.network.INetworkMaster;
|
||||
import refinedstorage.api.network.NetworkUtils;
|
||||
import refinedstorage.api.network.grid.IItemGridHandler;
|
||||
import refinedstorage.api.storage.CompareUtils;
|
||||
import refinedstorage.apiimpl.autocrafting.task.CraftingTaskNormal;
|
||||
|
||||
public class ItemGridHandler implements IItemGridHandler {
|
||||
@@ -35,7 +35,7 @@ public class ItemGridHandler implements IItemGridHandler {
|
||||
ItemStack held = player.inventory.getItemStack();
|
||||
|
||||
if (single) {
|
||||
if (held != null && (!CompareUtils.compareStackNoQuantity(item, held) || held.stackSize + 1 > held.getMaxStackSize())) {
|
||||
if (held != null && (!RSAPI.instance().getComparer().isEqualNoQuantity(item, held) || held.stackSize + 1 > held.getMaxStackSize())) {
|
||||
return;
|
||||
}
|
||||
} else if (player.inventory.getItemStack() != null) {
|
||||
|
||||
@@ -18,9 +18,9 @@ public class SoldererRecipeFluidStorage implements ISoldererRecipe {
|
||||
public SoldererRecipeFluidStorage(EnumFluidStorageType type, int storagePart) {
|
||||
this.type = type;
|
||||
this.rows = new ItemStack[]{
|
||||
new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_BASIC),
|
||||
new ItemStack(RSBlocks.MACHINE_CASING),
|
||||
new ItemStack(RSItems.FLUID_STORAGE_PART, 1, storagePart)
|
||||
new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_BASIC),
|
||||
new ItemStack(RSBlocks.MACHINE_CASING),
|
||||
new ItemStack(RSItems.FLUID_STORAGE_PART, 1, storagePart)
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ public class SoldererRecipeProcessor implements ISoldererRecipe {
|
||||
this.rows = new ItemStack[]{
|
||||
printedProcessor,
|
||||
new ItemStack(Items.REDSTONE),
|
||||
new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_PRINTED_SILICON)
|
||||
new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_PRINTED_SILICON)
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -18,9 +18,9 @@ public class SoldererRecipeStorage implements ISoldererRecipe {
|
||||
public SoldererRecipeStorage(EnumItemStorageType type, int storagePart) {
|
||||
this.type = type;
|
||||
this.rows = new ItemStack[]{
|
||||
new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_BASIC),
|
||||
new ItemStack(RSBlocks.MACHINE_CASING),
|
||||
new ItemStack(RSItems.STORAGE_PART, 1, storagePart)
|
||||
new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_BASIC),
|
||||
new ItemStack(RSBlocks.MACHINE_CASING),
|
||||
new ItemStack(RSItems.STORAGE_PART, 1, storagePart)
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ public class SoldererRecipeUpgrade implements ISoldererRecipe {
|
||||
this.result = new ItemStack(RSItems.UPGRADE, 1, type);
|
||||
this.rows = new ItemStack[]{
|
||||
ItemUpgrade.getRequirement(type),
|
||||
new ItemStack(RSItems.UPGRADE, 1, 0),
|
||||
new ItemStack(RSItems.UPGRADE, 1, 0),
|
||||
new ItemStack(Items.REDSTONE)
|
||||
};
|
||||
}
|
||||
|
||||
@@ -2,9 +2,9 @@ package refinedstorage.apiimpl.solderer;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
import refinedstorage.api.RSAPI;
|
||||
import refinedstorage.api.solderer.ISoldererRecipe;
|
||||
import refinedstorage.api.solderer.ISoldererRegistry;
|
||||
import refinedstorage.api.storage.CompareUtils;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
@@ -26,7 +26,7 @@ public class SoldererRegistry implements ISoldererRegistry {
|
||||
boolean found = true;
|
||||
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
if (!CompareUtils.compareStackNoQuantity(recipe.getRow(i), rows.getStackInSlot(i)) && !CompareUtils.compareStackOreDict(recipe.getRow(i), rows.getStackInSlot(i))) {
|
||||
if (!RSAPI.instance().getComparer().isEqualNoQuantity(recipe.getRow(i), rows.getStackInSlot(i)) && !RSAPI.instance().getComparer().isEqualOredict(recipe.getRow(i), rows.getStackInSlot(i))) {
|
||||
found = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import refinedstorage.api.storage.CompareUtils;
|
||||
import refinedstorage.api.RSAPI;
|
||||
import refinedstorage.api.storage.fluid.IFluidStorage;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
@@ -143,7 +143,7 @@ public abstract class FluidStorageNBT implements IFluidStorage {
|
||||
@Override
|
||||
public synchronized FluidStack extractFluid(FluidStack stack, int size, int flags) {
|
||||
for (FluidStack otherStack : stacks) {
|
||||
if (CompareUtils.compareStack(otherStack, stack, flags)) {
|
||||
if (RSAPI.instance().getComparer().isEqual(otherStack, stack, flags)) {
|
||||
if (size > otherStack.amount) {
|
||||
size = otherStack.amount;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import net.minecraftforge.fluids.IFluidContainerItem;
|
||||
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
|
||||
import refinedstorage.api.network.INetworkMaster;
|
||||
import refinedstorage.api.network.NetworkUtils;
|
||||
import refinedstorage.api.storage.CompareUtils;
|
||||
import refinedstorage.api.util.IComparer;
|
||||
|
||||
public final class FluidUtils {
|
||||
public static final ItemStack EMPTY_BUCKET = new ItemStack(Items.BUCKET);
|
||||
@@ -51,7 +51,7 @@ public final class FluidUtils {
|
||||
if (result != null) {
|
||||
result.getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, null).fill(NetworkUtils.extractFluid(network, fluidStack, Fluid.BUCKET_VOLUME), true);
|
||||
} else {
|
||||
NetworkUtils.scheduleCraftingTaskIfUnscheduled(network, EMPTY_BUCKET, 1, CompareUtils.COMPARE_DAMAGE | CompareUtils.COMPARE_NBT);
|
||||
NetworkUtils.scheduleCraftingTaskIfUnscheduled(network, EMPTY_BUCKET, 1, IComparer.COMPARE_DAMAGE | IComparer.COMPARE_NBT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,9 +4,9 @@ import com.google.common.collect.ArrayListMultimap;
|
||||
import com.google.common.collect.Multimap;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import refinedstorage.api.RSAPI;
|
||||
import refinedstorage.api.network.INetworkMaster;
|
||||
import refinedstorage.api.network.NetworkUtils;
|
||||
import refinedstorage.api.storage.CompareUtils;
|
||||
import refinedstorage.api.storage.fluid.IFluidStorage;
|
||||
import refinedstorage.api.storage.fluid.IFluidStorageProvider;
|
||||
import refinedstorage.api.storage.fluid.IGroupedFluidStorage;
|
||||
@@ -87,7 +87,7 @@ public class GroupedFluidStorage implements IGroupedFluidStorage {
|
||||
@Nullable
|
||||
public FluidStack get(@Nonnull FluidStack stack, int flags) {
|
||||
for (FluidStack otherStack : stacks.get(stack.getFluid())) {
|
||||
if (CompareUtils.compareStack(otherStack, stack, flags)) {
|
||||
if (RSAPI.instance().getComparer().isEqual(otherStack, stack, flags)) {
|
||||
return otherStack;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.items.ItemHandlerHelper;
|
||||
import refinedstorage.api.storage.CompareUtils;
|
||||
import refinedstorage.api.RSAPI;
|
||||
import refinedstorage.api.storage.item.IItemStorage;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
@@ -124,7 +124,7 @@ public abstract class ItemStorageNBT implements IItemStorage {
|
||||
@Override
|
||||
public synchronized ItemStack insertItem(ItemStack stack, int size, boolean simulate) {
|
||||
for (ItemStack otherStack : stacks) {
|
||||
if (CompareUtils.compareStackNoQuantity(otherStack, stack)) {
|
||||
if (RSAPI.instance().getComparer().isEqualNoQuantity(otherStack, stack)) {
|
||||
if (getCapacity() != -1 && getStored() + size > getCapacity()) {
|
||||
int remainingSpace = getCapacity() - getStored();
|
||||
|
||||
@@ -187,7 +187,7 @@ public abstract class ItemStorageNBT implements IItemStorage {
|
||||
@Override
|
||||
public synchronized ItemStack extractItem(ItemStack stack, int size, int flags) {
|
||||
for (ItemStack otherStack : stacks) {
|
||||
if (CompareUtils.compareStack(otherStack, stack, flags)) {
|
||||
if (RSAPI.instance().getComparer().isEqual(otherStack, stack, flags)) {
|
||||
if (size > otherStack.stackSize) {
|
||||
size = otherStack.stackSize;
|
||||
}
|
||||
|
||||
@@ -1,49 +1,14 @@
|
||||
package refinedstorage.api.storage;
|
||||
package refinedstorage.apiimpl.util;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import refinedstorage.api.util.IComparer;
|
||||
|
||||
/**
|
||||
* Utilities for comparing item and fluid stacks.
|
||||
*/
|
||||
public final class CompareUtils {
|
||||
public static final int COMPARE_DAMAGE = 1;
|
||||
public static final int COMPARE_NBT = 2;
|
||||
public static final int COMPARE_QUANTITY = 4;
|
||||
|
||||
/**
|
||||
* Compares two stacks by NBT, damage and quantity.
|
||||
*
|
||||
* @param left the left stack
|
||||
* @param right the right stack
|
||||
* @return true if the left and right stack are the same, false otherwise
|
||||
*/
|
||||
public static boolean compareStack(ItemStack left, ItemStack right) {
|
||||
return compareStack(left, right, COMPARE_NBT | COMPARE_DAMAGE | COMPARE_QUANTITY);
|
||||
}
|
||||
|
||||
/**
|
||||
* Compares two stacks by NBT and damage.
|
||||
*
|
||||
* @param left the left stack
|
||||
* @param right the right stack
|
||||
* @return true if the left and right stack are the same, false otherwise
|
||||
*/
|
||||
public static boolean compareStackNoQuantity(ItemStack left, ItemStack right) {
|
||||
return compareStack(left, right, COMPARE_NBT | COMPARE_DAMAGE);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 true if the left and right stack are the same, false otherwise
|
||||
*/
|
||||
public static boolean compareStack(ItemStack left, ItemStack right, int flags) {
|
||||
public class Comparer implements IComparer {
|
||||
@Override
|
||||
public boolean isEqual(ItemStack left, ItemStack right, int flags) {
|
||||
if (left == null && right == null) {
|
||||
return true;
|
||||
}
|
||||
@@ -63,7 +28,7 @@ public final class CompareUtils {
|
||||
}
|
||||
|
||||
if ((flags & COMPARE_NBT) == COMPARE_NBT) {
|
||||
if (!compareNbt(left, right)) {
|
||||
if (!isEqualNBT(left, right)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -77,15 +42,8 @@ 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 true if the left and right stack are the same, false otherwise
|
||||
*/
|
||||
public static boolean compareStack(FluidStack left, FluidStack right, int flags) {
|
||||
@Override
|
||||
public boolean isEqual(FluidStack left, FluidStack right, int flags) {
|
||||
if (left == null && right == null) {
|
||||
return true;
|
||||
}
|
||||
@@ -113,14 +71,8 @@ public final class CompareUtils {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Compares the NBT tags of two stacks.
|
||||
*
|
||||
* @param left the left stack
|
||||
* @param right the right stack
|
||||
* @return true if the NBT tags of the two stacks are the same, false otherwise
|
||||
*/
|
||||
public static boolean compareNbt(ItemStack left, ItemStack right) {
|
||||
@Override
|
||||
public boolean isEqualNBT(ItemStack left, ItemStack right) {
|
||||
if (!ItemStack.areItemStackTagsEqual(left, right)) {
|
||||
if (left.hasTagCompound() && !right.hasTagCompound() && left.getTagCompound().hasNoTags()) {
|
||||
return true;
|
||||
@@ -134,14 +86,8 @@ public final class CompareUtils {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Compares two stacks and checks if they share the same ore dictionary entry.
|
||||
*
|
||||
* @param left the left stack
|
||||
* @param right the right stack
|
||||
* @return true if the two stacks share the same ore dictionary entry
|
||||
*/
|
||||
public static boolean compareStackOreDict(ItemStack left, ItemStack right) {
|
||||
@Override
|
||||
public boolean isEqualOredict(ItemStack left, ItemStack right) {
|
||||
if (left == null && right == null) {
|
||||
return true;
|
||||
}
|
||||
@@ -4,8 +4,8 @@ import com.google.common.collect.ArrayListMultimap;
|
||||
import com.google.common.collect.Multimap;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import refinedstorage.api.RSAPI;
|
||||
import refinedstorage.api.network.NetworkUtils;
|
||||
import refinedstorage.api.storage.CompareUtils;
|
||||
import refinedstorage.api.util.IItemStackList;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
@@ -17,7 +17,7 @@ public class ItemStackList implements IItemStackList {
|
||||
|
||||
public void add(ItemStack stack) {
|
||||
for (ItemStack otherStack : stacks.get(stack.getItem())) {
|
||||
if (CompareUtils.compareStackNoQuantity(otherStack, stack)) {
|
||||
if (RSAPI.instance().getComparer().isEqualNoQuantity(otherStack, stack)) {
|
||||
otherStack.stackSize += stack.stackSize;
|
||||
|
||||
return;
|
||||
@@ -29,7 +29,7 @@ public class ItemStackList implements IItemStackList {
|
||||
|
||||
public boolean remove(@Nonnull ItemStack stack, boolean removeIfReachedZero) {
|
||||
for (ItemStack otherStack : stacks.get(stack.getItem())) {
|
||||
if (CompareUtils.compareStackNoQuantity(otherStack, stack)) {
|
||||
if (RSAPI.instance().getComparer().isEqualNoQuantity(otherStack, stack)) {
|
||||
otherStack.stackSize -= stack.stackSize;
|
||||
|
||||
if (otherStack.stackSize == 0 && removeIfReachedZero) {
|
||||
@@ -46,7 +46,7 @@ public class ItemStackList implements IItemStackList {
|
||||
@Nullable
|
||||
public ItemStack get(@Nonnull ItemStack stack, int flags) {
|
||||
for (ItemStack otherStack : stacks.get(stack.getItem())) {
|
||||
if (CompareUtils.compareStack(otherStack, stack, flags)) {
|
||||
if (RSAPI.instance().getComparer().isEqual(otherStack, stack, flags)) {
|
||||
return otherStack;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.items.ItemHandlerHelper;
|
||||
import refinedstorage.api.storage.CompareUtils;
|
||||
import refinedstorage.api.RSAPI;
|
||||
import refinedstorage.container.slot.*;
|
||||
import refinedstorage.tile.TileBase;
|
||||
import refinedstorage.tile.grid.WirelessGrid;
|
||||
@@ -107,7 +107,7 @@ public abstract class ContainerBase extends Container {
|
||||
|
||||
protected ItemStack mergeItemStackToSpecimen(ItemStack stack, int begin, int end) {
|
||||
for (int i = begin; i < end; ++i) {
|
||||
if (CompareUtils.compareStackNoQuantity(getStackFromSlot(getSlot(i)), stack)) {
|
||||
if (RSAPI.instance().getComparer().isEqualNoQuantity(getStackFromSlot(getSlot(i)), stack)) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
2
src/main/java/refinedstorage/container/ContainerDiskManipulator.java
Normal file → Executable file
2
src/main/java/refinedstorage/container/ContainerDiskManipulator.java
Normal file → Executable file
@@ -20,7 +20,7 @@ public class ContainerDiskManipulator extends ContainerBase {
|
||||
}
|
||||
|
||||
for (int i = 0; i < 6; ++i) {
|
||||
addSlotToContainer(new SlotItemHandler(manipulator.getDisks(), 6 + i, 116 + (i%2 * 18), ((i / 2) * 18) + 57));
|
||||
addSlotToContainer(new SlotItemHandler(manipulator.getDisks(), 6 + i, 116 + (i % 2 * 18), ((i / 2) * 18) + 57));
|
||||
}
|
||||
|
||||
for (int i = 0; i < 9; ++i) {
|
||||
|
||||
@@ -76,7 +76,7 @@ public class ContainerProcessingPatternEncoder extends ContainerBase {
|
||||
}
|
||||
|
||||
public void setInputs(Collection<ItemStack> stacks) {
|
||||
setSlots(stacks, 2 , 2 + 9);
|
||||
setSlots(stacks, 2, 2 + 9);
|
||||
}
|
||||
|
||||
public void setOutputs(Collection<ItemStack> stacks) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package refinedstorage.gui;
|
||||
|
||||
import refinedstorage.api.storage.CompareUtils;
|
||||
import refinedstorage.api.util.IComparer;
|
||||
import refinedstorage.container.ContainerConstructor;
|
||||
import refinedstorage.gui.sidebutton.SideButtonCompare;
|
||||
import refinedstorage.gui.sidebutton.SideButtonRedstoneMode;
|
||||
@@ -18,8 +18,8 @@ public class GuiConstructor extends GuiBase {
|
||||
|
||||
addSideButton(new SideButtonType(this, TileConstructor.TYPE));
|
||||
|
||||
addSideButton(new SideButtonCompare(this, TileConstructor.COMPARE, CompareUtils.COMPARE_DAMAGE));
|
||||
addSideButton(new SideButtonCompare(this, TileConstructor.COMPARE, CompareUtils.COMPARE_NBT));
|
||||
addSideButton(new SideButtonCompare(this, TileConstructor.COMPARE, IComparer.COMPARE_DAMAGE));
|
||||
addSideButton(new SideButtonCompare(this, TileConstructor.COMPARE, IComparer.COMPARE_NBT));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package refinedstorage.gui;
|
||||
|
||||
import refinedstorage.api.storage.CompareUtils;
|
||||
import refinedstorage.api.util.IComparer;
|
||||
import refinedstorage.container.ContainerDestructor;
|
||||
import refinedstorage.gui.sidebutton.SideButtonCompare;
|
||||
import refinedstorage.gui.sidebutton.SideButtonMode;
|
||||
@@ -21,8 +21,8 @@ public class GuiDestructor extends GuiBase {
|
||||
|
||||
addSideButton(new SideButtonMode(this, TileDestructor.MODE));
|
||||
|
||||
addSideButton(new SideButtonCompare(this, TileDestructor.COMPARE, CompareUtils.COMPARE_DAMAGE));
|
||||
addSideButton(new SideButtonCompare(this, TileDestructor.COMPARE, CompareUtils.COMPARE_NBT));
|
||||
addSideButton(new SideButtonCompare(this, TileDestructor.COMPARE, IComparer.COMPARE_DAMAGE));
|
||||
addSideButton(new SideButtonCompare(this, TileDestructor.COMPARE, IComparer.COMPARE_NBT));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -2,7 +2,7 @@ package refinedstorage.gui;
|
||||
|
||||
import com.google.common.primitives.Ints;
|
||||
import net.minecraft.client.gui.GuiTextField;
|
||||
import refinedstorage.api.storage.CompareUtils;
|
||||
import refinedstorage.api.util.IComparer;
|
||||
import refinedstorage.container.ContainerDetector;
|
||||
import refinedstorage.gui.sidebutton.SideButtonCompare;
|
||||
import refinedstorage.gui.sidebutton.SideButtonDetectorMode;
|
||||
@@ -25,8 +25,8 @@ public class GuiDetector extends GuiBase {
|
||||
|
||||
addSideButton(new SideButtonDetectorMode(this));
|
||||
|
||||
addSideButton(new SideButtonCompare(this, TileDetector.COMPARE, CompareUtils.COMPARE_DAMAGE));
|
||||
addSideButton(new SideButtonCompare(this, TileDetector.COMPARE, CompareUtils.COMPARE_NBT));
|
||||
addSideButton(new SideButtonCompare(this, TileDetector.COMPARE, IComparer.COMPARE_DAMAGE));
|
||||
addSideButton(new SideButtonCompare(this, TileDetector.COMPARE, IComparer.COMPARE_NBT));
|
||||
|
||||
AMOUNT = new GuiTextField(0, fontRendererObj, x + 62 + 1, y + 23 + 1, 29, fontRendererObj.FONT_HEIGHT);
|
||||
AMOUNT.setText(String.valueOf(TileDetector.AMOUNT.getValue()));
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package refinedstorage.gui;
|
||||
|
||||
import refinedstorage.api.storage.CompareUtils;
|
||||
import refinedstorage.api.util.IComparer;
|
||||
import refinedstorage.container.ContainerDiskManipulator;
|
||||
import refinedstorage.gui.sidebutton.*;
|
||||
import refinedstorage.tile.TileDiskManipulator;
|
||||
@@ -16,8 +16,8 @@ public class GuiDiskManipulator extends GuiBase {
|
||||
addSideButton(new SideButtonIOMode(this, TileDiskManipulator.IO_MODE));
|
||||
addSideButton(new SideButtonType(this, TileDiskManipulator.TYPE));
|
||||
addSideButton(new SideButtonMode(this, TileDiskManipulator.MODE));
|
||||
addSideButton(new SideButtonCompare(this, TileDiskManipulator.COMPARE, CompareUtils.COMPARE_DAMAGE));
|
||||
addSideButton(new SideButtonCompare(this, TileDiskManipulator.COMPARE, CompareUtils.COMPARE_NBT));
|
||||
addSideButton(new SideButtonCompare(this, TileDiskManipulator.COMPARE, IComparer.COMPARE_DAMAGE));
|
||||
addSideButton(new SideButtonCompare(this, TileDiskManipulator.COMPARE, IComparer.COMPARE_NBT));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package refinedstorage.gui;
|
||||
|
||||
import refinedstorage.api.storage.CompareUtils;
|
||||
import refinedstorage.api.util.IComparer;
|
||||
import refinedstorage.container.ContainerExporter;
|
||||
import refinedstorage.gui.sidebutton.SideButtonCompare;
|
||||
import refinedstorage.gui.sidebutton.SideButtonRedstoneMode;
|
||||
@@ -18,8 +18,8 @@ public class GuiExporter extends GuiBase {
|
||||
|
||||
addSideButton(new SideButtonType(this, TileExporter.TYPE));
|
||||
|
||||
addSideButton(new SideButtonCompare(this, TileExporter.COMPARE, CompareUtils.COMPARE_DAMAGE));
|
||||
addSideButton(new SideButtonCompare(this, TileExporter.COMPARE, CompareUtils.COMPARE_NBT));
|
||||
addSideButton(new SideButtonCompare(this, TileExporter.COMPARE, IComparer.COMPARE_DAMAGE));
|
||||
addSideButton(new SideButtonCompare(this, TileExporter.COMPARE, IComparer.COMPARE_NBT));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package refinedstorage.gui;
|
||||
|
||||
import refinedstorage.api.storage.CompareUtils;
|
||||
import refinedstorage.api.util.IComparer;
|
||||
import refinedstorage.apiimpl.storage.fluid.FluidRenderer;
|
||||
import refinedstorage.container.ContainerFluidInterface;
|
||||
import refinedstorage.gui.sidebutton.SideButtonCompare;
|
||||
@@ -18,7 +18,7 @@ public class GuiFluidInterface extends GuiBase {
|
||||
public void init(int x, int y) {
|
||||
addSideButton(new SideButtonRedstoneMode(this, TileFluidInterface.REDSTONE_MODE));
|
||||
|
||||
addSideButton(new SideButtonCompare(this, TileFluidInterface.COMPARE, CompareUtils.COMPARE_NBT));
|
||||
addSideButton(new SideButtonCompare(this, TileFluidInterface.COMPARE, IComparer.COMPARE_NBT));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -3,7 +3,7 @@ package refinedstorage.gui;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraftforge.fml.client.config.GuiCheckBox;
|
||||
import refinedstorage.RS;
|
||||
import refinedstorage.api.storage.CompareUtils;
|
||||
import refinedstorage.api.util.IComparer;
|
||||
import refinedstorage.container.ContainerGridFilter;
|
||||
import refinedstorage.item.ItemGridFilter;
|
||||
import refinedstorage.network.MessageGridFilterUpdate;
|
||||
@@ -24,8 +24,8 @@ public class GuiGridFilter extends GuiBase {
|
||||
|
||||
@Override
|
||||
public void init(int x, int y) {
|
||||
compareDamage = addCheckBox(x + 7, y + 41, t("gui.refinedstorage:grid_filter.compare_damage"), (compare & CompareUtils.COMPARE_DAMAGE) == CompareUtils.COMPARE_DAMAGE);
|
||||
compareNBT = addCheckBox(x + 7 + compareDamage.getButtonWidth() + 4, y + 41, t("gui.refinedstorage:grid_filter.compare_nbt"), (compare & CompareUtils.COMPARE_NBT) == CompareUtils.COMPARE_NBT);
|
||||
compareDamage = addCheckBox(x + 7, y + 41, t("gui.refinedstorage:grid_filter.compare_damage"), (compare & IComparer.COMPARE_DAMAGE) == IComparer.COMPARE_DAMAGE);
|
||||
compareNBT = addCheckBox(x + 7 + compareDamage.getButtonWidth() + 4, y + 41, t("gui.refinedstorage:grid_filter.compare_nbt"), (compare & IComparer.COMPARE_NBT) == IComparer.COMPARE_NBT);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -50,9 +50,9 @@ public class GuiGridFilter extends GuiBase {
|
||||
super.actionPerformed(button);
|
||||
|
||||
if (button == compareDamage) {
|
||||
compare ^= CompareUtils.COMPARE_DAMAGE;
|
||||
compare ^= IComparer.COMPARE_DAMAGE;
|
||||
} else if (button == compareNBT) {
|
||||
compare ^= CompareUtils.COMPARE_NBT;
|
||||
compare ^= IComparer.COMPARE_NBT;
|
||||
}
|
||||
|
||||
RS.INSTANCE.network.sendToServer(new MessageGridFilterUpdate(compare));
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package refinedstorage.gui;
|
||||
|
||||
import refinedstorage.api.storage.CompareUtils;
|
||||
import refinedstorage.api.util.IComparer;
|
||||
import refinedstorage.container.ContainerImporter;
|
||||
import refinedstorage.gui.sidebutton.SideButtonCompare;
|
||||
import refinedstorage.gui.sidebutton.SideButtonMode;
|
||||
@@ -21,8 +21,8 @@ public class GuiImporter extends GuiBase {
|
||||
|
||||
addSideButton(new SideButtonMode(this, TileImporter.MODE));
|
||||
|
||||
addSideButton(new SideButtonCompare(this, TileImporter.COMPARE, CompareUtils.COMPARE_DAMAGE));
|
||||
addSideButton(new SideButtonCompare(this, TileImporter.COMPARE, CompareUtils.COMPARE_NBT));
|
||||
addSideButton(new SideButtonCompare(this, TileImporter.COMPARE, IComparer.COMPARE_DAMAGE));
|
||||
addSideButton(new SideButtonCompare(this, TileImporter.COMPARE, IComparer.COMPARE_NBT));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package refinedstorage.gui;
|
||||
|
||||
import refinedstorage.api.storage.CompareUtils;
|
||||
import refinedstorage.api.util.IComparer;
|
||||
import refinedstorage.container.ContainerInterface;
|
||||
import refinedstorage.gui.sidebutton.SideButtonCompare;
|
||||
import refinedstorage.gui.sidebutton.SideButtonRedstoneMode;
|
||||
@@ -15,8 +15,8 @@ public class GuiInterface extends GuiBase {
|
||||
public void init(int x, int y) {
|
||||
addSideButton(new SideButtonRedstoneMode(this, TileInterface.REDSTONE_MODE));
|
||||
|
||||
addSideButton(new SideButtonCompare(this, TileInterface.COMPARE, CompareUtils.COMPARE_DAMAGE));
|
||||
addSideButton(new SideButtonCompare(this, TileInterface.COMPARE, CompareUtils.COMPARE_NBT));
|
||||
addSideButton(new SideButtonCompare(this, TileInterface.COMPARE, IComparer.COMPARE_DAMAGE));
|
||||
addSideButton(new SideButtonCompare(this, TileInterface.COMPARE, IComparer.COMPARE_NBT));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -2,7 +2,7 @@ package refinedstorage.gui;
|
||||
|
||||
import com.google.common.primitives.Ints;
|
||||
import net.minecraft.client.gui.GuiTextField;
|
||||
import refinedstorage.api.storage.CompareUtils;
|
||||
import refinedstorage.api.util.IComparer;
|
||||
import refinedstorage.container.ContainerBase;
|
||||
import refinedstorage.gui.sidebutton.SideButtonCompare;
|
||||
import refinedstorage.gui.sidebutton.SideButtonMode;
|
||||
@@ -50,8 +50,8 @@ public class GuiStorage extends GuiBase {
|
||||
}
|
||||
|
||||
if (gui.getCompareParameter() != null) {
|
||||
addSideButton(new SideButtonCompare(this, gui.getCompareParameter(), CompareUtils.COMPARE_DAMAGE));
|
||||
addSideButton(new SideButtonCompare(this, gui.getCompareParameter(), CompareUtils.COMPARE_NBT));
|
||||
addSideButton(new SideButtonCompare(this, gui.getCompareParameter(), IComparer.COMPARE_DAMAGE));
|
||||
addSideButton(new SideButtonCompare(this, gui.getCompareParameter(), IComparer.COMPARE_NBT));
|
||||
}
|
||||
|
||||
priorityField = new GuiTextField(0, fontRendererObj, x + 98 + 1, y + 54 + 1, 29, fontRendererObj.FONT_HEIGHT);
|
||||
|
||||
@@ -8,10 +8,10 @@ public class ModGuiConfig extends GuiConfig {
|
||||
|
||||
public ModGuiConfig(GuiScreen guiScreen) {
|
||||
super(guiScreen,
|
||||
RS.INSTANCE.config.getConfigElements(),
|
||||
RS.ID,
|
||||
false,
|
||||
false,
|
||||
GuiConfig.getAbridgedConfigPath(RS.INSTANCE.config.getConfig().toString()));
|
||||
RS.INSTANCE.config.getConfigElements(),
|
||||
RS.ID,
|
||||
false,
|
||||
false,
|
||||
GuiConfig.getAbridgedConfigPath(RS.INSTANCE.config.getConfig().toString()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,8 +15,8 @@ import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||
import refinedstorage.RS;
|
||||
import refinedstorage.api.RSAPI;
|
||||
import refinedstorage.api.network.grid.IItemGridHandler;
|
||||
import refinedstorage.api.storage.CompareUtils;
|
||||
import refinedstorage.block.EnumGridType;
|
||||
import refinedstorage.container.ContainerGrid;
|
||||
import refinedstorage.gui.GuiBase;
|
||||
@@ -128,7 +128,7 @@ public class GuiGrid extends GuiBase {
|
||||
boolean found = filteredItems.isEmpty();
|
||||
|
||||
for (GridFilteredItem filteredItem : filteredItems) {
|
||||
if (CompareUtils.compareStack(((ClientStackItem) stack).getStack(), filteredItem.getStack(), filteredItem.getCompare())) {
|
||||
if (RSAPI.instance().getComparer().isEqual(((ClientStackItem) stack).getStack(), filteredItem.getStack(), filteredItem.getCompare())) {
|
||||
found = true;
|
||||
|
||||
break;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package refinedstorage.gui.sidebutton;
|
||||
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import refinedstorage.api.storage.CompareUtils;
|
||||
import refinedstorage.api.util.IComparer;
|
||||
import refinedstorage.gui.GuiBase;
|
||||
import refinedstorage.tile.data.TileDataManager;
|
||||
import refinedstorage.tile.data.TileDataParameter;
|
||||
@@ -34,9 +34,9 @@ public class SideButtonCompare extends SideButton {
|
||||
protected void drawButtonIcon(int x, int y) {
|
||||
int ty = 0;
|
||||
|
||||
if (mask == CompareUtils.COMPARE_DAMAGE) {
|
||||
if (mask == IComparer.COMPARE_DAMAGE) {
|
||||
ty = 80;
|
||||
} else if (mask == CompareUtils.COMPARE_NBT) {
|
||||
} else if (mask == IComparer.COMPARE_NBT) {
|
||||
ty = 48;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import net.minecraft.world.World;
|
||||
import refinedstorage.RS;
|
||||
import refinedstorage.RSGui;
|
||||
import refinedstorage.RSItems;
|
||||
import refinedstorage.api.storage.CompareUtils;
|
||||
import refinedstorage.api.util.IComparer;
|
||||
import refinedstorage.inventory.ItemHandlerGridFilter;
|
||||
|
||||
import java.util.List;
|
||||
@@ -49,7 +49,7 @@ public class ItemGridFilter extends ItemBase {
|
||||
}
|
||||
|
||||
public static int getCompare(ItemStack stack) {
|
||||
return (stack.hasTagCompound() && stack.getTagCompound().hasKey(NBT_COMPARE)) ? stack.getTagCompound().getInteger(NBT_COMPARE) : (CompareUtils.COMPARE_DAMAGE | CompareUtils.COMPARE_NBT);
|
||||
return (stack.hasTagCompound() && stack.getTagCompound().hasKey(NBT_COMPARE)) ? stack.getTagCompound().getInteger(NBT_COMPARE) : (IComparer.COMPARE_DAMAGE | IComparer.COMPARE_NBT);
|
||||
}
|
||||
|
||||
public static void setCompare(ItemStack stack, int compare) {
|
||||
|
||||
@@ -14,10 +14,10 @@ import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.Constants;
|
||||
import refinedstorage.RSItems;
|
||||
import refinedstorage.api.RSAPI;
|
||||
import refinedstorage.api.autocrafting.ICraftingPattern;
|
||||
import refinedstorage.api.autocrafting.ICraftingPatternContainer;
|
||||
import refinedstorage.api.autocrafting.ICraftingPatternProvider;
|
||||
import refinedstorage.api.storage.CompareUtils;
|
||||
import refinedstorage.apiimpl.autocrafting.CraftingPattern;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
@@ -158,7 +158,7 @@ public class ItemPattern extends ItemBase implements ICraftingPatternProvider {
|
||||
int amount = stacks[i].stackSize;
|
||||
|
||||
for (int j = i + 1; j < stacks.length; ++j) {
|
||||
if (CompareUtils.compareStack(stacks[i], stacks[j])) {
|
||||
if (RSAPI.instance().getComparer().isEqual(stacks[i], stacks[j])) {
|
||||
amount += stacks[j].stackSize;
|
||||
|
||||
combinedIndices.add(j);
|
||||
|
||||
@@ -148,56 +148,56 @@ public class ClientProxy extends CommonProxy {
|
||||
|
||||
// Item Variants
|
||||
ModelBakery.registerItemVariants(RSItems.STORAGE_DISK,
|
||||
new ResourceLocation("refinedstorage:1k_storage_disk"),
|
||||
new ResourceLocation("refinedstorage:4k_storage_disk"),
|
||||
new ResourceLocation("refinedstorage:16k_storage_disk"),
|
||||
new ResourceLocation("refinedstorage:64k_storage_disk"),
|
||||
new ResourceLocation("refinedstorage:creative_storage_disk")
|
||||
new ResourceLocation("refinedstorage:1k_storage_disk"),
|
||||
new ResourceLocation("refinedstorage:4k_storage_disk"),
|
||||
new ResourceLocation("refinedstorage:16k_storage_disk"),
|
||||
new ResourceLocation("refinedstorage:64k_storage_disk"),
|
||||
new ResourceLocation("refinedstorage:creative_storage_disk")
|
||||
);
|
||||
|
||||
ModelBakery.registerItemVariants(RSItems.STORAGE_PART,
|
||||
new ResourceLocation("refinedstorage:1k_storage_part"),
|
||||
new ResourceLocation("refinedstorage:4k_storage_part"),
|
||||
new ResourceLocation("refinedstorage:16k_storage_part"),
|
||||
new ResourceLocation("refinedstorage:64k_storage_part")
|
||||
new ResourceLocation("refinedstorage:1k_storage_part"),
|
||||
new ResourceLocation("refinedstorage:4k_storage_part"),
|
||||
new ResourceLocation("refinedstorage:16k_storage_part"),
|
||||
new ResourceLocation("refinedstorage:64k_storage_part")
|
||||
);
|
||||
|
||||
ModelBakery.registerItemVariants(RSItems.FLUID_STORAGE_DISK,
|
||||
new ResourceLocation("refinedstorage:64k_fluid_storage_disk"),
|
||||
new ResourceLocation("refinedstorage:128k_fluid_storage_disk"),
|
||||
new ResourceLocation("refinedstorage:256k_fluid_storage_disk"),
|
||||
new ResourceLocation("refinedstorage:512k_fluid_storage_disk"),
|
||||
new ResourceLocation("refinedstorage:creative_fluid_storage_disk")
|
||||
new ResourceLocation("refinedstorage:64k_fluid_storage_disk"),
|
||||
new ResourceLocation("refinedstorage:128k_fluid_storage_disk"),
|
||||
new ResourceLocation("refinedstorage:256k_fluid_storage_disk"),
|
||||
new ResourceLocation("refinedstorage:512k_fluid_storage_disk"),
|
||||
new ResourceLocation("refinedstorage:creative_fluid_storage_disk")
|
||||
);
|
||||
|
||||
ModelBakery.registerItemVariants(RSItems.FLUID_STORAGE_PART,
|
||||
new ResourceLocation("refinedstorage:64k_fluid_storage_part"),
|
||||
new ResourceLocation("refinedstorage:128k_fluid_storage_part"),
|
||||
new ResourceLocation("refinedstorage:256k_fluid_storage_part"),
|
||||
new ResourceLocation("refinedstorage:512k_fluid_storage_part")
|
||||
new ResourceLocation("refinedstorage:64k_fluid_storage_part"),
|
||||
new ResourceLocation("refinedstorage:128k_fluid_storage_part"),
|
||||
new ResourceLocation("refinedstorage:256k_fluid_storage_part"),
|
||||
new ResourceLocation("refinedstorage:512k_fluid_storage_part")
|
||||
);
|
||||
|
||||
ModelBakery.registerItemVariants(RSItems.PROCESSOR,
|
||||
new ResourceLocation("refinedstorage:basic_printed_processor"),
|
||||
new ResourceLocation("refinedstorage:improved_printed_processor"),
|
||||
new ResourceLocation("refinedstorage:advanced_printed_processor"),
|
||||
new ResourceLocation("refinedstorage:basic_processor"),
|
||||
new ResourceLocation("refinedstorage:improved_processor"),
|
||||
new ResourceLocation("refinedstorage:advanced_processor"),
|
||||
new ResourceLocation("refinedstorage:printed_silicon")
|
||||
new ResourceLocation("refinedstorage:basic_printed_processor"),
|
||||
new ResourceLocation("refinedstorage:improved_printed_processor"),
|
||||
new ResourceLocation("refinedstorage:advanced_printed_processor"),
|
||||
new ResourceLocation("refinedstorage:basic_processor"),
|
||||
new ResourceLocation("refinedstorage:improved_processor"),
|
||||
new ResourceLocation("refinedstorage:advanced_processor"),
|
||||
new ResourceLocation("refinedstorage:printed_silicon")
|
||||
);
|
||||
|
||||
ModelBakery.registerItemVariants(RSItems.CORE,
|
||||
new ResourceLocation("refinedstorage:construction_core"),
|
||||
new ResourceLocation("refinedstorage:destruction_core")
|
||||
new ResourceLocation("refinedstorage:construction_core"),
|
||||
new ResourceLocation("refinedstorage:destruction_core")
|
||||
);
|
||||
|
||||
ModelBakery.registerItemVariants(RSItems.UPGRADE,
|
||||
new ResourceLocation("refinedstorage:upgrade"),
|
||||
new ResourceLocation("refinedstorage:range_upgrade"),
|
||||
new ResourceLocation("refinedstorage:speed_upgrade"),
|
||||
new ResourceLocation("refinedstorage:stack_upgrade"),
|
||||
new ResourceLocation("refinedstorage:interdimensional_upgrade")
|
||||
new ResourceLocation("refinedstorage:upgrade"),
|
||||
new ResourceLocation("refinedstorage:range_upgrade"),
|
||||
new ResourceLocation("refinedstorage:speed_upgrade"),
|
||||
new ResourceLocation("refinedstorage:stack_upgrade"),
|
||||
new ResourceLocation("refinedstorage:interdimensional_upgrade")
|
||||
);
|
||||
|
||||
// Items
|
||||
|
||||
@@ -162,315 +162,315 @@ public class CommonProxy {
|
||||
|
||||
// Quartz Enriched Iron
|
||||
GameRegistry.addRecipe(new ItemStack(RSItems.QUARTZ_ENRICHED_IRON, 4),
|
||||
"II",
|
||||
"IQ",
|
||||
'I', new ItemStack(Items.IRON_INGOT),
|
||||
'Q', new ItemStack(Items.QUARTZ)
|
||||
"II",
|
||||
"IQ",
|
||||
'I', new ItemStack(Items.IRON_INGOT),
|
||||
'Q', new ItemStack(Items.QUARTZ)
|
||||
);
|
||||
|
||||
// Machine Casing
|
||||
GameRegistry.addRecipe(new ItemStack(RSBlocks.MACHINE_CASING),
|
||||
"EEE",
|
||||
"E E",
|
||||
"EEE",
|
||||
'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON)
|
||||
"EEE",
|
||||
"E E",
|
||||
"EEE",
|
||||
'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON)
|
||||
);
|
||||
|
||||
// Construction Core
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(RSItems.CORE, 1, ItemCore.TYPE_CONSTRUCTION),
|
||||
new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_BASIC),
|
||||
new ItemStack(Items.GLOWSTONE_DUST)
|
||||
new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_BASIC),
|
||||
new ItemStack(Items.GLOWSTONE_DUST)
|
||||
);
|
||||
|
||||
// Destruction Core
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(RSItems.CORE, 1, ItemCore.TYPE_DESTRUCTION),
|
||||
new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_BASIC),
|
||||
new ItemStack(Items.QUARTZ)
|
||||
new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_BASIC),
|
||||
new ItemStack(Items.QUARTZ)
|
||||
);
|
||||
|
||||
// Relay
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(RSBlocks.RELAY),
|
||||
new ItemStack(RSBlocks.MACHINE_CASING),
|
||||
new ItemStack(RSBlocks.CABLE),
|
||||
new ItemStack(Blocks.REDSTONE_TORCH)
|
||||
new ItemStack(RSBlocks.MACHINE_CASING),
|
||||
new ItemStack(RSBlocks.CABLE),
|
||||
new ItemStack(Blocks.REDSTONE_TORCH)
|
||||
);
|
||||
|
||||
// Controller
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(RSBlocks.CONTROLLER, 1, EnumControllerType.NORMAL.getId()),
|
||||
"EDE",
|
||||
"SMS",
|
||||
"ESE",
|
||||
'D', new ItemStack(Items.DIAMOND),
|
||||
'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON),
|
||||
'M', new ItemStack(RSBlocks.MACHINE_CASING),
|
||||
'S', "itemSilicon"
|
||||
"EDE",
|
||||
"SMS",
|
||||
"ESE",
|
||||
'D', new ItemStack(Items.DIAMOND),
|
||||
'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON),
|
||||
'M', new ItemStack(RSBlocks.MACHINE_CASING),
|
||||
'S', "itemSilicon"
|
||||
));
|
||||
|
||||
// Solderer
|
||||
GameRegistry.addRecipe(new ItemStack(RSBlocks.SOLDERER),
|
||||
"ESE",
|
||||
"E E",
|
||||
"ESE",
|
||||
'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON),
|
||||
'S', new ItemStack(Blocks.STICKY_PISTON)
|
||||
"ESE",
|
||||
"E E",
|
||||
"ESE",
|
||||
'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON),
|
||||
'S', new ItemStack(Blocks.STICKY_PISTON)
|
||||
);
|
||||
|
||||
// Disk Drive
|
||||
RSAPI.instance().getSoldererRegistry().addRecipe(new SoldererRecipe(
|
||||
new ItemStack(RSBlocks.DISK_DRIVE),
|
||||
500,
|
||||
new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_ADVANCED),
|
||||
new ItemStack(RSBlocks.MACHINE_CASING),
|
||||
new ItemStack(Blocks.CHEST)
|
||||
new ItemStack(RSBlocks.DISK_DRIVE),
|
||||
500,
|
||||
new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_ADVANCED),
|
||||
new ItemStack(RSBlocks.MACHINE_CASING),
|
||||
new ItemStack(Blocks.CHEST)
|
||||
));
|
||||
|
||||
// Cable
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(RSBlocks.CABLE, 12),
|
||||
"EEE",
|
||||
"GRG",
|
||||
"EEE",
|
||||
'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON),
|
||||
'G', "blockGlass",
|
||||
'R', new ItemStack(Items.REDSTONE)
|
||||
"EEE",
|
||||
"GRG",
|
||||
"EEE",
|
||||
'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON),
|
||||
'G', "blockGlass",
|
||||
'R', new ItemStack(Items.REDSTONE)
|
||||
));
|
||||
|
||||
// Wireless Transmitter
|
||||
GameRegistry.addRecipe(new ItemStack(RSBlocks.WIRELESS_TRANSMITTER),
|
||||
"EPE",
|
||||
"EME",
|
||||
"EAE",
|
||||
'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON),
|
||||
'A', new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_ADVANCED),
|
||||
'P', new ItemStack(Items.ENDER_PEARL),
|
||||
'M', new ItemStack(RSBlocks.MACHINE_CASING)
|
||||
"EPE",
|
||||
"EME",
|
||||
"EAE",
|
||||
'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON),
|
||||
'A', new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_ADVANCED),
|
||||
'P', new ItemStack(Items.ENDER_PEARL),
|
||||
'M', new ItemStack(RSBlocks.MACHINE_CASING)
|
||||
);
|
||||
|
||||
// Grid
|
||||
GameRegistry.addRecipe(new ItemStack(RSBlocks.GRID, 1, EnumGridType.NORMAL.getId()),
|
||||
"ECE",
|
||||
"PMP",
|
||||
"EDE",
|
||||
'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON),
|
||||
'P', new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_IMPROVED),
|
||||
'C', new ItemStack(RSItems.CORE, 1, ItemCore.TYPE_CONSTRUCTION),
|
||||
'D', new ItemStack(RSItems.CORE, 1, ItemCore.TYPE_DESTRUCTION),
|
||||
'M', new ItemStack(RSBlocks.MACHINE_CASING)
|
||||
"ECE",
|
||||
"PMP",
|
||||
"EDE",
|
||||
'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON),
|
||||
'P', new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_IMPROVED),
|
||||
'C', new ItemStack(RSItems.CORE, 1, ItemCore.TYPE_CONSTRUCTION),
|
||||
'D', new ItemStack(RSItems.CORE, 1, ItemCore.TYPE_DESTRUCTION),
|
||||
'M', new ItemStack(RSBlocks.MACHINE_CASING)
|
||||
);
|
||||
|
||||
// Crafting Grid
|
||||
RSAPI.instance().getSoldererRegistry().addRecipe(new SoldererRecipe(
|
||||
new ItemStack(RSBlocks.GRID, 1, EnumGridType.CRAFTING.getId()),
|
||||
500,
|
||||
new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_ADVANCED),
|
||||
new ItemStack(RSBlocks.GRID, 1, EnumGridType.NORMAL.getId()),
|
||||
new ItemStack(Blocks.CRAFTING_TABLE)
|
||||
new ItemStack(RSBlocks.GRID, 1, EnumGridType.CRAFTING.getId()),
|
||||
500,
|
||||
new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_ADVANCED),
|
||||
new ItemStack(RSBlocks.GRID, 1, EnumGridType.NORMAL.getId()),
|
||||
new ItemStack(Blocks.CRAFTING_TABLE)
|
||||
));
|
||||
|
||||
// Pattern Grid
|
||||
RSAPI.instance().getSoldererRegistry().addRecipe(new SoldererRecipe(
|
||||
new ItemStack(RSBlocks.GRID, 1, EnumGridType.PATTERN.getId()),
|
||||
500,
|
||||
new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_ADVANCED),
|
||||
new ItemStack(RSBlocks.GRID, 1, EnumGridType.NORMAL.getId()),
|
||||
new ItemStack(RSItems.PATTERN)
|
||||
new ItemStack(RSBlocks.GRID, 1, EnumGridType.PATTERN.getId()),
|
||||
500,
|
||||
new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_ADVANCED),
|
||||
new ItemStack(RSBlocks.GRID, 1, EnumGridType.NORMAL.getId()),
|
||||
new ItemStack(RSItems.PATTERN)
|
||||
));
|
||||
|
||||
// Fluid Grid
|
||||
RSAPI.instance().getSoldererRegistry().addRecipe(new SoldererRecipe(
|
||||
new ItemStack(RSBlocks.GRID, 1, EnumGridType.FLUID.getId()),
|
||||
500,
|
||||
new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_ADVANCED),
|
||||
new ItemStack(RSBlocks.GRID, 1, EnumGridType.NORMAL.getId()),
|
||||
new ItemStack(Items.BUCKET)
|
||||
new ItemStack(RSBlocks.GRID, 1, EnumGridType.FLUID.getId()),
|
||||
500,
|
||||
new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_ADVANCED),
|
||||
new ItemStack(RSBlocks.GRID, 1, EnumGridType.NORMAL.getId()),
|
||||
new ItemStack(Items.BUCKET)
|
||||
));
|
||||
|
||||
// Wireless Grid
|
||||
GameRegistry.addRecipe(new ItemStack(RSItems.WIRELESS_GRID, 1, ItemWirelessGrid.TYPE_NORMAL),
|
||||
"EPE",
|
||||
"EAE",
|
||||
"EEE",
|
||||
'P', new ItemStack(Items.ENDER_PEARL),
|
||||
'A', new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_ADVANCED),
|
||||
'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON)
|
||||
"EPE",
|
||||
"EAE",
|
||||
"EEE",
|
||||
'P', new ItemStack(Items.ENDER_PEARL),
|
||||
'A', new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_ADVANCED),
|
||||
'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON)
|
||||
);
|
||||
|
||||
// Crafter
|
||||
GameRegistry.addRecipe(new ItemStack(RSBlocks.CRAFTER),
|
||||
"ECE",
|
||||
"AMA",
|
||||
"EDE",
|
||||
'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON),
|
||||
'A', new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_ADVANCED),
|
||||
'C', new ItemStack(RSItems.CORE, 1, ItemCore.TYPE_CONSTRUCTION),
|
||||
'D', new ItemStack(RSItems.CORE, 1, ItemCore.TYPE_DESTRUCTION),
|
||||
'M', new ItemStack(RSBlocks.MACHINE_CASING)
|
||||
"ECE",
|
||||
"AMA",
|
||||
"EDE",
|
||||
'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON),
|
||||
'A', new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_ADVANCED),
|
||||
'C', new ItemStack(RSItems.CORE, 1, ItemCore.TYPE_CONSTRUCTION),
|
||||
'D', new ItemStack(RSItems.CORE, 1, ItemCore.TYPE_DESTRUCTION),
|
||||
'M', new ItemStack(RSBlocks.MACHINE_CASING)
|
||||
);
|
||||
|
||||
// Processing Pattern Encoder
|
||||
GameRegistry.addRecipe(new ItemStack(RSBlocks.PROCESSING_PATTERN_ENCODER),
|
||||
"ECE",
|
||||
"PMP",
|
||||
"EFE",
|
||||
'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON),
|
||||
'M', new ItemStack(RSBlocks.MACHINE_CASING),
|
||||
'P', new ItemStack(RSItems.PATTERN),
|
||||
'C', new ItemStack(Blocks.CRAFTING_TABLE),
|
||||
'F', new ItemStack(Blocks.FURNACE)
|
||||
"ECE",
|
||||
"PMP",
|
||||
"EFE",
|
||||
'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON),
|
||||
'M', new ItemStack(RSBlocks.MACHINE_CASING),
|
||||
'P', new ItemStack(RSItems.PATTERN),
|
||||
'C', new ItemStack(Blocks.CRAFTING_TABLE),
|
||||
'F', new ItemStack(Blocks.FURNACE)
|
||||
);
|
||||
|
||||
// External Storage
|
||||
GameRegistry.addRecipe(new ItemStack(RSBlocks.EXTERNAL_STORAGE),
|
||||
"CED",
|
||||
"HMH",
|
||||
"EPE",
|
||||
'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON),
|
||||
'H', new ItemStack(Blocks.CHEST),
|
||||
'C', new ItemStack(RSItems.CORE, 1, ItemCore.TYPE_CONSTRUCTION),
|
||||
'D', new ItemStack(RSItems.CORE, 1, ItemCore.TYPE_DESTRUCTION),
|
||||
'M', new ItemStack(RSBlocks.CABLE),
|
||||
'P', new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_IMPROVED)
|
||||
"CED",
|
||||
"HMH",
|
||||
"EPE",
|
||||
'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON),
|
||||
'H', new ItemStack(Blocks.CHEST),
|
||||
'C', new ItemStack(RSItems.CORE, 1, ItemCore.TYPE_CONSTRUCTION),
|
||||
'D', new ItemStack(RSItems.CORE, 1, ItemCore.TYPE_DESTRUCTION),
|
||||
'M', new ItemStack(RSBlocks.CABLE),
|
||||
'P', new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_IMPROVED)
|
||||
);
|
||||
|
||||
// Importer
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(RSBlocks.IMPORTER),
|
||||
new ItemStack(RSBlocks.CABLE),
|
||||
new ItemStack(RSItems.CORE, 1, ItemCore.TYPE_DESTRUCTION),
|
||||
new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_IMPROVED)
|
||||
new ItemStack(RSBlocks.CABLE),
|
||||
new ItemStack(RSItems.CORE, 1, ItemCore.TYPE_DESTRUCTION),
|
||||
new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_IMPROVED)
|
||||
);
|
||||
|
||||
// Exporter
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(RSBlocks.EXPORTER),
|
||||
new ItemStack(RSBlocks.CABLE),
|
||||
new ItemStack(RSItems.CORE, 1, ItemCore.TYPE_CONSTRUCTION),
|
||||
new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_IMPROVED)
|
||||
new ItemStack(RSBlocks.CABLE),
|
||||
new ItemStack(RSItems.CORE, 1, ItemCore.TYPE_CONSTRUCTION),
|
||||
new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_IMPROVED)
|
||||
);
|
||||
|
||||
// Destructor
|
||||
GameRegistry.addShapedRecipe(new ItemStack(RSBlocks.DESTRUCTOR),
|
||||
"EDE",
|
||||
"RMR",
|
||||
"EIE",
|
||||
'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON),
|
||||
'D', new ItemStack(RSItems.CORE, 1, ItemCore.TYPE_DESTRUCTION),
|
||||
'R', new ItemStack(Items.REDSTONE),
|
||||
'M', new ItemStack(RSBlocks.CABLE),
|
||||
'I', new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_IMPROVED)
|
||||
"EDE",
|
||||
"RMR",
|
||||
"EIE",
|
||||
'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON),
|
||||
'D', new ItemStack(RSItems.CORE, 1, ItemCore.TYPE_DESTRUCTION),
|
||||
'R', new ItemStack(Items.REDSTONE),
|
||||
'M', new ItemStack(RSBlocks.CABLE),
|
||||
'I', new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_IMPROVED)
|
||||
);
|
||||
|
||||
// Constructor
|
||||
GameRegistry.addShapedRecipe(new ItemStack(RSBlocks.CONSTRUCTOR),
|
||||
"ECE",
|
||||
"RMR",
|
||||
"EIE",
|
||||
'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON),
|
||||
'C', new ItemStack(RSItems.CORE, 1, ItemCore.TYPE_CONSTRUCTION),
|
||||
'R', new ItemStack(Items.REDSTONE),
|
||||
'M', new ItemStack(RSBlocks.CABLE),
|
||||
'I', new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_IMPROVED)
|
||||
"ECE",
|
||||
"RMR",
|
||||
"EIE",
|
||||
'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON),
|
||||
'C', new ItemStack(RSItems.CORE, 1, ItemCore.TYPE_CONSTRUCTION),
|
||||
'R', new ItemStack(Items.REDSTONE),
|
||||
'M', new ItemStack(RSBlocks.CABLE),
|
||||
'I', new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_IMPROVED)
|
||||
);
|
||||
|
||||
// Detector
|
||||
GameRegistry.addRecipe(new ItemStack(RSBlocks.DETECTOR),
|
||||
"ECE",
|
||||
"RMR",
|
||||
"EPE",
|
||||
'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON),
|
||||
'R', new ItemStack(Items.REDSTONE),
|
||||
'C', new ItemStack(Items.COMPARATOR),
|
||||
'M', new ItemStack(RSBlocks.MACHINE_CASING),
|
||||
'P', new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_IMPROVED)
|
||||
"ECE",
|
||||
"RMR",
|
||||
"EPE",
|
||||
'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON),
|
||||
'R', new ItemStack(Items.REDSTONE),
|
||||
'C', new ItemStack(Items.COMPARATOR),
|
||||
'M', new ItemStack(RSBlocks.MACHINE_CASING),
|
||||
'P', new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_IMPROVED)
|
||||
);
|
||||
|
||||
// Storage Parts
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(RSItems.STORAGE_PART, 1, ItemStoragePart.TYPE_1K),
|
||||
"SES",
|
||||
"GRG",
|
||||
"SGS",
|
||||
'R', new ItemStack(Items.REDSTONE),
|
||||
'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON),
|
||||
'S', "itemSilicon",
|
||||
'G', "blockGlass"
|
||||
"SES",
|
||||
"GRG",
|
||||
"SGS",
|
||||
'R', new ItemStack(Items.REDSTONE),
|
||||
'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON),
|
||||
'S', "itemSilicon",
|
||||
'G', "blockGlass"
|
||||
));
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(RSItems.STORAGE_PART, 1, ItemStoragePart.TYPE_4K),
|
||||
"PEP",
|
||||
"SRS",
|
||||
"PSP",
|
||||
'R', new ItemStack(Items.REDSTONE),
|
||||
'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON),
|
||||
'P', new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_BASIC),
|
||||
'S', new ItemStack(RSItems.STORAGE_PART, 1, ItemStoragePart.TYPE_1K)
|
||||
"PEP",
|
||||
"SRS",
|
||||
"PSP",
|
||||
'R', new ItemStack(Items.REDSTONE),
|
||||
'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON),
|
||||
'P', new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_BASIC),
|
||||
'S', new ItemStack(RSItems.STORAGE_PART, 1, ItemStoragePart.TYPE_1K)
|
||||
);
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(RSItems.STORAGE_PART, 1, ItemStoragePart.TYPE_16K),
|
||||
"PEP",
|
||||
"SRS",
|
||||
"PSP",
|
||||
'R', new ItemStack(Items.REDSTONE),
|
||||
'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON),
|
||||
'P', new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_IMPROVED),
|
||||
'S', new ItemStack(RSItems.STORAGE_PART, 1, ItemStoragePart.TYPE_4K)
|
||||
"PEP",
|
||||
"SRS",
|
||||
"PSP",
|
||||
'R', new ItemStack(Items.REDSTONE),
|
||||
'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON),
|
||||
'P', new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_IMPROVED),
|
||||
'S', new ItemStack(RSItems.STORAGE_PART, 1, ItemStoragePart.TYPE_4K)
|
||||
);
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(RSItems.STORAGE_PART, 1, ItemStoragePart.TYPE_64K),
|
||||
"PEP",
|
||||
"SRS",
|
||||
"PSP",
|
||||
'R', new ItemStack(Items.REDSTONE),
|
||||
'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON),
|
||||
'P', new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_ADVANCED),
|
||||
'S', new ItemStack(RSItems.STORAGE_PART, 1, ItemStoragePart.TYPE_16K)
|
||||
"PEP",
|
||||
"SRS",
|
||||
"PSP",
|
||||
'R', new ItemStack(Items.REDSTONE),
|
||||
'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON),
|
||||
'P', new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_ADVANCED),
|
||||
'S', new ItemStack(RSItems.STORAGE_PART, 1, ItemStoragePart.TYPE_16K)
|
||||
);
|
||||
|
||||
// Fluid Storage Parts
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(RSItems.FLUID_STORAGE_PART, 1, ItemFluidStoragePart.TYPE_64K),
|
||||
"SES",
|
||||
"GRG",
|
||||
"SGS",
|
||||
'R', new ItemStack(Items.BUCKET),
|
||||
'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON),
|
||||
'S', "itemSilicon",
|
||||
'G', "blockGlass"
|
||||
"SES",
|
||||
"GRG",
|
||||
"SGS",
|
||||
'R', new ItemStack(Items.BUCKET),
|
||||
'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON),
|
||||
'S', "itemSilicon",
|
||||
'G', "blockGlass"
|
||||
));
|
||||
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(RSItems.FLUID_STORAGE_PART, 1, ItemFluidStoragePart.TYPE_128K),
|
||||
"PEP",
|
||||
"SRS",
|
||||
"PSP",
|
||||
'R', new ItemStack(Items.BUCKET),
|
||||
'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON),
|
||||
'P', new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_BASIC),
|
||||
'S', new ItemStack(RSItems.FLUID_STORAGE_PART, 1, ItemFluidStoragePart.TYPE_64K)
|
||||
"PEP",
|
||||
"SRS",
|
||||
"PSP",
|
||||
'R', new ItemStack(Items.BUCKET),
|
||||
'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON),
|
||||
'P', new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_BASIC),
|
||||
'S', new ItemStack(RSItems.FLUID_STORAGE_PART, 1, ItemFluidStoragePart.TYPE_64K)
|
||||
));
|
||||
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(RSItems.FLUID_STORAGE_PART, 1, ItemFluidStoragePart.TYPE_256K),
|
||||
"PEP",
|
||||
"SRS",
|
||||
"PSP",
|
||||
'R', new ItemStack(Items.BUCKET),
|
||||
'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON),
|
||||
'P', new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_IMPROVED),
|
||||
'S', new ItemStack(RSItems.FLUID_STORAGE_PART, 1, ItemFluidStoragePart.TYPE_128K)
|
||||
"PEP",
|
||||
"SRS",
|
||||
"PSP",
|
||||
'R', new ItemStack(Items.BUCKET),
|
||||
'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON),
|
||||
'P', new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_IMPROVED),
|
||||
'S', new ItemStack(RSItems.FLUID_STORAGE_PART, 1, ItemFluidStoragePart.TYPE_128K)
|
||||
));
|
||||
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(RSItems.FLUID_STORAGE_PART, 1, ItemFluidStoragePart.TYPE_512K),
|
||||
"PEP",
|
||||
"SRS",
|
||||
"PSP",
|
||||
'R', new ItemStack(Items.BUCKET),
|
||||
'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON),
|
||||
'P', new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_ADVANCED),
|
||||
'S', new ItemStack(RSItems.FLUID_STORAGE_PART, 1, ItemFluidStoragePart.TYPE_256K)
|
||||
"PEP",
|
||||
"SRS",
|
||||
"PSP",
|
||||
'R', new ItemStack(Items.BUCKET),
|
||||
'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON),
|
||||
'P', new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_ADVANCED),
|
||||
'S', new ItemStack(RSItems.FLUID_STORAGE_PART, 1, ItemFluidStoragePart.TYPE_256K)
|
||||
));
|
||||
|
||||
// Storage Housing
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(ItemStorageNBT.createStackWithNBT(new ItemStack(RSItems.STORAGE_HOUSING)),
|
||||
"GRG",
|
||||
"R R",
|
||||
"EEE",
|
||||
'G', "blockGlass",
|
||||
'R', new ItemStack(Items.REDSTONE),
|
||||
'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON)
|
||||
"GRG",
|
||||
"R R",
|
||||
"EEE",
|
||||
'G', "blockGlass",
|
||||
'R', new ItemStack(Items.REDSTONE),
|
||||
'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON)
|
||||
));
|
||||
|
||||
// Storage Disks
|
||||
@@ -478,18 +478,18 @@ public class CommonProxy {
|
||||
ItemStack disk = ItemStorageNBT.createStackWithNBT(new ItemStack(RSItems.STORAGE_DISK, 1, type));
|
||||
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(disk,
|
||||
"GRG",
|
||||
"RPR",
|
||||
"EEE",
|
||||
'G', "blockGlass",
|
||||
'R', new ItemStack(Items.REDSTONE),
|
||||
'P', new ItemStack(RSItems.STORAGE_PART, 1, type),
|
||||
'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON)
|
||||
"GRG",
|
||||
"RPR",
|
||||
"EEE",
|
||||
'G', "blockGlass",
|
||||
'R', new ItemStack(Items.REDSTONE),
|
||||
'P', new ItemStack(RSItems.STORAGE_PART, 1, type),
|
||||
'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON)
|
||||
));
|
||||
|
||||
GameRegistry.addShapelessRecipe(disk,
|
||||
new ItemStack(RSItems.STORAGE_HOUSING),
|
||||
new ItemStack(RSItems.STORAGE_PART, 1, type)
|
||||
new ItemStack(RSItems.STORAGE_HOUSING),
|
||||
new ItemStack(RSItems.STORAGE_PART, 1, type)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -498,39 +498,39 @@ public class CommonProxy {
|
||||
ItemStack disk = FluidStorageNBT.createStackWithNBT(new ItemStack(RSItems.FLUID_STORAGE_DISK, 1, type));
|
||||
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(disk,
|
||||
"GRG",
|
||||
"RPR",
|
||||
"EEE",
|
||||
'G', "blockGlass",
|
||||
'R', new ItemStack(Items.REDSTONE),
|
||||
'P', new ItemStack(RSItems.FLUID_STORAGE_PART, 1, type),
|
||||
'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON)
|
||||
"GRG",
|
||||
"RPR",
|
||||
"EEE",
|
||||
'G', "blockGlass",
|
||||
'R', new ItemStack(Items.REDSTONE),
|
||||
'P', new ItemStack(RSItems.FLUID_STORAGE_PART, 1, type),
|
||||
'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON)
|
||||
));
|
||||
|
||||
GameRegistry.addShapelessRecipe(disk,
|
||||
new ItemStack(RSItems.STORAGE_HOUSING),
|
||||
new ItemStack(RSItems.FLUID_STORAGE_PART, 1, type)
|
||||
new ItemStack(RSItems.STORAGE_HOUSING),
|
||||
new ItemStack(RSItems.FLUID_STORAGE_PART, 1, type)
|
||||
);
|
||||
}
|
||||
|
||||
// Pattern
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(RSItems.PATTERN),
|
||||
"GRG",
|
||||
"RGR",
|
||||
"EEE",
|
||||
'G', "blockGlass",
|
||||
'R', new ItemStack(Items.REDSTONE),
|
||||
'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON)
|
||||
"GRG",
|
||||
"RGR",
|
||||
"EEE",
|
||||
'G', "blockGlass",
|
||||
'R', new ItemStack(Items.REDSTONE),
|
||||
'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON)
|
||||
));
|
||||
|
||||
// Upgrade
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(RSItems.UPGRADE, 1, 0),
|
||||
"EGE",
|
||||
"EPE",
|
||||
"EGE",
|
||||
'G', "blockGlass",
|
||||
'P', new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_IMPROVED),
|
||||
'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON)
|
||||
"EGE",
|
||||
"EPE",
|
||||
"EGE",
|
||||
'G', "blockGlass",
|
||||
'P', new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_IMPROVED),
|
||||
'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON)
|
||||
));
|
||||
|
||||
RSAPI.instance().getSoldererRegistry().addRecipe(new SoldererRecipeUpgrade(ItemUpgrade.TYPE_RANGE));
|
||||
@@ -539,11 +539,11 @@ public class CommonProxy {
|
||||
RSAPI.instance().getSoldererRegistry().addRecipe(new SoldererRecipeUpgrade(ItemUpgrade.TYPE_CRAFTING));
|
||||
|
||||
GameRegistry.addShapedRecipe(new ItemStack(RSItems.UPGRADE, 1, ItemUpgrade.TYPE_STACK),
|
||||
"USU",
|
||||
"SUS",
|
||||
"USU",
|
||||
'U', new ItemStack(Items.SUGAR),
|
||||
'S', new ItemStack(RSItems.UPGRADE, 1, ItemUpgrade.TYPE_SPEED)
|
||||
"USU",
|
||||
"SUS",
|
||||
"USU",
|
||||
'U', new ItemStack(Items.SUGAR),
|
||||
'S', new ItemStack(RSItems.UPGRADE, 1, ItemUpgrade.TYPE_SPEED)
|
||||
);
|
||||
|
||||
// Storage Blocks
|
||||
@@ -560,87 +560,87 @@ public class CommonProxy {
|
||||
|
||||
// Crafting Monitor
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(RSBlocks.CRAFTING_MONITOR),
|
||||
"EGE",
|
||||
"GMG",
|
||||
"EPE",
|
||||
'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON),
|
||||
'M', new ItemStack(RSBlocks.MACHINE_CASING),
|
||||
'G', "blockGlass",
|
||||
'P', new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_IMPROVED)
|
||||
"EGE",
|
||||
"GMG",
|
||||
"EPE",
|
||||
'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON),
|
||||
'M', new ItemStack(RSBlocks.MACHINE_CASING),
|
||||
'G', "blockGlass",
|
||||
'P', new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_IMPROVED)
|
||||
));
|
||||
|
||||
// Interface
|
||||
RSAPI.instance().getSoldererRegistry().addRecipe(new SoldererRecipe(
|
||||
new ItemStack(RSBlocks.INTERFACE),
|
||||
200,
|
||||
new ItemStack(RSBlocks.IMPORTER),
|
||||
new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_BASIC),
|
||||
new ItemStack(RSBlocks.EXPORTER)
|
||||
new ItemStack(RSBlocks.INTERFACE),
|
||||
200,
|
||||
new ItemStack(RSBlocks.IMPORTER),
|
||||
new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_BASIC),
|
||||
new ItemStack(RSBlocks.EXPORTER)
|
||||
));
|
||||
|
||||
// Fluid Interface
|
||||
RSAPI.instance().getSoldererRegistry().addRecipe(new SoldererRecipe(
|
||||
new ItemStack(RSBlocks.FLUID_INTERFACE),
|
||||
200,
|
||||
new ItemStack(Items.BUCKET),
|
||||
new ItemStack(RSBlocks.INTERFACE),
|
||||
new ItemStack(Items.BUCKET)
|
||||
new ItemStack(RSBlocks.FLUID_INTERFACE),
|
||||
200,
|
||||
new ItemStack(Items.BUCKET),
|
||||
new ItemStack(RSBlocks.INTERFACE),
|
||||
new ItemStack(Items.BUCKET)
|
||||
));
|
||||
|
||||
// Grid Filter
|
||||
GameRegistry.addShapedRecipe(new ItemStack(RSItems.GRID_FILTER),
|
||||
"EPE",
|
||||
"PHP",
|
||||
"EPE",
|
||||
'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON),
|
||||
'P', new ItemStack(Items.PAPER),
|
||||
'H', new ItemStack(Blocks.HOPPER)
|
||||
"EPE",
|
||||
"PHP",
|
||||
"EPE",
|
||||
'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON),
|
||||
'P', new ItemStack(Items.PAPER),
|
||||
'H', new ItemStack(Blocks.HOPPER)
|
||||
);
|
||||
|
||||
// Network Card
|
||||
GameRegistry.addShapedRecipe(new ItemStack(RSItems.NETWORK_CARD),
|
||||
"EEE",
|
||||
"PAP",
|
||||
"EEE",
|
||||
'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON),
|
||||
'P', new ItemStack(Items.PAPER),
|
||||
'A', new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_ADVANCED)
|
||||
"EEE",
|
||||
"PAP",
|
||||
"EEE",
|
||||
'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON),
|
||||
'P', new ItemStack(Items.PAPER),
|
||||
'A', new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_ADVANCED)
|
||||
);
|
||||
|
||||
// Network Transmitter
|
||||
GameRegistry.addShapedRecipe(new ItemStack(RSBlocks.NETWORK_TRANSMITTER),
|
||||
"EEE",
|
||||
"CMD",
|
||||
"AAA",
|
||||
'E', new ItemStack(Items.ENDER_PEARL),
|
||||
'C', new ItemStack(RSItems.CORE, 1, ItemCore.TYPE_CONSTRUCTION),
|
||||
'M', new ItemStack(RSBlocks.MACHINE_CASING),
|
||||
'D', new ItemStack(RSItems.CORE, 1, ItemCore.TYPE_DESTRUCTION),
|
||||
'A', new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_ADVANCED)
|
||||
"EEE",
|
||||
"CMD",
|
||||
"AAA",
|
||||
'E', new ItemStack(Items.ENDER_PEARL),
|
||||
'C', new ItemStack(RSItems.CORE, 1, ItemCore.TYPE_CONSTRUCTION),
|
||||
'M', new ItemStack(RSBlocks.MACHINE_CASING),
|
||||
'D', new ItemStack(RSItems.CORE, 1, ItemCore.TYPE_DESTRUCTION),
|
||||
'A', new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_ADVANCED)
|
||||
);
|
||||
|
||||
// Network Receiver
|
||||
GameRegistry.addShapedRecipe(new ItemStack(RSBlocks.NETWORK_RECEIVER),
|
||||
"AAA",
|
||||
"CMD",
|
||||
"EEE",
|
||||
'E', new ItemStack(Items.ENDER_PEARL),
|
||||
'C', new ItemStack(RSItems.CORE, 1, ItemCore.TYPE_CONSTRUCTION),
|
||||
'M', new ItemStack(RSBlocks.MACHINE_CASING),
|
||||
'D', new ItemStack(RSItems.CORE, 1, ItemCore.TYPE_DESTRUCTION),
|
||||
'A', new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_ADVANCED)
|
||||
"AAA",
|
||||
"CMD",
|
||||
"EEE",
|
||||
'E', new ItemStack(Items.ENDER_PEARL),
|
||||
'C', new ItemStack(RSItems.CORE, 1, ItemCore.TYPE_CONSTRUCTION),
|
||||
'M', new ItemStack(RSBlocks.MACHINE_CASING),
|
||||
'D', new ItemStack(RSItems.CORE, 1, ItemCore.TYPE_DESTRUCTION),
|
||||
'A', new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_ADVANCED)
|
||||
);
|
||||
|
||||
// Disk Manipulator
|
||||
GameRegistry.addShapedRecipe(new ItemStack(RSBlocks.DISK_MANIPULATOR),
|
||||
"ESE",
|
||||
"CMD",
|
||||
"ESE",
|
||||
'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON),
|
||||
'S', new ItemStack(RSItems.STORAGE_HOUSING),
|
||||
'C', new ItemStack(RSItems.CORE, 1, ItemCore.TYPE_CONSTRUCTION),
|
||||
'M', new ItemStack(RSBlocks.MACHINE_CASING),
|
||||
'D', new ItemStack(RSItems.CORE, 1, ItemCore.TYPE_DESTRUCTION)
|
||||
"ESE",
|
||||
"CMD",
|
||||
"ESE",
|
||||
'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON),
|
||||
'S', new ItemStack(RSItems.STORAGE_HOUSING),
|
||||
'C', new ItemStack(RSItems.CORE, 1, ItemCore.TYPE_CONSTRUCTION),
|
||||
'M', new ItemStack(RSBlocks.MACHINE_CASING),
|
||||
'D', new ItemStack(RSItems.CORE, 1, ItemCore.TYPE_DESTRUCTION)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package refinedstorage.tile;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import refinedstorage.api.storage.CompareUtils;
|
||||
import refinedstorage.api.RSAPI;
|
||||
|
||||
public class ClientNode {
|
||||
private ItemStack stack;
|
||||
@@ -40,7 +40,7 @@ public class ClientNode {
|
||||
return false;
|
||||
}
|
||||
|
||||
return energyUsage == ((ClientNode) other).energyUsage && CompareUtils.compareStack(stack, ((ClientNode) other).stack);
|
||||
return energyUsage == ((ClientNode) other).energyUsage && RSAPI.instance().getComparer().isEqual(stack, ((ClientNode) other).stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -17,7 +17,7 @@ import net.minecraftforge.items.CapabilityItemHandler;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
import refinedstorage.RS;
|
||||
import refinedstorage.api.network.NetworkUtils;
|
||||
import refinedstorage.api.storage.CompareUtils;
|
||||
import refinedstorage.api.util.IComparer;
|
||||
import refinedstorage.container.slot.SlotSpecimen;
|
||||
import refinedstorage.inventory.ItemHandlerBasic;
|
||||
import refinedstorage.inventory.ItemHandlerFluid;
|
||||
@@ -49,7 +49,7 @@ public class TileConstructor extends TileMultipartNode implements IComparable, I
|
||||
|
||||
private ItemHandlerUpgrade upgrades = new ItemHandlerUpgrade(4, this, ItemUpgrade.TYPE_SPEED, ItemUpgrade.TYPE_CRAFTING);
|
||||
|
||||
private int compare = CompareUtils.COMPARE_NBT | CompareUtils.COMPARE_DAMAGE;
|
||||
private int compare = IComparer.COMPARE_NBT | IComparer.COMPARE_DAMAGE;
|
||||
private int type = IType.ITEMS;
|
||||
|
||||
private IBlockState block;
|
||||
|
||||
@@ -20,6 +20,7 @@ import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.items.ItemHandlerHelper;
|
||||
import refinedstorage.RS;
|
||||
import refinedstorage.RSBlocks;
|
||||
import refinedstorage.api.RSAPI;
|
||||
import refinedstorage.api.autocrafting.ICraftingPattern;
|
||||
import refinedstorage.api.autocrafting.ICraftingPatternContainer;
|
||||
import refinedstorage.api.autocrafting.task.ICraftingTask;
|
||||
@@ -27,11 +28,11 @@ import refinedstorage.api.autocrafting.task.IProcessable;
|
||||
import refinedstorage.api.network.*;
|
||||
import refinedstorage.api.network.grid.IFluidGridHandler;
|
||||
import refinedstorage.api.network.grid.IItemGridHandler;
|
||||
import refinedstorage.api.storage.CompareUtils;
|
||||
import refinedstorage.api.storage.fluid.IFluidStorage;
|
||||
import refinedstorage.api.storage.fluid.IGroupedFluidStorage;
|
||||
import refinedstorage.api.storage.item.IGroupedItemStorage;
|
||||
import refinedstorage.api.storage.item.IItemStorage;
|
||||
import refinedstorage.api.util.IComparer;
|
||||
import refinedstorage.apiimpl.network.NetworkNodeGraph;
|
||||
import refinedstorage.apiimpl.network.WirelessGridHandler;
|
||||
import refinedstorage.apiimpl.network.grid.FluidGridHandler;
|
||||
@@ -101,9 +102,9 @@ public class TileController extends TileBase implements INetworkMaster, IEnergyR
|
||||
IBlockState state = tile.worldObj.getBlockState(node.getPosition());
|
||||
|
||||
ClientNode clientNode = new ClientNode(
|
||||
new ItemStack(state.getBlock(), 1, state.getBlock().getMetaFromState(state)),
|
||||
1,
|
||||
node.getEnergyUsage()
|
||||
new ItemStack(state.getBlock(), 1, state.getBlock().getMetaFromState(state)),
|
||||
1,
|
||||
node.getEnergyUsage()
|
||||
);
|
||||
|
||||
if (clientNode.getStack().getItem() != null) {
|
||||
@@ -401,7 +402,7 @@ public class TileController extends TileBase implements INetworkMaster, IEnergyR
|
||||
|
||||
for (ICraftingPattern craftingPattern : getPatterns()) {
|
||||
for (ItemStack output : craftingPattern.getOutputs()) {
|
||||
if (CompareUtils.compareStack(output, pattern, flags)) {
|
||||
if (RSAPI.instance().getComparer().isEqual(output, pattern, flags)) {
|
||||
patterns.add(craftingPattern);
|
||||
}
|
||||
}
|
||||
@@ -427,7 +428,7 @@ public class TileController extends TileBase implements INetworkMaster, IEnergyR
|
||||
int score = 0;
|
||||
|
||||
for (ItemStack input : patterns.get(i).getInputs()) {
|
||||
ItemStack stored = itemStorage.getList().get(input, CompareUtils.COMPARE_DAMAGE | CompareUtils.COMPARE_NBT);
|
||||
ItemStack stored = itemStorage.getList().get(input, IComparer.COMPARE_DAMAGE | IComparer.COMPARE_NBT);
|
||||
|
||||
score += stored != null ? stored.stackSize : 0;
|
||||
}
|
||||
@@ -457,8 +458,8 @@ public class TileController extends TileBase implements INetworkMaster, IEnergyR
|
||||
@Override
|
||||
public void sendItemStorageToClient() {
|
||||
worldObj.getMinecraftServer().getPlayerList().getPlayerList().stream()
|
||||
.filter(player -> isWatchingGrid(player, EnumGridType.NORMAL, EnumGridType.CRAFTING, EnumGridType.PATTERN))
|
||||
.forEach(this::sendItemStorageToClient);
|
||||
.filter(player -> isWatchingGrid(player, EnumGridType.NORMAL, EnumGridType.CRAFTING, EnumGridType.PATTERN))
|
||||
.forEach(this::sendItemStorageToClient);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -469,15 +470,15 @@ public class TileController extends TileBase implements INetworkMaster, IEnergyR
|
||||
@Override
|
||||
public void sendItemStorageDeltaToClient(ItemStack stack, int delta) {
|
||||
worldObj.getMinecraftServer().getPlayerList().getPlayerList().stream()
|
||||
.filter(player -> isWatchingGrid(player, EnumGridType.NORMAL, EnumGridType.CRAFTING, EnumGridType.PATTERN))
|
||||
.forEach(player -> RS.INSTANCE.network.sendTo(new MessageGridItemDelta(this, stack, delta), player));
|
||||
.filter(player -> isWatchingGrid(player, EnumGridType.NORMAL, EnumGridType.CRAFTING, EnumGridType.PATTERN))
|
||||
.forEach(player -> RS.INSTANCE.network.sendTo(new MessageGridItemDelta(this, stack, delta), player));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendFluidStorageToClient() {
|
||||
worldObj.getMinecraftServer().getPlayerList().getPlayerList().stream()
|
||||
.filter(player -> isWatchingGrid(player, EnumGridType.FLUID))
|
||||
.forEach(this::sendFluidStorageToClient);
|
||||
.filter(player -> isWatchingGrid(player, EnumGridType.FLUID))
|
||||
.forEach(this::sendFluidStorageToClient);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -488,8 +489,8 @@ public class TileController extends TileBase implements INetworkMaster, IEnergyR
|
||||
@Override
|
||||
public void sendFluidStorageDeltaToClient(FluidStack stack, int delta) {
|
||||
worldObj.getMinecraftServer().getPlayerList().getPlayerList().stream()
|
||||
.filter(player -> isWatchingGrid(player, EnumGridType.FLUID))
|
||||
.forEach(player -> RS.INSTANCE.network.sendTo(new MessageGridFluidDelta(stack, delta), player));
|
||||
.filter(player -> isWatchingGrid(player, EnumGridType.FLUID))
|
||||
.forEach(player -> RS.INSTANCE.network.sendTo(new MessageGridFluidDelta(stack, delta), player));
|
||||
}
|
||||
|
||||
private boolean isWatchingGrid(EntityPlayer player, EnumGridType... types) {
|
||||
@@ -798,7 +799,7 @@ public class TileController extends TileBase implements INetworkMaster, IEnergyR
|
||||
@Override
|
||||
public boolean hasCapability(Capability<?> capability, EnumFacing facing) {
|
||||
return capability == CapabilityEnergy.ENERGY
|
||||
|| (energyTesla != null && (capability == TeslaCapabilities.CAPABILITY_HOLDER || capability == TeslaCapabilities.CAPABILITY_CONSUMER))
|
||||
|| super.hasCapability(capability, facing);
|
||||
|| (energyTesla != null && (capability == TeslaCapabilities.CAPABILITY_HOLDER || capability == TeslaCapabilities.CAPABILITY_CONSUMER))
|
||||
|| super.hasCapability(capability, facing);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ import refinedstorage.api.autocrafting.ICraftingPatternContainer;
|
||||
import refinedstorage.api.autocrafting.ICraftingPatternProvider;
|
||||
import refinedstorage.api.network.INetworkMaster;
|
||||
import refinedstorage.api.network.NetworkUtils;
|
||||
import refinedstorage.api.storage.CompareUtils;
|
||||
import refinedstorage.api.util.IComparer;
|
||||
import refinedstorage.inventory.ItemHandlerBasic;
|
||||
import refinedstorage.inventory.ItemHandlerUpgrade;
|
||||
import refinedstorage.item.ItemUpgrade;
|
||||
@@ -110,7 +110,7 @@ public class TileCrafter extends TileNode implements ICraftingPatternContainer {
|
||||
if (triggeredAutocrafting && worldObj.isBlockPowered(pos)) {
|
||||
for (ICraftingPattern pattern : actualPatterns) {
|
||||
for (ItemStack output : pattern.getOutputs()) {
|
||||
NetworkUtils.scheduleCraftingTaskIfUnscheduled(network, output, 1, CompareUtils.COMPARE_DAMAGE | CompareUtils.COMPARE_NBT);
|
||||
NetworkUtils.scheduleCraftingTaskIfUnscheduled(network, output, 1, IComparer.COMPARE_DAMAGE | IComparer.COMPARE_NBT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ import net.minecraftforge.fluids.capability.wrappers.FluidBlockWrapper;
|
||||
import net.minecraftforge.items.CapabilityItemHandler;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
import refinedstorage.RS;
|
||||
import refinedstorage.api.storage.CompareUtils;
|
||||
import refinedstorage.api.util.IComparer;
|
||||
import refinedstorage.inventory.ItemHandlerBasic;
|
||||
import refinedstorage.inventory.ItemHandlerFluid;
|
||||
import refinedstorage.inventory.ItemHandlerUpgrade;
|
||||
@@ -47,7 +47,7 @@ public class TileDestructor extends TileMultipartNode implements IComparable, IF
|
||||
|
||||
private ItemHandlerUpgrade upgrades = new ItemHandlerUpgrade(4, this, ItemUpgrade.TYPE_SPEED);
|
||||
|
||||
private int compare = CompareUtils.COMPARE_NBT | CompareUtils.COMPARE_DAMAGE;
|
||||
private int compare = IComparer.COMPARE_NBT | IComparer.COMPARE_DAMAGE;
|
||||
private int mode = IFilterable.WHITELIST;
|
||||
private int type = IType.ITEMS;
|
||||
|
||||
@@ -74,7 +74,7 @@ public class TileDestructor extends TileMultipartNode implements IComparable, IF
|
||||
BlockPos front = pos.offset(getDirection());
|
||||
|
||||
IBlockState frontBlockState = worldObj.getBlockState(front);
|
||||
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
ItemStack frontStack = frontBlockState.getBlock().getItem(worldObj, front, frontBlockState);
|
||||
|
||||
|
||||
@@ -11,9 +11,10 @@ import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
import refinedstorage.RS;
|
||||
import refinedstorage.RSBlocks;
|
||||
import refinedstorage.api.RSAPI;
|
||||
import refinedstorage.api.autocrafting.task.ICraftingTask;
|
||||
import refinedstorage.api.network.INetworkMaster;
|
||||
import refinedstorage.api.storage.CompareUtils;
|
||||
import refinedstorage.api.util.IComparer;
|
||||
import refinedstorage.gui.GuiDetector;
|
||||
import refinedstorage.inventory.ItemHandlerBasic;
|
||||
import refinedstorage.inventory.ItemHandlerFluid;
|
||||
@@ -82,7 +83,7 @@ public class TileDetector extends TileNode implements IComparable, IType {
|
||||
private ItemHandlerBasic itemFilters = new ItemHandlerBasic(1, this);
|
||||
private ItemHandlerFluid fluidFilters = new ItemHandlerFluid(1, this);
|
||||
|
||||
private int compare = CompareUtils.COMPARE_NBT | CompareUtils.COMPARE_DAMAGE;
|
||||
private int compare = IComparer.COMPARE_NBT | IComparer.COMPARE_DAMAGE;
|
||||
private int type = IType.ITEMS;
|
||||
private int mode = MODE_EQUAL;
|
||||
private int amount = 0;
|
||||
@@ -114,7 +115,7 @@ public class TileDetector extends TileNode implements IComparable, IType {
|
||||
|
||||
for (ICraftingTask task : network.getCraftingTasks()) {
|
||||
for (ItemStack output : task.getPattern().getOutputs()) {
|
||||
if (CompareUtils.compareStackNoQuantity(slot, output)) {
|
||||
if (RSAPI.instance().getComparer().isEqualNoQuantity(slot, output)) {
|
||||
found = true;
|
||||
|
||||
break;
|
||||
|
||||
@@ -13,11 +13,11 @@ import net.minecraftforge.items.ItemHandlerHelper;
|
||||
import refinedstorage.RS;
|
||||
import refinedstorage.RSItems;
|
||||
import refinedstorage.api.network.INetworkMaster;
|
||||
import refinedstorage.api.storage.CompareUtils;
|
||||
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.api.util.IComparer;
|
||||
import refinedstorage.apiimpl.storage.NBTStorage;
|
||||
import refinedstorage.apiimpl.storage.fluid.FluidStorageNBT;
|
||||
import refinedstorage.apiimpl.storage.fluid.FluidUtils;
|
||||
@@ -128,7 +128,7 @@ public class TileDiskDrive extends TileNode implements IItemStorageProvider, IFl
|
||||
private FluidStorage fluidStorages[] = new FluidStorage[8];
|
||||
|
||||
private int priority = 0;
|
||||
private int compare = CompareUtils.COMPARE_NBT | CompareUtils.COMPARE_DAMAGE;
|
||||
private int compare = IComparer.COMPARE_NBT | IComparer.COMPARE_DAMAGE;
|
||||
private int mode = IFilterable.WHITELIST;
|
||||
private int type = IType.ITEMS;
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ import net.minecraftforge.items.CapabilityItemHandler;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
import net.minecraftforge.items.ItemHandlerHelper;
|
||||
import refinedstorage.RS;
|
||||
import refinedstorage.api.storage.CompareUtils;
|
||||
import refinedstorage.api.util.IComparer;
|
||||
import refinedstorage.apiimpl.storage.NBTStorage;
|
||||
import refinedstorage.apiimpl.storage.fluid.FluidStorageNBT;
|
||||
import refinedstorage.apiimpl.storage.fluid.FluidUtils;
|
||||
@@ -59,7 +59,7 @@ public class TileDiskManipulator extends TileNode implements IComparable, IFilte
|
||||
private static final String NBT_TYPE = "Type";
|
||||
private static final String NBT_IO_MODE = "IOMode";
|
||||
|
||||
private int compare = CompareUtils.COMPARE_NBT | CompareUtils.COMPARE_DAMAGE;
|
||||
private int compare = IComparer.COMPARE_NBT | IComparer.COMPARE_DAMAGE;
|
||||
private int mode = IFilterable.WHITELIST;
|
||||
private int type = IType.ITEMS;
|
||||
private int ioMode = IO_MODE_INSERT;
|
||||
|
||||
@@ -13,7 +13,7 @@ import net.minecraftforge.items.IItemHandler;
|
||||
import net.minecraftforge.items.ItemHandlerHelper;
|
||||
import refinedstorage.RS;
|
||||
import refinedstorage.api.network.NetworkUtils;
|
||||
import refinedstorage.api.storage.CompareUtils;
|
||||
import refinedstorage.api.util.IComparer;
|
||||
import refinedstorage.inventory.ItemHandlerBasic;
|
||||
import refinedstorage.inventory.ItemHandlerFluid;
|
||||
import refinedstorage.inventory.ItemHandlerUpgrade;
|
||||
@@ -34,7 +34,7 @@ public class TileExporter extends TileMultipartNode implements IComparable, ITyp
|
||||
|
||||
private ItemHandlerUpgrade upgrades = new ItemHandlerUpgrade(4, this, ItemUpgrade.TYPE_SPEED, ItemUpgrade.TYPE_CRAFTING, ItemUpgrade.TYPE_STACK);
|
||||
|
||||
private int compare = CompareUtils.COMPARE_NBT | CompareUtils.COMPARE_DAMAGE;
|
||||
private int compare = IComparer.COMPARE_NBT | IComparer.COMPARE_DAMAGE;
|
||||
private int type = IType.ITEMS;
|
||||
|
||||
public TileExporter() {
|
||||
|
||||
@@ -9,7 +9,7 @@ import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTank;
|
||||
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
|
||||
import refinedstorage.RS;
|
||||
import refinedstorage.api.storage.CompareUtils;
|
||||
import refinedstorage.api.util.IComparer;
|
||||
import refinedstorage.apiimpl.storage.fluid.FluidUtils;
|
||||
import refinedstorage.inventory.ItemHandlerBasic;
|
||||
import refinedstorage.inventory.ItemHandlerFluid;
|
||||
@@ -43,7 +43,7 @@ public class TileFluidInterface extends TileNode implements IComparable {
|
||||
private static final String NBT_TANK_IN = "TankIn";
|
||||
private static final String NBT_TANK_OUT = "TankOut";
|
||||
|
||||
private int compare = CompareUtils.COMPARE_NBT;
|
||||
private int compare = IComparer.COMPARE_NBT;
|
||||
|
||||
private FluidTank tankIn = new FluidTank(TANK_CAPACITY) {
|
||||
@Override
|
||||
|
||||
@@ -6,9 +6,9 @@ import net.minecraftforge.fluids.FluidStack;
|
||||
import refinedstorage.RS;
|
||||
import refinedstorage.RSBlocks;
|
||||
import refinedstorage.api.network.INetworkMaster;
|
||||
import refinedstorage.api.storage.CompareUtils;
|
||||
import refinedstorage.api.storage.fluid.IFluidStorage;
|
||||
import refinedstorage.api.storage.fluid.IFluidStorageProvider;
|
||||
import refinedstorage.api.util.IComparer;
|
||||
import refinedstorage.apiimpl.storage.fluid.FluidStorageNBT;
|
||||
import refinedstorage.apiimpl.storage.fluid.FluidUtils;
|
||||
import refinedstorage.block.BlockFluidStorage;
|
||||
@@ -68,7 +68,7 @@ public class TileFluidStorage extends TileNode implements IFluidStorageProvider,
|
||||
private EnumFluidStorageType type;
|
||||
|
||||
private int priority = 0;
|
||||
private int compare = CompareUtils.COMPARE_NBT;
|
||||
private int compare = IComparer.COMPARE_NBT;
|
||||
private int mode = IFilterable.WHITELIST;
|
||||
|
||||
public TileFluidStorage() {
|
||||
|
||||
@@ -11,7 +11,7 @@ import net.minecraftforge.fluids.capability.IFluidHandler;
|
||||
import net.minecraftforge.items.CapabilityItemHandler;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
import refinedstorage.RS;
|
||||
import refinedstorage.api.storage.CompareUtils;
|
||||
import refinedstorage.api.util.IComparer;
|
||||
import refinedstorage.inventory.ItemHandlerBasic;
|
||||
import refinedstorage.inventory.ItemHandlerFluid;
|
||||
import refinedstorage.inventory.ItemHandlerUpgrade;
|
||||
@@ -35,7 +35,7 @@ public class TileImporter extends TileMultipartNode implements IComparable, IFil
|
||||
|
||||
private ItemHandlerUpgrade upgrades = new ItemHandlerUpgrade(4, this, ItemUpgrade.TYPE_SPEED, ItemUpgrade.TYPE_STACK);
|
||||
|
||||
private int compare = CompareUtils.COMPARE_NBT | CompareUtils.COMPARE_DAMAGE;
|
||||
private int compare = IComparer.COMPARE_NBT | IComparer.COMPARE_DAMAGE;
|
||||
private int mode = IFilterable.WHITELIST;
|
||||
private int type = IType.ITEMS;
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import net.minecraftforge.items.IItemHandler;
|
||||
import net.minecraftforge.items.wrapper.CombinedInvWrapper;
|
||||
import refinedstorage.RS;
|
||||
import refinedstorage.api.network.NetworkUtils;
|
||||
import refinedstorage.api.storage.CompareUtils;
|
||||
import refinedstorage.api.util.IComparer;
|
||||
import refinedstorage.inventory.ItemHandlerBasic;
|
||||
import refinedstorage.inventory.ItemHandlerUpgrade;
|
||||
import refinedstorage.item.ItemUpgrade;
|
||||
@@ -26,7 +26,7 @@ public class TileInterface extends TileNode implements IComparable {
|
||||
private ItemHandlerBasic exportItems = new ItemHandlerBasic(9, this);
|
||||
private ItemHandlerUpgrade upgrades = new ItemHandlerUpgrade(4, this, ItemUpgrade.TYPE_SPEED, ItemUpgrade.TYPE_STACK, ItemUpgrade.TYPE_CRAFTING);
|
||||
|
||||
private int compare = CompareUtils.COMPARE_NBT | CompareUtils.COMPARE_DAMAGE;
|
||||
private int compare = IComparer.COMPARE_NBT | IComparer.COMPARE_DAMAGE;
|
||||
|
||||
private int currentSlot = 0;
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@ import refinedstorage.RS;
|
||||
import refinedstorage.api.RSAPI;
|
||||
import refinedstorage.api.network.INetworkMaster;
|
||||
import refinedstorage.api.solderer.ISoldererRecipe;
|
||||
import refinedstorage.api.storage.CompareUtils;
|
||||
import refinedstorage.inventory.ItemHandlerBasic;
|
||||
import refinedstorage.inventory.ItemHandlerUpgrade;
|
||||
import refinedstorage.item.ItemUpgrade;
|
||||
@@ -54,7 +53,7 @@ public class TileSolderer extends TileNode {
|
||||
|
||||
for (ISoldererRecipe recipe : RSAPI.instance().getSoldererRegistry().getRecipes()) {
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
if (CompareUtils.compareStackNoQuantity(recipe.getRow(i), stack) || CompareUtils.compareStackOreDict(recipe.getRow(i), stack)) {
|
||||
if (RSAPI.instance().getComparer().isEqualNoQuantity(recipe.getRow(i), stack) || RSAPI.instance().getComparer().isEqualOredict(recipe.getRow(i), stack)) {
|
||||
possibleSlots.add(i);
|
||||
}
|
||||
}
|
||||
@@ -97,7 +96,7 @@ public class TileSolderer extends TileNode {
|
||||
if (newRecipe == null) {
|
||||
stop();
|
||||
} else if (newRecipe != recipe) {
|
||||
boolean sameItem = result.getStackInSlot(0) != null ? CompareUtils.compareStackNoQuantity(result.getStackInSlot(0), newRecipe.getResult()) : false;
|
||||
boolean sameItem = result.getStackInSlot(0) != null ? RSAPI.instance().getComparer().isEqualNoQuantity(result.getStackInSlot(0), newRecipe.getResult()) : false;
|
||||
|
||||
if (result.getStackInSlot(0) == null || (sameItem && ((result.getStackInSlot(0).stackSize + newRecipe.getResult().stackSize) <= result.getStackInSlot(0).getMaxStackSize()))) {
|
||||
recipe = newRecipe;
|
||||
|
||||
@@ -7,9 +7,9 @@ import net.minecraftforge.items.ItemHandlerHelper;
|
||||
import refinedstorage.RS;
|
||||
import refinedstorage.RSBlocks;
|
||||
import refinedstorage.api.network.INetworkMaster;
|
||||
import refinedstorage.api.storage.CompareUtils;
|
||||
import refinedstorage.api.storage.item.IItemStorage;
|
||||
import refinedstorage.api.storage.item.IItemStorageProvider;
|
||||
import refinedstorage.api.util.IComparer;
|
||||
import refinedstorage.apiimpl.storage.item.ItemStorageNBT;
|
||||
import refinedstorage.block.BlockStorage;
|
||||
import refinedstorage.block.EnumItemStorageType;
|
||||
@@ -68,7 +68,7 @@ public class TileStorage extends TileNode implements IItemStorageProvider, IStor
|
||||
private EnumItemStorageType type;
|
||||
|
||||
private int priority = 0;
|
||||
private int compare = CompareUtils.COMPARE_NBT | CompareUtils.COMPARE_DAMAGE;
|
||||
private int compare = IComparer.COMPARE_NBT | IComparer.COMPARE_DAMAGE;
|
||||
private int mode = IFilterable.WHITELIST;
|
||||
|
||||
public TileStorage() {
|
||||
|
||||
@@ -5,7 +5,7 @@ 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.api.RSAPI;
|
||||
import refinedstorage.inventory.ItemHandlerFluid;
|
||||
import refinedstorage.tile.data.ITileDataConsumer;
|
||||
import refinedstorage.tile.data.ITileDataProducer;
|
||||
@@ -41,7 +41,7 @@ public interface IFilterable {
|
||||
if (slot != null) {
|
||||
slots++;
|
||||
|
||||
if (CompareUtils.compareStack(slot, stack, compare)) {
|
||||
if (RSAPI.instance().getComparer().isEqual(slot, stack, compare)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -52,7 +52,7 @@ public interface IFilterable {
|
||||
for (int i = 0; i < filters.getSlots(); ++i) {
|
||||
ItemStack slot = filters.getStackInSlot(i);
|
||||
|
||||
if (slot != null && CompareUtils.compareStack(slot, stack, compare)) {
|
||||
if (slot != null && RSAPI.instance().getComparer().isEqual(slot, stack, compare)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -73,7 +73,7 @@ public interface IFilterable {
|
||||
if (slot != null) {
|
||||
slots++;
|
||||
|
||||
if (CompareUtils.compareStack(slot, stack, compare)) {
|
||||
if (RSAPI.instance().getComparer().isEqual(slot, stack, compare)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -84,7 +84,7 @@ public interface IFilterable {
|
||||
for (int i = 0; i < filters.getSlots(); ++i) {
|
||||
FluidStack slot = filters.getFluidStackInSlot(i);
|
||||
|
||||
if (slot != null && CompareUtils.compareStack(slot, stack, compare)) {
|
||||
if (slot != null && RSAPI.instance().getComparer().isEqual(slot, stack, compare)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,9 @@ package refinedstorage.tile.externalstorage;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.capability.IFluidHandler;
|
||||
import net.minecraftforge.fluids.capability.IFluidTankProperties;
|
||||
import refinedstorage.api.storage.CompareUtils;
|
||||
import refinedstorage.api.RSAPI;
|
||||
import refinedstorage.api.storage.fluid.IFluidStorage;
|
||||
import refinedstorage.api.util.IComparer;
|
||||
import refinedstorage.apiimpl.storage.fluid.FluidUtils;
|
||||
import refinedstorage.tile.config.IFilterable;
|
||||
|
||||
@@ -58,7 +59,7 @@ public class FluidStorageExternal implements IFluidStorage {
|
||||
public FluidStack extractFluid(@Nonnull FluidStack stack, int size, int flags) {
|
||||
FluidStack toDrain = FluidUtils.copyStackWithSize(stack, size);
|
||||
|
||||
if (CompareUtils.compareStack(getContents(), toDrain, flags)) {
|
||||
if (RSAPI.instance().getComparer().isEqual(getContents(), toDrain, flags)) {
|
||||
return handler.drain(toDrain, true);
|
||||
}
|
||||
|
||||
@@ -84,7 +85,7 @@ public class FluidStorageExternal implements IFluidStorage {
|
||||
|
||||
if (cache == null) {
|
||||
cache = FluidUtils.copy(stack);
|
||||
} else if (!CompareUtils.compareStack(stack, cache, CompareUtils.COMPARE_NBT | CompareUtils.COMPARE_QUANTITY)) {
|
||||
} else if (!RSAPI.instance().getComparer().isEqual(stack, cache, IComparer.COMPARE_NBT | RSAPI.instance().getComparer().COMPARE_QUANTITY)) {
|
||||
cache = FluidUtils.copy(stack);
|
||||
|
||||
return true;
|
||||
|
||||
@@ -3,7 +3,7 @@ package refinedstorage.tile.externalstorage;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.items.ItemHandlerHelper;
|
||||
import powercrystals.minefactoryreloaded.api.IDeepStorageUnit;
|
||||
import refinedstorage.api.storage.CompareUtils;
|
||||
import refinedstorage.api.RSAPI;
|
||||
import refinedstorage.tile.config.IFilterable;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
@@ -37,7 +37,7 @@ public class ItemStorageDSU extends ItemStorageExternal {
|
||||
public ItemStack insertItem(@Nonnull ItemStack stack, int size, boolean simulate) {
|
||||
if (IFilterable.canTake(externalStorage.getItemFilters(), externalStorage.getMode(), externalStorage.getCompare(), stack)) {
|
||||
if (unit.getStoredItemType() != null) {
|
||||
if (CompareUtils.compareStackNoQuantity(unit.getStoredItemType(), stack)) {
|
||||
if (RSAPI.instance().getComparer().isEqualNoQuantity(unit.getStoredItemType(), stack)) {
|
||||
if (getStored() + size > unit.getMaxStoredCount()) {
|
||||
int remainingSpace = getCapacity() - getStored();
|
||||
|
||||
@@ -86,7 +86,7 @@ public class ItemStorageDSU extends ItemStorageExternal {
|
||||
|
||||
@Override
|
||||
public ItemStack extractItem(@Nonnull ItemStack stack, int size, int flags) {
|
||||
if (CompareUtils.compareStack(stack, unit.getStoredItemType(), flags)) {
|
||||
if (RSAPI.instance().getComparer().isEqual(stack, unit.getStoredItemType(), flags)) {
|
||||
if (size > unit.getStoredItemType().stackSize) {
|
||||
size = unit.getStoredItemType().stackSize;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import com.jaquadro.minecraft.storagedrawers.api.storage.IDrawer;
|
||||
import com.jaquadro.minecraft.storagedrawers.api.storage.attribute.IVoidable;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.items.ItemHandlerHelper;
|
||||
import refinedstorage.api.storage.CompareUtils;
|
||||
import refinedstorage.api.RSAPI;
|
||||
import refinedstorage.tile.config.IFilterable;
|
||||
|
||||
import java.util.Collections;
|
||||
@@ -88,7 +88,7 @@ public class ItemStorageDrawer extends ItemStorageExternal {
|
||||
|
||||
@Override
|
||||
public ItemStack extractItem(ItemStack stack, int size, int flags) {
|
||||
if (CompareUtils.compareStack(stack, drawer.getStoredItemPrototype(), flags) && drawer.canItemBeExtracted(stack)) {
|
||||
if (RSAPI.instance().getComparer().isEqual(stack, drawer.getStoredItemPrototype(), flags) && drawer.canItemBeExtracted(stack)) {
|
||||
if (size > drawer.getStoredItemCount()) {
|
||||
size = drawer.getStoredItemCount();
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package refinedstorage.tile.externalstorage;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import refinedstorage.api.storage.CompareUtils;
|
||||
import refinedstorage.api.RSAPI;
|
||||
import refinedstorage.api.storage.item.IItemStorage;
|
||||
|
||||
import java.util.List;
|
||||
@@ -22,7 +22,7 @@ public abstract class ItemStorageExternal implements IItemStorage {
|
||||
return true;
|
||||
} else {
|
||||
for (int i = 0; i < items.size(); ++i) {
|
||||
if (!CompareUtils.compareStack(items.get(i), cache.get(i))) {
|
||||
if (!RSAPI.instance().getComparer().isEqual(items.get(i), cache.get(i))) {
|
||||
cache = items;
|
||||
|
||||
return true;
|
||||
|
||||
@@ -3,7 +3,7 @@ package refinedstorage.tile.externalstorage;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
import net.minecraftforge.items.ItemHandlerHelper;
|
||||
import refinedstorage.api.storage.CompareUtils;
|
||||
import refinedstorage.api.RSAPI;
|
||||
import refinedstorage.tile.config.IFilterable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -54,7 +54,7 @@ public class ItemStorageItemHandler extends ItemStorageExternal {
|
||||
for (int i = 0; i < handler.getSlots(); ++i) {
|
||||
ItemStack slot = handler.getStackInSlot(i);
|
||||
|
||||
if (slot != null && CompareUtils.compareStack(slot, stack, flags)) {
|
||||
if (slot != null && RSAPI.instance().getComparer().isEqual(slot, stack, flags)) {
|
||||
ItemStack got = handler.extractItem(i, remaining, false);
|
||||
|
||||
if (got != null) {
|
||||
|
||||
@@ -12,11 +12,11 @@ import net.minecraftforge.items.IItemHandler;
|
||||
import powercrystals.minefactoryreloaded.api.IDeepStorageUnit;
|
||||
import refinedstorage.RS;
|
||||
import refinedstorage.api.network.INetworkMaster;
|
||||
import refinedstorage.api.storage.CompareUtils;
|
||||
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.api.util.IComparer;
|
||||
import refinedstorage.inventory.ItemHandlerBasic;
|
||||
import refinedstorage.inventory.ItemHandlerFluid;
|
||||
import refinedstorage.tile.IStorageGui;
|
||||
@@ -80,7 +80,7 @@ public class TileExternalStorage extends TileMultipartNode implements IItemStora
|
||||
private ItemHandlerFluid fluidFilters = new ItemHandlerFluid(9, this);
|
||||
|
||||
private int priority = 0;
|
||||
private int compare = CompareUtils.COMPARE_NBT | CompareUtils.COMPARE_DAMAGE;
|
||||
private int compare = IComparer.COMPARE_NBT | IComparer.COMPARE_DAMAGE;
|
||||
private int mode = IFilterable.WHITELIST;
|
||||
private int type = IType.ITEMS;
|
||||
|
||||
|
||||
@@ -16,10 +16,10 @@ import net.minecraftforge.items.wrapper.InvWrapper;
|
||||
import refinedstorage.RS;
|
||||
import refinedstorage.RSBlocks;
|
||||
import refinedstorage.RSItems;
|
||||
import refinedstorage.api.RSAPI;
|
||||
import refinedstorage.api.network.NetworkUtils;
|
||||
import refinedstorage.api.network.grid.IFluidGridHandler;
|
||||
import refinedstorage.api.network.grid.IItemGridHandler;
|
||||
import refinedstorage.api.storage.CompareUtils;
|
||||
import refinedstorage.block.BlockGrid;
|
||||
import refinedstorage.block.EnumGridType;
|
||||
import refinedstorage.container.ContainerGrid;
|
||||
@@ -287,7 +287,7 @@ public class TileGrid extends TileNode implements IGrid {
|
||||
|
||||
craftedItems += crafted.stackSize;
|
||||
|
||||
if (!CompareUtils.compareStack(crafted, result.getStackInSlot(0)) || craftedItems + crafted.stackSize > crafted.getMaxStackSize()) {
|
||||
if (!RSAPI.instance().getComparer().isEqual(crafted, result.getStackInSlot(0)) || craftedItems + crafted.stackSize > crafted.getMaxStackSize()) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -364,7 +364,7 @@ public class TileGrid extends TileNode implements IGrid {
|
||||
if (!found) {
|
||||
for (ItemStack possibility : possibilities) {
|
||||
for (int j = 0; j < player.inventory.getSizeInventory(); ++j) {
|
||||
if (CompareUtils.compareStackNoQuantity(possibility, player.inventory.getStackInSlot(j))) {
|
||||
if (RSAPI.instance().getComparer().isEqualNoQuantity(possibility, player.inventory.getStackInSlot(j))) {
|
||||
matrix.setInventorySlotContents(i, ItemHandlerHelper.copyStackWithSize(player.inventory.getStackInSlot(j), 1));
|
||||
|
||||
player.inventory.decrStackSize(j, 1);
|
||||
|
||||
Reference in New Issue
Block a user