Rename CraftingTaskNormal to CraftingTask

This commit is contained in:
Raoul Van den Berge
2016-10-09 18:41:56 +02:00
parent e821e63043
commit 3cfeb3a39b
5 changed files with 14 additions and 11 deletions

View File

@@ -10,7 +10,7 @@ import net.minecraftforge.items.ItemHandlerHelper;
import refinedstorage.api.autocrafting.ICraftingPattern;
import refinedstorage.api.autocrafting.ICraftingPatternContainer;
import refinedstorage.apiimpl.API;
import refinedstorage.apiimpl.autocrafting.registry.CraftingTaskFactoryNormal;
import refinedstorage.apiimpl.autocrafting.registry.CraftingTaskFactory;
import refinedstorage.item.ItemPattern;
import java.util.ArrayList;
@@ -100,7 +100,7 @@ public class CraftingPattern implements ICraftingPattern {
@Override
public String getId() {
return CraftingTaskFactoryNormal.ID;
return CraftingTaskFactory.ID;
}
@Override

View File

@@ -7,17 +7,17 @@ import refinedstorage.api.autocrafting.ICraftingPattern;
import refinedstorage.api.autocrafting.registry.ICraftingTaskFactory;
import refinedstorage.api.autocrafting.task.ICraftingTask;
import refinedstorage.api.network.INetworkMaster;
import refinedstorage.apiimpl.autocrafting.task.CraftingTaskNormal;
import refinedstorage.apiimpl.autocrafting.task.CraftingTask;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
public class CraftingTaskFactoryNormal implements ICraftingTaskFactory {
public class CraftingTaskFactory implements ICraftingTaskFactory {
public static final String ID = "normal";
@Override
@Nonnull
public ICraftingTask create(World world, INetworkMaster network, @Nullable ItemStack stack, ICraftingPattern pattern, int quantity, @Nullable NBTTagCompound tag) {
return new CraftingTaskNormal(network, stack, pattern, quantity);
return new CraftingTask(network, stack, pattern, quantity);
}
}

View File

@@ -21,7 +21,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
public class CraftingTaskNormal implements ICraftingTask {
public class CraftingTask implements ICraftingTask {
private INetworkMaster network;
private ItemStack requested;
private ICraftingPattern pattern;
@@ -33,7 +33,7 @@ public class CraftingTaskNormal implements ICraftingTask {
private IItemStackList missing = API.instance().createItemStackList();
private IItemStackList extras = API.instance().createItemStackList();
public CraftingTaskNormal(INetworkMaster network, ItemStack requested, ICraftingPattern pattern, int quantity) {
public CraftingTask(INetworkMaster network, ItemStack requested, ICraftingPattern pattern, int quantity) {
this.network = network;
this.requested = requested;
this.pattern = pattern;
@@ -113,6 +113,7 @@ public class CraftingTaskNormal implements ICraftingTask {
public String toString() {
return "\nCraftingTask{quantity=" + quantity +
"\n, toTake=" + toTake +
"\n, toTakeFluids=" + toTakeFluids +
"\n, toCraft=" + toCraft +
"\n, toProcess=" + toProcess +
"\n, missing=" + missing +

View File

@@ -10,7 +10,7 @@ import refinedstorage.api.autocrafting.task.ICraftingTask;
import refinedstorage.api.network.INetworkMaster;
import refinedstorage.api.network.grid.IItemGridHandler;
import refinedstorage.apiimpl.API;
import refinedstorage.apiimpl.autocrafting.task.CraftingTaskNormal;
import refinedstorage.apiimpl.autocrafting.task.CraftingTask;
public class ItemGridHandler implements IItemGridHandler {
private INetworkMaster network;
@@ -122,10 +122,12 @@ public class ItemGridHandler implements IItemGridHandler {
ItemStack stack = network.getItemStorage().getList().get(hash);
if (stack != null) {
CraftingTaskNormal task = new CraftingTaskNormal(network, stack, network.getPattern(stack), quantity);
CraftingTask task = new CraftingTask(network, stack, network.getPattern(stack), quantity);
task.calculate();
System.out.println(task.toString());
network.addCraftingTask(task);
/*CraftingPreviewData previewData = new CraftingPreviewData(network);

View File

@@ -23,7 +23,7 @@ import refinedstorage.apiimpl.API;
import refinedstorage.apiimpl.autocrafting.craftingmonitor.CraftingMonitorElementFluidRender;
import refinedstorage.apiimpl.autocrafting.craftingmonitor.CraftingMonitorElementItemRender;
import refinedstorage.apiimpl.autocrafting.craftingmonitor.CraftingMonitorElementText;
import refinedstorage.apiimpl.autocrafting.registry.CraftingTaskFactoryNormal;
import refinedstorage.apiimpl.autocrafting.registry.CraftingTaskFactory;
import refinedstorage.apiimpl.solderer.*;
import refinedstorage.apiimpl.storage.fluid.FluidStorageNBT;
import refinedstorage.apiimpl.storage.item.ItemStorageNBT;
@@ -51,7 +51,7 @@ public class CommonProxy {
API.deliver(e.getAsmData());
API.instance().getCraftingTaskRegistry().addFactory(CraftingTaskFactoryNormal.ID, new CraftingTaskFactoryNormal());
API.instance().getCraftingTaskRegistry().addFactory(CraftingTaskFactory.ID, new CraftingTaskFactory());
API.instance().getCraftingMonitorElementRegistry().add(CraftingMonitorElementItemRender.ID, buf -> new CraftingMonitorElementItemRender(buf.readInt(), ByteBufUtils.readItemStack(buf), buf.readInt(), buf.readInt()));
API.instance().getCraftingMonitorElementRegistry().add(CraftingMonitorElementFluidRender.ID, buf -> new CraftingMonitorElementFluidRender(buf.readInt(), RSUtils.readFluidStack(buf).getRight(), buf.readInt()));