From 48bb49ceebb3393b0693fc6ffe48f39c09cbd9f1 Mon Sep 17 00:00:00 2001 From: Raoul Van den Berge Date: Fri, 7 Oct 2016 01:55:29 +0200 Subject: [PATCH 1/8] Fix wrong quantity stuff --- .../registry/ICraftingTaskFactory.java | 4 +- .../api/network/NetworkUtils.java | 10 +- .../registry/CraftingTaskFactoryNormal.java | 5 +- .../autocrafting/task/CraftingTaskNormal.java | 91 ++++++++++--------- .../apiimpl/network/grid/ItemGridHandler.java | 2 +- 5 files changed, 62 insertions(+), 50 deletions(-) diff --git a/src/main/java/refinedstorage/api/autocrafting/registry/ICraftingTaskFactory.java b/src/main/java/refinedstorage/api/autocrafting/registry/ICraftingTaskFactory.java index 3ba57ea6a..c0cf62f81 100755 --- a/src/main/java/refinedstorage/api/autocrafting/registry/ICraftingTaskFactory.java +++ b/src/main/java/refinedstorage/api/autocrafting/registry/ICraftingTaskFactory.java @@ -1,5 +1,6 @@ package refinedstorage.api.autocrafting.registry; +import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; import refinedstorage.api.autocrafting.ICraftingPattern; @@ -19,11 +20,12 @@ public interface ICraftingTaskFactory { * * @param world the world * @param network the network + * @param stack the stack to create task for * @param pattern the pattern * @param quantity the quantity * @param tag the NBT tag, if this is null it isn't reading from disk but is used for making a task on demand * @return the crafting task */ @Nonnull - ICraftingTask create(World world, INetworkMaster network, ICraftingPattern pattern, int quantity, @Nullable NBTTagCompound tag); + ICraftingTask create(World world, INetworkMaster network, @Nullable ItemStack stack, ICraftingPattern pattern, int quantity, @Nullable NBTTagCompound tag); } diff --git a/src/main/java/refinedstorage/api/network/NetworkUtils.java b/src/main/java/refinedstorage/api/network/NetworkUtils.java index 5e389476a..7f40ac0e2 100755 --- a/src/main/java/refinedstorage/api/network/NetworkUtils.java +++ b/src/main/java/refinedstorage/api/network/NetworkUtils.java @@ -18,6 +18,8 @@ import refinedstorage.api.autocrafting.registry.ICraftingTaskFactory; import refinedstorage.api.autocrafting.task.ICraftingTask; import refinedstorage.api.storage.CompareUtils; +import javax.annotation.Nullable; + /** * Utilities for network manipulation. */ @@ -34,8 +36,8 @@ public final class NetworkUtils { return network.getPattern(stack, CompareUtils.COMPARE_DAMAGE | CompareUtils.COMPARE_NBT); } - public static ICraftingTask createCraftingTask(INetworkMaster network, ICraftingPattern pattern, int quantity) { - return RefinedStorageAPI.instance().getCraftingTaskRegistry().getFactory(pattern.getId()).create(network.getNetworkWorld(), network, pattern, quantity, null); + public static ICraftingTask createCraftingTask(INetworkMaster network, @Nullable ItemStack stack, ICraftingPattern pattern, int quantity) { + return RefinedStorageAPI.instance().getCraftingTaskRegistry().getFactory(pattern.getId()).create(network.getNetworkWorld(), network, stack, pattern, quantity, null); } public static boolean hasPattern(INetworkMaster network, ItemStack stack) { @@ -69,7 +71,7 @@ public final class NetworkUtils { ICraftingPattern pattern = network.getPattern(stack, compare); if (pattern != null) { - network.addCraftingTask(createCraftingTask(network, pattern, 1)); + network.addCraftingTask(createCraftingTask(network, stack, pattern, 1)); } } } @@ -86,7 +88,7 @@ public final class NetworkUtils { ICraftingTaskFactory factory = RefinedStorageAPI.instance().getCraftingTaskRegistry().getFactory(tag.getString(ICraftingTask.NBT_PATTERN_ID)); if (factory != null) { - return factory.create(world, network, pattern, tag.getInteger(ICraftingTask.NBT_QUANTITY), tag); + return factory.create(world, network, null, pattern, tag.getInteger(ICraftingTask.NBT_QUANTITY), tag); } } } diff --git a/src/main/java/refinedstorage/apiimpl/autocrafting/registry/CraftingTaskFactoryNormal.java b/src/main/java/refinedstorage/apiimpl/autocrafting/registry/CraftingTaskFactoryNormal.java index d4f5d22d3..62d064073 100755 --- a/src/main/java/refinedstorage/apiimpl/autocrafting/registry/CraftingTaskFactoryNormal.java +++ b/src/main/java/refinedstorage/apiimpl/autocrafting/registry/CraftingTaskFactoryNormal.java @@ -1,5 +1,6 @@ package refinedstorage.apiimpl.autocrafting.registry; +import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; import refinedstorage.api.autocrafting.ICraftingPattern; @@ -16,7 +17,7 @@ public class CraftingTaskFactoryNormal implements ICraftingTaskFactory { @Override @Nonnull - public ICraftingTask create(World world, INetworkMaster network, ICraftingPattern pattern, int quantity, @Nullable NBTTagCompound tag) { - return new CraftingTaskNormal(network, pattern, quantity); + public ICraftingTask create(World world, INetworkMaster network, @Nullable ItemStack stack, ICraftingPattern pattern, int quantity, @Nullable NBTTagCompound tag) { + return new CraftingTaskNormal(network, stack, pattern, quantity); } } \ No newline at end of file diff --git a/src/main/java/refinedstorage/apiimpl/autocrafting/task/CraftingTaskNormal.java b/src/main/java/refinedstorage/apiimpl/autocrafting/task/CraftingTaskNormal.java index 669f460e8..f5e6b6799 100755 --- a/src/main/java/refinedstorage/apiimpl/autocrafting/task/CraftingTaskNormal.java +++ b/src/main/java/refinedstorage/apiimpl/autocrafting/task/CraftingTaskNormal.java @@ -24,6 +24,7 @@ import java.util.List; public class CraftingTaskNormal implements ICraftingTask { private INetworkMaster network; + private ItemStack requested; private ICraftingPattern pattern; private int quantity; private Deque toTake = new ArrayDeque<>(); @@ -32,60 +33,65 @@ public class CraftingTaskNormal implements ICraftingTask { private Multimap missing = ArrayListMultimap.create(); private Multimap extras = ArrayListMultimap.create(); - public CraftingTaskNormal(INetworkMaster network, ICraftingPattern pattern, int quantity) { + public CraftingTaskNormal(INetworkMaster network, ItemStack requested, ICraftingPattern pattern, int quantity) { this.network = network; + this.requested = requested; this.pattern = pattern; this.quantity = quantity; } public void calculate() { - calculate(network.getItemStorage().copy(), pattern, true); + int newQuantity = quantity; + + while (newQuantity > 0) { + calculate(network.getItemStorage().copy(), pattern, true); + + newQuantity -= requested == null ? newQuantity : pattern.getQuantityPerRequest(requested); + } + } + + private void calculate(IGroupedItemStorage storage, ICraftingPattern pattern, boolean basePattern) { + if (pattern.isProcessing()) { + toProcess.add(new Processable(pattern)); + } + + for (ItemStack input : pattern.getInputs()) { + ItemStack inputInNetwork = storage.get(input, CompareUtils.COMPARE_DAMAGE | CompareUtils.COMPARE_NBT); + + if (inputInNetwork == null || inputInNetwork.stackSize == 0) { + if (getExtrasFor(input) != null) { + decrOrRemoveExtras(input); + } else { + ICraftingPattern inputPattern = NetworkUtils.getPattern(network, input); + + if (inputPattern != null) { + for (ItemStack output : inputPattern.getOutputs()) { + addToCraft(output); + } + + calculate(storage, inputPattern, false); + } else { + addMissing(input); + } + } + } else { + if (!pattern.isProcessing()) { + toTake.push(input); + } + + storage.remove(input); + } + } + + if (!basePattern) { + addExtras(pattern); + } } @Override public void onCancelled() { } - private void calculate(IGroupedItemStorage storage, ICraftingPattern pattern, boolean basePattern) { - for (int i = 0; i < quantity; ++i) { - if (pattern.isProcessing()) { - toProcess.add(new Processable(pattern)); - } - - for (ItemStack input : pattern.getInputs()) { - ItemStack inputInNetwork = storage.get(input, CompareUtils.COMPARE_DAMAGE | CompareUtils.COMPARE_NBT); - - if (inputInNetwork == null || inputInNetwork.stackSize == 0) { - if (getExtrasFor(input) != null) { - decrOrRemoveExtras(input); - } else { - ICraftingPattern inputPattern = NetworkUtils.getPattern(network, input); - - if (inputPattern != null) { - for (ItemStack output : inputPattern.getOutputs()) { - addToCraft(output); - } - - calculate(storage, inputPattern, false); - } else { - addMissing(input); - } - } - } else { - if (!pattern.isProcessing()) { - toTake.push(input); - } - - storage.remove(input); - } - } - - if (!basePattern) { - addExtras(pattern); - } - } - } - @Override public String toString() { return "\nCraftingTask{quantity=" + quantity + @@ -174,6 +180,7 @@ public class CraftingTaskNormal implements ICraftingTask { return pattern; } + @Override public List getToProcess() { return toProcess; diff --git a/src/main/java/refinedstorage/apiimpl/network/grid/ItemGridHandler.java b/src/main/java/refinedstorage/apiimpl/network/grid/ItemGridHandler.java index de14175a0..15bba8c82 100755 --- a/src/main/java/refinedstorage/apiimpl/network/grid/ItemGridHandler.java +++ b/src/main/java/refinedstorage/apiimpl/network/grid/ItemGridHandler.java @@ -123,7 +123,7 @@ public class ItemGridHandler implements IItemGridHandler { ItemStack stack = network.getItemStorage().get(hash); if (stack != null) { - CraftingTaskNormal task = new CraftingTaskNormal(network, NetworkUtils.getPattern(network, stack), quantity); + CraftingTaskNormal task = new CraftingTaskNormal(network, stack, NetworkUtils.getPattern(network, stack), quantity); task.calculate(); From 3ee04b64804dc144b7946e7ddf3b0ca9b2996dc2 Mon Sep 17 00:00:00 2001 From: Raoul Van den Berge Date: Fri, 7 Oct 2016 02:10:45 +0200 Subject: [PATCH 2/8] IItemStackList holds some behavior that I don't want to duplicate everywhere --- src/main/java/refinedstorage/api/IAPI.java | 7 ++ .../api/storage/item/IGroupedItemStorage.java | 33 +------ .../api/util/IItemStackList.java | 27 ++++++ src/main/java/refinedstorage/apiimpl/API.java | 8 ++ .../autocrafting/task/CraftingTaskNormal.java | 14 +-- .../apiimpl/network/grid/ItemGridHandler.java | 4 +- .../storage/item/GroupedItemStorage.java | 83 ++--------------- .../apiimpl/util/ItemStackList.java | 90 +++++++++++++++++++ .../network/MessageGridItemUpdate.java | 4 +- .../refinedstorage/tile/TileController.java | 2 +- .../refinedstorage/tile/TileDetector.java | 2 +- .../tile/TileDiskManipulator.java | 2 +- 12 files changed, 159 insertions(+), 117 deletions(-) create mode 100755 src/main/java/refinedstorage/api/util/IItemStackList.java create mode 100755 src/main/java/refinedstorage/apiimpl/util/ItemStackList.java diff --git a/src/main/java/refinedstorage/api/IAPI.java b/src/main/java/refinedstorage/api/IAPI.java index bd7a98f83..f4862b4ba 100755 --- a/src/main/java/refinedstorage/api/IAPI.java +++ b/src/main/java/refinedstorage/api/IAPI.java @@ -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.IItemStackList; import javax.annotation.Nonnull; @@ -27,4 +28,10 @@ public interface IAPI { */ @Nonnull ICraftingMonitorElementRegistry getCraftingMonitorElementRegistry(); + + /** + * @return a empty fast item stack list + */ + @Nonnull + IItemStackList createItemStackList(); } diff --git a/src/main/java/refinedstorage/api/storage/item/IGroupedItemStorage.java b/src/main/java/refinedstorage/api/storage/item/IGroupedItemStorage.java index b1c2292d7..0ae4bf23a 100755 --- a/src/main/java/refinedstorage/api/storage/item/IGroupedItemStorage.java +++ b/src/main/java/refinedstorage/api/storage/item/IGroupedItemStorage.java @@ -2,11 +2,9 @@ package refinedstorage.api.storage.item; import net.minecraft.item.ItemStack; import refinedstorage.api.network.INetworkMaster; -import refinedstorage.api.storage.CompareUtils; +import refinedstorage.api.util.IItemStackList; import javax.annotation.Nonnull; -import javax.annotation.Nullable; -import java.util.Collection; import java.util.List; /** @@ -47,34 +45,9 @@ public interface IGroupedItemStorage { void remove(@Nonnull ItemStack stack); /** - * Gets an item from the network. - * - * @param stack the stack to find - * @param flags the flags to compare on, see {@link CompareUtils} - * @return null if no item is found, or the stack, do NOT modify + * @return the list behind this grouped storage */ - @Nullable - ItemStack get(@Nonnull ItemStack stack, int flags); - - /** - * Gets an item from the network by hash, see {@link refinedstorage.api.network.NetworkUtils#getItemStackHashCode(ItemStack)}. - * - * @return null if no item is found matching the hash, or the stack, do NOT modify - */ - @Nullable - ItemStack get(int hash); - - /** - * Copies a grouped item storage. - * - * @return the storage - */ - IGroupedItemStorage copy(); - - /** - * @return all items in this storage network - */ - Collection getStacks(); + IItemStackList getList(); /** * @return the item storages connected to this network diff --git a/src/main/java/refinedstorage/api/util/IItemStackList.java b/src/main/java/refinedstorage/api/util/IItemStackList.java new file mode 100755 index 000000000..bc2374699 --- /dev/null +++ b/src/main/java/refinedstorage/api/util/IItemStackList.java @@ -0,0 +1,27 @@ +package refinedstorage.api.util; + +import net.minecraft.item.ItemStack; + +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import java.util.Collection; + +public interface IItemStackList { + void add(ItemStack stack); + + boolean remove(@Nonnull ItemStack stack, boolean removeIfReachedZero); + + @Nullable + ItemStack get(@Nonnull ItemStack stack, int flags); + + @Nullable + ItemStack get(int hash); + + void clear(); + + @Nonnull + Collection getStacks(); + + @Nonnull + IItemStackList copy(); +} diff --git a/src/main/java/refinedstorage/apiimpl/API.java b/src/main/java/refinedstorage/apiimpl/API.java index 88ec325b7..c4e02fdf2 100755 --- a/src/main/java/refinedstorage/apiimpl/API.java +++ b/src/main/java/refinedstorage/apiimpl/API.java @@ -4,9 +4,11 @@ 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.IItemStackList; import refinedstorage.apiimpl.autocrafting.craftingmonitor.CraftingMonitorElementRegistry; import refinedstorage.apiimpl.autocrafting.registry.CraftingTaskRegistry; import refinedstorage.apiimpl.solderer.SoldererRegistry; +import refinedstorage.apiimpl.util.ItemStackList; import javax.annotation.Nonnull; @@ -34,4 +36,10 @@ public class API implements IAPI { public ICraftingMonitorElementRegistry getCraftingMonitorElementRegistry() { return craftingMonitorElementRegistry; } + + @Nonnull + @Override + public IItemStackList createItemStackList() { + return new ItemStackList(); + } } diff --git a/src/main/java/refinedstorage/apiimpl/autocrafting/task/CraftingTaskNormal.java b/src/main/java/refinedstorage/apiimpl/autocrafting/task/CraftingTaskNormal.java index f5e6b6799..9b2ca7d93 100755 --- a/src/main/java/refinedstorage/apiimpl/autocrafting/task/CraftingTaskNormal.java +++ b/src/main/java/refinedstorage/apiimpl/autocrafting/task/CraftingTaskNormal.java @@ -13,7 +13,7 @@ import refinedstorage.api.autocrafting.task.IProcessable; import refinedstorage.api.network.INetworkMaster; import refinedstorage.api.network.NetworkUtils; import refinedstorage.api.storage.CompareUtils; -import refinedstorage.api.storage.item.IGroupedItemStorage; +import refinedstorage.api.util.IItemStackList; import refinedstorage.apiimpl.autocrafting.craftingmonitor.CraftingMonitorElementRoot; import refinedstorage.apiimpl.autocrafting.craftingmonitor.CraftingMonitorElementToTake; @@ -41,22 +41,24 @@ public class CraftingTaskNormal implements ICraftingTask { } public void calculate() { + IItemStackList list = network.getItemStorage().getList().copy(); + int newQuantity = quantity; while (newQuantity > 0) { - calculate(network.getItemStorage().copy(), pattern, true); + calculate(list, pattern, true); newQuantity -= requested == null ? newQuantity : pattern.getQuantityPerRequest(requested); } } - private void calculate(IGroupedItemStorage storage, ICraftingPattern pattern, boolean basePattern) { + private void calculate(IItemStackList list, ICraftingPattern pattern, boolean basePattern) { if (pattern.isProcessing()) { toProcess.add(new Processable(pattern)); } for (ItemStack input : pattern.getInputs()) { - ItemStack inputInNetwork = storage.get(input, CompareUtils.COMPARE_DAMAGE | CompareUtils.COMPARE_NBT); + ItemStack inputInNetwork = list.get(input, CompareUtils.COMPARE_DAMAGE | CompareUtils.COMPARE_NBT); if (inputInNetwork == null || inputInNetwork.stackSize == 0) { if (getExtrasFor(input) != null) { @@ -69,7 +71,7 @@ public class CraftingTaskNormal implements ICraftingTask { addToCraft(output); } - calculate(storage, inputPattern, false); + calculate(list, inputPattern, false); } else { addMissing(input); } @@ -79,7 +81,7 @@ public class CraftingTaskNormal implements ICraftingTask { toTake.push(input); } - storage.remove(input); + list.remove(input, true); } } diff --git a/src/main/java/refinedstorage/apiimpl/network/grid/ItemGridHandler.java b/src/main/java/refinedstorage/apiimpl/network/grid/ItemGridHandler.java index 15bba8c82..dda97a31a 100755 --- a/src/main/java/refinedstorage/apiimpl/network/grid/ItemGridHandler.java +++ b/src/main/java/refinedstorage/apiimpl/network/grid/ItemGridHandler.java @@ -22,7 +22,7 @@ public class ItemGridHandler implements IItemGridHandler { @Override public void onExtract(int hash, int flags, EntityPlayerMP player) { - ItemStack item = network.getItemStorage().get(hash); + ItemStack item = network.getItemStorage().getList().get(hash); if (item == null) { return; @@ -120,7 +120,7 @@ public class ItemGridHandler implements IItemGridHandler { @Override public void onCraftingPreviewRequested(EntityPlayerMP player, int hash, int quantity) { - ItemStack stack = network.getItemStorage().get(hash); + ItemStack stack = network.getItemStorage().getList().get(hash); if (stack != null) { CraftingTaskNormal task = new CraftingTaskNormal(network, stack, NetworkUtils.getPattern(network, stack), quantity); diff --git a/src/main/java/refinedstorage/apiimpl/storage/item/GroupedItemStorage.java b/src/main/java/refinedstorage/apiimpl/storage/item/GroupedItemStorage.java index 8d9778ed6..8cf8a9fc0 100755 --- a/src/main/java/refinedstorage/apiimpl/storage/item/GroupedItemStorage.java +++ b/src/main/java/refinedstorage/apiimpl/storage/item/GroupedItemStorage.java @@ -1,27 +1,23 @@ package refinedstorage.apiimpl.storage.item; -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.RefinedStorageAPI; import refinedstorage.api.autocrafting.ICraftingPattern; import refinedstorage.api.network.INetworkMaster; import refinedstorage.api.network.NetworkUtils; -import refinedstorage.api.storage.CompareUtils; import refinedstorage.api.storage.item.IGroupedItemStorage; import refinedstorage.api.storage.item.IItemStorage; import refinedstorage.api.storage.item.IItemStorageProvider; +import refinedstorage.api.util.IItemStackList; import javax.annotation.Nonnull; -import javax.annotation.Nullable; import java.util.ArrayList; -import java.util.Collection; import java.util.List; public class GroupedItemStorage implements IGroupedItemStorage { private INetworkMaster network; private List storages = new ArrayList<>(); - private Multimap stacks = ArrayListMultimap.create(); + private IItemStackList list = RefinedStorageAPI.instance().createItemStackList(); public GroupedItemStorage(INetworkMaster network) { this.network = network; @@ -35,7 +31,7 @@ public class GroupedItemStorage implements IGroupedItemStorage { .filter(node -> node.canUpdate() && node instanceof IItemStorageProvider) .forEach(node -> ((IItemStorageProvider) node).addItemStorages(storages)); - stacks.clear(); + list.clear(); for (IItemStorage storage : storages) { for (ItemStack stack : storage.getItems()) { @@ -56,19 +52,7 @@ public class GroupedItemStorage implements IGroupedItemStorage { @Override public void add(@Nonnull ItemStack stack, boolean rebuilding) { - for (ItemStack otherStack : stacks.get(stack.getItem())) { - if (CompareUtils.compareStackNoQuantity(otherStack, stack)) { - otherStack.stackSize += stack.stackSize; - - if (!rebuilding) { - network.sendItemStorageDeltaToClient(stack, stack.stackSize); - } - - return; - } - } - - stacks.put(stack.getItem(), stack.copy()); + list.add(stack); if (!rebuilding) { network.sendItemStorageDeltaToClient(stack, stack.stackSize); @@ -77,63 +61,14 @@ public class GroupedItemStorage implements IGroupedItemStorage { @Override public void remove(@Nonnull ItemStack stack) { - for (ItemStack otherStack : stacks.get(stack.getItem())) { - if (CompareUtils.compareStackNoQuantity(otherStack, stack)) { - otherStack.stackSize -= stack.stackSize; - - if (otherStack.stackSize == 0) { - if (!NetworkUtils.hasPattern(network, stack)) { - stacks.remove(otherStack.getItem(), otherStack); - } - } - - network.sendItemStorageDeltaToClient(stack, -stack.stackSize); - - return; - } + if (list.remove(stack, !NetworkUtils.hasPattern(network, stack))) { + network.sendItemStorageDeltaToClient(stack, -stack.stackSize); } } @Override - @Nullable - public ItemStack get(@Nonnull ItemStack stack, int flags) { - for (ItemStack otherStack : stacks.get(stack.getItem())) { - if (CompareUtils.compareStack(otherStack, stack, flags)) { - return otherStack; - } - } - - return null; - } - - @Override - @Nullable - public ItemStack get(int hash) { - for (ItemStack stack : this.stacks.values()) { - if (NetworkUtils.getItemStackHashCode(stack) == hash) { - return stack; - } - } - - return null; - } - - @Override - public IGroupedItemStorage copy() { - GroupedItemStorage copy = new GroupedItemStorage(network); - - copy.storages = storages; - - for (ItemStack stack : stacks.values()) { - copy.stacks.put(stack.getItem(), stack.copy()); - } - - return copy; - } - - @Override - public Collection getStacks() { - return stacks.values(); + public IItemStackList getList() { + return list; } @Override diff --git a/src/main/java/refinedstorage/apiimpl/util/ItemStackList.java b/src/main/java/refinedstorage/apiimpl/util/ItemStackList.java new file mode 100755 index 000000000..1e902a1da --- /dev/null +++ b/src/main/java/refinedstorage/apiimpl/util/ItemStackList.java @@ -0,0 +1,90 @@ +package refinedstorage.apiimpl.util; + +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.network.NetworkUtils; +import refinedstorage.api.storage.CompareUtils; +import refinedstorage.api.util.IItemStackList; + +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import java.util.Collection; + +public class ItemStackList implements IItemStackList { + private Multimap stacks = ArrayListMultimap.create(); + + public void add(ItemStack stack) { + for (ItemStack otherStack : stacks.get(stack.getItem())) { + if (CompareUtils.compareStackNoQuantity(otherStack, stack)) { + otherStack.stackSize += stack.stackSize; + + return; + } + } + + stacks.put(stack.getItem(), stack.copy()); + } + + public boolean remove(@Nonnull ItemStack stack, boolean removeIfReachedZero) { + for (ItemStack otherStack : stacks.get(stack.getItem())) { + if (CompareUtils.compareStackNoQuantity(otherStack, stack)) { + otherStack.stackSize -= stack.stackSize; + + if (otherStack.stackSize == 0 && removeIfReachedZero) { + stacks.remove(otherStack.getItem(), otherStack); + } + + return true; + } + } + + return false; + } + + @Nullable + public ItemStack get(@Nonnull ItemStack stack, int flags) { + for (ItemStack otherStack : stacks.get(stack.getItem())) { + if (CompareUtils.compareStack(otherStack, stack, flags)) { + return otherStack; + } + } + + return null; + } + + @Nullable + public ItemStack get(int hash) { + for (ItemStack stack : this.stacks.values()) { + if (NetworkUtils.getItemStackHashCode(stack) == hash) { + return stack; + } + } + + return null; + } + + @Override + public void clear() { + stacks.clear(); + } + + @Nonnull + @Override + public Collection getStacks() { + return stacks.values(); + } + + @Override + @Nonnull + public IItemStackList copy() { + ItemStackList list = new ItemStackList(); + + for (ItemStack stack : stacks.values()) { + list.add(stack.copy()); + } + + return list; + } +} diff --git a/src/main/java/refinedstorage/network/MessageGridItemUpdate.java b/src/main/java/refinedstorage/network/MessageGridItemUpdate.java index f88300cce..2a514d5c1 100755 --- a/src/main/java/refinedstorage/network/MessageGridItemUpdate.java +++ b/src/main/java/refinedstorage/network/MessageGridItemUpdate.java @@ -35,9 +35,9 @@ public class MessageGridItemUpdate implements IMessage, IMessageHandler networkItems = new ArrayList<>(network.getItemStorage().getStacks()); + ArrayList networkItems = new ArrayList<>(network.getItemStorage().getList().getStacks()); int j = 0; From ca47253ecd2982b9212177681a05dad5998249b2 Mon Sep 17 00:00:00 2001 From: Raoul Van den Berge Date: Fri, 7 Oct 2016 02:18:58 +0200 Subject: [PATCH 3/8] Make the new crafting task use the IItemStackList --- src/main/java/refinedstorage/api/IAPI.java | 2 +- .../api/util/IItemStackList.java | 2 + .../autocrafting/task/CraftingTaskNormal.java | 74 ++++--------------- .../apiimpl/util/ItemStackList.java | 5 ++ 4 files changed, 22 insertions(+), 61 deletions(-) diff --git a/src/main/java/refinedstorage/api/IAPI.java b/src/main/java/refinedstorage/api/IAPI.java index f4862b4ba..c85e52638 100755 --- a/src/main/java/refinedstorage/api/IAPI.java +++ b/src/main/java/refinedstorage/api/IAPI.java @@ -30,7 +30,7 @@ public interface IAPI { ICraftingMonitorElementRegistry getCraftingMonitorElementRegistry(); /** - * @return a empty fast item stack list + * @return an empty item stack list */ @Nonnull IItemStackList createItemStackList(); diff --git a/src/main/java/refinedstorage/api/util/IItemStackList.java b/src/main/java/refinedstorage/api/util/IItemStackList.java index bc2374699..dd6172ef7 100755 --- a/src/main/java/refinedstorage/api/util/IItemStackList.java +++ b/src/main/java/refinedstorage/api/util/IItemStackList.java @@ -19,6 +19,8 @@ public interface IItemStackList { void clear(); + boolean isEmpty(); + @Nonnull Collection getStacks(); diff --git a/src/main/java/refinedstorage/apiimpl/autocrafting/task/CraftingTaskNormal.java b/src/main/java/refinedstorage/apiimpl/autocrafting/task/CraftingTaskNormal.java index 9b2ca7d93..07a8c3874 100755 --- a/src/main/java/refinedstorage/apiimpl/autocrafting/task/CraftingTaskNormal.java +++ b/src/main/java/refinedstorage/apiimpl/autocrafting/task/CraftingTaskNormal.java @@ -1,11 +1,9 @@ package refinedstorage.apiimpl.autocrafting.task; -import com.google.common.collect.ArrayListMultimap; -import com.google.common.collect.Multimap; -import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.items.ItemHandlerHelper; +import refinedstorage.api.RefinedStorageAPI; import refinedstorage.api.autocrafting.ICraftingPattern; import refinedstorage.api.autocrafting.craftingmonitor.ICraftingMonitorElement; import refinedstorage.api.autocrafting.task.ICraftingTask; @@ -29,9 +27,9 @@ public class CraftingTaskNormal implements ICraftingTask { private int quantity; private Deque toTake = new ArrayDeque<>(); private List toProcess = new ArrayList<>(); - private Multimap toCraft = ArrayListMultimap.create(); - private Multimap missing = ArrayListMultimap.create(); - private Multimap extras = ArrayListMultimap.create(); + private IItemStackList toCraft = RefinedStorageAPI.instance().createItemStackList(); + private IItemStackList missing = RefinedStorageAPI.instance().createItemStackList(); + private IItemStackList extras = RefinedStorageAPI.instance().createItemStackList(); public CraftingTaskNormal(INetworkMaster network, ItemStack requested, ICraftingPattern pattern, int quantity) { this.network = network; @@ -61,19 +59,19 @@ public class CraftingTaskNormal implements ICraftingTask { ItemStack inputInNetwork = list.get(input, CompareUtils.COMPARE_DAMAGE | CompareUtils.COMPARE_NBT); if (inputInNetwork == null || inputInNetwork.stackSize == 0) { - if (getExtrasFor(input) != null) { + if (extras.get(input, CompareUtils.COMPARE_DAMAGE | CompareUtils.COMPARE_NBT) != null) { decrOrRemoveExtras(input); } else { ICraftingPattern inputPattern = NetworkUtils.getPattern(network, input); if (inputPattern != null) { for (ItemStack output : inputPattern.getOutputs()) { - addToCraft(output); + toCraft.add(output); } calculate(list, inputPattern, false); } else { - addMissing(input); + missing.add(input); } } } else { @@ -163,13 +161,13 @@ public class CraftingTaskNormal implements ICraftingTask { )); if (!toTake.isEmpty()) { - Multimap toTake = ArrayListMultimap.create(); + IItemStackList toTake = RefinedStorageAPI.instance().createItemStackList(); for (ItemStack stack : new ArrayList<>(this.toTake)) { - add(toTake, stack); + toTake.add(stack); } - for (ItemStack stack : toTake.values()) { + for (ItemStack stack : toTake.getStacks()) { elements.add(new CraftingMonitorElementToTake(stack, stack.stackSize)); } } @@ -188,57 +186,13 @@ public class CraftingTaskNormal implements ICraftingTask { return toProcess; } - private void addMissing(ItemStack stack) { - add(missing, stack); - } - - private void addToCraft(ItemStack stack) { - add(toCraft, stack); - } - - private void add(Multimap map, ItemStack stack) { - for (ItemStack m : map.get(stack.getItem())) { - if (CompareUtils.compareStackNoQuantity(m, stack)) { - m.stackSize += stack.stackSize; - - return; - } - } - - map.put(stack.getItem(), stack.copy()); - } - private void addExtras(ICraftingPattern pattern) { - pattern.getOutputs().stream().filter(o -> o.stackSize > 1).forEach(o -> addExtras(ItemHandlerHelper.copyStackWithSize(o, o.stackSize - 1))); - } - - private void addExtras(ItemStack stack) { - ItemStack extras = getExtrasFor(stack); - - if (extras != null) { - extras.stackSize += stack.stackSize; - } else { - this.extras.put(stack.getItem(), stack.copy()); - } - } - - private ItemStack getExtrasFor(ItemStack stack) { - for (ItemStack m : extras.get(stack.getItem())) { - if (CompareUtils.compareStackNoQuantity(m, stack)) { - return m; - } - } - - return null; + pattern.getOutputs().stream() + .filter(o -> o.stackSize > 1) + .forEach(o -> extras.add(ItemHandlerHelper.copyStackWithSize(o, o.stackSize - 1))); } private void decrOrRemoveExtras(ItemStack stack) { - ItemStack extras = getExtrasFor(stack); - - extras.stackSize--; - - if (extras.stackSize == 0) { - this.extras.remove(extras.getItem(), extras); - } + extras.remove(ItemHandlerHelper.copyStackWithSize(stack, 1), true); } } diff --git a/src/main/java/refinedstorage/apiimpl/util/ItemStackList.java b/src/main/java/refinedstorage/apiimpl/util/ItemStackList.java index 1e902a1da..d8fd848e3 100755 --- a/src/main/java/refinedstorage/apiimpl/util/ItemStackList.java +++ b/src/main/java/refinedstorage/apiimpl/util/ItemStackList.java @@ -70,6 +70,11 @@ public class ItemStackList implements IItemStackList { stacks.clear(); } + @Override + public boolean isEmpty() { + return stacks.isEmpty(); + } + @Nonnull @Override public Collection getStacks() { From 51a9ead259c222d739fdd6a386f83873d7bc9575 Mon Sep 17 00:00:00 2001 From: Raoul Van den Berge Date: Fri, 7 Oct 2016 02:24:10 +0200 Subject: [PATCH 4/8] Add docs --- .../api/util/IItemStackList.java | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/src/main/java/refinedstorage/api/util/IItemStackList.java b/src/main/java/refinedstorage/api/util/IItemStackList.java index dd6172ef7..9e7380623 100755 --- a/src/main/java/refinedstorage/api/util/IItemStackList.java +++ b/src/main/java/refinedstorage/api/util/IItemStackList.java @@ -6,24 +6,64 @@ import javax.annotation.Nonnull; import javax.annotation.Nullable; import java.util.Collection; +/** + * An item stack list. + */ public interface IItemStackList { + /** + * Adds a stack to the list, will merge it with another stack if it already exists in the list. + * + * @param stack the stack + */ void add(ItemStack stack); + /** + * Decrements the count of that stack in the list. + * + * @param stack the stack + * @param removeIfReachedZero true to remove the stack if the count reaches 0, false otherwise + * @return whether the remove was successful + */ boolean remove(@Nonnull ItemStack stack, boolean removeIfReachedZero); + /** + * Returns a stack. + * + * @param stack the stack to search for + * @param flags the flags to compare on, see {@link refinedstorage.api.storage.CompareUtils} + * @return the stack, or null if no stack was found + */ @Nullable ItemStack get(@Nonnull ItemStack stack, int flags); + /** + * Returns a stack. + * + * @param hash the hash of the stack to search for, see {@link refinedstorage.api.network.NetworkUtils#getItemStackHashCode(ItemStack)} + * @return the stack, or null if no stack was found + */ @Nullable ItemStack get(int hash); + /** + * Clears the list. + */ void clear(); + /** + * @return true if the list is empty, false otherwise + */ boolean isEmpty(); + /** + * @return a collection of stacks in this list + */ @Nonnull Collection getStacks(); + /** + * @return a new copy of this list, with the stacks in it copied as well + */ @Nonnull IItemStackList copy(); } From e689d2a6ebfb61fa0f67e3816e294912721cc80b Mon Sep 17 00:00:00 2001 From: Raoul Van den Berge Date: Fri, 7 Oct 2016 02:30:17 +0200 Subject: [PATCH 5/8] "There is no need to verbose", ancients legends said --- .../{RefinedStorage.java => RS.java} | 12 +- ...efinedStorageBlocks.java => RSBlocks.java} | 58 +- ...efinedStorageConfig.java => RSConfig.java} | 6 +- .../{RefinedStorageGui.java => RSGui.java} | 54 +- ...{RefinedStorageItems.java => RSItems.java} | 40 +- .../{RefinedStorageAPI.java => RSAPI.java} | 2 +- .../api/network/NetworkUtils.java | 6 +- .../autocrafting/task/CraftingTaskNormal.java | 10 +- .../apiimpl/network/WirelessGridHandler.java | 16 +- .../apiimpl/network/grid/ItemGridHandler.java | 8 +- .../solderer/SoldererRecipeFluidStorage.java | 12 +- .../SoldererRecipePrintedProcessor.java | 6 +- .../solderer/SoldererRecipeProcessor.java | 12 +- .../solderer/SoldererRecipeStorage.java | 12 +- .../solderer/SoldererRecipeUpgrade.java | 6 +- .../apiimpl/storage/NBTStorage.java | 6 +- .../storage/item/GroupedItemStorage.java | 4 +- .../java/refinedstorage/block/BlockBase.java | 8 +- .../java/refinedstorage/block/BlockCable.java | 8 +- .../block/BlockConstructor.java | 6 +- .../refinedstorage/block/BlockController.java | 10 +- .../refinedstorage/block/BlockCrafter.java | 6 +- .../block/BlockCraftingMonitor.java | 6 +- .../refinedstorage/block/BlockDestructor.java | 10 +- .../refinedstorage/block/BlockDetector.java | 6 +- .../refinedstorage/block/BlockDiskDrive.java | 6 +- .../block/BlockDiskManipulator.java | 6 +- .../refinedstorage/block/BlockExporter.java | 6 +- .../block/BlockExternalStorage.java | 6 +- .../block/BlockFluidInterface.java | 6 +- .../block/BlockFluidStorage.java | 10 +- .../java/refinedstorage/block/BlockGrid.java | 6 +- .../refinedstorage/block/BlockImporter.java | 6 +- .../refinedstorage/block/BlockInterface.java | 6 +- .../block/BlockNetworkTransmitter.java | 6 +- .../block/BlockProcessingPatternEncoder.java | 6 +- .../java/refinedstorage/block/BlockRelay.java | 6 +- .../refinedstorage/block/BlockSolderer.java | 6 +- .../refinedstorage/block/BlockStorage.java | 10 +- .../block/BlockWirelessTransmitter.java | 6 +- .../container/ContainerSolderer.java | 4 +- src/main/java/refinedstorage/gui/GuiBase.java | 4 +- .../gui/GuiCraftingMonitor.java | 6 +- .../gui/GuiCraftingPreview.java | 4 +- .../refinedstorage/gui/GuiGridFilter.java | 4 +- .../java/refinedstorage/gui/GuiHandler.java | 94 ++-- .../gui/GuiProcessingPatternEncoder.java | 6 +- .../gui/config/ModGuiConfig.java | 8 +- .../gui/grid/GuiCraftingStart.java | 4 +- .../java/refinedstorage/gui/grid/GuiGrid.java | 12 +- .../forgeenergy/WirelessGridEnergyForge.java | 10 +- .../integration/jei/RecipeMakerSolderer.java | 4 +- .../jei/RecipeTransferHandlerGrid.java | 4 +- .../jei/RecipeTransferHandlerPattern.java | 4 +- .../jei/RefinedStorageJEIPlugin.java | 9 +- .../tesla/WirelessGridEnergyTesla.java | 8 +- .../inventory/IItemValidator.java | 6 +- .../ItemHandlerGridFilterInGrid.java | 4 +- .../inventory/ItemHandlerUpgrade.java | 4 +- .../java/refinedstorage/item/ItemBase.java | 8 +- .../item/ItemBlockController.java | 10 +- .../item/ItemBlockFluidStorage.java | 12 +- .../refinedstorage/item/ItemBlockStorage.java | 12 +- .../item/ItemFluidStorageDisk.java | 6 +- .../refinedstorage/item/ItemGridFilter.java | 10 +- .../refinedstorage/item/ItemNetworkCard.java | 4 +- .../java/refinedstorage/item/ItemPattern.java | 4 +- .../refinedstorage/item/ItemStorageDisk.java | 8 +- .../java/refinedstorage/item/ItemUpgrade.java | 12 +- .../refinedstorage/item/ItemWirelessGrid.java | 12 +- .../refinedstorage/proxy/ClientProxy.java | 176 +++--- .../refinedstorage/proxy/CommonProxy.java | 506 +++++++++--------- .../java/refinedstorage/tile/TileCable.java | 4 +- .../refinedstorage/tile/TileConstructor.java | 4 +- .../refinedstorage/tile/TileController.java | 20 +- .../java/refinedstorage/tile/TileCrafter.java | 6 +- .../tile/TileCraftingMonitor.java | 4 +- .../refinedstorage/tile/TileDestructor.java | 4 +- .../refinedstorage/tile/TileDetector.java | 8 +- .../refinedstorage/tile/TileDiskDrive.java | 16 +- .../tile/TileDiskManipulator.java | 4 +- .../refinedstorage/tile/TileExporter.java | 4 +- .../tile/TileFluidInterface.java | 4 +- .../refinedstorage/tile/TileFluidStorage.java | 8 +- .../refinedstorage/tile/TileImporter.java | 4 +- .../refinedstorage/tile/TileInterface.java | 4 +- .../tile/TileMultipartNode.java | 4 +- .../tile/TileNetworkReceiver.java | 4 +- .../tile/TileNetworkTransmitter.java | 8 +- .../tile/TileProcessingPatternEncoder.java | 6 +- .../java/refinedstorage/tile/TileRelay.java | 4 +- .../refinedstorage/tile/TileSolderer.java | 12 +- .../java/refinedstorage/tile/TileStorage.java | 8 +- .../tile/TileWirelessTransmitter.java | 6 +- .../tile/data/RefinedStorageSerializers.java | 4 +- .../tile/data/TileDataManager.java | 6 +- .../externalstorage/TileExternalStorage.java | 4 +- .../refinedstorage/tile/grid/TileGrid.java | 20 +- .../tile/grid/WirelessGrid.java | 10 +- 99 files changed, 800 insertions(+), 797 deletions(-) rename src/main/java/refinedstorage/{RefinedStorage.java => RS.java} (82%) rename src/main/java/refinedstorage/{RefinedStorageBlocks.java => RSBlocks.java} (96%) rename src/main/java/refinedstorage/{RefinedStorageConfig.java => RSConfig.java} (98%) rename src/main/java/refinedstorage/{RefinedStorageGui.java => RSGui.java} (94%) rename src/main/java/refinedstorage/{RefinedStorageItems.java => RSItems.java} (94%) rename src/main/java/refinedstorage/api/{RefinedStorageAPI.java => RSAPI.java} (94%) mode change 100644 => 100755 src/main/java/refinedstorage/apiimpl/storage/NBTStorage.java mode change 100644 => 100755 src/main/java/refinedstorage/gui/config/ModGuiConfig.java diff --git a/src/main/java/refinedstorage/RefinedStorage.java b/src/main/java/refinedstorage/RS.java similarity index 82% rename from src/main/java/refinedstorage/RefinedStorage.java rename to src/main/java/refinedstorage/RS.java index a98b6ff3b..9931bbadd 100755 --- a/src/main/java/refinedstorage/RefinedStorage.java +++ b/src/main/java/refinedstorage/RS.java @@ -15,8 +15,8 @@ import net.minecraftforge.fml.common.network.NetworkRegistry; import net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper; import refinedstorage.proxy.CommonProxy; -@Mod(modid = RefinedStorage.ID, version = RefinedStorage.VERSION, guiFactory = RefinedStorage.GUI_FACTORY, dependencies = RefinedStorage.DEPENDENCIES) -public final class RefinedStorage { +@Mod(modid = RS.ID, version = RS.VERSION, guiFactory = RS.GUI_FACTORY, dependencies = RS.DEPENDENCIES) +public final class RS { public static final String ID = "refinedstorage"; public static final String VERSION = "1.2"; public static final String DEPENDENCIES = "required-after:Forge@[12.18.1.2088,);required-after:mcmultipart@[1.2.1,);after:JEI@[3.12.0,);"; @@ -26,16 +26,16 @@ public final class RefinedStorage { public static CommonProxy PROXY; @Instance - public static RefinedStorage INSTANCE; + public static RS INSTANCE; - public RefinedStorageConfig config; + public RSConfig config; public final SimpleNetworkWrapper network = NetworkRegistry.INSTANCE.newSimpleChannel(ID); public final CreativeTabs tab = new CreativeTabs(ID) { @Override public ItemStack getIconItemStack() { - return new ItemStack(RefinedStorageItems.STORAGE_HOUSING); + return new ItemStack(RSItems.STORAGE_HOUSING); } @Override @@ -50,7 +50,7 @@ public final class RefinedStorage { @EventHandler public void preInit(FMLPreInitializationEvent e) { - config = new RefinedStorageConfig(e.getSuggestedConfigurationFile()); + config = new RSConfig(e.getSuggestedConfigurationFile()); PROXY.preInit(e); } diff --git a/src/main/java/refinedstorage/RefinedStorageBlocks.java b/src/main/java/refinedstorage/RSBlocks.java similarity index 96% rename from src/main/java/refinedstorage/RefinedStorageBlocks.java rename to src/main/java/refinedstorage/RSBlocks.java index 8c48c3a92..b89bfd341 100755 --- a/src/main/java/refinedstorage/RefinedStorageBlocks.java +++ b/src/main/java/refinedstorage/RSBlocks.java @@ -1,30 +1,30 @@ -package refinedstorage; - -import refinedstorage.block.*; - -public final class RefinedStorageBlocks { - public static final BlockController CONTROLLER = new BlockController(); - public static final BlockCable CABLE = new BlockCable(); - public static final BlockGrid GRID = new BlockGrid(); - public static final BlockDiskDrive DISK_DRIVE = new BlockDiskDrive(); - public static final BlockExternalStorage EXTERNAL_STORAGE = new BlockExternalStorage(); - public static final BlockImporter IMPORTER = new BlockImporter(); - public static final BlockExporter EXPORTER = new BlockExporter(); - public static final BlockDetector DETECTOR = new BlockDetector(); - public static final BlockMachineCasing MACHINE_CASING = new BlockMachineCasing(); - public static final BlockSolderer SOLDERER = new BlockSolderer(); - public static final BlockDestructor DESTRUCTOR = new BlockDestructor(); - public static final BlockConstructor CONSTRUCTOR = new BlockConstructor(); - public static final BlockStorage STORAGE = new BlockStorage(); - public static final BlockRelay RELAY = new BlockRelay(); - public static final BlockInterface INTERFACE = new BlockInterface(); - public static final BlockCraftingMonitor CRAFTING_MONITOR = new BlockCraftingMonitor(); - public static final BlockWirelessTransmitter WIRELESS_TRANSMITTER = new BlockWirelessTransmitter(); - public static final BlockCrafter CRAFTER = new BlockCrafter(); - public static final BlockProcessingPatternEncoder PROCESSING_PATTERN_ENCODER = new BlockProcessingPatternEncoder(); - public static final BlockNetworkTransmitter NETWORK_TRANSMITTER = new BlockNetworkTransmitter(); - public static final BlockNetworkReceiver NETWORK_RECEIVER = new BlockNetworkReceiver(); - public static final BlockFluidInterface FLUID_INTERFACE = new BlockFluidInterface(); - public static final BlockFluidStorage FLUID_STORAGE = new BlockFluidStorage(); - public static final BlockDiskManipulator DISK_MANIPULATOR = new BlockDiskManipulator(); +package refinedstorage; + +import refinedstorage.block.*; + +public final class RSBlocks { + public static final BlockController CONTROLLER = new BlockController(); + public static final BlockCable CABLE = new BlockCable(); + public static final BlockGrid GRID = new BlockGrid(); + public static final BlockDiskDrive DISK_DRIVE = new BlockDiskDrive(); + public static final BlockExternalStorage EXTERNAL_STORAGE = new BlockExternalStorage(); + public static final BlockImporter IMPORTER = new BlockImporter(); + public static final BlockExporter EXPORTER = new BlockExporter(); + public static final BlockDetector DETECTOR = new BlockDetector(); + public static final BlockMachineCasing MACHINE_CASING = new BlockMachineCasing(); + public static final BlockSolderer SOLDERER = new BlockSolderer(); + public static final BlockDestructor DESTRUCTOR = new BlockDestructor(); + public static final BlockConstructor CONSTRUCTOR = new BlockConstructor(); + public static final BlockStorage STORAGE = new BlockStorage(); + public static final BlockRelay RELAY = new BlockRelay(); + public static final BlockInterface INTERFACE = new BlockInterface(); + public static final BlockCraftingMonitor CRAFTING_MONITOR = new BlockCraftingMonitor(); + public static final BlockWirelessTransmitter WIRELESS_TRANSMITTER = new BlockWirelessTransmitter(); + public static final BlockCrafter CRAFTER = new BlockCrafter(); + public static final BlockProcessingPatternEncoder PROCESSING_PATTERN_ENCODER = new BlockProcessingPatternEncoder(); + public static final BlockNetworkTransmitter NETWORK_TRANSMITTER = new BlockNetworkTransmitter(); + public static final BlockNetworkReceiver NETWORK_RECEIVER = new BlockNetworkReceiver(); + public static final BlockFluidInterface FLUID_INTERFACE = new BlockFluidInterface(); + public static final BlockFluidStorage FLUID_STORAGE = new BlockFluidStorage(); + public static final BlockDiskManipulator DISK_MANIPULATOR = new BlockDiskManipulator(); } \ No newline at end of file diff --git a/src/main/java/refinedstorage/RefinedStorageConfig.java b/src/main/java/refinedstorage/RSConfig.java similarity index 98% rename from src/main/java/refinedstorage/RefinedStorageConfig.java rename to src/main/java/refinedstorage/RSConfig.java index 76f8a5a26..43952fc8d 100755 --- a/src/main/java/refinedstorage/RefinedStorageConfig.java +++ b/src/main/java/refinedstorage/RSConfig.java @@ -11,7 +11,7 @@ import java.io.File; import java.util.ArrayList; import java.util.List; -public final class RefinedStorageConfig { +public final class RSConfig { private Configuration config; //region Energy @@ -80,7 +80,7 @@ public final class RefinedStorageConfig { private static final String MISC = "misc"; //endregion - public RefinedStorageConfig(File configFile) { + public RSConfig(File configFile) { config = new Configuration(configFile); MinecraftForge.EVENT_BUS.register(this); @@ -94,7 +94,7 @@ public final class RefinedStorageConfig { @SubscribeEvent public void onConfigChangedEvent(ConfigChangedEvent.OnConfigChangedEvent event) { - if (event.getModID().equalsIgnoreCase(RefinedStorage.ID)) { + if (event.getModID().equalsIgnoreCase(RS.ID)) { loadConfig(); } } diff --git a/src/main/java/refinedstorage/RefinedStorageGui.java b/src/main/java/refinedstorage/RSGui.java similarity index 94% rename from src/main/java/refinedstorage/RefinedStorageGui.java rename to src/main/java/refinedstorage/RSGui.java index b88a76736..2df745d09 100755 --- a/src/main/java/refinedstorage/RefinedStorageGui.java +++ b/src/main/java/refinedstorage/RSGui.java @@ -1,27 +1,27 @@ -package refinedstorage; - -public final class RefinedStorageGui { - public static final int CONTROLLER = 0; - public static final int GRID = 1; - public static final int DISK_DRIVE = 2; - public static final int IMPORTER = 3; - public static final int EXPORTER = 4; - public static final int DETECTOR = 5; - public static final int SOLDERER = 6; - public static final int DESTRUCTOR = 7; - public static final int CONSTRUCTOR = 8; - public static final int STORAGE = 9; - public static final int RELAY = 10; - public static final int INTERFACE = 11; - public static final int WIRELESS_GRID = 12; - public static final int CRAFTING_MONITOR = 13; - public static final int WIRELESS_TRANSMITTER = 14; - public static final int CRAFTER = 15; - public static final int PROCESSING_PATTERN_ENCODER = 16; - public static final int GRID_FILTER = 17; - public static final int NETWORK_TRANSMITTER = 18; - public static final int FLUID_INTERFACE = 19; - public static final int EXTERNAL_STORAGE = 20; - public static final int FLUID_STORAGE = 21; - public static final int DISK_MANIPULATOR = 22; -} +package refinedstorage; + +public final class RSGui { + public static final int CONTROLLER = 0; + public static final int GRID = 1; + public static final int DISK_DRIVE = 2; + public static final int IMPORTER = 3; + public static final int EXPORTER = 4; + public static final int DETECTOR = 5; + public static final int SOLDERER = 6; + public static final int DESTRUCTOR = 7; + public static final int CONSTRUCTOR = 8; + public static final int STORAGE = 9; + public static final int RELAY = 10; + public static final int INTERFACE = 11; + public static final int WIRELESS_GRID = 12; + public static final int CRAFTING_MONITOR = 13; + public static final int WIRELESS_TRANSMITTER = 14; + public static final int CRAFTER = 15; + public static final int PROCESSING_PATTERN_ENCODER = 16; + public static final int GRID_FILTER = 17; + public static final int NETWORK_TRANSMITTER = 18; + public static final int FLUID_INTERFACE = 19; + public static final int EXTERNAL_STORAGE = 20; + public static final int FLUID_STORAGE = 21; + public static final int DISK_MANIPULATOR = 22; +} diff --git a/src/main/java/refinedstorage/RefinedStorageItems.java b/src/main/java/refinedstorage/RSItems.java similarity index 94% rename from src/main/java/refinedstorage/RefinedStorageItems.java rename to src/main/java/refinedstorage/RSItems.java index a4796a2a6..1f0e1d8f9 100755 --- a/src/main/java/refinedstorage/RefinedStorageItems.java +++ b/src/main/java/refinedstorage/RSItems.java @@ -1,20 +1,20 @@ -package refinedstorage; - -import refinedstorage.item.*; - -public final class RefinedStorageItems { - public static final ItemStorageDisk STORAGE_DISK = new ItemStorageDisk(); - public static final ItemWirelessGrid WIRELESS_GRID = new ItemWirelessGrid(); - public static final ItemQuartzEnrichedIron QUARTZ_ENRICHED_IRON = new ItemQuartzEnrichedIron(); - public static final ItemCore CORE = new ItemCore(); - public static final ItemSilicon SILICON = new ItemSilicon(); - public static final ItemProcessor PROCESSOR = new ItemProcessor(); - public static final ItemStoragePart STORAGE_PART = new ItemStoragePart(); - public static final ItemPattern PATTERN = new ItemPattern(); - public static final ItemUpgrade UPGRADE = new ItemUpgrade(); - public static final ItemStorageHousing STORAGE_HOUSING = new ItemStorageHousing(); - public static final ItemGridFilter GRID_FILTER = new ItemGridFilter(); - public static final ItemNetworkCard NETWORK_CARD = new ItemNetworkCard(); - public static final ItemFluidStorageDisk FLUID_STORAGE_DISK = new ItemFluidStorageDisk(); - public static final ItemFluidStoragePart FLUID_STORAGE_PART = new ItemFluidStoragePart(); -} +package refinedstorage; + +import refinedstorage.item.*; + +public final class RSItems { + public static final ItemStorageDisk STORAGE_DISK = new ItemStorageDisk(); + public static final ItemWirelessGrid WIRELESS_GRID = new ItemWirelessGrid(); + public static final ItemQuartzEnrichedIron QUARTZ_ENRICHED_IRON = new ItemQuartzEnrichedIron(); + public static final ItemCore CORE = new ItemCore(); + public static final ItemSilicon SILICON = new ItemSilicon(); + public static final ItemProcessor PROCESSOR = new ItemProcessor(); + public static final ItemStoragePart STORAGE_PART = new ItemStoragePart(); + public static final ItemPattern PATTERN = new ItemPattern(); + public static final ItemUpgrade UPGRADE = new ItemUpgrade(); + public static final ItemStorageHousing STORAGE_HOUSING = new ItemStorageHousing(); + public static final ItemGridFilter GRID_FILTER = new ItemGridFilter(); + public static final ItemNetworkCard NETWORK_CARD = new ItemNetworkCard(); + public static final ItemFluidStorageDisk FLUID_STORAGE_DISK = new ItemFluidStorageDisk(); + public static final ItemFluidStoragePart FLUID_STORAGE_PART = new ItemFluidStoragePart(); +} diff --git a/src/main/java/refinedstorage/api/RefinedStorageAPI.java b/src/main/java/refinedstorage/api/RSAPI.java similarity index 94% rename from src/main/java/refinedstorage/api/RefinedStorageAPI.java rename to src/main/java/refinedstorage/api/RSAPI.java index b4cde27e9..3f0139be7 100755 --- a/src/main/java/refinedstorage/api/RefinedStorageAPI.java +++ b/src/main/java/refinedstorage/api/RSAPI.java @@ -2,7 +2,7 @@ package refinedstorage.api; import java.lang.reflect.Field; -public final class RefinedStorageAPI { +public final class RSAPI { private static final String API_IMPL_CLASS = "refinedstorage.apiimpl.API"; private static final String API_IMPL_FIELD = "INSTANCE"; diff --git a/src/main/java/refinedstorage/api/network/NetworkUtils.java b/src/main/java/refinedstorage/api/network/NetworkUtils.java index 7f40ac0e2..1f40d2cbd 100755 --- a/src/main/java/refinedstorage/api/network/NetworkUtils.java +++ b/src/main/java/refinedstorage/api/network/NetworkUtils.java @@ -10,7 +10,7 @@ import net.minecraft.world.World; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fml.common.network.ByteBufUtils; -import refinedstorage.api.RefinedStorageAPI; +import refinedstorage.api.RSAPI; import refinedstorage.api.autocrafting.ICraftingPattern; import refinedstorage.api.autocrafting.ICraftingPatternContainer; import refinedstorage.api.autocrafting.ICraftingPatternProvider; @@ -37,7 +37,7 @@ public final class NetworkUtils { } public static ICraftingTask createCraftingTask(INetworkMaster network, @Nullable ItemStack stack, ICraftingPattern pattern, int quantity) { - return RefinedStorageAPI.instance().getCraftingTaskRegistry().getFactory(pattern.getId()).create(network.getNetworkWorld(), network, stack, pattern, quantity, null); + return RSAPI.instance().getCraftingTaskRegistry().getFactory(pattern.getId()).create(network.getNetworkWorld(), network, stack, pattern, quantity, null); } public static boolean hasPattern(INetworkMaster network, ItemStack stack) { @@ -85,7 +85,7 @@ public final class NetworkUtils { if (container instanceof ICraftingPatternContainer) { ICraftingPattern pattern = ((ICraftingPatternProvider) stack.getItem()).create(world, stack, (ICraftingPatternContainer) container); - ICraftingTaskFactory factory = RefinedStorageAPI.instance().getCraftingTaskRegistry().getFactory(tag.getString(ICraftingTask.NBT_PATTERN_ID)); + ICraftingTaskFactory factory = RSAPI.instance().getCraftingTaskRegistry().getFactory(tag.getString(ICraftingTask.NBT_PATTERN_ID)); if (factory != null) { return factory.create(world, network, null, pattern, tag.getInteger(ICraftingTask.NBT_QUANTITY), tag); diff --git a/src/main/java/refinedstorage/apiimpl/autocrafting/task/CraftingTaskNormal.java b/src/main/java/refinedstorage/apiimpl/autocrafting/task/CraftingTaskNormal.java index 07a8c3874..b58aedb36 100755 --- a/src/main/java/refinedstorage/apiimpl/autocrafting/task/CraftingTaskNormal.java +++ b/src/main/java/refinedstorage/apiimpl/autocrafting/task/CraftingTaskNormal.java @@ -3,7 +3,7 @@ package refinedstorage.apiimpl.autocrafting.task; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.items.ItemHandlerHelper; -import refinedstorage.api.RefinedStorageAPI; +import refinedstorage.api.RSAPI; import refinedstorage.api.autocrafting.ICraftingPattern; import refinedstorage.api.autocrafting.craftingmonitor.ICraftingMonitorElement; import refinedstorage.api.autocrafting.task.ICraftingTask; @@ -27,9 +27,9 @@ public class CraftingTaskNormal implements ICraftingTask { private int quantity; private Deque toTake = new ArrayDeque<>(); private List toProcess = new ArrayList<>(); - private IItemStackList toCraft = RefinedStorageAPI.instance().createItemStackList(); - private IItemStackList missing = RefinedStorageAPI.instance().createItemStackList(); - private IItemStackList extras = RefinedStorageAPI.instance().createItemStackList(); + private IItemStackList toCraft = RSAPI.instance().createItemStackList(); + private IItemStackList missing = RSAPI.instance().createItemStackList(); + private IItemStackList extras = RSAPI.instance().createItemStackList(); public CraftingTaskNormal(INetworkMaster network, ItemStack requested, ICraftingPattern pattern, int quantity) { this.network = network; @@ -161,7 +161,7 @@ public class CraftingTaskNormal implements ICraftingTask { )); if (!toTake.isEmpty()) { - IItemStackList toTake = RefinedStorageAPI.instance().createItemStackList(); + IItemStackList toTake = RSAPI.instance().createItemStackList(); for (ItemStack stack : new ArrayList<>(this.toTake)) { toTake.add(stack); diff --git a/src/main/java/refinedstorage/apiimpl/network/WirelessGridHandler.java b/src/main/java/refinedstorage/apiimpl/network/WirelessGridHandler.java index 3cb6c3407..f9fb95a74 100755 --- a/src/main/java/refinedstorage/apiimpl/network/WirelessGridHandler.java +++ b/src/main/java/refinedstorage/apiimpl/network/WirelessGridHandler.java @@ -5,9 +5,9 @@ import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumHand; import net.minecraft.world.World; -import refinedstorage.RefinedStorage; -import refinedstorage.RefinedStorageGui; -import refinedstorage.RefinedStorageItems; +import refinedstorage.RS; +import refinedstorage.RSGui; +import refinedstorage.RSItems; import refinedstorage.api.network.*; import refinedstorage.item.ItemWirelessGrid; @@ -55,17 +55,17 @@ public class WirelessGridHandler implements IWirelessGridHandler { ItemStack stack = player.getHeldItem(hand); - if (RefinedStorage.INSTANCE.config.wirelessGridUsesEnergy && stack.getItemDamage() != ItemWirelessGrid.TYPE_CREATIVE && RefinedStorageItems.WIRELESS_GRID.getEnergyStored(stack) <= RefinedStorage.INSTANCE.config.wirelessGridOpenUsage) { + if (RS.INSTANCE.config.wirelessGridUsesEnergy && stack.getItemDamage() != ItemWirelessGrid.TYPE_CREATIVE && RSItems.WIRELESS_GRID.getEnergyStored(stack) <= RS.INSTANCE.config.wirelessGridOpenUsage) { return true; } consumers.add(new WirelessGridConsumer(player, stack)); - player.openGui(RefinedStorage.INSTANCE, RefinedStorageGui.WIRELESS_GRID, player.worldObj, hand.ordinal(), controllerWorld.provider.getDimension(), 0); + player.openGui(RS.INSTANCE, RSGui.WIRELESS_GRID, player.worldObj, hand.ordinal(), controllerWorld.provider.getDimension(), 0); network.sendItemStorageToClient((EntityPlayerMP) player); - drainEnergy(player, RefinedStorage.INSTANCE.config.wirelessGridOpenUsage); + drainEnergy(player, RS.INSTANCE.config.wirelessGridOpenUsage); return true; } @@ -83,8 +83,8 @@ public class WirelessGridHandler implements IWirelessGridHandler { public void drainEnergy(EntityPlayer player, int energy) { IWirelessGridConsumer consumer = getConsumer(player); - if (consumer != null && RefinedStorage.INSTANCE.config.wirelessGridUsesEnergy) { - ItemWirelessGrid item = RefinedStorageItems.WIRELESS_GRID; + if (consumer != null && RS.INSTANCE.config.wirelessGridUsesEnergy) { + ItemWirelessGrid item = RSItems.WIRELESS_GRID; if (consumer.getStack().getItemDamage() != ItemWirelessGrid.TYPE_CREATIVE) { item.extractEnergy(consumer.getStack(), energy, false); diff --git a/src/main/java/refinedstorage/apiimpl/network/grid/ItemGridHandler.java b/src/main/java/refinedstorage/apiimpl/network/grid/ItemGridHandler.java index dda97a31a..ea21f8ba3 100755 --- a/src/main/java/refinedstorage/apiimpl/network/grid/ItemGridHandler.java +++ b/src/main/java/refinedstorage/apiimpl/network/grid/ItemGridHandler.java @@ -5,7 +5,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.EnumFacing; import net.minecraftforge.items.CapabilityItemHandler; import net.minecraftforge.items.ItemHandlerHelper; -import refinedstorage.RefinedStorage; +import refinedstorage.RS; import refinedstorage.api.autocrafting.task.ICraftingTask; import refinedstorage.api.network.INetworkMaster; import refinedstorage.api.network.NetworkUtils; @@ -77,7 +77,7 @@ public class ItemGridHandler implements IItemGridHandler { player.updateHeldItem(); } - network.getWirelessGridHandler().drainEnergy(player, RefinedStorage.INSTANCE.config.wirelessGridExtractUsage); + network.getWirelessGridHandler().drainEnergy(player, RS.INSTANCE.config.wirelessGridExtractUsage); } } @@ -85,7 +85,7 @@ public class ItemGridHandler implements IItemGridHandler { public ItemStack onInsert(EntityPlayerMP player, ItemStack stack) { ItemStack remainder = network.insertItem(stack, stack.stackSize, false); - network.getWirelessGridHandler().drainEnergy(player, RefinedStorage.INSTANCE.config.wirelessGridInsertUsage); + network.getWirelessGridHandler().drainEnergy(player, RS.INSTANCE.config.wirelessGridInsertUsage); return remainder; } @@ -115,7 +115,7 @@ public class ItemGridHandler implements IItemGridHandler { player.updateHeldItem(); - network.getWirelessGridHandler().drainEnergy(player, RefinedStorage.INSTANCE.config.wirelessGridInsertUsage); + network.getWirelessGridHandler().drainEnergy(player, RS.INSTANCE.config.wirelessGridInsertUsage); } @Override diff --git a/src/main/java/refinedstorage/apiimpl/solderer/SoldererRecipeFluidStorage.java b/src/main/java/refinedstorage/apiimpl/solderer/SoldererRecipeFluidStorage.java index bf98efe9e..4f2a2f931 100755 --- a/src/main/java/refinedstorage/apiimpl/solderer/SoldererRecipeFluidStorage.java +++ b/src/main/java/refinedstorage/apiimpl/solderer/SoldererRecipeFluidStorage.java @@ -1,8 +1,8 @@ package refinedstorage.apiimpl.solderer; import net.minecraft.item.ItemStack; -import refinedstorage.RefinedStorageBlocks; -import refinedstorage.RefinedStorageItems; +import refinedstorage.RSBlocks; +import refinedstorage.RSItems; import refinedstorage.api.solderer.ISoldererRecipe; import refinedstorage.block.EnumFluidStorageType; import refinedstorage.item.ItemBlockFluidStorage; @@ -18,9 +18,9 @@ public class SoldererRecipeFluidStorage implements ISoldererRecipe { public SoldererRecipeFluidStorage(EnumFluidStorageType type, int storagePart) { this.type = type; this.rows = new ItemStack[]{ - new ItemStack(RefinedStorageItems.PROCESSOR, 1, ItemProcessor.TYPE_BASIC), - new ItemStack(RefinedStorageBlocks.MACHINE_CASING), - new ItemStack(RefinedStorageItems.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) }; } @@ -33,7 +33,7 @@ public class SoldererRecipeFluidStorage implements ISoldererRecipe { @Override @Nonnull public ItemStack getResult() { - return ItemBlockFluidStorage.initNBT(new ItemStack(RefinedStorageBlocks.FLUID_STORAGE, 1, type.getId())); + return ItemBlockFluidStorage.initNBT(new ItemStack(RSBlocks.FLUID_STORAGE, 1, type.getId())); } @Override diff --git a/src/main/java/refinedstorage/apiimpl/solderer/SoldererRecipePrintedProcessor.java b/src/main/java/refinedstorage/apiimpl/solderer/SoldererRecipePrintedProcessor.java index 980d83c2f..4c4ea1289 100755 --- a/src/main/java/refinedstorage/apiimpl/solderer/SoldererRecipePrintedProcessor.java +++ b/src/main/java/refinedstorage/apiimpl/solderer/SoldererRecipePrintedProcessor.java @@ -2,7 +2,7 @@ package refinedstorage.apiimpl.solderer; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; -import refinedstorage.RefinedStorageItems; +import refinedstorage.RSItems; import refinedstorage.api.solderer.ISoldererRecipe; import refinedstorage.item.ItemProcessor; @@ -16,7 +16,7 @@ public class SoldererRecipePrintedProcessor implements ISoldererRecipe { public SoldererRecipePrintedProcessor(int type) { this.type = type; - this.result = new ItemStack(RefinedStorageItems.PROCESSOR, 1, type); + this.result = new ItemStack(RSItems.PROCESSOR, 1, type); switch (type) { case ItemProcessor.TYPE_PRINTED_BASIC: @@ -29,7 +29,7 @@ public class SoldererRecipePrintedProcessor implements ISoldererRecipe { this.requirement = new ItemStack(Items.DIAMOND); break; case ItemProcessor.TYPE_PRINTED_SILICON: - this.requirement = new ItemStack(RefinedStorageItems.SILICON); + this.requirement = new ItemStack(RSItems.SILICON); break; } } diff --git a/src/main/java/refinedstorage/apiimpl/solderer/SoldererRecipeProcessor.java b/src/main/java/refinedstorage/apiimpl/solderer/SoldererRecipeProcessor.java index 8920613dc..aa525ec03 100755 --- a/src/main/java/refinedstorage/apiimpl/solderer/SoldererRecipeProcessor.java +++ b/src/main/java/refinedstorage/apiimpl/solderer/SoldererRecipeProcessor.java @@ -2,7 +2,7 @@ package refinedstorage.apiimpl.solderer; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; -import refinedstorage.RefinedStorageItems; +import refinedstorage.RSItems; import refinedstorage.api.solderer.ISoldererRecipe; import refinedstorage.item.ItemProcessor; @@ -21,21 +21,21 @@ public class SoldererRecipeProcessor implements ISoldererRecipe { switch (type) { case ItemProcessor.TYPE_BASIC: - printedProcessor = new ItemStack(RefinedStorageItems.PROCESSOR, 1, ItemProcessor.TYPE_PRINTED_BASIC); + printedProcessor = new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_PRINTED_BASIC); break; case ItemProcessor.TYPE_IMPROVED: - printedProcessor = new ItemStack(RefinedStorageItems.PROCESSOR, 1, ItemProcessor.TYPE_PRINTED_IMPROVED); + printedProcessor = new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_PRINTED_IMPROVED); break; case ItemProcessor.TYPE_ADVANCED: - printedProcessor = new ItemStack(RefinedStorageItems.PROCESSOR, 1, ItemProcessor.TYPE_PRINTED_ADVANCED); + printedProcessor = new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_PRINTED_ADVANCED); break; } - this.result = new ItemStack(RefinedStorageItems.PROCESSOR, 1, type); + this.result = new ItemStack(RSItems.PROCESSOR, 1, type); this.rows = new ItemStack[]{ printedProcessor, new ItemStack(Items.REDSTONE), - new ItemStack(RefinedStorageItems.PROCESSOR, 1, ItemProcessor.TYPE_PRINTED_SILICON) + new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_PRINTED_SILICON) }; } diff --git a/src/main/java/refinedstorage/apiimpl/solderer/SoldererRecipeStorage.java b/src/main/java/refinedstorage/apiimpl/solderer/SoldererRecipeStorage.java index 1cb4defa0..1302a5255 100755 --- a/src/main/java/refinedstorage/apiimpl/solderer/SoldererRecipeStorage.java +++ b/src/main/java/refinedstorage/apiimpl/solderer/SoldererRecipeStorage.java @@ -1,8 +1,8 @@ package refinedstorage.apiimpl.solderer; import net.minecraft.item.ItemStack; -import refinedstorage.RefinedStorageBlocks; -import refinedstorage.RefinedStorageItems; +import refinedstorage.RSBlocks; +import refinedstorage.RSItems; import refinedstorage.api.solderer.ISoldererRecipe; import refinedstorage.block.EnumItemStorageType; import refinedstorage.item.ItemBlockStorage; @@ -18,9 +18,9 @@ public class SoldererRecipeStorage implements ISoldererRecipe { public SoldererRecipeStorage(EnumItemStorageType type, int storagePart) { this.type = type; this.rows = new ItemStack[]{ - new ItemStack(RefinedStorageItems.PROCESSOR, 1, ItemProcessor.TYPE_BASIC), - new ItemStack(RefinedStorageBlocks.MACHINE_CASING), - new ItemStack(RefinedStorageItems.STORAGE_PART, 1, storagePart) + new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_BASIC), + new ItemStack(RSBlocks.MACHINE_CASING), + new ItemStack(RSItems.STORAGE_PART, 1, storagePart) }; } @@ -33,7 +33,7 @@ public class SoldererRecipeStorage implements ISoldererRecipe { @Override @Nonnull public ItemStack getResult() { - return ItemBlockStorage.initNBT(new ItemStack(RefinedStorageBlocks.STORAGE, 1, type.getId())); + return ItemBlockStorage.initNBT(new ItemStack(RSBlocks.STORAGE, 1, type.getId())); } @Override diff --git a/src/main/java/refinedstorage/apiimpl/solderer/SoldererRecipeUpgrade.java b/src/main/java/refinedstorage/apiimpl/solderer/SoldererRecipeUpgrade.java index ace718aa2..4cf7b02e5 100755 --- a/src/main/java/refinedstorage/apiimpl/solderer/SoldererRecipeUpgrade.java +++ b/src/main/java/refinedstorage/apiimpl/solderer/SoldererRecipeUpgrade.java @@ -2,7 +2,7 @@ package refinedstorage.apiimpl.solderer; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; -import refinedstorage.RefinedStorageItems; +import refinedstorage.RSItems; import refinedstorage.api.solderer.ISoldererRecipe; import refinedstorage.item.ItemUpgrade; @@ -14,10 +14,10 @@ public class SoldererRecipeUpgrade implements ISoldererRecipe { private ItemStack result; public SoldererRecipeUpgrade(int type) { - this.result = new ItemStack(RefinedStorageItems.UPGRADE, 1, type); + this.result = new ItemStack(RSItems.UPGRADE, 1, type); this.rows = new ItemStack[]{ ItemUpgrade.getRequirement(type), - new ItemStack(RefinedStorageItems.UPGRADE, 1, 0), + new ItemStack(RSItems.UPGRADE, 1, 0), new ItemStack(Items.REDSTONE) }; } diff --git a/src/main/java/refinedstorage/apiimpl/storage/NBTStorage.java b/src/main/java/refinedstorage/apiimpl/storage/NBTStorage.java old mode 100644 new mode 100755 index 362ff1b1d..ad3193f08 --- a/src/main/java/refinedstorage/apiimpl/storage/NBTStorage.java +++ b/src/main/java/refinedstorage/apiimpl/storage/NBTStorage.java @@ -1,7 +1,7 @@ package refinedstorage.apiimpl.storage; import net.minecraft.item.ItemStack; -import refinedstorage.RefinedStorageItems; +import refinedstorage.RSItems; import refinedstorage.apiimpl.storage.fluid.FluidStorageNBT; import refinedstorage.apiimpl.storage.item.ItemStorageNBT; @@ -13,9 +13,9 @@ public final class NBTStorage { itemStorages[slot] = null; fluidStorages[slot] = null; } else { - if (disk.getItem() == RefinedStorageItems.STORAGE_DISK) { + if (disk.getItem() == RSItems.STORAGE_DISK) { itemStorages[slot] = itemStorageSupplier.apply(disk); - } else if (disk.getItem() == RefinedStorageItems.FLUID_STORAGE_DISK) { + } else if (disk.getItem() == RSItems.FLUID_STORAGE_DISK) { fluidStorages[slot] = fluidStorageNBTSupplier.apply(disk); } } diff --git a/src/main/java/refinedstorage/apiimpl/storage/item/GroupedItemStorage.java b/src/main/java/refinedstorage/apiimpl/storage/item/GroupedItemStorage.java index 8cf8a9fc0..df260003a 100755 --- a/src/main/java/refinedstorage/apiimpl/storage/item/GroupedItemStorage.java +++ b/src/main/java/refinedstorage/apiimpl/storage/item/GroupedItemStorage.java @@ -1,7 +1,7 @@ package refinedstorage.apiimpl.storage.item; import net.minecraft.item.ItemStack; -import refinedstorage.api.RefinedStorageAPI; +import refinedstorage.api.RSAPI; import refinedstorage.api.autocrafting.ICraftingPattern; import refinedstorage.api.network.INetworkMaster; import refinedstorage.api.network.NetworkUtils; @@ -17,7 +17,7 @@ import java.util.List; public class GroupedItemStorage implements IGroupedItemStorage { private INetworkMaster network; private List storages = new ArrayList<>(); - private IItemStackList list = RefinedStorageAPI.instance().createItemStackList(); + private IItemStackList list = RSAPI.instance().createItemStackList(); public GroupedItemStorage(INetworkMaster network) { this.network = network; diff --git a/src/main/java/refinedstorage/block/BlockBase.java b/src/main/java/refinedstorage/block/BlockBase.java index 74fcab142..7acbbe385 100755 --- a/src/main/java/refinedstorage/block/BlockBase.java +++ b/src/main/java/refinedstorage/block/BlockBase.java @@ -15,7 +15,7 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.items.IItemHandler; -import refinedstorage.RefinedStorage; +import refinedstorage.RS; import refinedstorage.item.ItemBlockBase; import refinedstorage.tile.TileBase; @@ -30,13 +30,13 @@ public abstract class BlockBase extends Block { this.name = name; setHardness(1.9F); - setRegistryName(RefinedStorage.ID, name); - setCreativeTab(RefinedStorage.INSTANCE.tab); + setRegistryName(RS.ID, name); + setCreativeTab(RS.INSTANCE.tab); } @Override public String getUnlocalizedName() { - return "block." + RefinedStorage.ID + ":" + name; + return "block." + RS.ID + ":" + name; } protected BlockStateContainer.Builder createBlockStateBuilder() { diff --git a/src/main/java/refinedstorage/block/BlockCable.java b/src/main/java/refinedstorage/block/BlockCable.java index 8a4486e8c..bce4131d1 100755 --- a/src/main/java/refinedstorage/block/BlockCable.java +++ b/src/main/java/refinedstorage/block/BlockCable.java @@ -22,7 +22,7 @@ import net.minecraft.util.math.Vec3d; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.items.IItemHandler; -import refinedstorage.RefinedStorage; +import refinedstorage.RS; import refinedstorage.api.network.INetworkMaster; import refinedstorage.api.network.INetworkNode; import refinedstorage.api.network.NetworkUtils; @@ -66,8 +66,8 @@ public class BlockCable extends BlockCoverable { this.name = name; setHardness(0.6F); - setRegistryName(RefinedStorage.ID, name); - setCreativeTab(RefinedStorage.INSTANCE.tab); + setRegistryName(RS.ID, name); + setCreativeTab(RS.INSTANCE.tab); } public BlockCable() { @@ -76,7 +76,7 @@ public class BlockCable extends BlockCoverable { @Override public String getUnlocalizedName() { - return "block." + RefinedStorage.ID + ":" + name; + return "block." + RS.ID + ":" + name; } public String getName() { diff --git a/src/main/java/refinedstorage/block/BlockConstructor.java b/src/main/java/refinedstorage/block/BlockConstructor.java index 07787737a..6c5bfb9aa 100755 --- a/src/main/java/refinedstorage/block/BlockConstructor.java +++ b/src/main/java/refinedstorage/block/BlockConstructor.java @@ -9,8 +9,8 @@ import net.minecraft.util.EnumHand; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import refinedstorage.RefinedStorage; -import refinedstorage.RefinedStorageGui; +import refinedstorage.RS; +import refinedstorage.RSGui; import refinedstorage.tile.TileConstructor; import java.util.ArrayList; @@ -85,7 +85,7 @@ public class BlockConstructor extends BlockCable { } if (!world.isRemote) { - player.openGui(RefinedStorage.INSTANCE, RefinedStorageGui.CONSTRUCTOR, world, pos.getX(), pos.getY(), pos.getZ()); + player.openGui(RS.INSTANCE, RSGui.CONSTRUCTOR, world, pos.getX(), pos.getY(), pos.getZ()); } return true; diff --git a/src/main/java/refinedstorage/block/BlockController.java b/src/main/java/refinedstorage/block/BlockController.java index c64347317..a516f1f1c 100755 --- a/src/main/java/refinedstorage/block/BlockController.java +++ b/src/main/java/refinedstorage/block/BlockController.java @@ -17,9 +17,9 @@ import net.minecraft.util.EnumHand; import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -import refinedstorage.RefinedStorage; -import refinedstorage.RefinedStorageBlocks; -import refinedstorage.RefinedStorageGui; +import refinedstorage.RS; +import refinedstorage.RSBlocks; +import refinedstorage.RSGui; import refinedstorage.api.network.NetworkUtils; import refinedstorage.item.ItemBlockController; import refinedstorage.tile.TileController; @@ -82,7 +82,7 @@ public class BlockController extends BlockBase { @Override public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) { if (!world.isRemote) { - player.openGui(RefinedStorage.INSTANCE, RefinedStorageGui.CONTROLLER, world, pos.getX(), pos.getY(), pos.getZ()); + player.openGui(RS.INSTANCE, RSGui.CONTROLLER, world, pos.getX(), pos.getY(), pos.getZ()); } return true; @@ -126,7 +126,7 @@ public class BlockController extends BlockBase { public List getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) { List drops = new ArrayList<>(); - ItemStack stack = new ItemStack(RefinedStorageBlocks.CONTROLLER, 1, RefinedStorageBlocks.CONTROLLER.getMetaFromState(state)); + ItemStack stack = new ItemStack(RSBlocks.CONTROLLER, 1, RSBlocks.CONTROLLER.getMetaFromState(state)); stack.setTagCompound(new NBTTagCompound()); stack.getTagCompound().setInteger(TileController.NBT_ENERGY, ((TileController) world.getTileEntity(pos)).getEnergy().getEnergyStored()); diff --git a/src/main/java/refinedstorage/block/BlockCrafter.java b/src/main/java/refinedstorage/block/BlockCrafter.java index 23f33586a..3c8741265 100755 --- a/src/main/java/refinedstorage/block/BlockCrafter.java +++ b/src/main/java/refinedstorage/block/BlockCrafter.java @@ -8,8 +8,8 @@ import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumHand; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import refinedstorage.RefinedStorage; -import refinedstorage.RefinedStorageGui; +import refinedstorage.RS; +import refinedstorage.RSGui; import refinedstorage.tile.TileCrafter; public class BlockCrafter extends BlockNode { @@ -25,7 +25,7 @@ public class BlockCrafter extends BlockNode { @Override public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) { if (!world.isRemote) { - player.openGui(RefinedStorage.INSTANCE, RefinedStorageGui.CRAFTER, world, pos.getX(), pos.getY(), pos.getZ()); + player.openGui(RS.INSTANCE, RSGui.CRAFTER, world, pos.getX(), pos.getY(), pos.getZ()); } return true; diff --git a/src/main/java/refinedstorage/block/BlockCraftingMonitor.java b/src/main/java/refinedstorage/block/BlockCraftingMonitor.java index 1eb575fb3..382169cbe 100755 --- a/src/main/java/refinedstorage/block/BlockCraftingMonitor.java +++ b/src/main/java/refinedstorage/block/BlockCraftingMonitor.java @@ -8,8 +8,8 @@ import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumHand; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import refinedstorage.RefinedStorage; -import refinedstorage.RefinedStorageGui; +import refinedstorage.RS; +import refinedstorage.RSGui; import refinedstorage.tile.TileCraftingMonitor; public class BlockCraftingMonitor extends BlockNode { @@ -25,7 +25,7 @@ public class BlockCraftingMonitor extends BlockNode { @Override public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) { if (!world.isRemote) { - player.openGui(RefinedStorage.INSTANCE, RefinedStorageGui.CRAFTING_MONITOR, world, pos.getX(), pos.getY(), pos.getZ()); + player.openGui(RS.INSTANCE, RSGui.CRAFTING_MONITOR, world, pos.getX(), pos.getY(), pos.getZ()); } return true; diff --git a/src/main/java/refinedstorage/block/BlockDestructor.java b/src/main/java/refinedstorage/block/BlockDestructor.java index 9a90b2df0..432f3d94d 100755 --- a/src/main/java/refinedstorage/block/BlockDestructor.java +++ b/src/main/java/refinedstorage/block/BlockDestructor.java @@ -9,9 +9,9 @@ import net.minecraft.util.EnumHand; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import refinedstorage.RefinedStorage; -import refinedstorage.RefinedStorageBlocks; -import refinedstorage.RefinedStorageGui; +import refinedstorage.RS; +import refinedstorage.RSBlocks; +import refinedstorage.RSGui; import refinedstorage.tile.TileDestructor; import java.util.List; @@ -32,7 +32,7 @@ public class BlockDestructor extends BlockCable { @Override public List getNonUnionizedCollisionBoxes(IBlockState state) { - return RefinedStorageBlocks.CONSTRUCTOR.getNonUnionizedCollisionBoxes(state); + return RSBlocks.CONSTRUCTOR.getNonUnionizedCollisionBoxes(state); } @Override @@ -42,7 +42,7 @@ public class BlockDestructor extends BlockCable { } if (!world.isRemote) { - player.openGui(RefinedStorage.INSTANCE, RefinedStorageGui.DESTRUCTOR, world, pos.getX(), pos.getY(), pos.getZ()); + player.openGui(RS.INSTANCE, RSGui.DESTRUCTOR, world, pos.getX(), pos.getY(), pos.getZ()); } return true; diff --git a/src/main/java/refinedstorage/block/BlockDetector.java b/src/main/java/refinedstorage/block/BlockDetector.java index b4c22785a..3de740e81 100755 --- a/src/main/java/refinedstorage/block/BlockDetector.java +++ b/src/main/java/refinedstorage/block/BlockDetector.java @@ -13,8 +13,8 @@ import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -import refinedstorage.RefinedStorage; -import refinedstorage.RefinedStorageGui; +import refinedstorage.RS; +import refinedstorage.RSGui; import refinedstorage.tile.TileDetector; public class BlockDetector extends BlockNode { @@ -71,7 +71,7 @@ public class BlockDetector extends BlockNode { @Override public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) { if (!world.isRemote) { - player.openGui(RefinedStorage.INSTANCE, RefinedStorageGui.DETECTOR, world, pos.getX(), pos.getY(), pos.getZ()); + player.openGui(RS.INSTANCE, RSGui.DETECTOR, world, pos.getX(), pos.getY(), pos.getZ()); } return true; diff --git a/src/main/java/refinedstorage/block/BlockDiskDrive.java b/src/main/java/refinedstorage/block/BlockDiskDrive.java index b84e2a46d..b101d049b 100755 --- a/src/main/java/refinedstorage/block/BlockDiskDrive.java +++ b/src/main/java/refinedstorage/block/BlockDiskDrive.java @@ -12,8 +12,8 @@ import net.minecraft.util.EnumHand; import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -import refinedstorage.RefinedStorage; -import refinedstorage.RefinedStorageGui; +import refinedstorage.RS; +import refinedstorage.RSGui; import refinedstorage.tile.TileDiskDrive; public class BlockDiskDrive extends BlockNode { @@ -73,7 +73,7 @@ public class BlockDiskDrive extends BlockNode { @Override public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) { if (!world.isRemote) { - player.openGui(RefinedStorage.INSTANCE, RefinedStorageGui.DISK_DRIVE, world, pos.getX(), pos.getY(), pos.getZ()); + player.openGui(RS.INSTANCE, RSGui.DISK_DRIVE, world, pos.getX(), pos.getY(), pos.getZ()); } return true; diff --git a/src/main/java/refinedstorage/block/BlockDiskManipulator.java b/src/main/java/refinedstorage/block/BlockDiskManipulator.java index ce078fce8..3e464576b 100755 --- a/src/main/java/refinedstorage/block/BlockDiskManipulator.java +++ b/src/main/java/refinedstorage/block/BlockDiskManipulator.java @@ -8,8 +8,8 @@ import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumHand; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import refinedstorage.RefinedStorage; -import refinedstorage.RefinedStorageGui; +import refinedstorage.RS; +import refinedstorage.RSGui; import refinedstorage.tile.TileDiskManipulator; import javax.annotation.Nullable; @@ -27,7 +27,7 @@ public class BlockDiskManipulator extends BlockNode { @Override public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, @Nullable ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) { if (!world.isRemote) { - player.openGui(RefinedStorage.INSTANCE, RefinedStorageGui.DISK_MANIPULATOR, world, pos.getX(), pos.getY(), pos.getZ()); + player.openGui(RS.INSTANCE, RSGui.DISK_MANIPULATOR, world, pos.getX(), pos.getY(), pos.getZ()); } return true; diff --git a/src/main/java/refinedstorage/block/BlockExporter.java b/src/main/java/refinedstorage/block/BlockExporter.java index b78aaef9f..83c873eaf 100755 --- a/src/main/java/refinedstorage/block/BlockExporter.java +++ b/src/main/java/refinedstorage/block/BlockExporter.java @@ -9,8 +9,8 @@ import net.minecraft.util.EnumHand; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import refinedstorage.RefinedStorage; -import refinedstorage.RefinedStorageGui; +import refinedstorage.RS; +import refinedstorage.RSGui; import refinedstorage.tile.TileExporter; import java.util.ArrayList; @@ -92,7 +92,7 @@ public class BlockExporter extends BlockCable { } if (!world.isRemote) { - player.openGui(RefinedStorage.INSTANCE, RefinedStorageGui.EXPORTER, world, pos.getX(), pos.getY(), pos.getZ()); + player.openGui(RS.INSTANCE, RSGui.EXPORTER, world, pos.getX(), pos.getY(), pos.getZ()); } return true; diff --git a/src/main/java/refinedstorage/block/BlockExternalStorage.java b/src/main/java/refinedstorage/block/BlockExternalStorage.java index a41a50c27..62fbfcede 100755 --- a/src/main/java/refinedstorage/block/BlockExternalStorage.java +++ b/src/main/java/refinedstorage/block/BlockExternalStorage.java @@ -10,8 +10,8 @@ import net.minecraft.util.EnumHand; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import refinedstorage.RefinedStorage; -import refinedstorage.RefinedStorageGui; +import refinedstorage.RS; +import refinedstorage.RSGui; import refinedstorage.tile.externalstorage.TileExternalStorage; import java.util.ArrayList; @@ -75,7 +75,7 @@ public class BlockExternalStorage extends BlockCable { } if (!world.isRemote) { - player.openGui(RefinedStorage.INSTANCE, RefinedStorageGui.EXTERNAL_STORAGE, world, pos.getX(), pos.getY(), pos.getZ()); + player.openGui(RS.INSTANCE, RSGui.EXTERNAL_STORAGE, world, pos.getX(), pos.getY(), pos.getZ()); } return true; diff --git a/src/main/java/refinedstorage/block/BlockFluidInterface.java b/src/main/java/refinedstorage/block/BlockFluidInterface.java index e7be93f32..2a923eec6 100755 --- a/src/main/java/refinedstorage/block/BlockFluidInterface.java +++ b/src/main/java/refinedstorage/block/BlockFluidInterface.java @@ -8,8 +8,8 @@ import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumHand; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import refinedstorage.RefinedStorage; -import refinedstorage.RefinedStorageGui; +import refinedstorage.RS; +import refinedstorage.RSGui; import refinedstorage.tile.TileFluidInterface; public class BlockFluidInterface extends BlockNode { @@ -25,7 +25,7 @@ public class BlockFluidInterface extends BlockNode { @Override public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) { if (!world.isRemote) { - player.openGui(RefinedStorage.INSTANCE, RefinedStorageGui.FLUID_INTERFACE, world, pos.getX(), pos.getY(), pos.getZ()); + player.openGui(RS.INSTANCE, RSGui.FLUID_INTERFACE, world, pos.getX(), pos.getY(), pos.getZ()); } return true; diff --git a/src/main/java/refinedstorage/block/BlockFluidStorage.java b/src/main/java/refinedstorage/block/BlockFluidStorage.java index 774c57818..9ba6625b5 100755 --- a/src/main/java/refinedstorage/block/BlockFluidStorage.java +++ b/src/main/java/refinedstorage/block/BlockFluidStorage.java @@ -15,9 +15,9 @@ import net.minecraft.util.EnumHand; import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -import refinedstorage.RefinedStorage; -import refinedstorage.RefinedStorageBlocks; -import refinedstorage.RefinedStorageGui; +import refinedstorage.RS; +import refinedstorage.RSBlocks; +import refinedstorage.RSGui; import refinedstorage.item.ItemBlockFluidStorage; import refinedstorage.tile.TileFluidStorage; @@ -65,7 +65,7 @@ public class BlockFluidStorage extends BlockNode { @Override public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) { if (!world.isRemote) { - player.openGui(RefinedStorage.INSTANCE, RefinedStorageGui.FLUID_STORAGE, world, pos.getX(), pos.getY(), pos.getZ()); + player.openGui(RS.INSTANCE, RSGui.FLUID_STORAGE, world, pos.getX(), pos.getY(), pos.getZ()); } return true; @@ -93,7 +93,7 @@ public class BlockFluidStorage extends BlockNode { List drops = new ArrayList<>(); - ItemStack stack = new ItemStack(RefinedStorageBlocks.FLUID_STORAGE, 1, getMetaFromState(state)); + ItemStack stack = new ItemStack(RSBlocks.FLUID_STORAGE, 1, getMetaFromState(state)); stack.setTagCompound(new NBTTagCompound()); stack.getTagCompound().setTag(TileFluidStorage.NBT_STORAGE, storage.getStorageTag()); diff --git a/src/main/java/refinedstorage/block/BlockGrid.java b/src/main/java/refinedstorage/block/BlockGrid.java index 923502a41..53a9b92d6 100755 --- a/src/main/java/refinedstorage/block/BlockGrid.java +++ b/src/main/java/refinedstorage/block/BlockGrid.java @@ -12,8 +12,8 @@ import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumHand; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import refinedstorage.RefinedStorage; -import refinedstorage.RefinedStorageGui; +import refinedstorage.RS; +import refinedstorage.RSGui; import refinedstorage.item.ItemBlockBase; import refinedstorage.tile.grid.TileGrid; @@ -58,7 +58,7 @@ public class BlockGrid extends BlockNode { @Override public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) { if (!world.isRemote) { - player.openGui(RefinedStorage.INSTANCE, RefinedStorageGui.GRID, world, pos.getX(), pos.getY(), pos.getZ()); + player.openGui(RS.INSTANCE, RSGui.GRID, world, pos.getX(), pos.getY(), pos.getZ()); ((TileGrid) world.getTileEntity(pos)).onGridOpened(player); } diff --git a/src/main/java/refinedstorage/block/BlockImporter.java b/src/main/java/refinedstorage/block/BlockImporter.java index 1e574576e..e06e62761 100755 --- a/src/main/java/refinedstorage/block/BlockImporter.java +++ b/src/main/java/refinedstorage/block/BlockImporter.java @@ -9,8 +9,8 @@ import net.minecraft.util.EnumHand; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import refinedstorage.RefinedStorage; -import refinedstorage.RefinedStorageGui; +import refinedstorage.RS; +import refinedstorage.RSGui; import refinedstorage.tile.TileImporter; import java.util.ArrayList; @@ -96,7 +96,7 @@ public class BlockImporter extends BlockCable { } if (!world.isRemote) { - player.openGui(RefinedStorage.INSTANCE, RefinedStorageGui.IMPORTER, world, pos.getX(), pos.getY(), pos.getZ()); + player.openGui(RS.INSTANCE, RSGui.IMPORTER, world, pos.getX(), pos.getY(), pos.getZ()); } return true; diff --git a/src/main/java/refinedstorage/block/BlockInterface.java b/src/main/java/refinedstorage/block/BlockInterface.java index 9200f7802..7c625e937 100755 --- a/src/main/java/refinedstorage/block/BlockInterface.java +++ b/src/main/java/refinedstorage/block/BlockInterface.java @@ -8,8 +8,8 @@ import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumHand; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import refinedstorage.RefinedStorage; -import refinedstorage.RefinedStorageGui; +import refinedstorage.RS; +import refinedstorage.RSGui; import refinedstorage.tile.TileInterface; public class BlockInterface extends BlockNode { @@ -25,7 +25,7 @@ public class BlockInterface extends BlockNode { @Override public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) { if (!world.isRemote) { - player.openGui(RefinedStorage.INSTANCE, RefinedStorageGui.INTERFACE, world, pos.getX(), pos.getY(), pos.getZ()); + player.openGui(RS.INSTANCE, RSGui.INTERFACE, world, pos.getX(), pos.getY(), pos.getZ()); } return true; diff --git a/src/main/java/refinedstorage/block/BlockNetworkTransmitter.java b/src/main/java/refinedstorage/block/BlockNetworkTransmitter.java index 75b6512b3..1340830f0 100755 --- a/src/main/java/refinedstorage/block/BlockNetworkTransmitter.java +++ b/src/main/java/refinedstorage/block/BlockNetworkTransmitter.java @@ -8,8 +8,8 @@ import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumHand; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import refinedstorage.RefinedStorage; -import refinedstorage.RefinedStorageGui; +import refinedstorage.RS; +import refinedstorage.RSGui; import refinedstorage.tile.TileNetworkTransmitter; public class BlockNetworkTransmitter extends BlockNode { @@ -20,7 +20,7 @@ public class BlockNetworkTransmitter extends BlockNode { @Override public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) { if (!world.isRemote) { - player.openGui(RefinedStorage.INSTANCE, RefinedStorageGui.NETWORK_TRANSMITTER, world, pos.getX(), pos.getY(), pos.getZ()); + player.openGui(RS.INSTANCE, RSGui.NETWORK_TRANSMITTER, world, pos.getX(), pos.getY(), pos.getZ()); } return true; diff --git a/src/main/java/refinedstorage/block/BlockProcessingPatternEncoder.java b/src/main/java/refinedstorage/block/BlockProcessingPatternEncoder.java index a80e702be..824c1c3e7 100755 --- a/src/main/java/refinedstorage/block/BlockProcessingPatternEncoder.java +++ b/src/main/java/refinedstorage/block/BlockProcessingPatternEncoder.java @@ -10,8 +10,8 @@ import net.minecraft.util.EnumHand; import net.minecraft.util.math.BlockPos; import net.minecraft.util.text.TextFormatting; import net.minecraft.world.World; -import refinedstorage.RefinedStorage; -import refinedstorage.RefinedStorageGui; +import refinedstorage.RS; +import refinedstorage.RSGui; import refinedstorage.tile.TileProcessingPatternEncoder; import java.util.List; @@ -42,7 +42,7 @@ public class BlockProcessingPatternEncoder extends BlockBase { @Override public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) { if (!world.isRemote) { - player.openGui(RefinedStorage.INSTANCE, RefinedStorageGui.PROCESSING_PATTERN_ENCODER, world, pos.getX(), pos.getY(), pos.getZ()); + player.openGui(RS.INSTANCE, RSGui.PROCESSING_PATTERN_ENCODER, world, pos.getX(), pos.getY(), pos.getZ()); } return true; diff --git a/src/main/java/refinedstorage/block/BlockRelay.java b/src/main/java/refinedstorage/block/BlockRelay.java index eaf456546..9e1dc6304 100755 --- a/src/main/java/refinedstorage/block/BlockRelay.java +++ b/src/main/java/refinedstorage/block/BlockRelay.java @@ -8,8 +8,8 @@ import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumHand; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import refinedstorage.RefinedStorage; -import refinedstorage.RefinedStorageGui; +import refinedstorage.RS; +import refinedstorage.RSGui; import refinedstorage.tile.TileRelay; public class BlockRelay extends BlockNode { @@ -25,7 +25,7 @@ public class BlockRelay extends BlockNode { @Override public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) { if (!world.isRemote) { - player.openGui(RefinedStorage.INSTANCE, RefinedStorageGui.RELAY, world, pos.getX(), pos.getY(), pos.getZ()); + player.openGui(RS.INSTANCE, RSGui.RELAY, world, pos.getX(), pos.getY(), pos.getZ()); } return true; diff --git a/src/main/java/refinedstorage/block/BlockSolderer.java b/src/main/java/refinedstorage/block/BlockSolderer.java index 848add815..b6209ffb5 100755 --- a/src/main/java/refinedstorage/block/BlockSolderer.java +++ b/src/main/java/refinedstorage/block/BlockSolderer.java @@ -10,8 +10,8 @@ import net.minecraft.util.EnumHand; import net.minecraft.util.math.BlockPos; import net.minecraft.util.text.TextFormatting; import net.minecraft.world.World; -import refinedstorage.RefinedStorage; -import refinedstorage.RefinedStorageGui; +import refinedstorage.RS; +import refinedstorage.RSGui; import refinedstorage.tile.TileSolderer; import java.util.List; @@ -40,7 +40,7 @@ public class BlockSolderer extends BlockNode { @Override public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) { if (!world.isRemote) { - player.openGui(RefinedStorage.INSTANCE, RefinedStorageGui.SOLDERER, world, pos.getX(), pos.getY(), pos.getZ()); + player.openGui(RS.INSTANCE, RSGui.SOLDERER, world, pos.getX(), pos.getY(), pos.getZ()); } return true; diff --git a/src/main/java/refinedstorage/block/BlockStorage.java b/src/main/java/refinedstorage/block/BlockStorage.java index c2880d805..012010539 100755 --- a/src/main/java/refinedstorage/block/BlockStorage.java +++ b/src/main/java/refinedstorage/block/BlockStorage.java @@ -15,9 +15,9 @@ import net.minecraft.util.EnumHand; import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -import refinedstorage.RefinedStorage; -import refinedstorage.RefinedStorageBlocks; -import refinedstorage.RefinedStorageGui; +import refinedstorage.RS; +import refinedstorage.RSBlocks; +import refinedstorage.RSGui; import refinedstorage.item.ItemBlockStorage; import refinedstorage.tile.TileStorage; @@ -65,7 +65,7 @@ public class BlockStorage extends BlockNode { @Override public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) { if (!world.isRemote) { - player.openGui(RefinedStorage.INSTANCE, RefinedStorageGui.STORAGE, world, pos.getX(), pos.getY(), pos.getZ()); + player.openGui(RS.INSTANCE, RSGui.STORAGE, world, pos.getX(), pos.getY(), pos.getZ()); } return true; @@ -93,7 +93,7 @@ public class BlockStorage extends BlockNode { List drops = new ArrayList<>(); - ItemStack stack = new ItemStack(RefinedStorageBlocks.STORAGE, 1, getMetaFromState(state)); + ItemStack stack = new ItemStack(RSBlocks.STORAGE, 1, getMetaFromState(state)); stack.setTagCompound(new NBTTagCompound()); stack.getTagCompound().setTag(TileStorage.NBT_STORAGE, storage.getStorageTag()); diff --git a/src/main/java/refinedstorage/block/BlockWirelessTransmitter.java b/src/main/java/refinedstorage/block/BlockWirelessTransmitter.java index a2ca0e331..59d011186 100755 --- a/src/main/java/refinedstorage/block/BlockWirelessTransmitter.java +++ b/src/main/java/refinedstorage/block/BlockWirelessTransmitter.java @@ -13,8 +13,8 @@ import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -import refinedstorage.RefinedStorage; -import refinedstorage.RefinedStorageGui; +import refinedstorage.RS; +import refinedstorage.RSGui; import refinedstorage.tile.TileWirelessTransmitter; public class BlockWirelessTransmitter extends BlockNode { @@ -33,7 +33,7 @@ public class BlockWirelessTransmitter extends BlockNode { @Override public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) { if (!world.isRemote) { - player.openGui(RefinedStorage.INSTANCE, RefinedStorageGui.WIRELESS_TRANSMITTER, world, pos.getX(), pos.getY(), pos.getZ()); + player.openGui(RS.INSTANCE, RSGui.WIRELESS_TRANSMITTER, world, pos.getX(), pos.getY(), pos.getZ()); } return true; diff --git a/src/main/java/refinedstorage/container/ContainerSolderer.java b/src/main/java/refinedstorage/container/ContainerSolderer.java index 0b36f779e..6933e7fdd 100755 --- a/src/main/java/refinedstorage/container/ContainerSolderer.java +++ b/src/main/java/refinedstorage/container/ContainerSolderer.java @@ -4,7 +4,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; import net.minecraftforge.items.SlotItemHandler; -import refinedstorage.RefinedStorageItems; +import refinedstorage.RSItems; import refinedstorage.container.slot.SlotOutput; import refinedstorage.tile.TileSolderer; @@ -48,7 +48,7 @@ public class ContainerSolderer extends ContainerBase { return null; } } else { - if (stack.getItem() != RefinedStorageItems.UPGRADE || !mergeItemStack(stack, 4, 4 + 4, false)) { + if (stack.getItem() != RSItems.UPGRADE || !mergeItemStack(stack, 4, 4 + 4, false)) { if (!mergeItemStack(stack, 0, 3, false)) { // 0 - 3 because we can't shift click to output slot return null; } diff --git a/src/main/java/refinedstorage/gui/GuiBase.java b/src/main/java/refinedstorage/gui/GuiBase.java index dda61cd03..22bd100f1 100755 --- a/src/main/java/refinedstorage/gui/GuiBase.java +++ b/src/main/java/refinedstorage/gui/GuiBase.java @@ -12,7 +12,7 @@ import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fml.client.config.GuiCheckBox; import net.minecraftforge.items.SlotItemHandler; import org.lwjgl.input.Mouse; -import refinedstorage.RefinedStorage; +import refinedstorage.RS; import refinedstorage.apiimpl.storage.fluid.FluidRenderer; import refinedstorage.gui.sidebutton.SideButton; import refinedstorage.inventory.ItemHandlerFluid; @@ -180,7 +180,7 @@ public abstract class GuiBase extends GuiContainer { } public void bindTexture(String file) { - bindTexture(RefinedStorage.ID, file); + bindTexture(RS.ID, file); } public void bindTexture(String base, String file) { diff --git a/src/main/java/refinedstorage/gui/GuiCraftingMonitor.java b/src/main/java/refinedstorage/gui/GuiCraftingMonitor.java index b5c1d88d2..d3dbfcd2e 100755 --- a/src/main/java/refinedstorage/gui/GuiCraftingMonitor.java +++ b/src/main/java/refinedstorage/gui/GuiCraftingMonitor.java @@ -2,7 +2,7 @@ package refinedstorage.gui; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.renderer.RenderHelper; -import refinedstorage.RefinedStorage; +import refinedstorage.RS; import refinedstorage.api.autocrafting.craftingmonitor.ICraftingMonitorElement; import refinedstorage.container.ContainerCraftingMonitor; import refinedstorage.gui.sidebutton.SideButtonRedstoneMode; @@ -121,10 +121,10 @@ public class GuiCraftingMonitor extends GuiBase { ICraftingMonitorElement element = getElements().get(itemSelected); if (element.getTaskId() != -1) { - RefinedStorage.INSTANCE.network.sendToServer(new MessageCraftingMonitorCancel(craftingMonitor, element.getTaskId())); + RS.INSTANCE.network.sendToServer(new MessageCraftingMonitorCancel(craftingMonitor, element.getTaskId())); } } else if (button == cancelAllButton && getElements().size() > 0) { - RefinedStorage.INSTANCE.network.sendToServer(new MessageCraftingMonitorCancel(craftingMonitor, -1)); + RS.INSTANCE.network.sendToServer(new MessageCraftingMonitorCancel(craftingMonitor, -1)); } } diff --git a/src/main/java/refinedstorage/gui/GuiCraftingPreview.java b/src/main/java/refinedstorage/gui/GuiCraftingPreview.java index f8e6b8b1f..dfc40a60b 100755 --- a/src/main/java/refinedstorage/gui/GuiCraftingPreview.java +++ b/src/main/java/refinedstorage/gui/GuiCraftingPreview.java @@ -6,7 +6,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.Container; import net.minecraftforge.fml.client.FMLClientHandler; import org.lwjgl.input.Keyboard; -import refinedstorage.RefinedStorage; +import refinedstorage.RS; import refinedstorage.network.MessageGridCraftingStart; import java.io.IOException; @@ -181,7 +181,7 @@ public class GuiCraftingPreview extends GuiBase { } private void startRequest() { - RefinedStorage.INSTANCE.network.sendToServer(new MessageGridCraftingStart(hash, quantity)); + RS.INSTANCE.network.sendToServer(new MessageGridCraftingStart(hash, quantity)); close(); } diff --git a/src/main/java/refinedstorage/gui/GuiGridFilter.java b/src/main/java/refinedstorage/gui/GuiGridFilter.java index 8d6b119ed..d6a14050f 100755 --- a/src/main/java/refinedstorage/gui/GuiGridFilter.java +++ b/src/main/java/refinedstorage/gui/GuiGridFilter.java @@ -2,7 +2,7 @@ package refinedstorage.gui; import net.minecraft.client.gui.GuiButton; import net.minecraftforge.fml.client.config.GuiCheckBox; -import refinedstorage.RefinedStorage; +import refinedstorage.RS; import refinedstorage.api.storage.CompareUtils; import refinedstorage.container.ContainerGridFilter; import refinedstorage.item.ItemGridFilter; @@ -55,6 +55,6 @@ public class GuiGridFilter extends GuiBase { compare ^= CompareUtils.COMPARE_NBT; } - RefinedStorage.INSTANCE.network.sendToServer(new MessageGridFilterUpdate(compare)); + RS.INSTANCE.network.sendToServer(new MessageGridFilterUpdate(compare)); } } diff --git a/src/main/java/refinedstorage/gui/GuiHandler.java b/src/main/java/refinedstorage/gui/GuiHandler.java index 4bafad742..38e9dc85d 100755 --- a/src/main/java/refinedstorage/gui/GuiHandler.java +++ b/src/main/java/refinedstorage/gui/GuiHandler.java @@ -7,7 +7,7 @@ import net.minecraft.util.EnumHand; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraftforge.fml.common.network.IGuiHandler; -import refinedstorage.RefinedStorageGui; +import refinedstorage.RSGui; import refinedstorage.container.*; import refinedstorage.gui.grid.GuiGrid; import refinedstorage.tile.*; @@ -18,47 +18,47 @@ import refinedstorage.tile.grid.WirelessGrid; public class GuiHandler implements IGuiHandler { private Container getContainer(int ID, EntityPlayer player, TileEntity tile) { switch (ID) { - case RefinedStorageGui.CONTROLLER: + case RSGui.CONTROLLER: return new ContainerController((TileController) tile, player); - case RefinedStorageGui.GRID: + case RSGui.GRID: return new ContainerGrid((TileGrid) tile, player); - case RefinedStorageGui.DISK_DRIVE: + case RSGui.DISK_DRIVE: return new ContainerDiskDrive((TileDiskDrive) tile, player); - case RefinedStorageGui.IMPORTER: + case RSGui.IMPORTER: return new ContainerImporter((TileImporter) tile, player); - case RefinedStorageGui.EXPORTER: + case RSGui.EXPORTER: return new ContainerExporter((TileExporter) tile, player); - case RefinedStorageGui.DETECTOR: + case RSGui.DETECTOR: return new ContainerDetector((TileDetector) tile, player); - case RefinedStorageGui.SOLDERER: + case RSGui.SOLDERER: return new ContainerSolderer((TileSolderer) tile, player); - case RefinedStorageGui.DESTRUCTOR: + case RSGui.DESTRUCTOR: return new ContainerDestructor((TileDestructor) tile, player); - case RefinedStorageGui.CONSTRUCTOR: + case RSGui.CONSTRUCTOR: return new ContainerConstructor((TileConstructor) tile, player); - case RefinedStorageGui.STORAGE: + case RSGui.STORAGE: return new ContainerStorage((TileStorage) tile, player); - case RefinedStorageGui.EXTERNAL_STORAGE: + case RSGui.EXTERNAL_STORAGE: return new ContainerExternalStorage((TileExternalStorage) tile, player); - case RefinedStorageGui.RELAY: + case RSGui.RELAY: return new ContainerRelay((TileRelay) tile, player); - case RefinedStorageGui.INTERFACE: + case RSGui.INTERFACE: return new ContainerInterface((TileInterface) tile, player); - case RefinedStorageGui.CRAFTING_MONITOR: + case RSGui.CRAFTING_MONITOR: return new ContainerCraftingMonitor((TileCraftingMonitor) tile, player); - case RefinedStorageGui.WIRELESS_TRANSMITTER: + case RSGui.WIRELESS_TRANSMITTER: return new ContainerWirelessTransmitter((TileWirelessTransmitter) tile, player); - case RefinedStorageGui.CRAFTER: + case RSGui.CRAFTER: return new ContainerCrafter((TileCrafter) tile, player); - case RefinedStorageGui.PROCESSING_PATTERN_ENCODER: + case RSGui.PROCESSING_PATTERN_ENCODER: return new ContainerProcessingPatternEncoder((TileProcessingPatternEncoder) tile, player); - case RefinedStorageGui.NETWORK_TRANSMITTER: + case RSGui.NETWORK_TRANSMITTER: return new ContainerNetworkTransmitter((TileNetworkTransmitter) tile, player); - case RefinedStorageGui.FLUID_INTERFACE: + case RSGui.FLUID_INTERFACE: return new ContainerFluidInterface((TileFluidInterface) tile, player); - case RefinedStorageGui.FLUID_STORAGE: + case RSGui.FLUID_STORAGE: return new ContainerFluidStorage((TileFluidStorage) tile, player); - case RefinedStorageGui.DISK_MANIPULATOR: + case RSGui.DISK_MANIPULATOR: return new ContainerDiskManipulator((TileDiskManipulator) tile, player); default: return null; @@ -79,9 +79,9 @@ public class GuiHandler implements IGuiHandler { @Override public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { - if (ID == RefinedStorageGui.WIRELESS_GRID) { + if (ID == RSGui.WIRELESS_GRID) { return getWirelessGridContainer(player, x, y); - } else if (ID == RefinedStorageGui.GRID_FILTER) { + } else if (ID == RSGui.GRID_FILTER) { return getGridFilterContainer(player, x); } @@ -93,51 +93,51 @@ public class GuiHandler implements IGuiHandler { TileEntity tile = world.getTileEntity(new BlockPos(x, y, z)); switch (ID) { - case RefinedStorageGui.CONTROLLER: + case RSGui.CONTROLLER: return new GuiController((ContainerController) getContainer(ID, player, tile), (TileController) tile); - case RefinedStorageGui.GRID: + case RSGui.GRID: return new GuiGrid((ContainerGrid) getContainer(ID, player, tile), (TileGrid) tile); - case RefinedStorageGui.WIRELESS_GRID: + case RSGui.WIRELESS_GRID: return getWirelessGridGui(player, x, y); - case RefinedStorageGui.DISK_DRIVE: + case RSGui.DISK_DRIVE: return new GuiStorage((ContainerDiskDrive) getContainer(ID, player, tile), (IStorageGui) tile, "gui/disk_drive.png"); - case RefinedStorageGui.IMPORTER: + case RSGui.IMPORTER: return new GuiImporter((ContainerImporter) getContainer(ID, player, tile)); - case RefinedStorageGui.EXPORTER: + case RSGui.EXPORTER: return new GuiExporter((ContainerExporter) getContainer(ID, player, tile)); - case RefinedStorageGui.DETECTOR: + case RSGui.DETECTOR: return new GuiDetector((ContainerDetector) getContainer(ID, player, tile)); - case RefinedStorageGui.SOLDERER: + case RSGui.SOLDERER: return new GuiSolderer((ContainerSolderer) getContainer(ID, player, tile), (TileSolderer) tile); - case RefinedStorageGui.DESTRUCTOR: + case RSGui.DESTRUCTOR: return new GuiDestructor((ContainerDestructor) getContainer(ID, player, tile)); - case RefinedStorageGui.CONSTRUCTOR: + case RSGui.CONSTRUCTOR: return new GuiConstructor((ContainerConstructor) getContainer(ID, player, tile)); - case RefinedStorageGui.STORAGE: + case RSGui.STORAGE: return new GuiStorage((ContainerStorage) getContainer(ID, player, tile), (TileStorage) tile); - case RefinedStorageGui.EXTERNAL_STORAGE: + case RSGui.EXTERNAL_STORAGE: return new GuiStorage((ContainerExternalStorage) getContainer(ID, player, tile), (TileExternalStorage) tile); - case RefinedStorageGui.RELAY: + case RSGui.RELAY: return new GuiRelay((ContainerRelay) getContainer(ID, player, tile)); - case RefinedStorageGui.INTERFACE: + case RSGui.INTERFACE: return new GuiInterface((ContainerInterface) getContainer(ID, player, tile)); - case RefinedStorageGui.CRAFTING_MONITOR: + case RSGui.CRAFTING_MONITOR: return new GuiCraftingMonitor((ContainerCraftingMonitor) getContainer(ID, player, tile), (TileCraftingMonitor) tile); - case RefinedStorageGui.WIRELESS_TRANSMITTER: + case RSGui.WIRELESS_TRANSMITTER: return new GuiWirelessTransmitter((ContainerWirelessTransmitter) getContainer(ID, player, tile)); - case RefinedStorageGui.CRAFTER: + case RSGui.CRAFTER: return new GuiCrafter((ContainerCrafter) getContainer(ID, player, tile)); - case RefinedStorageGui.PROCESSING_PATTERN_ENCODER: + case RSGui.PROCESSING_PATTERN_ENCODER: return new GuiProcessingPatternEncoder((ContainerProcessingPatternEncoder) getContainer(ID, player, tile), (TileProcessingPatternEncoder) tile); - case RefinedStorageGui.GRID_FILTER: + case RSGui.GRID_FILTER: return new GuiGridFilter(getGridFilterContainer(player, x)); - case RefinedStorageGui.NETWORK_TRANSMITTER: + case RSGui.NETWORK_TRANSMITTER: return new GuiNetworkTransmitter((ContainerNetworkTransmitter) getContainer(ID, player, tile), (TileNetworkTransmitter) tile); - case RefinedStorageGui.FLUID_INTERFACE: + case RSGui.FLUID_INTERFACE: return new GuiFluidInterface((ContainerFluidInterface) getContainer(ID, player, tile)); - case RefinedStorageGui.FLUID_STORAGE: + case RSGui.FLUID_STORAGE: return new GuiStorage((ContainerFluidStorage) getContainer(ID, player, tile), (TileFluidStorage) tile); - case RefinedStorageGui.DISK_MANIPULATOR: + case RSGui.DISK_MANIPULATOR: return new GuiDiskManipulator((ContainerDiskManipulator) getContainer(ID, player, tile)); default: return null; diff --git a/src/main/java/refinedstorage/gui/GuiProcessingPatternEncoder.java b/src/main/java/refinedstorage/gui/GuiProcessingPatternEncoder.java index 50adf22a8..0bceb777b 100755 --- a/src/main/java/refinedstorage/gui/GuiProcessingPatternEncoder.java +++ b/src/main/java/refinedstorage/gui/GuiProcessingPatternEncoder.java @@ -2,7 +2,7 @@ package refinedstorage.gui; import net.minecraft.client.audio.PositionedSoundRecord; import net.minecraft.init.SoundEvents; -import refinedstorage.RefinedStorage; +import refinedstorage.RS; import refinedstorage.container.ContainerProcessingPatternEncoder; import refinedstorage.network.MessageGridPatternCreate; import refinedstorage.network.MessageProcessingPatternEncoderClear; @@ -73,11 +73,11 @@ public class GuiProcessingPatternEncoder extends GuiBase { super.mouseClicked(mouseX, mouseY, mouseButton); if (isOverCreatePattern(mouseX - guiLeft, mouseY - guiTop)) { - RefinedStorage.INSTANCE.network.sendToServer(new MessageGridPatternCreate(encoder.getPos().getX(), encoder.getPos().getY(), encoder.getPos().getZ())); + RS.INSTANCE.network.sendToServer(new MessageGridPatternCreate(encoder.getPos().getX(), encoder.getPos().getY(), encoder.getPos().getZ())); mc.getSoundHandler().playSound(PositionedSoundRecord.getMasterRecord(SoundEvents.UI_BUTTON_CLICK, 1.0F)); } else if (isOverClear(mouseX - guiLeft, mouseY - guiTop)) { - RefinedStorage.INSTANCE.network.sendToServer(new MessageProcessingPatternEncoderClear(encoder)); + RS.INSTANCE.network.sendToServer(new MessageProcessingPatternEncoderClear(encoder)); mc.getSoundHandler().playSound(PositionedSoundRecord.getMasterRecord(SoundEvents.UI_BUTTON_CLICK, 1.0F)); } diff --git a/src/main/java/refinedstorage/gui/config/ModGuiConfig.java b/src/main/java/refinedstorage/gui/config/ModGuiConfig.java old mode 100644 new mode 100755 index eb7a23296..1d07456c9 --- a/src/main/java/refinedstorage/gui/config/ModGuiConfig.java +++ b/src/main/java/refinedstorage/gui/config/ModGuiConfig.java @@ -2,16 +2,16 @@ package refinedstorage.gui.config; import net.minecraft.client.gui.GuiScreen; import net.minecraftforge.fml.client.config.GuiConfig; -import refinedstorage.RefinedStorage; +import refinedstorage.RS; public class ModGuiConfig extends GuiConfig { public ModGuiConfig(GuiScreen guiScreen) { super(guiScreen, - RefinedStorage.INSTANCE.config.getConfigElements(), - RefinedStorage.ID, + RS.INSTANCE.config.getConfigElements(), + RS.ID, false, false, - GuiConfig.getAbridgedConfigPath(RefinedStorage.INSTANCE.config.getConfig().toString())); + GuiConfig.getAbridgedConfigPath(RS.INSTANCE.config.getConfig().toString())); } } diff --git a/src/main/java/refinedstorage/gui/grid/GuiCraftingStart.java b/src/main/java/refinedstorage/gui/grid/GuiCraftingStart.java index 623d7c9ac..56929bebc 100755 --- a/src/main/java/refinedstorage/gui/grid/GuiCraftingStart.java +++ b/src/main/java/refinedstorage/gui/grid/GuiCraftingStart.java @@ -6,7 +6,7 @@ import net.minecraft.client.gui.GuiTextField; import net.minecraft.entity.player.EntityPlayer; import net.minecraftforge.fml.client.FMLClientHandler; import org.lwjgl.input.Keyboard; -import refinedstorage.RefinedStorage; +import refinedstorage.RS; import refinedstorage.container.ContainerCraftingSettings; import refinedstorage.gui.GuiBase; import refinedstorage.gui.grid.stack.ClientStackItem; @@ -124,7 +124,7 @@ public class GuiCraftingStart extends GuiBase { Integer quantity = Ints.tryParse(amountField.getText()); if (quantity != null && quantity > 0) { - RefinedStorage.INSTANCE.network.sendToServer(new MessageGridCraftingPreview(stack.getHash(), quantity)); + RS.INSTANCE.network.sendToServer(new MessageGridCraftingPreview(stack.getHash(), quantity)); } } diff --git a/src/main/java/refinedstorage/gui/grid/GuiGrid.java b/src/main/java/refinedstorage/gui/grid/GuiGrid.java index 47960cb9d..9ae48aa9d 100755 --- a/src/main/java/refinedstorage/gui/grid/GuiGrid.java +++ b/src/main/java/refinedstorage/gui/grid/GuiGrid.java @@ -14,7 +14,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.math.BlockPos; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fml.common.FMLCommonHandler; -import refinedstorage.RefinedStorage; +import refinedstorage.RS; import refinedstorage.api.network.grid.IItemGridHandler; import refinedstorage.api.storage.CompareUtils; import refinedstorage.block.EnumGridType; @@ -356,16 +356,16 @@ public class GuiGrid extends GuiBase { if (clickedCreatePattern) { BlockPos gridPos = ((TileGrid) grid).getPos(); - RefinedStorage.INSTANCE.network.sendToServer(new MessageGridPatternCreate(gridPos.getX(), gridPos.getY(), gridPos.getZ())); + RS.INSTANCE.network.sendToServer(new MessageGridPatternCreate(gridPos.getX(), gridPos.getY(), gridPos.getZ())); } else if (grid.isConnected()) { if (clickedClear) { - RefinedStorage.INSTANCE.network.sendToServer(new MessageGridCraftingClear((TileGrid) grid)); + RS.INSTANCE.network.sendToServer(new MessageGridCraftingClear((TileGrid) grid)); } ItemStack held = container.getPlayer().inventory.getItemStack(); if (isOverSlotArea(mouseX - guiLeft, mouseY - guiTop) && held != null && (clickedButton == 0 || clickedButton == 1)) { - RefinedStorage.INSTANCE.network.sendToServer(grid.getType() == EnumGridType.FLUID ? new MessageGridFluidInsertHeld() : new MessageGridItemInsertHeld(clickedButton == 1)); + RS.INSTANCE.network.sendToServer(grid.getType() == EnumGridType.FLUID ? new MessageGridFluidInsertHeld() : new MessageGridItemInsertHeld(clickedButton == 1)); } if (isOverSlotWithItem()) { @@ -389,10 +389,10 @@ public class GuiGrid extends GuiBase { flags |= IItemGridHandler.EXTRACT_SINGLE; } - RefinedStorage.INSTANCE.network.sendToServer(new MessageGridItemPull(stack.getHash(), flags)); + RS.INSTANCE.network.sendToServer(new MessageGridItemPull(stack.getHash(), flags)); } } else if (grid.getType() == EnumGridType.FLUID && held == null) { - RefinedStorage.INSTANCE.network.sendToServer(new MessageGridFluidPull(STACKS.get(slotNumber).getHash(), GuiScreen.isShiftKeyDown())); + RS.INSTANCE.network.sendToServer(new MessageGridFluidPull(STACKS.get(slotNumber).getHash(), GuiScreen.isShiftKeyDown())); } } } diff --git a/src/main/java/refinedstorage/integration/forgeenergy/WirelessGridEnergyForge.java b/src/main/java/refinedstorage/integration/forgeenergy/WirelessGridEnergyForge.java index 02dd99c58..f3ac74cb9 100755 --- a/src/main/java/refinedstorage/integration/forgeenergy/WirelessGridEnergyForge.java +++ b/src/main/java/refinedstorage/integration/forgeenergy/WirelessGridEnergyForge.java @@ -2,7 +2,7 @@ package refinedstorage.integration.forgeenergy; import net.minecraft.item.ItemStack; import net.minecraftforge.energy.IEnergyStorage; -import refinedstorage.RefinedStorageItems; +import refinedstorage.RSItems; public class WirelessGridEnergyForge implements IEnergyStorage { private ItemStack stack; @@ -13,22 +13,22 @@ public class WirelessGridEnergyForge implements IEnergyStorage { @Override public int receiveEnergy(int maxReceive, boolean simulate) { - return RefinedStorageItems.WIRELESS_GRID.receiveEnergy(stack, maxReceive, simulate); + return RSItems.WIRELESS_GRID.receiveEnergy(stack, maxReceive, simulate); } @Override public int extractEnergy(int maxExtract, boolean simulate) { - return RefinedStorageItems.WIRELESS_GRID.extractEnergy(stack, maxExtract, simulate); + return RSItems.WIRELESS_GRID.extractEnergy(stack, maxExtract, simulate); } @Override public int getEnergyStored() { - return RefinedStorageItems.WIRELESS_GRID.getEnergyStored(stack); + return RSItems.WIRELESS_GRID.getEnergyStored(stack); } @Override public int getMaxEnergyStored() { - return RefinedStorageItems.WIRELESS_GRID.getMaxEnergyStored(stack); + return RSItems.WIRELESS_GRID.getMaxEnergyStored(stack); } @Override diff --git a/src/main/java/refinedstorage/integration/jei/RecipeMakerSolderer.java b/src/main/java/refinedstorage/integration/jei/RecipeMakerSolderer.java index 9ec2da280..5550b39e9 100755 --- a/src/main/java/refinedstorage/integration/jei/RecipeMakerSolderer.java +++ b/src/main/java/refinedstorage/integration/jei/RecipeMakerSolderer.java @@ -1,7 +1,7 @@ package refinedstorage.integration.jei; import net.minecraft.item.ItemStack; -import refinedstorage.api.RefinedStorageAPI; +import refinedstorage.api.RSAPI; import refinedstorage.api.solderer.ISoldererRecipe; import java.util.ArrayList; @@ -11,7 +11,7 @@ public final class RecipeMakerSolderer { public static List getRecipes() { List recipes = new ArrayList<>(); - for (ISoldererRecipe recipe : RefinedStorageAPI.instance().getSoldererRegistry().getRecipes()) { + for (ISoldererRecipe recipe : RSAPI.instance().getSoldererRegistry().getRecipes()) { List inputs = new ArrayList<>(); inputs.add(recipe.getRow(0)); diff --git a/src/main/java/refinedstorage/integration/jei/RecipeTransferHandlerGrid.java b/src/main/java/refinedstorage/integration/jei/RecipeTransferHandlerGrid.java index 36f61b40c..d3f5154f3 100755 --- a/src/main/java/refinedstorage/integration/jei/RecipeTransferHandlerGrid.java +++ b/src/main/java/refinedstorage/integration/jei/RecipeTransferHandlerGrid.java @@ -11,7 +11,7 @@ import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; -import refinedstorage.RefinedStorage; +import refinedstorage.RS; import refinedstorage.container.ContainerGrid; import refinedstorage.network.MessageGridCraftingTransfer; @@ -63,7 +63,7 @@ public class RecipeTransferHandlerGrid implements IRecipeTransferHandler { } } - RefinedStorage.INSTANCE.network.sendToServer(new MessageGridCraftingTransfer(recipe)); + RS.INSTANCE.network.sendToServer(new MessageGridCraftingTransfer(recipe)); } return null; diff --git a/src/main/java/refinedstorage/integration/jei/RecipeTransferHandlerPattern.java b/src/main/java/refinedstorage/integration/jei/RecipeTransferHandlerPattern.java index 7dbb7083e..15083d8f4 100755 --- a/src/main/java/refinedstorage/integration/jei/RecipeTransferHandlerPattern.java +++ b/src/main/java/refinedstorage/integration/jei/RecipeTransferHandlerPattern.java @@ -6,7 +6,7 @@ import mezz.jei.api.recipe.transfer.IRecipeTransferError; import mezz.jei.api.recipe.transfer.IRecipeTransferHandler; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; -import refinedstorage.RefinedStorage; +import refinedstorage.RS; import refinedstorage.api.network.NetworkUtils; import refinedstorage.container.ContainerProcessingPatternEncoder; import refinedstorage.network.MessageProcessingPatternEncoderTransfer; @@ -55,7 +55,7 @@ public class RecipeTransferHandlerPattern implements IRecipeTransferHandler filteredItems; public ItemHandlerGridFilterInGrid(List filteredItems) { - super(4, new ItemValidatorBasic(RefinedStorageItems.GRID_FILTER)); + super(4, new ItemValidatorBasic(RSItems.GRID_FILTER)); this.filteredItems = filteredItems; } diff --git a/src/main/java/refinedstorage/inventory/ItemHandlerUpgrade.java b/src/main/java/refinedstorage/inventory/ItemHandlerUpgrade.java index 38243f5a1..6032db3f3 100755 --- a/src/main/java/refinedstorage/inventory/ItemHandlerUpgrade.java +++ b/src/main/java/refinedstorage/inventory/ItemHandlerUpgrade.java @@ -1,7 +1,7 @@ package refinedstorage.inventory; import net.minecraft.tileentity.TileEntity; -import refinedstorage.RefinedStorageItems; +import refinedstorage.RSItems; import refinedstorage.item.ItemUpgrade; public class ItemHandlerUpgrade extends ItemHandlerBasic { @@ -9,7 +9,7 @@ public class ItemHandlerUpgrade extends ItemHandlerBasic { super(size, tile, new IItemValidator[supportedUpgrades.length]); for (int i = 0; i < supportedUpgrades.length; ++i) { - this.validators[i] = new ItemValidatorBasic(RefinedStorageItems.UPGRADE, supportedUpgrades[i]); + this.validators[i] = new ItemValidatorBasic(RSItems.UPGRADE, supportedUpgrades[i]); } } diff --git a/src/main/java/refinedstorage/item/ItemBase.java b/src/main/java/refinedstorage/item/ItemBase.java index 6d1aea756..9920055ef 100755 --- a/src/main/java/refinedstorage/item/ItemBase.java +++ b/src/main/java/refinedstorage/item/ItemBase.java @@ -2,7 +2,7 @@ package refinedstorage.item; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import refinedstorage.RefinedStorage; +import refinedstorage.RS; public abstract class ItemBase extends Item { private String name; @@ -10,13 +10,13 @@ public abstract class ItemBase extends Item { public ItemBase(String name) { this.name = name; - setRegistryName(RefinedStorage.ID, name); - setCreativeTab(RefinedStorage.INSTANCE.tab); + setRegistryName(RS.ID, name); + setCreativeTab(RS.INSTANCE.tab); } @Override public String getUnlocalizedName() { - return "item." + RefinedStorage.ID + ":" + name; + return "item." + RS.ID + ":" + name; } @Override diff --git a/src/main/java/refinedstorage/item/ItemBlockController.java b/src/main/java/refinedstorage/item/ItemBlockController.java index 83814a6ce..ed7f78dd6 100755 --- a/src/main/java/refinedstorage/item/ItemBlockController.java +++ b/src/main/java/refinedstorage/item/ItemBlockController.java @@ -5,8 +5,8 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; -import refinedstorage.RefinedStorage; -import refinedstorage.RefinedStorageBlocks; +import refinedstorage.RS; +import refinedstorage.RSBlocks; import refinedstorage.block.EnumControllerType; import refinedstorage.tile.TileController; @@ -14,7 +14,7 @@ import java.util.List; public class ItemBlockController extends ItemBlockBase { public ItemBlockController() { - super(RefinedStorageBlocks.CONTROLLER, RefinedStorageBlocks.CONTROLLER.getPlacementType(), true); + super(RSBlocks.CONTROLLER, RSBlocks.CONTROLLER.getPlacementType(), true); } @Override @@ -29,7 +29,7 @@ public class ItemBlockController extends ItemBlockBase { } public static int getEnergyCapacity(ItemStack stack) { - return (stack.hasTagCompound() && stack.getTagCompound().hasKey(TileController.NBT_ENERGY_CAPACITY)) ? stack.getTagCompound().getInteger(TileController.NBT_ENERGY_CAPACITY) : RefinedStorage.INSTANCE.config.controllerCapacity; + return (stack.hasTagCompound() && stack.getTagCompound().hasKey(TileController.NBT_ENERGY_CAPACITY)) ? stack.getTagCompound().getInteger(TileController.NBT_ENERGY_CAPACITY) : RS.INSTANCE.config.controllerCapacity; } @Override @@ -46,7 +46,7 @@ public class ItemBlockController extends ItemBlockBase { tag = new NBTTagCompound(); } - tag.setInteger(TileController.NBT_ENERGY, stack.getMetadata() == EnumControllerType.CREATIVE.getId() ? RefinedStorage.INSTANCE.config.controllerCapacity : 0); + tag.setInteger(TileController.NBT_ENERGY, stack.getMetadata() == EnumControllerType.CREATIVE.getId() ? RS.INSTANCE.config.controllerCapacity : 0); return stack; } diff --git a/src/main/java/refinedstorage/item/ItemBlockFluidStorage.java b/src/main/java/refinedstorage/item/ItemBlockFluidStorage.java index d33b01440..1719caac8 100755 --- a/src/main/java/refinedstorage/item/ItemBlockFluidStorage.java +++ b/src/main/java/refinedstorage/item/ItemBlockFluidStorage.java @@ -10,8 +10,8 @@ import net.minecraft.util.ActionResult; import net.minecraft.util.EnumActionResult; import net.minecraft.util.EnumHand; import net.minecraft.world.World; -import refinedstorage.RefinedStorageBlocks; -import refinedstorage.RefinedStorageItems; +import refinedstorage.RSBlocks; +import refinedstorage.RSItems; import refinedstorage.apiimpl.storage.fluid.FluidStorageNBT; import refinedstorage.block.EnumFluidStorageType; import refinedstorage.tile.TileFluidStorage; @@ -20,7 +20,7 @@ import java.util.List; public class ItemBlockFluidStorage extends ItemBlockBase { public ItemBlockFluidStorage() { - super(RefinedStorageBlocks.FLUID_STORAGE, RefinedStorageBlocks.FLUID_STORAGE.getPlacementType(), true); + super(RSBlocks.FLUID_STORAGE, RSBlocks.FLUID_STORAGE.getPlacementType(), true); } @Override @@ -43,19 +43,19 @@ public class ItemBlockFluidStorage extends ItemBlockBase { EnumFluidStorageType type = EnumFluidStorageType.getById(stack.getMetadata()); if (type != null && stack.stackSize == 1 && isValid(stack) && FluidStorageNBT.getStoredFromNBT(stack.getTagCompound().getCompoundTag(TileFluidStorage.NBT_STORAGE)) == 0 && stack.getMetadata() != ItemFluidStorageDisk.TYPE_CREATIVE && !world.isRemote && player.isSneaking()) { - ItemStack storagePart = new ItemStack(RefinedStorageItems.FLUID_STORAGE_PART, 1, stack.getMetadata()); + ItemStack storagePart = new ItemStack(RSItems.FLUID_STORAGE_PART, 1, stack.getMetadata()); if (!player.inventory.addItemStackToInventory(storagePart.copy())) { InventoryHelper.spawnItemStack(world, player.getPosition().getX(), player.getPosition().getY(), player.getPosition().getZ(), storagePart); } - ItemStack processor = new ItemStack(RefinedStorageItems.PROCESSOR, 1, ItemProcessor.TYPE_BASIC); + ItemStack processor = new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_BASIC); if (!player.inventory.addItemStackToInventory(processor.copy())) { InventoryHelper.spawnItemStack(world, player.getPosition().getX(), player.getPosition().getY(), player.getPosition().getZ(), processor); } - return new ActionResult<>(EnumActionResult.SUCCESS, new ItemStack(RefinedStorageBlocks.MACHINE_CASING)); + return new ActionResult<>(EnumActionResult.SUCCESS, new ItemStack(RSBlocks.MACHINE_CASING)); } return new ActionResult<>(EnumActionResult.PASS, stack); diff --git a/src/main/java/refinedstorage/item/ItemBlockStorage.java b/src/main/java/refinedstorage/item/ItemBlockStorage.java index bba1c5ced..4f179ca4a 100755 --- a/src/main/java/refinedstorage/item/ItemBlockStorage.java +++ b/src/main/java/refinedstorage/item/ItemBlockStorage.java @@ -10,8 +10,8 @@ import net.minecraft.util.ActionResult; import net.minecraft.util.EnumActionResult; import net.minecraft.util.EnumHand; import net.minecraft.world.World; -import refinedstorage.RefinedStorageBlocks; -import refinedstorage.RefinedStorageItems; +import refinedstorage.RSBlocks; +import refinedstorage.RSItems; import refinedstorage.apiimpl.storage.item.ItemStorageNBT; import refinedstorage.block.EnumItemStorageType; import refinedstorage.tile.TileStorage; @@ -20,7 +20,7 @@ import java.util.List; public class ItemBlockStorage extends ItemBlockBase { public ItemBlockStorage() { - super(RefinedStorageBlocks.STORAGE, RefinedStorageBlocks.STORAGE.getPlacementType(), true); + super(RSBlocks.STORAGE, RSBlocks.STORAGE.getPlacementType(), true); } @Override @@ -43,19 +43,19 @@ public class ItemBlockStorage extends ItemBlockBase { EnumItemStorageType type = EnumItemStorageType.getById(stack.getMetadata()); if (type != null && stack.stackSize == 1 && isValid(stack) && ItemStorageNBT.getStoredFromNBT(stack.getTagCompound().getCompoundTag(TileStorage.NBT_STORAGE)) == 0 && stack.getMetadata() != ItemStorageDisk.TYPE_CREATIVE && !world.isRemote && player.isSneaking()) { - ItemStack storagePart = new ItemStack(RefinedStorageItems.STORAGE_PART, 1, stack.getMetadata()); + ItemStack storagePart = new ItemStack(RSItems.STORAGE_PART, 1, stack.getMetadata()); if (!player.inventory.addItemStackToInventory(storagePart.copy())) { InventoryHelper.spawnItemStack(world, player.getPosition().getX(), player.getPosition().getY(), player.getPosition().getZ(), storagePart); } - ItemStack processor = new ItemStack(RefinedStorageItems.PROCESSOR, 1, ItemProcessor.TYPE_BASIC); + ItemStack processor = new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_BASIC); if (!player.inventory.addItemStackToInventory(processor.copy())) { InventoryHelper.spawnItemStack(world, player.getPosition().getX(), player.getPosition().getY(), player.getPosition().getZ(), processor); } - return new ActionResult<>(EnumActionResult.SUCCESS, new ItemStack(RefinedStorageBlocks.MACHINE_CASING)); + return new ActionResult<>(EnumActionResult.SUCCESS, new ItemStack(RSBlocks.MACHINE_CASING)); } return new ActionResult<>(EnumActionResult.PASS, stack); diff --git a/src/main/java/refinedstorage/item/ItemFluidStorageDisk.java b/src/main/java/refinedstorage/item/ItemFluidStorageDisk.java index ff4ee5adc..b0b1630b2 100755 --- a/src/main/java/refinedstorage/item/ItemFluidStorageDisk.java +++ b/src/main/java/refinedstorage/item/ItemFluidStorageDisk.java @@ -15,7 +15,7 @@ import net.minecraft.world.World; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; -import refinedstorage.RefinedStorageItems; +import refinedstorage.RSItems; import refinedstorage.apiimpl.storage.fluid.FluidStorageNBT; import refinedstorage.block.EnumFluidStorageType; @@ -83,13 +83,13 @@ public class ItemFluidStorageDisk extends ItemBase { @Override public ActionResult onItemRightClick(ItemStack disk, World world, EntityPlayer player, EnumHand hand) { if (!world.isRemote && player.isSneaking() && FluidStorageNBT.isValid(disk) && FluidStorageNBT.getStoredFromNBT(disk.getTagCompound()) == 0 && disk.getMetadata() != TYPE_CREATIVE) { - ItemStack storagePart = new ItemStack(RefinedStorageItems.FLUID_STORAGE_PART, 1, disk.getMetadata()); + ItemStack storagePart = new ItemStack(RSItems.FLUID_STORAGE_PART, 1, disk.getMetadata()); if (!player.inventory.addItemStackToInventory(storagePart.copy())) { InventoryHelper.spawnItemStack(world, player.getPosition().getX(), player.getPosition().getY(), player.getPosition().getZ(), storagePart); } - return new ActionResult<>(EnumActionResult.SUCCESS, new ItemStack(RefinedStorageItems.STORAGE_HOUSING)); + return new ActionResult<>(EnumActionResult.SUCCESS, new ItemStack(RSItems.STORAGE_HOUSING)); } return new ActionResult<>(EnumActionResult.PASS, disk); diff --git a/src/main/java/refinedstorage/item/ItemGridFilter.java b/src/main/java/refinedstorage/item/ItemGridFilter.java index 81048e31e..97dda1051 100755 --- a/src/main/java/refinedstorage/item/ItemGridFilter.java +++ b/src/main/java/refinedstorage/item/ItemGridFilter.java @@ -7,9 +7,9 @@ import net.minecraft.util.ActionResult; import net.minecraft.util.EnumActionResult; import net.minecraft.util.EnumHand; import net.minecraft.world.World; -import refinedstorage.RefinedStorage; -import refinedstorage.RefinedStorageGui; -import refinedstorage.RefinedStorageItems; +import refinedstorage.RS; +import refinedstorage.RSGui; +import refinedstorage.RSItems; import refinedstorage.api.storage.CompareUtils; import refinedstorage.inventory.ItemHandlerGridFilter; @@ -28,10 +28,10 @@ public class ItemGridFilter extends ItemBase { public ActionResult onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand) { if (!world.isRemote) { if (player.isSneaking()) { - return new ActionResult<>(EnumActionResult.SUCCESS, new ItemStack(RefinedStorageItems.GRID_FILTER)); + return new ActionResult<>(EnumActionResult.SUCCESS, new ItemStack(RSItems.GRID_FILTER)); } - player.openGui(RefinedStorage.INSTANCE, RefinedStorageGui.GRID_FILTER, world, hand.ordinal(), 0, 0); + player.openGui(RS.INSTANCE, RSGui.GRID_FILTER, world, hand.ordinal(), 0, 0); return new ActionResult<>(EnumActionResult.SUCCESS, stack); } diff --git a/src/main/java/refinedstorage/item/ItemNetworkCard.java b/src/main/java/refinedstorage/item/ItemNetworkCard.java index 61cd73b12..0d6b61521 100755 --- a/src/main/java/refinedstorage/item/ItemNetworkCard.java +++ b/src/main/java/refinedstorage/item/ItemNetworkCard.java @@ -10,7 +10,7 @@ import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumHand; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import refinedstorage.RefinedStorageBlocks; +import refinedstorage.RSBlocks; import java.util.List; @@ -30,7 +30,7 @@ public class ItemNetworkCard extends ItemBase { public EnumActionResult onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { Block block = world.getBlockState(pos).getBlock(); - if (block == RefinedStorageBlocks.NETWORK_RECEIVER) { + if (block == RSBlocks.NETWORK_RECEIVER) { setReceiver(stack, pos, world.provider.getDimension()); return EnumActionResult.SUCCESS; diff --git a/src/main/java/refinedstorage/item/ItemPattern.java b/src/main/java/refinedstorage/item/ItemPattern.java index 8563d6fe6..a8a04ddf9 100755 --- a/src/main/java/refinedstorage/item/ItemPattern.java +++ b/src/main/java/refinedstorage/item/ItemPattern.java @@ -13,7 +13,7 @@ import net.minecraft.util.EnumHand; import net.minecraft.util.text.TextFormatting; import net.minecraft.world.World; import net.minecraftforge.common.util.Constants; -import refinedstorage.RefinedStorageItems; +import refinedstorage.RSItems; import refinedstorage.api.autocrafting.ICraftingPattern; import refinedstorage.api.autocrafting.ICraftingPatternContainer; import refinedstorage.api.autocrafting.ICraftingPatternProvider; @@ -175,7 +175,7 @@ public class ItemPattern extends ItemBase implements ICraftingPatternProvider { @Override public ActionResult onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand) { if (!world.isRemote && player.isSneaking()) { - return new ActionResult<>(EnumActionResult.SUCCESS, new ItemStack(RefinedStorageItems.PATTERN, stack.stackSize)); + return new ActionResult<>(EnumActionResult.SUCCESS, new ItemStack(RSItems.PATTERN, stack.stackSize)); } return new ActionResult<>(EnumActionResult.PASS, stack); diff --git a/src/main/java/refinedstorage/item/ItemStorageDisk.java b/src/main/java/refinedstorage/item/ItemStorageDisk.java index b809b0cc7..e793eade6 100755 --- a/src/main/java/refinedstorage/item/ItemStorageDisk.java +++ b/src/main/java/refinedstorage/item/ItemStorageDisk.java @@ -12,7 +12,7 @@ import net.minecraft.util.ActionResult; import net.minecraft.util.EnumActionResult; import net.minecraft.util.EnumHand; import net.minecraft.world.World; -import refinedstorage.RefinedStorageItems; +import refinedstorage.RSItems; import refinedstorage.apiimpl.storage.item.ItemStorageNBT; import refinedstorage.block.EnumItemStorageType; @@ -74,7 +74,7 @@ public class ItemStorageDisk extends ItemBase { while (it.hasNext()) { Item item = it.next(); - if (item != RefinedStorageItems.STORAGE_DISK) { + if (item != RSItems.STORAGE_DISK) { List stacks = new ArrayList<>(); item.getSubItems(item, CreativeTabs.INVENTORY, stacks); @@ -107,13 +107,13 @@ public class ItemStorageDisk extends ItemBase { @Override public ActionResult onItemRightClick(ItemStack disk, World world, EntityPlayer player, EnumHand hand) { if (!world.isRemote && player.isSneaking() && ItemStorageNBT.isValid(disk) && ItemStorageNBT.getStoredFromNBT(disk.getTagCompound()) == 0 && disk.getMetadata() != TYPE_CREATIVE) { - ItemStack storagePart = new ItemStack(RefinedStorageItems.STORAGE_PART, 1, disk.getMetadata()); + ItemStack storagePart = new ItemStack(RSItems.STORAGE_PART, 1, disk.getMetadata()); if (!player.inventory.addItemStackToInventory(storagePart.copy())) { InventoryHelper.spawnItemStack(world, player.getPosition().getX(), player.getPosition().getY(), player.getPosition().getZ(), storagePart); } - return new ActionResult<>(EnumActionResult.SUCCESS, new ItemStack(RefinedStorageItems.STORAGE_HOUSING)); + return new ActionResult<>(EnumActionResult.SUCCESS, new ItemStack(RSItems.STORAGE_HOUSING)); } return new ActionResult<>(EnumActionResult.PASS, disk); diff --git a/src/main/java/refinedstorage/item/ItemUpgrade.java b/src/main/java/refinedstorage/item/ItemUpgrade.java index dc295a624..50d9eb04a 100755 --- a/src/main/java/refinedstorage/item/ItemUpgrade.java +++ b/src/main/java/refinedstorage/item/ItemUpgrade.java @@ -5,7 +5,7 @@ import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import refinedstorage.RefinedStorage; +import refinedstorage.RS; import java.util.List; @@ -34,15 +34,15 @@ public class ItemUpgrade extends ItemBase { public static int getEnergyUsage(int type) { switch (type) { case TYPE_RANGE: - return RefinedStorage.INSTANCE.config.rangeUpgradeUsage; + return RS.INSTANCE.config.rangeUpgradeUsage; case TYPE_SPEED: - return RefinedStorage.INSTANCE.config.speedUpgradeUsage; + return RS.INSTANCE.config.speedUpgradeUsage; case TYPE_CRAFTING: - return RefinedStorage.INSTANCE.config.craftingUpgradeUsage; + return RS.INSTANCE.config.craftingUpgradeUsage; case TYPE_STACK: - return RefinedStorage.INSTANCE.config.stackUpgradeUsage; + return RS.INSTANCE.config.stackUpgradeUsage; case TYPE_INTERDIMENSIONAL: - return RefinedStorage.INSTANCE.config.interdimensionalUpgradeUsage; + return RS.INSTANCE.config.interdimensionalUpgradeUsage; default: return 0; } diff --git a/src/main/java/refinedstorage/item/ItemWirelessGrid.java b/src/main/java/refinedstorage/item/ItemWirelessGrid.java index 70060b95b..2075dedc1 100755 --- a/src/main/java/refinedstorage/item/ItemWirelessGrid.java +++ b/src/main/java/refinedstorage/item/ItemWirelessGrid.java @@ -22,8 +22,8 @@ import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.common.capabilities.ICapabilityProvider; import net.minecraftforge.energy.CapabilityEnergy; import net.minecraftforge.fml.common.Optional; -import refinedstorage.RefinedStorage; -import refinedstorage.RefinedStorageBlocks; +import refinedstorage.RS; +import refinedstorage.RSBlocks; import refinedstorage.integration.forgeenergy.WirelessGridEnergyForge; import refinedstorage.integration.ic2.IntegrationIC2; import refinedstorage.integration.tesla.IntegrationTesla; @@ -50,11 +50,11 @@ public class ItemWirelessGrid extends ItemEnergyContainer implements ISpecialEle public ItemWirelessGrid() { super(3200); - setRegistryName(RefinedStorage.ID, "wireless_grid"); + setRegistryName(RS.ID, "wireless_grid"); setMaxDamage(3200); setMaxStackSize(1); setHasSubtypes(true); - setCreativeTab(RefinedStorage.INSTANCE.tab); + setCreativeTab(RS.INSTANCE.tab); addPropertyOverride(new ResourceLocation("connected"), (stack, world, entity) -> (entity != null && isValid(stack)) ? 1.0f : 0.0f); } @@ -116,7 +116,7 @@ public class ItemWirelessGrid extends ItemEnergyContainer implements ISpecialEle public EnumActionResult onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { Block block = world.getBlockState(pos).getBlock(); - if (block == RefinedStorageBlocks.CONTROLLER) { + if (block == RSBlocks.CONTROLLER) { NBTTagCompound tag = stack.getTagCompound(); if (tag == null) { @@ -220,7 +220,7 @@ public class ItemWirelessGrid extends ItemEnergyContainer implements ISpecialEle @Override public String getUnlocalizedName() { - return "item." + RefinedStorage.ID + ":wireless_grid"; + return "item." + RS.ID + ":wireless_grid"; } @Override diff --git a/src/main/java/refinedstorage/proxy/ClientProxy.java b/src/main/java/refinedstorage/proxy/ClientProxy.java index 6029c8b9b..13b21abff 100755 --- a/src/main/java/refinedstorage/proxy/ClientProxy.java +++ b/src/main/java/refinedstorage/proxy/ClientProxy.java @@ -24,9 +24,9 @@ import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.eventhandler.EventPriority; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import org.lwjgl.opengl.GL11; -import refinedstorage.RefinedStorage; -import refinedstorage.RefinedStorageBlocks; -import refinedstorage.RefinedStorageItems; +import refinedstorage.RS; +import refinedstorage.RSBlocks; +import refinedstorage.RSItems; import refinedstorage.block.*; import refinedstorage.item.*; import refinedstorage.tile.TileController; @@ -38,12 +38,12 @@ public class ClientProxy extends CommonProxy { public void onModelBake(ModelBakeEvent e) { for (ModelResourceLocation model : e.getModelRegistry().getKeys()) { for (BlockCable cable : cableTypes) { - if (model.getResourceDomain().equals(RefinedStorage.ID) && model.getResourcePath().equals(cable.getName()) && !model.getVariant().equals("inventory")) { + if (model.getResourceDomain().equals(RS.ID) && model.getResourcePath().equals(cable.getName()) && !model.getVariant().equals("inventory")) { e.getModelRegistry().putObject(model, ModelMultipartContainer.fromBlock(e.getModelRegistry().getObject(model), cable)); } } - if (model.getResourceDomain().equals(RefinedStorage.ID) && model.getResourcePath().equals("pattern")) { + if (model.getResourceDomain().equals(RS.ID) && model.getResourcePath().equals("pattern")) { e.getModelRegistry().putObject(model, new PatternBakedModel(e.getModelRegistry().getObject(model))); } } @@ -147,7 +147,7 @@ public class ClientProxy extends CommonProxy { MinecraftForge.EVENT_BUS.register(this); // Item Variants - ModelBakery.registerItemVariants(RefinedStorageItems.STORAGE_DISK, + ModelBakery.registerItemVariants(RSItems.STORAGE_DISK, new ResourceLocation("refinedstorage:1k_storage_disk"), new ResourceLocation("refinedstorage:4k_storage_disk"), new ResourceLocation("refinedstorage:16k_storage_disk"), @@ -155,14 +155,14 @@ public class ClientProxy extends CommonProxy { new ResourceLocation("refinedstorage:creative_storage_disk") ); - ModelBakery.registerItemVariants(RefinedStorageItems.STORAGE_PART, + 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") ); - ModelBakery.registerItemVariants(RefinedStorageItems.FLUID_STORAGE_DISK, + 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"), @@ -170,14 +170,14 @@ public class ClientProxy extends CommonProxy { new ResourceLocation("refinedstorage:creative_fluid_storage_disk") ); - ModelBakery.registerItemVariants(RefinedStorageItems.FLUID_STORAGE_PART, + 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") ); - ModelBakery.registerItemVariants(RefinedStorageItems.PROCESSOR, + ModelBakery.registerItemVariants(RSItems.PROCESSOR, new ResourceLocation("refinedstorage:basic_printed_processor"), new ResourceLocation("refinedstorage:improved_printed_processor"), new ResourceLocation("refinedstorage:advanced_printed_processor"), @@ -187,12 +187,12 @@ public class ClientProxy extends CommonProxy { new ResourceLocation("refinedstorage:printed_silicon") ); - ModelBakery.registerItemVariants(RefinedStorageItems.CORE, + ModelBakery.registerItemVariants(RSItems.CORE, new ResourceLocation("refinedstorage:construction_core"), new ResourceLocation("refinedstorage:destruction_core") ); - ModelBakery.registerItemVariants(RefinedStorageItems.UPGRADE, + ModelBakery.registerItemVariants(RSItems.UPGRADE, new ResourceLocation("refinedstorage:upgrade"), new ResourceLocation("refinedstorage:range_upgrade"), new ResourceLocation("refinedstorage:speed_upgrade"), @@ -201,94 +201,94 @@ public class ClientProxy extends CommonProxy { ); // Items - ModelLoader.setCustomModelResourceLocation(RefinedStorageItems.STORAGE_DISK, ItemStorageDisk.TYPE_1K, new ModelResourceLocation("refinedstorage:1k_storage_disk", "inventory")); - ModelLoader.setCustomModelResourceLocation(RefinedStorageItems.STORAGE_DISK, ItemStorageDisk.TYPE_4K, new ModelResourceLocation("refinedstorage:4k_storage_disk", "inventory")); - ModelLoader.setCustomModelResourceLocation(RefinedStorageItems.STORAGE_DISK, ItemStorageDisk.TYPE_16K, new ModelResourceLocation("refinedstorage:16k_storage_disk", "inventory")); - ModelLoader.setCustomModelResourceLocation(RefinedStorageItems.STORAGE_DISK, ItemStorageDisk.TYPE_64K, new ModelResourceLocation("refinedstorage:64k_storage_disk", "inventory")); - ModelLoader.setCustomModelResourceLocation(RefinedStorageItems.STORAGE_DISK, ItemStorageDisk.TYPE_CREATIVE, new ModelResourceLocation("refinedstorage:creative_storage_disk", "inventory")); + ModelLoader.setCustomModelResourceLocation(RSItems.STORAGE_DISK, ItemStorageDisk.TYPE_1K, new ModelResourceLocation("refinedstorage:1k_storage_disk", "inventory")); + ModelLoader.setCustomModelResourceLocation(RSItems.STORAGE_DISK, ItemStorageDisk.TYPE_4K, new ModelResourceLocation("refinedstorage:4k_storage_disk", "inventory")); + ModelLoader.setCustomModelResourceLocation(RSItems.STORAGE_DISK, ItemStorageDisk.TYPE_16K, new ModelResourceLocation("refinedstorage:16k_storage_disk", "inventory")); + ModelLoader.setCustomModelResourceLocation(RSItems.STORAGE_DISK, ItemStorageDisk.TYPE_64K, new ModelResourceLocation("refinedstorage:64k_storage_disk", "inventory")); + ModelLoader.setCustomModelResourceLocation(RSItems.STORAGE_DISK, ItemStorageDisk.TYPE_CREATIVE, new ModelResourceLocation("refinedstorage:creative_storage_disk", "inventory")); - ModelLoader.setCustomModelResourceLocation(RefinedStorageItems.STORAGE_PART, ItemStoragePart.TYPE_1K, new ModelResourceLocation("refinedstorage:1k_storage_part", "inventory")); - ModelLoader.setCustomModelResourceLocation(RefinedStorageItems.STORAGE_PART, ItemStoragePart.TYPE_4K, new ModelResourceLocation("refinedstorage:4k_storage_part", "inventory")); - ModelLoader.setCustomModelResourceLocation(RefinedStorageItems.STORAGE_PART, ItemStoragePart.TYPE_16K, new ModelResourceLocation("refinedstorage:16k_storage_part", "inventory")); - ModelLoader.setCustomModelResourceLocation(RefinedStorageItems.STORAGE_PART, ItemStoragePart.TYPE_64K, new ModelResourceLocation("refinedstorage:64k_storage_part", "inventory")); + ModelLoader.setCustomModelResourceLocation(RSItems.STORAGE_PART, ItemStoragePart.TYPE_1K, new ModelResourceLocation("refinedstorage:1k_storage_part", "inventory")); + ModelLoader.setCustomModelResourceLocation(RSItems.STORAGE_PART, ItemStoragePart.TYPE_4K, new ModelResourceLocation("refinedstorage:4k_storage_part", "inventory")); + ModelLoader.setCustomModelResourceLocation(RSItems.STORAGE_PART, ItemStoragePart.TYPE_16K, new ModelResourceLocation("refinedstorage:16k_storage_part", "inventory")); + ModelLoader.setCustomModelResourceLocation(RSItems.STORAGE_PART, ItemStoragePart.TYPE_64K, new ModelResourceLocation("refinedstorage:64k_storage_part", "inventory")); - ModelLoader.setCustomModelResourceLocation(RefinedStorageItems.FLUID_STORAGE_DISK, ItemFluidStorageDisk.TYPE_64K, new ModelResourceLocation("refinedstorage:64k_fluid_storage_disk", "inventory")); - ModelLoader.setCustomModelResourceLocation(RefinedStorageItems.FLUID_STORAGE_DISK, ItemFluidStorageDisk.TYPE_128K, new ModelResourceLocation("refinedstorage:128k_fluid_storage_disk", "inventory")); - ModelLoader.setCustomModelResourceLocation(RefinedStorageItems.FLUID_STORAGE_DISK, ItemFluidStorageDisk.TYPE_256K, new ModelResourceLocation("refinedstorage:256k_fluid_storage_disk", "inventory")); - ModelLoader.setCustomModelResourceLocation(RefinedStorageItems.FLUID_STORAGE_DISK, ItemFluidStorageDisk.TYPE_512K, new ModelResourceLocation("refinedstorage:512k_fluid_storage_disk", "inventory")); - ModelLoader.setCustomModelResourceLocation(RefinedStorageItems.FLUID_STORAGE_DISK, ItemFluidStorageDisk.TYPE_CREATIVE, new ModelResourceLocation("refinedstorage:creative_fluid_storage_disk", "inventory")); + ModelLoader.setCustomModelResourceLocation(RSItems.FLUID_STORAGE_DISK, ItemFluidStorageDisk.TYPE_64K, new ModelResourceLocation("refinedstorage:64k_fluid_storage_disk", "inventory")); + ModelLoader.setCustomModelResourceLocation(RSItems.FLUID_STORAGE_DISK, ItemFluidStorageDisk.TYPE_128K, new ModelResourceLocation("refinedstorage:128k_fluid_storage_disk", "inventory")); + ModelLoader.setCustomModelResourceLocation(RSItems.FLUID_STORAGE_DISK, ItemFluidStorageDisk.TYPE_256K, new ModelResourceLocation("refinedstorage:256k_fluid_storage_disk", "inventory")); + ModelLoader.setCustomModelResourceLocation(RSItems.FLUID_STORAGE_DISK, ItemFluidStorageDisk.TYPE_512K, new ModelResourceLocation("refinedstorage:512k_fluid_storage_disk", "inventory")); + ModelLoader.setCustomModelResourceLocation(RSItems.FLUID_STORAGE_DISK, ItemFluidStorageDisk.TYPE_CREATIVE, new ModelResourceLocation("refinedstorage:creative_fluid_storage_disk", "inventory")); - ModelLoader.setCustomModelResourceLocation(RefinedStorageItems.FLUID_STORAGE_PART, ItemFluidStoragePart.TYPE_64K, new ModelResourceLocation("refinedstorage:64k_fluid_storage_part", "inventory")); - ModelLoader.setCustomModelResourceLocation(RefinedStorageItems.FLUID_STORAGE_PART, ItemFluidStoragePart.TYPE_128K, new ModelResourceLocation("refinedstorage:128k_fluid_storage_part", "inventory")); - ModelLoader.setCustomModelResourceLocation(RefinedStorageItems.FLUID_STORAGE_PART, ItemFluidStoragePart.TYPE_256K, new ModelResourceLocation("refinedstorage:256k_fluid_storage_part", "inventory")); - ModelLoader.setCustomModelResourceLocation(RefinedStorageItems.FLUID_STORAGE_PART, ItemFluidStoragePart.TYPE_512K, new ModelResourceLocation("refinedstorage:512k_fluid_storage_part", "inventory")); + ModelLoader.setCustomModelResourceLocation(RSItems.FLUID_STORAGE_PART, ItemFluidStoragePart.TYPE_64K, new ModelResourceLocation("refinedstorage:64k_fluid_storage_part", "inventory")); + ModelLoader.setCustomModelResourceLocation(RSItems.FLUID_STORAGE_PART, ItemFluidStoragePart.TYPE_128K, new ModelResourceLocation("refinedstorage:128k_fluid_storage_part", "inventory")); + ModelLoader.setCustomModelResourceLocation(RSItems.FLUID_STORAGE_PART, ItemFluidStoragePart.TYPE_256K, new ModelResourceLocation("refinedstorage:256k_fluid_storage_part", "inventory")); + ModelLoader.setCustomModelResourceLocation(RSItems.FLUID_STORAGE_PART, ItemFluidStoragePart.TYPE_512K, new ModelResourceLocation("refinedstorage:512k_fluid_storage_part", "inventory")); - ModelLoader.setCustomModelResourceLocation(RefinedStorageItems.PROCESSOR, ItemProcessor.TYPE_PRINTED_BASIC, new ModelResourceLocation("refinedstorage:basic_printed_processor", "inventory")); - ModelLoader.setCustomModelResourceLocation(RefinedStorageItems.PROCESSOR, ItemProcessor.TYPE_PRINTED_IMPROVED, new ModelResourceLocation("refinedstorage:improved_printed_processor", "inventory")); - ModelLoader.setCustomModelResourceLocation(RefinedStorageItems.PROCESSOR, ItemProcessor.TYPE_PRINTED_ADVANCED, new ModelResourceLocation("refinedstorage:advanced_printed_processor", "inventory")); - ModelLoader.setCustomModelResourceLocation(RefinedStorageItems.PROCESSOR, ItemProcessor.TYPE_BASIC, new ModelResourceLocation("refinedstorage:basic_processor", "inventory")); - ModelLoader.setCustomModelResourceLocation(RefinedStorageItems.PROCESSOR, ItemProcessor.TYPE_IMPROVED, new ModelResourceLocation("refinedstorage:improved_processor", "inventory")); - ModelLoader.setCustomModelResourceLocation(RefinedStorageItems.PROCESSOR, ItemProcessor.TYPE_ADVANCED, new ModelResourceLocation("refinedstorage:advanced_processor", "inventory")); - ModelLoader.setCustomModelResourceLocation(RefinedStorageItems.PROCESSOR, ItemProcessor.TYPE_PRINTED_SILICON, new ModelResourceLocation("refinedstorage:printed_silicon", "inventory")); + ModelLoader.setCustomModelResourceLocation(RSItems.PROCESSOR, ItemProcessor.TYPE_PRINTED_BASIC, new ModelResourceLocation("refinedstorage:basic_printed_processor", "inventory")); + ModelLoader.setCustomModelResourceLocation(RSItems.PROCESSOR, ItemProcessor.TYPE_PRINTED_IMPROVED, new ModelResourceLocation("refinedstorage:improved_printed_processor", "inventory")); + ModelLoader.setCustomModelResourceLocation(RSItems.PROCESSOR, ItemProcessor.TYPE_PRINTED_ADVANCED, new ModelResourceLocation("refinedstorage:advanced_printed_processor", "inventory")); + ModelLoader.setCustomModelResourceLocation(RSItems.PROCESSOR, ItemProcessor.TYPE_BASIC, new ModelResourceLocation("refinedstorage:basic_processor", "inventory")); + ModelLoader.setCustomModelResourceLocation(RSItems.PROCESSOR, ItemProcessor.TYPE_IMPROVED, new ModelResourceLocation("refinedstorage:improved_processor", "inventory")); + ModelLoader.setCustomModelResourceLocation(RSItems.PROCESSOR, ItemProcessor.TYPE_ADVANCED, new ModelResourceLocation("refinedstorage:advanced_processor", "inventory")); + ModelLoader.setCustomModelResourceLocation(RSItems.PROCESSOR, ItemProcessor.TYPE_PRINTED_SILICON, new ModelResourceLocation("refinedstorage:printed_silicon", "inventory")); - ModelLoader.setCustomModelResourceLocation(RefinedStorageItems.SILICON, 0, new ModelResourceLocation("refinedstorage:silicon", "inventory")); - ModelLoader.setCustomModelResourceLocation(RefinedStorageItems.QUARTZ_ENRICHED_IRON, 0, new ModelResourceLocation("refinedstorage:quartz_enriched_iron", "inventory")); + ModelLoader.setCustomModelResourceLocation(RSItems.SILICON, 0, new ModelResourceLocation("refinedstorage:silicon", "inventory")); + ModelLoader.setCustomModelResourceLocation(RSItems.QUARTZ_ENRICHED_IRON, 0, new ModelResourceLocation("refinedstorage:quartz_enriched_iron", "inventory")); - ModelLoader.setCustomModelResourceLocation(RefinedStorageItems.CORE, ItemCore.TYPE_CONSTRUCTION, new ModelResourceLocation("refinedstorage:construction_core", "inventory")); - ModelLoader.setCustomModelResourceLocation(RefinedStorageItems.CORE, ItemCore.TYPE_DESTRUCTION, new ModelResourceLocation("refinedstorage:destruction_core", "inventory")); + ModelLoader.setCustomModelResourceLocation(RSItems.CORE, ItemCore.TYPE_CONSTRUCTION, new ModelResourceLocation("refinedstorage:construction_core", "inventory")); + ModelLoader.setCustomModelResourceLocation(RSItems.CORE, ItemCore.TYPE_DESTRUCTION, new ModelResourceLocation("refinedstorage:destruction_core", "inventory")); - ModelLoader.setCustomModelResourceLocation(RefinedStorageItems.WIRELESS_GRID, 0, new ModelResourceLocation("refinedstorage:wireless_grid", "inventory")); - ModelLoader.setCustomModelResourceLocation(RefinedStorageItems.PATTERN, 0, new ModelResourceLocation("refinedstorage:pattern", "inventory")); - ModelLoader.setCustomModelResourceLocation(RefinedStorageItems.STORAGE_HOUSING, 0, new ModelResourceLocation("refinedstorage:storage_housing", "inventory")); - ModelLoader.setCustomModelResourceLocation(RefinedStorageItems.GRID_FILTER, 0, new ModelResourceLocation("refinedstorage:grid_filter", "inventory")); - ModelLoader.setCustomModelResourceLocation(RefinedStorageItems.NETWORK_CARD, 0, new ModelResourceLocation("refinedstorage:network_card", "inventory")); + ModelLoader.setCustomModelResourceLocation(RSItems.WIRELESS_GRID, 0, new ModelResourceLocation("refinedstorage:wireless_grid", "inventory")); + ModelLoader.setCustomModelResourceLocation(RSItems.PATTERN, 0, new ModelResourceLocation("refinedstorage:pattern", "inventory")); + ModelLoader.setCustomModelResourceLocation(RSItems.STORAGE_HOUSING, 0, new ModelResourceLocation("refinedstorage:storage_housing", "inventory")); + ModelLoader.setCustomModelResourceLocation(RSItems.GRID_FILTER, 0, new ModelResourceLocation("refinedstorage:grid_filter", "inventory")); + ModelLoader.setCustomModelResourceLocation(RSItems.NETWORK_CARD, 0, new ModelResourceLocation("refinedstorage:network_card", "inventory")); - ModelLoader.setCustomModelResourceLocation(RefinedStorageItems.UPGRADE, 0, new ModelResourceLocation("refinedstorage:upgrade", "inventory")); - ModelLoader.setCustomModelResourceLocation(RefinedStorageItems.UPGRADE, ItemUpgrade.TYPE_RANGE, new ModelResourceLocation("refinedstorage:range_upgrade", "inventory")); - ModelLoader.setCustomModelResourceLocation(RefinedStorageItems.UPGRADE, ItemUpgrade.TYPE_SPEED, new ModelResourceLocation("refinedstorage:speed_upgrade", "inventory")); - ModelLoader.setCustomModelResourceLocation(RefinedStorageItems.UPGRADE, ItemUpgrade.TYPE_CRAFTING, new ModelResourceLocation("refinedstorage:crafting_upgrade", "inventory")); - ModelLoader.setCustomModelResourceLocation(RefinedStorageItems.UPGRADE, ItemUpgrade.TYPE_STACK, new ModelResourceLocation("refinedstorage:stack_upgrade", "inventory")); - ModelLoader.setCustomModelResourceLocation(RefinedStorageItems.UPGRADE, ItemUpgrade.TYPE_INTERDIMENSIONAL, new ModelResourceLocation("refinedstorage:interdimensional_upgrade", "inventory")); + ModelLoader.setCustomModelResourceLocation(RSItems.UPGRADE, 0, new ModelResourceLocation("refinedstorage:upgrade", "inventory")); + ModelLoader.setCustomModelResourceLocation(RSItems.UPGRADE, ItemUpgrade.TYPE_RANGE, new ModelResourceLocation("refinedstorage:range_upgrade", "inventory")); + ModelLoader.setCustomModelResourceLocation(RSItems.UPGRADE, ItemUpgrade.TYPE_SPEED, new ModelResourceLocation("refinedstorage:speed_upgrade", "inventory")); + ModelLoader.setCustomModelResourceLocation(RSItems.UPGRADE, ItemUpgrade.TYPE_CRAFTING, new ModelResourceLocation("refinedstorage:crafting_upgrade", "inventory")); + ModelLoader.setCustomModelResourceLocation(RSItems.UPGRADE, ItemUpgrade.TYPE_STACK, new ModelResourceLocation("refinedstorage:stack_upgrade", "inventory")); + ModelLoader.setCustomModelResourceLocation(RSItems.UPGRADE, ItemUpgrade.TYPE_INTERDIMENSIONAL, new ModelResourceLocation("refinedstorage:interdimensional_upgrade", "inventory")); // Blocks - ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RefinedStorageBlocks.CABLE), 0, new ModelResourceLocation("refinedstorage:cable", "inventory")); - ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RefinedStorageBlocks.GRID), EnumGridType.NORMAL.getId(), new ModelResourceLocation("refinedstorage:grid", "connected=false,direction=north,type=normal")); - ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RefinedStorageBlocks.GRID), EnumGridType.CRAFTING.getId(), new ModelResourceLocation("refinedstorage:grid", "connected=false,direction=north,type=crafting")); - ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RefinedStorageBlocks.GRID), EnumGridType.PATTERN.getId(), new ModelResourceLocation("refinedstorage:grid", "connected=false,direction=north,type=pattern")); - ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RefinedStorageBlocks.GRID), EnumGridType.FLUID.getId(), new ModelResourceLocation("refinedstorage:grid", "connected=false,direction=north,type=fluid")); - ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RefinedStorageBlocks.MACHINE_CASING), 0, new ModelResourceLocation("refinedstorage:machine_casing", "inventory")); - ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RefinedStorageBlocks.EXPORTER), 0, new ModelResourceLocation("refinedstorage:exporter", "inventory")); - ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RefinedStorageBlocks.IMPORTER), 0, new ModelResourceLocation("refinedstorage:importer", "inventory")); - ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RefinedStorageBlocks.EXTERNAL_STORAGE), 0, new ModelResourceLocation("refinedstorage:external_storage", "inventory")); - ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RefinedStorageBlocks.DISK_DRIVE), 0, new ModelResourceLocation("refinedstorage:disk_drive", "inventory")); - ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RefinedStorageBlocks.CONSTRUCTOR), 0, new ModelResourceLocation("refinedstorage:constructor", "inventory")); - ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RefinedStorageBlocks.DESTRUCTOR), 0, new ModelResourceLocation("refinedstorage:destructor", "inventory")); - ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RefinedStorageBlocks.SOLDERER), 0, new ModelResourceLocation("refinedstorage:solderer", "inventory")); - ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RefinedStorageBlocks.DETECTOR), 0, new ModelResourceLocation("refinedstorage:detector", "inventory")); - ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RefinedStorageBlocks.RELAY), 0, new ModelResourceLocation("refinedstorage:relay", "inventory")); - ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RefinedStorageBlocks.INTERFACE), 0, new ModelResourceLocation("refinedstorage:interface", "inventory")); - ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RefinedStorageBlocks.FLUID_INTERFACE), 0, new ModelResourceLocation("refinedstorage:fluid_interface", "inventory")); - ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RefinedStorageBlocks.WIRELESS_TRANSMITTER), 0, new ModelResourceLocation("refinedstorage:wireless_transmitter", "inventory")); - ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RefinedStorageBlocks.CRAFTING_MONITOR), 0, new ModelResourceLocation("refinedstorage:crafting_monitor", "inventory")); - ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RefinedStorageBlocks.CRAFTER), 0, new ModelResourceLocation("refinedstorage:crafter", "connected=false,direction=north")); - ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RefinedStorageBlocks.PROCESSING_PATTERN_ENCODER), 0, new ModelResourceLocation("refinedstorage:processing_pattern_encoder", "inventory")); - ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RefinedStorageBlocks.NETWORK_TRANSMITTER), 0, new ModelResourceLocation("refinedstorage:network_transmitter", "inventory")); - ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RefinedStorageBlocks.NETWORK_RECEIVER), 0, new ModelResourceLocation("refinedstorage:network_receiver", "inventory")); - ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RefinedStorageBlocks.STORAGE), EnumItemStorageType.TYPE_1K.getId(), new ModelResourceLocation("refinedstorage:storage", "type=1k")); - ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RefinedStorageBlocks.STORAGE), EnumItemStorageType.TYPE_4K.getId(), new ModelResourceLocation("refinedstorage:storage", "type=4k")); - ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RefinedStorageBlocks.STORAGE), EnumItemStorageType.TYPE_16K.getId(), new ModelResourceLocation("refinedstorage:storage", "type=16k")); - ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RefinedStorageBlocks.STORAGE), EnumItemStorageType.TYPE_64K.getId(), new ModelResourceLocation("refinedstorage:storage", "type=64k")); - ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RefinedStorageBlocks.STORAGE), EnumItemStorageType.TYPE_CREATIVE.getId(), new ModelResourceLocation("refinedstorage:storage", "type=creative")); - ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RefinedStorageBlocks.FLUID_STORAGE), EnumFluidStorageType.TYPE_64K.getId(), new ModelResourceLocation("refinedstorage:fluid_storage", "type=64k")); - ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RefinedStorageBlocks.FLUID_STORAGE), EnumFluidStorageType.TYPE_128K.getId(), new ModelResourceLocation("refinedstorage:fluid_storage", "type=128k")); - ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RefinedStorageBlocks.FLUID_STORAGE), EnumFluidStorageType.TYPE_256K.getId(), new ModelResourceLocation("refinedstorage:fluid_storage", "type=256k")); - ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RefinedStorageBlocks.FLUID_STORAGE), EnumFluidStorageType.TYPE_512K.getId(), new ModelResourceLocation("refinedstorage:fluid_storage", "type=512k")); - ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RefinedStorageBlocks.FLUID_STORAGE), EnumFluidStorageType.TYPE_CREATIVE.getId(), new ModelResourceLocation("refinedstorage:fluid_storage", "type=creative")); - ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RefinedStorageBlocks.DISK_MANIPULATOR), 0, new ModelResourceLocation("refinedstorage:disk_manipulator", "inventory")); + ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.CABLE), 0, new ModelResourceLocation("refinedstorage:cable", "inventory")); + ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.GRID), EnumGridType.NORMAL.getId(), new ModelResourceLocation("refinedstorage:grid", "connected=false,direction=north,type=normal")); + ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.GRID), EnumGridType.CRAFTING.getId(), new ModelResourceLocation("refinedstorage:grid", "connected=false,direction=north,type=crafting")); + ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.GRID), EnumGridType.PATTERN.getId(), new ModelResourceLocation("refinedstorage:grid", "connected=false,direction=north,type=pattern")); + ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.GRID), EnumGridType.FLUID.getId(), new ModelResourceLocation("refinedstorage:grid", "connected=false,direction=north,type=fluid")); + ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.MACHINE_CASING), 0, new ModelResourceLocation("refinedstorage:machine_casing", "inventory")); + ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.EXPORTER), 0, new ModelResourceLocation("refinedstorage:exporter", "inventory")); + ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.IMPORTER), 0, new ModelResourceLocation("refinedstorage:importer", "inventory")); + ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.EXTERNAL_STORAGE), 0, new ModelResourceLocation("refinedstorage:external_storage", "inventory")); + ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.DISK_DRIVE), 0, new ModelResourceLocation("refinedstorage:disk_drive", "inventory")); + ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.CONSTRUCTOR), 0, new ModelResourceLocation("refinedstorage:constructor", "inventory")); + ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.DESTRUCTOR), 0, new ModelResourceLocation("refinedstorage:destructor", "inventory")); + ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.SOLDERER), 0, new ModelResourceLocation("refinedstorage:solderer", "inventory")); + ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.DETECTOR), 0, new ModelResourceLocation("refinedstorage:detector", "inventory")); + ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.RELAY), 0, new ModelResourceLocation("refinedstorage:relay", "inventory")); + ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.INTERFACE), 0, new ModelResourceLocation("refinedstorage:interface", "inventory")); + ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.FLUID_INTERFACE), 0, new ModelResourceLocation("refinedstorage:fluid_interface", "inventory")); + ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.WIRELESS_TRANSMITTER), 0, new ModelResourceLocation("refinedstorage:wireless_transmitter", "inventory")); + ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.CRAFTING_MONITOR), 0, new ModelResourceLocation("refinedstorage:crafting_monitor", "inventory")); + ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.CRAFTER), 0, new ModelResourceLocation("refinedstorage:crafter", "connected=false,direction=north")); + ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.PROCESSING_PATTERN_ENCODER), 0, new ModelResourceLocation("refinedstorage:processing_pattern_encoder", "inventory")); + ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.NETWORK_TRANSMITTER), 0, new ModelResourceLocation("refinedstorage:network_transmitter", "inventory")); + ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.NETWORK_RECEIVER), 0, new ModelResourceLocation("refinedstorage:network_receiver", "inventory")); + ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.STORAGE), EnumItemStorageType.TYPE_1K.getId(), new ModelResourceLocation("refinedstorage:storage", "type=1k")); + ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.STORAGE), EnumItemStorageType.TYPE_4K.getId(), new ModelResourceLocation("refinedstorage:storage", "type=4k")); + ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.STORAGE), EnumItemStorageType.TYPE_16K.getId(), new ModelResourceLocation("refinedstorage:storage", "type=16k")); + ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.STORAGE), EnumItemStorageType.TYPE_64K.getId(), new ModelResourceLocation("refinedstorage:storage", "type=64k")); + ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.STORAGE), EnumItemStorageType.TYPE_CREATIVE.getId(), new ModelResourceLocation("refinedstorage:storage", "type=creative")); + ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.FLUID_STORAGE), EnumFluidStorageType.TYPE_64K.getId(), new ModelResourceLocation("refinedstorage:fluid_storage", "type=64k")); + ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.FLUID_STORAGE), EnumFluidStorageType.TYPE_128K.getId(), new ModelResourceLocation("refinedstorage:fluid_storage", "type=128k")); + ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.FLUID_STORAGE), EnumFluidStorageType.TYPE_256K.getId(), new ModelResourceLocation("refinedstorage:fluid_storage", "type=256k")); + ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.FLUID_STORAGE), EnumFluidStorageType.TYPE_512K.getId(), new ModelResourceLocation("refinedstorage:fluid_storage", "type=512k")); + ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.FLUID_STORAGE), EnumFluidStorageType.TYPE_CREATIVE.getId(), new ModelResourceLocation("refinedstorage:fluid_storage", "type=creative")); + ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.DISK_MANIPULATOR), 0, new ModelResourceLocation("refinedstorage:disk_manipulator", "inventory")); - ModelLoader.setCustomStateMapper(RefinedStorageBlocks.CONTROLLER, new StateMap.Builder().ignore(BlockController.TYPE).build()); + ModelLoader.setCustomStateMapper(RSBlocks.CONTROLLER, new StateMap.Builder().ignore(BlockController.TYPE).build()); - ModelLoader.setCustomMeshDefinition(Item.getItemFromBlock(RefinedStorageBlocks.CONTROLLER), stack -> { + ModelLoader.setCustomMeshDefinition(Item.getItemFromBlock(RSBlocks.CONTROLLER), stack -> { int energy = stack.getItemDamage() == EnumControllerType.CREATIVE.getId() ? 7 : TileController.getEnergyScaled(ItemBlockController.getEnergyStored(stack), ItemBlockController.getEnergyCapacity(stack), 7); return new ModelResourceLocation("refinedstorage:controller", "direction=north,energy=" + energy); diff --git a/src/main/java/refinedstorage/proxy/CommonProxy.java b/src/main/java/refinedstorage/proxy/CommonProxy.java index b2901bdfd..927708ebe 100755 --- a/src/main/java/refinedstorage/proxy/CommonProxy.java +++ b/src/main/java/refinedstorage/proxy/CommonProxy.java @@ -15,10 +15,10 @@ import net.minecraftforge.fml.common.registry.GameRegistry; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.ShapedOreRecipe; -import refinedstorage.RefinedStorage; -import refinedstorage.RefinedStorageBlocks; -import refinedstorage.RefinedStorageItems; -import refinedstorage.api.RefinedStorageAPI; +import refinedstorage.RS; +import refinedstorage.RSBlocks; +import refinedstorage.RSItems; +import refinedstorage.api.RSAPI; import refinedstorage.api.solderer.SoldererRecipe; import refinedstorage.apiimpl.autocrafting.craftingmonitor.CraftingMonitorElementRoot; import refinedstorage.apiimpl.autocrafting.craftingmonitor.CraftingMonitorElementToTake; @@ -48,36 +48,36 @@ public class CommonProxy { IntegrationCraftingTweaks.register(); } - RefinedStorageAPI.instance().getCraftingTaskRegistry().addFactory(CraftingTaskFactoryNormal.ID, new CraftingTaskFactoryNormal()); + RSAPI.instance().getCraftingTaskRegistry().addFactory(CraftingTaskFactoryNormal.ID, new CraftingTaskFactoryNormal()); - RefinedStorageAPI.instance().getCraftingMonitorElementRegistry().add(CraftingMonitorElementRoot.ID, buf -> new CraftingMonitorElementRoot(buf.readInt(), ByteBufUtils.readItemStack(buf), buf.readInt())); - RefinedStorageAPI.instance().getCraftingMonitorElementRegistry().add(CraftingMonitorElementToTake.ID, buf -> new CraftingMonitorElementToTake(ByteBufUtils.readItemStack(buf), buf.readInt())); + RSAPI.instance().getCraftingMonitorElementRegistry().add(CraftingMonitorElementRoot.ID, buf -> new CraftingMonitorElementRoot(buf.readInt(), ByteBufUtils.readItemStack(buf), buf.readInt())); + RSAPI.instance().getCraftingMonitorElementRegistry().add(CraftingMonitorElementToTake.ID, buf -> new CraftingMonitorElementToTake(ByteBufUtils.readItemStack(buf), buf.readInt())); int id = 0; - RefinedStorage.INSTANCE.network.registerMessage(MessageTileDataParameter.class, MessageTileDataParameter.class, id++, Side.CLIENT); - RefinedStorage.INSTANCE.network.registerMessage(MessageTileDataParameterUpdate.class, MessageTileDataParameterUpdate.class, id++, Side.SERVER); - RefinedStorage.INSTANCE.network.registerMessage(MessageGridItemInsertHeld.class, MessageGridItemInsertHeld.class, id++, Side.SERVER); - RefinedStorage.INSTANCE.network.registerMessage(MessageGridItemPull.class, MessageGridItemPull.class, id++, Side.SERVER); - RefinedStorage.INSTANCE.network.registerMessage(MessageGridCraftingClear.class, MessageGridCraftingClear.class, id++, Side.SERVER); - RefinedStorage.INSTANCE.network.registerMessage(MessageGridCraftingTransfer.class, MessageGridCraftingTransfer.class, id++, Side.SERVER); - RefinedStorage.INSTANCE.network.registerMessage(MessageWirelessGridSettingsUpdate.class, MessageWirelessGridSettingsUpdate.class, id++, Side.SERVER); - RefinedStorage.INSTANCE.network.registerMessage(MessageGridCraftingStart.class, MessageGridCraftingStart.class, id++, Side.SERVER); - RefinedStorage.INSTANCE.network.registerMessage(MessageGridPatternCreate.class, MessageGridPatternCreate.class, id++, Side.SERVER); - RefinedStorage.INSTANCE.network.registerMessage(MessageCraftingMonitorCancel.class, MessageCraftingMonitorCancel.class, id++, Side.SERVER); - RefinedStorage.INSTANCE.network.registerMessage(MessageGridItemUpdate.class, MessageGridItemUpdate.class, id++, Side.CLIENT); - RefinedStorage.INSTANCE.network.registerMessage(MessageGridItemDelta.class, MessageGridItemDelta.class, id++, Side.CLIENT); - RefinedStorage.INSTANCE.network.registerMessage(MessageGridFluidUpdate.class, MessageGridFluidUpdate.class, id++, Side.CLIENT); - RefinedStorage.INSTANCE.network.registerMessage(MessageGridFluidDelta.class, MessageGridFluidDelta.class, id++, Side.CLIENT); - RefinedStorage.INSTANCE.network.registerMessage(MessageGridFluidPull.class, MessageGridFluidPull.class, id++, Side.SERVER); - RefinedStorage.INSTANCE.network.registerMessage(MessageGridFluidInsertHeld.class, MessageGridFluidInsertHeld.class, id++, Side.SERVER); - RefinedStorage.INSTANCE.network.registerMessage(MessageProcessingPatternEncoderClear.class, MessageProcessingPatternEncoderClear.class, id++, Side.SERVER); - RefinedStorage.INSTANCE.network.registerMessage(MessageGridFilterUpdate.class, MessageGridFilterUpdate.class, id++, Side.SERVER); - RefinedStorage.INSTANCE.network.registerMessage(MessageGridCraftingPreview.class, MessageGridCraftingPreview.class, id++, Side.SERVER); + RS.INSTANCE.network.registerMessage(MessageTileDataParameter.class, MessageTileDataParameter.class, id++, Side.CLIENT); + RS.INSTANCE.network.registerMessage(MessageTileDataParameterUpdate.class, MessageTileDataParameterUpdate.class, id++, Side.SERVER); + RS.INSTANCE.network.registerMessage(MessageGridItemInsertHeld.class, MessageGridItemInsertHeld.class, id++, Side.SERVER); + RS.INSTANCE.network.registerMessage(MessageGridItemPull.class, MessageGridItemPull.class, id++, Side.SERVER); + RS.INSTANCE.network.registerMessage(MessageGridCraftingClear.class, MessageGridCraftingClear.class, id++, Side.SERVER); + RS.INSTANCE.network.registerMessage(MessageGridCraftingTransfer.class, MessageGridCraftingTransfer.class, id++, Side.SERVER); + RS.INSTANCE.network.registerMessage(MessageWirelessGridSettingsUpdate.class, MessageWirelessGridSettingsUpdate.class, id++, Side.SERVER); + RS.INSTANCE.network.registerMessage(MessageGridCraftingStart.class, MessageGridCraftingStart.class, id++, Side.SERVER); + RS.INSTANCE.network.registerMessage(MessageGridPatternCreate.class, MessageGridPatternCreate.class, id++, Side.SERVER); + RS.INSTANCE.network.registerMessage(MessageCraftingMonitorCancel.class, MessageCraftingMonitorCancel.class, id++, Side.SERVER); + RS.INSTANCE.network.registerMessage(MessageGridItemUpdate.class, MessageGridItemUpdate.class, id++, Side.CLIENT); + RS.INSTANCE.network.registerMessage(MessageGridItemDelta.class, MessageGridItemDelta.class, id++, Side.CLIENT); + RS.INSTANCE.network.registerMessage(MessageGridFluidUpdate.class, MessageGridFluidUpdate.class, id++, Side.CLIENT); + RS.INSTANCE.network.registerMessage(MessageGridFluidDelta.class, MessageGridFluidDelta.class, id++, Side.CLIENT); + RS.INSTANCE.network.registerMessage(MessageGridFluidPull.class, MessageGridFluidPull.class, id++, Side.SERVER); + RS.INSTANCE.network.registerMessage(MessageGridFluidInsertHeld.class, MessageGridFluidInsertHeld.class, id++, Side.SERVER); + RS.INSTANCE.network.registerMessage(MessageProcessingPatternEncoderClear.class, MessageProcessingPatternEncoderClear.class, id++, Side.SERVER); + RS.INSTANCE.network.registerMessage(MessageGridFilterUpdate.class, MessageGridFilterUpdate.class, id++, Side.SERVER); + RS.INSTANCE.network.registerMessage(MessageGridCraftingPreview.class, MessageGridCraftingPreview.class, id++, Side.SERVER); //RefinedStorage.INSTANCE.network.registerMessage(MessageGridCraftingPreviewResponse.class, MessageGridCraftingPreviewResponse.class, id++, Side.CLIENT); - RefinedStorage.INSTANCE.network.registerMessage(MessageProcessingPatternEncoderTransfer.class, MessageProcessingPatternEncoderTransfer.class, id++, Side.SERVER); + RS.INSTANCE.network.registerMessage(MessageProcessingPatternEncoderTransfer.class, MessageProcessingPatternEncoderTransfer.class, id++, Side.SERVER); - NetworkRegistry.INSTANCE.registerGuiHandler(RefinedStorage.INSTANCE, new GuiHandler()); + NetworkRegistry.INSTANCE.registerGuiHandler(RS.INSTANCE, new GuiHandler()); MinecraftForge.EVENT_BUS.register(new ContainerListener()); @@ -105,63 +105,63 @@ public class CommonProxy { registerTile(TileFluidStorage.class, "fluid_storage"); registerTile(TileDiskManipulator.class, "disk_manipulator"); - registerBlock(RefinedStorageBlocks.CONTROLLER); - registerBlock(RefinedStorageBlocks.GRID); - registerBlock(RefinedStorageBlocks.CRAFTING_MONITOR); - registerBlock(RefinedStorageBlocks.CRAFTER); - registerBlock(RefinedStorageBlocks.PROCESSING_PATTERN_ENCODER); - registerBlock(RefinedStorageBlocks.DISK_DRIVE); - registerBlock(RefinedStorageBlocks.STORAGE); - registerBlock(RefinedStorageBlocks.FLUID_STORAGE); - registerBlock(RefinedStorageBlocks.SOLDERER); - registerBlock(RefinedStorageBlocks.CABLE); - registerBlock(RefinedStorageBlocks.IMPORTER); - registerBlock(RefinedStorageBlocks.EXPORTER); - registerBlock(RefinedStorageBlocks.EXTERNAL_STORAGE); - registerBlock(RefinedStorageBlocks.CONSTRUCTOR); - registerBlock(RefinedStorageBlocks.DESTRUCTOR); - registerBlock(RefinedStorageBlocks.DETECTOR); - registerBlock(RefinedStorageBlocks.RELAY); - registerBlock(RefinedStorageBlocks.INTERFACE); - registerBlock(RefinedStorageBlocks.FLUID_INTERFACE); - registerBlock(RefinedStorageBlocks.WIRELESS_TRANSMITTER); - registerBlock(RefinedStorageBlocks.MACHINE_CASING); - registerBlock(RefinedStorageBlocks.NETWORK_TRANSMITTER); - registerBlock(RefinedStorageBlocks.NETWORK_RECEIVER); - registerBlock(RefinedStorageBlocks.DISK_MANIPULATOR); + registerBlock(RSBlocks.CONTROLLER); + registerBlock(RSBlocks.GRID); + registerBlock(RSBlocks.CRAFTING_MONITOR); + registerBlock(RSBlocks.CRAFTER); + registerBlock(RSBlocks.PROCESSING_PATTERN_ENCODER); + registerBlock(RSBlocks.DISK_DRIVE); + registerBlock(RSBlocks.STORAGE); + registerBlock(RSBlocks.FLUID_STORAGE); + registerBlock(RSBlocks.SOLDERER); + registerBlock(RSBlocks.CABLE); + registerBlock(RSBlocks.IMPORTER); + registerBlock(RSBlocks.EXPORTER); + registerBlock(RSBlocks.EXTERNAL_STORAGE); + registerBlock(RSBlocks.CONSTRUCTOR); + registerBlock(RSBlocks.DESTRUCTOR); + registerBlock(RSBlocks.DETECTOR); + registerBlock(RSBlocks.RELAY); + registerBlock(RSBlocks.INTERFACE); + registerBlock(RSBlocks.FLUID_INTERFACE); + registerBlock(RSBlocks.WIRELESS_TRANSMITTER); + registerBlock(RSBlocks.MACHINE_CASING); + registerBlock(RSBlocks.NETWORK_TRANSMITTER); + registerBlock(RSBlocks.NETWORK_RECEIVER); + registerBlock(RSBlocks.DISK_MANIPULATOR); - registerItem(RefinedStorageItems.QUARTZ_ENRICHED_IRON); - registerItem(RefinedStorageItems.STORAGE_DISK); - registerItem(RefinedStorageItems.FLUID_STORAGE_DISK); - registerItem(RefinedStorageItems.STORAGE_HOUSING); - registerItem(RefinedStorageItems.PATTERN); - registerItem(RefinedStorageItems.STORAGE_PART); - registerItem(RefinedStorageItems.FLUID_STORAGE_PART); - registerItem(RefinedStorageItems.WIRELESS_GRID); - registerItem(RefinedStorageItems.PROCESSOR); - registerItem(RefinedStorageItems.CORE); - registerItem(RefinedStorageItems.SILICON); - registerItem(RefinedStorageItems.UPGRADE); - registerItem(RefinedStorageItems.GRID_FILTER); - registerItem(RefinedStorageItems.NETWORK_CARD); + registerItem(RSItems.QUARTZ_ENRICHED_IRON); + registerItem(RSItems.STORAGE_DISK); + registerItem(RSItems.FLUID_STORAGE_DISK); + registerItem(RSItems.STORAGE_HOUSING); + registerItem(RSItems.PATTERN); + registerItem(RSItems.STORAGE_PART); + registerItem(RSItems.FLUID_STORAGE_PART); + registerItem(RSItems.WIRELESS_GRID); + registerItem(RSItems.PROCESSOR); + registerItem(RSItems.CORE); + registerItem(RSItems.SILICON); + registerItem(RSItems.UPGRADE); + registerItem(RSItems.GRID_FILTER); + registerItem(RSItems.NETWORK_CARD); - OreDictionary.registerOre("itemSilicon", RefinedStorageItems.SILICON); + OreDictionary.registerOre("itemSilicon", RSItems.SILICON); // Processors - RefinedStorageAPI.instance().getSoldererRegistry().addRecipe(new SoldererRecipePrintedProcessor(ItemProcessor.TYPE_PRINTED_BASIC)); - RefinedStorageAPI.instance().getSoldererRegistry().addRecipe(new SoldererRecipePrintedProcessor(ItemProcessor.TYPE_PRINTED_IMPROVED)); - RefinedStorageAPI.instance().getSoldererRegistry().addRecipe(new SoldererRecipePrintedProcessor(ItemProcessor.TYPE_PRINTED_ADVANCED)); - RefinedStorageAPI.instance().getSoldererRegistry().addRecipe(new SoldererRecipePrintedProcessor(ItemProcessor.TYPE_PRINTED_SILICON)); + RSAPI.instance().getSoldererRegistry().addRecipe(new SoldererRecipePrintedProcessor(ItemProcessor.TYPE_PRINTED_BASIC)); + RSAPI.instance().getSoldererRegistry().addRecipe(new SoldererRecipePrintedProcessor(ItemProcessor.TYPE_PRINTED_IMPROVED)); + RSAPI.instance().getSoldererRegistry().addRecipe(new SoldererRecipePrintedProcessor(ItemProcessor.TYPE_PRINTED_ADVANCED)); + RSAPI.instance().getSoldererRegistry().addRecipe(new SoldererRecipePrintedProcessor(ItemProcessor.TYPE_PRINTED_SILICON)); - RefinedStorageAPI.instance().getSoldererRegistry().addRecipe(new SoldererRecipeProcessor(ItemProcessor.TYPE_BASIC)); - RefinedStorageAPI.instance().getSoldererRegistry().addRecipe(new SoldererRecipeProcessor(ItemProcessor.TYPE_IMPROVED)); - RefinedStorageAPI.instance().getSoldererRegistry().addRecipe(new SoldererRecipeProcessor(ItemProcessor.TYPE_ADVANCED)); + RSAPI.instance().getSoldererRegistry().addRecipe(new SoldererRecipeProcessor(ItemProcessor.TYPE_BASIC)); + RSAPI.instance().getSoldererRegistry().addRecipe(new SoldererRecipeProcessor(ItemProcessor.TYPE_IMPROVED)); + RSAPI.instance().getSoldererRegistry().addRecipe(new SoldererRecipeProcessor(ItemProcessor.TYPE_ADVANCED)); // Silicon - GameRegistry.addSmelting(Items.QUARTZ, new ItemStack(RefinedStorageItems.SILICON), 0.5f); + GameRegistry.addSmelting(Items.QUARTZ, new ItemStack(RSItems.SILICON), 0.5f); // Quartz Enriched Iron - GameRegistry.addRecipe(new ItemStack(RefinedStorageItems.QUARTZ_ENRICHED_IRON, 4), + GameRegistry.addRecipe(new ItemStack(RSItems.QUARTZ_ENRICHED_IRON, 4), "II", "IQ", 'I', new ItemStack(Items.IRON_INGOT), @@ -169,313 +169,313 @@ public class CommonProxy { ); // Machine Casing - GameRegistry.addRecipe(new ItemStack(RefinedStorageBlocks.MACHINE_CASING), + GameRegistry.addRecipe(new ItemStack(RSBlocks.MACHINE_CASING), "EEE", "E E", "EEE", - 'E', new ItemStack(RefinedStorageItems.QUARTZ_ENRICHED_IRON) + 'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON) ); // Construction Core - GameRegistry.addShapelessRecipe(new ItemStack(RefinedStorageItems.CORE, 1, ItemCore.TYPE_CONSTRUCTION), - new ItemStack(RefinedStorageItems.PROCESSOR, 1, ItemProcessor.TYPE_BASIC), + GameRegistry.addShapelessRecipe(new ItemStack(RSItems.CORE, 1, ItemCore.TYPE_CONSTRUCTION), + new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_BASIC), new ItemStack(Items.GLOWSTONE_DUST) ); // Destruction Core - GameRegistry.addShapelessRecipe(new ItemStack(RefinedStorageItems.CORE, 1, ItemCore.TYPE_DESTRUCTION), - new ItemStack(RefinedStorageItems.PROCESSOR, 1, ItemProcessor.TYPE_BASIC), + GameRegistry.addShapelessRecipe(new ItemStack(RSItems.CORE, 1, ItemCore.TYPE_DESTRUCTION), + new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_BASIC), new ItemStack(Items.QUARTZ) ); // Relay - GameRegistry.addShapelessRecipe(new ItemStack(RefinedStorageBlocks.RELAY), - new ItemStack(RefinedStorageBlocks.MACHINE_CASING), - new ItemStack(RefinedStorageBlocks.CABLE), + GameRegistry.addShapelessRecipe(new ItemStack(RSBlocks.RELAY), + new ItemStack(RSBlocks.MACHINE_CASING), + new ItemStack(RSBlocks.CABLE), new ItemStack(Blocks.REDSTONE_TORCH) ); // Controller - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(RefinedStorageBlocks.CONTROLLER, 1, EnumControllerType.NORMAL.getId()), + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(RSBlocks.CONTROLLER, 1, EnumControllerType.NORMAL.getId()), "EDE", "SMS", "ESE", 'D', new ItemStack(Items.DIAMOND), - 'E', new ItemStack(RefinedStorageItems.QUARTZ_ENRICHED_IRON), - 'M', new ItemStack(RefinedStorageBlocks.MACHINE_CASING), + 'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON), + 'M', new ItemStack(RSBlocks.MACHINE_CASING), 'S', "itemSilicon" )); // Solderer - GameRegistry.addRecipe(new ItemStack(RefinedStorageBlocks.SOLDERER), + GameRegistry.addRecipe(new ItemStack(RSBlocks.SOLDERER), "ESE", "E E", "ESE", - 'E', new ItemStack(RefinedStorageItems.QUARTZ_ENRICHED_IRON), + 'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON), 'S', new ItemStack(Blocks.STICKY_PISTON) ); // Disk Drive - RefinedStorageAPI.instance().getSoldererRegistry().addRecipe(new SoldererRecipe( - new ItemStack(RefinedStorageBlocks.DISK_DRIVE), + RSAPI.instance().getSoldererRegistry().addRecipe(new SoldererRecipe( + new ItemStack(RSBlocks.DISK_DRIVE), 500, - new ItemStack(RefinedStorageItems.PROCESSOR, 1, ItemProcessor.TYPE_ADVANCED), - new ItemStack(RefinedStorageBlocks.MACHINE_CASING), + new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_ADVANCED), + new ItemStack(RSBlocks.MACHINE_CASING), new ItemStack(Blocks.CHEST) )); // Cable - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(RefinedStorageBlocks.CABLE, 12), + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(RSBlocks.CABLE, 12), "EEE", "GRG", "EEE", - 'E', new ItemStack(RefinedStorageItems.QUARTZ_ENRICHED_IRON), + 'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON), 'G', "blockGlass", 'R', new ItemStack(Items.REDSTONE) )); // Wireless Transmitter - GameRegistry.addRecipe(new ItemStack(RefinedStorageBlocks.WIRELESS_TRANSMITTER), + GameRegistry.addRecipe(new ItemStack(RSBlocks.WIRELESS_TRANSMITTER), "EPE", "EME", "EAE", - 'E', new ItemStack(RefinedStorageItems.QUARTZ_ENRICHED_IRON), - 'A', new ItemStack(RefinedStorageItems.PROCESSOR, 1, ItemProcessor.TYPE_ADVANCED), + '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(RefinedStorageBlocks.MACHINE_CASING) + 'M', new ItemStack(RSBlocks.MACHINE_CASING) ); // Grid - GameRegistry.addRecipe(new ItemStack(RefinedStorageBlocks.GRID, 1, EnumGridType.NORMAL.getId()), + GameRegistry.addRecipe(new ItemStack(RSBlocks.GRID, 1, EnumGridType.NORMAL.getId()), "ECE", "PMP", "EDE", - 'E', new ItemStack(RefinedStorageItems.QUARTZ_ENRICHED_IRON), - 'P', new ItemStack(RefinedStorageItems.PROCESSOR, 1, ItemProcessor.TYPE_IMPROVED), - 'C', new ItemStack(RefinedStorageItems.CORE, 1, ItemCore.TYPE_CONSTRUCTION), - 'D', new ItemStack(RefinedStorageItems.CORE, 1, ItemCore.TYPE_DESTRUCTION), - 'M', new ItemStack(RefinedStorageBlocks.MACHINE_CASING) + '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 - RefinedStorageAPI.instance().getSoldererRegistry().addRecipe(new SoldererRecipe( - new ItemStack(RefinedStorageBlocks.GRID, 1, EnumGridType.CRAFTING.getId()), + RSAPI.instance().getSoldererRegistry().addRecipe(new SoldererRecipe( + new ItemStack(RSBlocks.GRID, 1, EnumGridType.CRAFTING.getId()), 500, - new ItemStack(RefinedStorageItems.PROCESSOR, 1, ItemProcessor.TYPE_ADVANCED), - new ItemStack(RefinedStorageBlocks.GRID, 1, EnumGridType.NORMAL.getId()), + new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_ADVANCED), + new ItemStack(RSBlocks.GRID, 1, EnumGridType.NORMAL.getId()), new ItemStack(Blocks.CRAFTING_TABLE) )); // Pattern Grid - RefinedStorageAPI.instance().getSoldererRegistry().addRecipe(new SoldererRecipe( - new ItemStack(RefinedStorageBlocks.GRID, 1, EnumGridType.PATTERN.getId()), + RSAPI.instance().getSoldererRegistry().addRecipe(new SoldererRecipe( + new ItemStack(RSBlocks.GRID, 1, EnumGridType.PATTERN.getId()), 500, - new ItemStack(RefinedStorageItems.PROCESSOR, 1, ItemProcessor.TYPE_ADVANCED), - new ItemStack(RefinedStorageBlocks.GRID, 1, EnumGridType.NORMAL.getId()), - new ItemStack(RefinedStorageItems.PATTERN) + new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_ADVANCED), + new ItemStack(RSBlocks.GRID, 1, EnumGridType.NORMAL.getId()), + new ItemStack(RSItems.PATTERN) )); // Fluid Grid - RefinedStorageAPI.instance().getSoldererRegistry().addRecipe(new SoldererRecipe( - new ItemStack(RefinedStorageBlocks.GRID, 1, EnumGridType.FLUID.getId()), + RSAPI.instance().getSoldererRegistry().addRecipe(new SoldererRecipe( + new ItemStack(RSBlocks.GRID, 1, EnumGridType.FLUID.getId()), 500, - new ItemStack(RefinedStorageItems.PROCESSOR, 1, ItemProcessor.TYPE_ADVANCED), - new ItemStack(RefinedStorageBlocks.GRID, 1, EnumGridType.NORMAL.getId()), + 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(RefinedStorageItems.WIRELESS_GRID, 1, ItemWirelessGrid.TYPE_NORMAL), + GameRegistry.addRecipe(new ItemStack(RSItems.WIRELESS_GRID, 1, ItemWirelessGrid.TYPE_NORMAL), "EPE", "EAE", "EEE", 'P', new ItemStack(Items.ENDER_PEARL), - 'A', new ItemStack(RefinedStorageItems.PROCESSOR, 1, ItemProcessor.TYPE_ADVANCED), - 'E', new ItemStack(RefinedStorageItems.QUARTZ_ENRICHED_IRON) + 'A', new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_ADVANCED), + 'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON) ); // Crafter - GameRegistry.addRecipe(new ItemStack(RefinedStorageBlocks.CRAFTER), + GameRegistry.addRecipe(new ItemStack(RSBlocks.CRAFTER), "ECE", "AMA", "EDE", - 'E', new ItemStack(RefinedStorageItems.QUARTZ_ENRICHED_IRON), - 'A', new ItemStack(RefinedStorageItems.PROCESSOR, 1, ItemProcessor.TYPE_ADVANCED), - 'C', new ItemStack(RefinedStorageItems.CORE, 1, ItemCore.TYPE_CONSTRUCTION), - 'D', new ItemStack(RefinedStorageItems.CORE, 1, ItemCore.TYPE_DESTRUCTION), - 'M', new ItemStack(RefinedStorageBlocks.MACHINE_CASING) + '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(RefinedStorageBlocks.PROCESSING_PATTERN_ENCODER), + GameRegistry.addRecipe(new ItemStack(RSBlocks.PROCESSING_PATTERN_ENCODER), "ECE", "PMP", "EFE", - 'E', new ItemStack(RefinedStorageItems.QUARTZ_ENRICHED_IRON), - 'M', new ItemStack(RefinedStorageBlocks.MACHINE_CASING), - 'P', new ItemStack(RefinedStorageItems.PATTERN), + '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(RefinedStorageBlocks.EXTERNAL_STORAGE), + GameRegistry.addRecipe(new ItemStack(RSBlocks.EXTERNAL_STORAGE), "CED", "HMH", "EPE", - 'E', new ItemStack(RefinedStorageItems.QUARTZ_ENRICHED_IRON), + 'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON), 'H', new ItemStack(Blocks.CHEST), - 'C', new ItemStack(RefinedStorageItems.CORE, 1, ItemCore.TYPE_CONSTRUCTION), - 'D', new ItemStack(RefinedStorageItems.CORE, 1, ItemCore.TYPE_DESTRUCTION), - 'M', new ItemStack(RefinedStorageBlocks.CABLE), - 'P', new ItemStack(RefinedStorageItems.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.CABLE), + 'P', new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_IMPROVED) ); // Importer - GameRegistry.addShapelessRecipe(new ItemStack(RefinedStorageBlocks.IMPORTER), - new ItemStack(RefinedStorageBlocks.CABLE), - new ItemStack(RefinedStorageItems.CORE, 1, ItemCore.TYPE_DESTRUCTION), - new ItemStack(RefinedStorageItems.PROCESSOR, 1, ItemProcessor.TYPE_IMPROVED) + 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) ); // Exporter - GameRegistry.addShapelessRecipe(new ItemStack(RefinedStorageBlocks.EXPORTER), - new ItemStack(RefinedStorageBlocks.CABLE), - new ItemStack(RefinedStorageItems.CORE, 1, ItemCore.TYPE_CONSTRUCTION), - new ItemStack(RefinedStorageItems.PROCESSOR, 1, ItemProcessor.TYPE_IMPROVED) + 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) ); // Destructor - GameRegistry.addShapedRecipe(new ItemStack(RefinedStorageBlocks.DESTRUCTOR), + GameRegistry.addShapedRecipe(new ItemStack(RSBlocks.DESTRUCTOR), "EDE", "RMR", "EIE", - 'E', new ItemStack(RefinedStorageItems.QUARTZ_ENRICHED_IRON), - 'D', new ItemStack(RefinedStorageItems.CORE, 1, ItemCore.TYPE_DESTRUCTION), + 'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON), + 'D', new ItemStack(RSItems.CORE, 1, ItemCore.TYPE_DESTRUCTION), 'R', new ItemStack(Items.REDSTONE), - 'M', new ItemStack(RefinedStorageBlocks.CABLE), - 'I', new ItemStack(RefinedStorageItems.PROCESSOR, 1, ItemProcessor.TYPE_IMPROVED) + 'M', new ItemStack(RSBlocks.CABLE), + 'I', new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_IMPROVED) ); // Constructor - GameRegistry.addShapedRecipe(new ItemStack(RefinedStorageBlocks.CONSTRUCTOR), + GameRegistry.addShapedRecipe(new ItemStack(RSBlocks.CONSTRUCTOR), "ECE", "RMR", "EIE", - 'E', new ItemStack(RefinedStorageItems.QUARTZ_ENRICHED_IRON), - 'C', new ItemStack(RefinedStorageItems.CORE, 1, ItemCore.TYPE_CONSTRUCTION), + 'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON), + 'C', new ItemStack(RSItems.CORE, 1, ItemCore.TYPE_CONSTRUCTION), 'R', new ItemStack(Items.REDSTONE), - 'M', new ItemStack(RefinedStorageBlocks.CABLE), - 'I', new ItemStack(RefinedStorageItems.PROCESSOR, 1, ItemProcessor.TYPE_IMPROVED) + 'M', new ItemStack(RSBlocks.CABLE), + 'I', new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_IMPROVED) ); // Detector - GameRegistry.addRecipe(new ItemStack(RefinedStorageBlocks.DETECTOR), + GameRegistry.addRecipe(new ItemStack(RSBlocks.DETECTOR), "ECE", "RMR", "EPE", - 'E', new ItemStack(RefinedStorageItems.QUARTZ_ENRICHED_IRON), + 'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON), 'R', new ItemStack(Items.REDSTONE), 'C', new ItemStack(Items.COMPARATOR), - 'M', new ItemStack(RefinedStorageBlocks.MACHINE_CASING), - 'P', new ItemStack(RefinedStorageItems.PROCESSOR, 1, ItemProcessor.TYPE_IMPROVED) + 'M', new ItemStack(RSBlocks.MACHINE_CASING), + 'P', new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_IMPROVED) ); // Storage Parts - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(RefinedStorageItems.STORAGE_PART, 1, ItemStoragePart.TYPE_1K), + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(RSItems.STORAGE_PART, 1, ItemStoragePart.TYPE_1K), "SES", "GRG", "SGS", 'R', new ItemStack(Items.REDSTONE), - 'E', new ItemStack(RefinedStorageItems.QUARTZ_ENRICHED_IRON), + 'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON), 'S', "itemSilicon", 'G', "blockGlass" )); - GameRegistry.addRecipe(new ItemStack(RefinedStorageItems.STORAGE_PART, 1, ItemStoragePart.TYPE_4K), + GameRegistry.addRecipe(new ItemStack(RSItems.STORAGE_PART, 1, ItemStoragePart.TYPE_4K), "PEP", "SRS", "PSP", 'R', new ItemStack(Items.REDSTONE), - 'E', new ItemStack(RefinedStorageItems.QUARTZ_ENRICHED_IRON), - 'P', new ItemStack(RefinedStorageItems.PROCESSOR, 1, ItemProcessor.TYPE_BASIC), - 'S', new ItemStack(RefinedStorageItems.STORAGE_PART, 1, ItemStoragePart.TYPE_1K) + '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(RefinedStorageItems.STORAGE_PART, 1, ItemStoragePart.TYPE_16K), + GameRegistry.addRecipe(new ItemStack(RSItems.STORAGE_PART, 1, ItemStoragePart.TYPE_16K), "PEP", "SRS", "PSP", 'R', new ItemStack(Items.REDSTONE), - 'E', new ItemStack(RefinedStorageItems.QUARTZ_ENRICHED_IRON), - 'P', new ItemStack(RefinedStorageItems.PROCESSOR, 1, ItemProcessor.TYPE_IMPROVED), - 'S', new ItemStack(RefinedStorageItems.STORAGE_PART, 1, ItemStoragePart.TYPE_4K) + '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(RefinedStorageItems.STORAGE_PART, 1, ItemStoragePart.TYPE_64K), + GameRegistry.addRecipe(new ItemStack(RSItems.STORAGE_PART, 1, ItemStoragePart.TYPE_64K), "PEP", "SRS", "PSP", 'R', new ItemStack(Items.REDSTONE), - 'E', new ItemStack(RefinedStorageItems.QUARTZ_ENRICHED_IRON), - 'P', new ItemStack(RefinedStorageItems.PROCESSOR, 1, ItemProcessor.TYPE_ADVANCED), - 'S', new ItemStack(RefinedStorageItems.STORAGE_PART, 1, ItemStoragePart.TYPE_16K) + '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(RefinedStorageItems.FLUID_STORAGE_PART, 1, ItemFluidStoragePart.TYPE_64K), + 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(RefinedStorageItems.QUARTZ_ENRICHED_IRON), + 'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON), 'S', "itemSilicon", 'G', "blockGlass" )); - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(RefinedStorageItems.FLUID_STORAGE_PART, 1, ItemFluidStoragePart.TYPE_128K), + 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(RefinedStorageItems.QUARTZ_ENRICHED_IRON), - 'P', new ItemStack(RefinedStorageItems.PROCESSOR, 1, ItemProcessor.TYPE_BASIC), - 'S', new ItemStack(RefinedStorageItems.FLUID_STORAGE_PART, 1, ItemFluidStoragePart.TYPE_64K) + '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(RefinedStorageItems.FLUID_STORAGE_PART, 1, ItemFluidStoragePart.TYPE_256K), + 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(RefinedStorageItems.QUARTZ_ENRICHED_IRON), - 'P', new ItemStack(RefinedStorageItems.PROCESSOR, 1, ItemProcessor.TYPE_IMPROVED), - 'S', new ItemStack(RefinedStorageItems.FLUID_STORAGE_PART, 1, ItemFluidStoragePart.TYPE_128K) + '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(RefinedStorageItems.FLUID_STORAGE_PART, 1, ItemFluidStoragePart.TYPE_512K), + 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(RefinedStorageItems.QUARTZ_ENRICHED_IRON), - 'P', new ItemStack(RefinedStorageItems.PROCESSOR, 1, ItemProcessor.TYPE_ADVANCED), - 'S', new ItemStack(RefinedStorageItems.FLUID_STORAGE_PART, 1, ItemFluidStoragePart.TYPE_256K) + '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(RefinedStorageItems.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(RefinedStorageItems.QUARTZ_ENRICHED_IRON) + 'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON) )); // Storage Disks for (int type = 0; type <= 3; ++type) { - ItemStack disk = ItemStorageNBT.createStackWithNBT(new ItemStack(RefinedStorageItems.STORAGE_DISK, 1, type)); + ItemStack disk = ItemStorageNBT.createStackWithNBT(new ItemStack(RSItems.STORAGE_DISK, 1, type)); GameRegistry.addRecipe(new ShapedOreRecipe(disk, "GRG", @@ -483,19 +483,19 @@ public class CommonProxy { "EEE", 'G', "blockGlass", 'R', new ItemStack(Items.REDSTONE), - 'P', new ItemStack(RefinedStorageItems.STORAGE_PART, 1, type), - 'E', new ItemStack(RefinedStorageItems.QUARTZ_ENRICHED_IRON) + 'P', new ItemStack(RSItems.STORAGE_PART, 1, type), + 'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON) )); GameRegistry.addShapelessRecipe(disk, - new ItemStack(RefinedStorageItems.STORAGE_HOUSING), - new ItemStack(RefinedStorageItems.STORAGE_PART, 1, type) + new ItemStack(RSItems.STORAGE_HOUSING), + new ItemStack(RSItems.STORAGE_PART, 1, type) ); } // Fluid Storage Disks for (int type = 0; type <= 3; ++type) { - ItemStack disk = FluidStorageNBT.createStackWithNBT(new ItemStack(RefinedStorageItems.FLUID_STORAGE_DISK, 1, type)); + ItemStack disk = FluidStorageNBT.createStackWithNBT(new ItemStack(RSItems.FLUID_STORAGE_DISK, 1, type)); GameRegistry.addRecipe(new ShapedOreRecipe(disk, "GRG", @@ -503,144 +503,144 @@ public class CommonProxy { "EEE", 'G', "blockGlass", 'R', new ItemStack(Items.REDSTONE), - 'P', new ItemStack(RefinedStorageItems.FLUID_STORAGE_PART, 1, type), - 'E', new ItemStack(RefinedStorageItems.QUARTZ_ENRICHED_IRON) + 'P', new ItemStack(RSItems.FLUID_STORAGE_PART, 1, type), + 'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON) )); GameRegistry.addShapelessRecipe(disk, - new ItemStack(RefinedStorageItems.STORAGE_HOUSING), - new ItemStack(RefinedStorageItems.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(RefinedStorageItems.PATTERN), + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(RSItems.PATTERN), "GRG", "RGR", "EEE", 'G', "blockGlass", 'R', new ItemStack(Items.REDSTONE), - 'E', new ItemStack(RefinedStorageItems.QUARTZ_ENRICHED_IRON) + 'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON) )); // Upgrade - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(RefinedStorageItems.UPGRADE, 1, 0), + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(RSItems.UPGRADE, 1, 0), "EGE", "EPE", "EGE", 'G', "blockGlass", - 'P', new ItemStack(RefinedStorageItems.PROCESSOR, 1, ItemProcessor.TYPE_IMPROVED), - 'E', new ItemStack(RefinedStorageItems.QUARTZ_ENRICHED_IRON) + 'P', new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_IMPROVED), + 'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON) )); - RefinedStorageAPI.instance().getSoldererRegistry().addRecipe(new SoldererRecipeUpgrade(ItemUpgrade.TYPE_RANGE)); - RefinedStorageAPI.instance().getSoldererRegistry().addRecipe(new SoldererRecipeUpgrade(ItemUpgrade.TYPE_SPEED)); - RefinedStorageAPI.instance().getSoldererRegistry().addRecipe(new SoldererRecipeUpgrade(ItemUpgrade.TYPE_INTERDIMENSIONAL)); - RefinedStorageAPI.instance().getSoldererRegistry().addRecipe(new SoldererRecipeUpgrade(ItemUpgrade.TYPE_CRAFTING)); + RSAPI.instance().getSoldererRegistry().addRecipe(new SoldererRecipeUpgrade(ItemUpgrade.TYPE_RANGE)); + RSAPI.instance().getSoldererRegistry().addRecipe(new SoldererRecipeUpgrade(ItemUpgrade.TYPE_SPEED)); + RSAPI.instance().getSoldererRegistry().addRecipe(new SoldererRecipeUpgrade(ItemUpgrade.TYPE_INTERDIMENSIONAL)); + RSAPI.instance().getSoldererRegistry().addRecipe(new SoldererRecipeUpgrade(ItemUpgrade.TYPE_CRAFTING)); - GameRegistry.addShapedRecipe(new ItemStack(RefinedStorageItems.UPGRADE, 1, ItemUpgrade.TYPE_STACK), + GameRegistry.addShapedRecipe(new ItemStack(RSItems.UPGRADE, 1, ItemUpgrade.TYPE_STACK), "USU", "SUS", "USU", 'U', new ItemStack(Items.SUGAR), - 'S', new ItemStack(RefinedStorageItems.UPGRADE, 1, ItemUpgrade.TYPE_SPEED) + 'S', new ItemStack(RSItems.UPGRADE, 1, ItemUpgrade.TYPE_SPEED) ); // Storage Blocks - RefinedStorageAPI.instance().getSoldererRegistry().addRecipe(new SoldererRecipeStorage(EnumItemStorageType.TYPE_1K, ItemStoragePart.TYPE_1K)); - RefinedStorageAPI.instance().getSoldererRegistry().addRecipe(new SoldererRecipeStorage(EnumItemStorageType.TYPE_4K, ItemStoragePart.TYPE_4K)); - RefinedStorageAPI.instance().getSoldererRegistry().addRecipe(new SoldererRecipeStorage(EnumItemStorageType.TYPE_16K, ItemStoragePart.TYPE_16K)); - RefinedStorageAPI.instance().getSoldererRegistry().addRecipe(new SoldererRecipeStorage(EnumItemStorageType.TYPE_64K, ItemStoragePart.TYPE_64K)); + RSAPI.instance().getSoldererRegistry().addRecipe(new SoldererRecipeStorage(EnumItemStorageType.TYPE_1K, ItemStoragePart.TYPE_1K)); + RSAPI.instance().getSoldererRegistry().addRecipe(new SoldererRecipeStorage(EnumItemStorageType.TYPE_4K, ItemStoragePart.TYPE_4K)); + RSAPI.instance().getSoldererRegistry().addRecipe(new SoldererRecipeStorage(EnumItemStorageType.TYPE_16K, ItemStoragePart.TYPE_16K)); + RSAPI.instance().getSoldererRegistry().addRecipe(new SoldererRecipeStorage(EnumItemStorageType.TYPE_64K, ItemStoragePart.TYPE_64K)); // Fluid Storage Blocks - RefinedStorageAPI.instance().getSoldererRegistry().addRecipe(new SoldererRecipeFluidStorage(EnumFluidStorageType.TYPE_64K, ItemFluidStoragePart.TYPE_64K)); - RefinedStorageAPI.instance().getSoldererRegistry().addRecipe(new SoldererRecipeFluidStorage(EnumFluidStorageType.TYPE_128K, ItemFluidStoragePart.TYPE_128K)); - RefinedStorageAPI.instance().getSoldererRegistry().addRecipe(new SoldererRecipeFluidStorage(EnumFluidStorageType.TYPE_256K, ItemFluidStoragePart.TYPE_256K)); - RefinedStorageAPI.instance().getSoldererRegistry().addRecipe(new SoldererRecipeFluidStorage(EnumFluidStorageType.TYPE_512K, ItemFluidStoragePart.TYPE_512K)); + RSAPI.instance().getSoldererRegistry().addRecipe(new SoldererRecipeFluidStorage(EnumFluidStorageType.TYPE_64K, ItemFluidStoragePart.TYPE_64K)); + RSAPI.instance().getSoldererRegistry().addRecipe(new SoldererRecipeFluidStorage(EnumFluidStorageType.TYPE_128K, ItemFluidStoragePart.TYPE_128K)); + RSAPI.instance().getSoldererRegistry().addRecipe(new SoldererRecipeFluidStorage(EnumFluidStorageType.TYPE_256K, ItemFluidStoragePart.TYPE_256K)); + RSAPI.instance().getSoldererRegistry().addRecipe(new SoldererRecipeFluidStorage(EnumFluidStorageType.TYPE_512K, ItemFluidStoragePart.TYPE_512K)); // Crafting Monitor - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(RefinedStorageBlocks.CRAFTING_MONITOR), + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(RSBlocks.CRAFTING_MONITOR), "EGE", "GMG", "EPE", - 'E', new ItemStack(RefinedStorageItems.QUARTZ_ENRICHED_IRON), - 'M', new ItemStack(RefinedStorageBlocks.MACHINE_CASING), + 'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON), + 'M', new ItemStack(RSBlocks.MACHINE_CASING), 'G', "blockGlass", - 'P', new ItemStack(RefinedStorageItems.PROCESSOR, 1, ItemProcessor.TYPE_IMPROVED) + 'P', new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_IMPROVED) )); // Interface - RefinedStorageAPI.instance().getSoldererRegistry().addRecipe(new SoldererRecipe( - new ItemStack(RefinedStorageBlocks.INTERFACE), + RSAPI.instance().getSoldererRegistry().addRecipe(new SoldererRecipe( + new ItemStack(RSBlocks.INTERFACE), 200, - new ItemStack(RefinedStorageBlocks.IMPORTER), - new ItemStack(RefinedStorageItems.PROCESSOR, 1, ItemProcessor.TYPE_BASIC), - new ItemStack(RefinedStorageBlocks.EXPORTER) + new ItemStack(RSBlocks.IMPORTER), + new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_BASIC), + new ItemStack(RSBlocks.EXPORTER) )); // Fluid Interface - RefinedStorageAPI.instance().getSoldererRegistry().addRecipe(new SoldererRecipe( - new ItemStack(RefinedStorageBlocks.FLUID_INTERFACE), + RSAPI.instance().getSoldererRegistry().addRecipe(new SoldererRecipe( + new ItemStack(RSBlocks.FLUID_INTERFACE), 200, new ItemStack(Items.BUCKET), - new ItemStack(RefinedStorageBlocks.INTERFACE), + new ItemStack(RSBlocks.INTERFACE), new ItemStack(Items.BUCKET) )); // Grid Filter - GameRegistry.addShapedRecipe(new ItemStack(RefinedStorageItems.GRID_FILTER), + GameRegistry.addShapedRecipe(new ItemStack(RSItems.GRID_FILTER), "EPE", "PHP", "EPE", - 'E', new ItemStack(RefinedStorageItems.QUARTZ_ENRICHED_IRON), + 'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON), 'P', new ItemStack(Items.PAPER), 'H', new ItemStack(Blocks.HOPPER) ); // Network Card - GameRegistry.addShapedRecipe(new ItemStack(RefinedStorageItems.NETWORK_CARD), + GameRegistry.addShapedRecipe(new ItemStack(RSItems.NETWORK_CARD), "EEE", "PAP", "EEE", - 'E', new ItemStack(RefinedStorageItems.QUARTZ_ENRICHED_IRON), + 'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON), 'P', new ItemStack(Items.PAPER), - 'A', new ItemStack(RefinedStorageItems.PROCESSOR, 1, ItemProcessor.TYPE_ADVANCED) + 'A', new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_ADVANCED) ); // Network Transmitter - GameRegistry.addShapedRecipe(new ItemStack(RefinedStorageBlocks.NETWORK_TRANSMITTER), + GameRegistry.addShapedRecipe(new ItemStack(RSBlocks.NETWORK_TRANSMITTER), "EEE", "CMD", "AAA", 'E', new ItemStack(Items.ENDER_PEARL), - 'C', new ItemStack(RefinedStorageItems.CORE, 1, ItemCore.TYPE_CONSTRUCTION), - 'M', new ItemStack(RefinedStorageBlocks.MACHINE_CASING), - 'D', new ItemStack(RefinedStorageItems.CORE, 1, ItemCore.TYPE_DESTRUCTION), - 'A', new ItemStack(RefinedStorageItems.PROCESSOR, 1, ItemProcessor.TYPE_ADVANCED) + '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(RefinedStorageBlocks.NETWORK_RECEIVER), + GameRegistry.addShapedRecipe(new ItemStack(RSBlocks.NETWORK_RECEIVER), "AAA", "CMD", "EEE", 'E', new ItemStack(Items.ENDER_PEARL), - 'C', new ItemStack(RefinedStorageItems.CORE, 1, ItemCore.TYPE_CONSTRUCTION), - 'M', new ItemStack(RefinedStorageBlocks.MACHINE_CASING), - 'D', new ItemStack(RefinedStorageItems.CORE, 1, ItemCore.TYPE_DESTRUCTION), - 'A', new ItemStack(RefinedStorageItems.PROCESSOR, 1, ItemProcessor.TYPE_ADVANCED) + '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(RefinedStorageBlocks.DISK_MANIPULATOR), + GameRegistry.addShapedRecipe(new ItemStack(RSBlocks.DISK_MANIPULATOR), "ESE", "CMD", "ESE", - 'E', new ItemStack(RefinedStorageItems.QUARTZ_ENRICHED_IRON), - 'S', new ItemStack(RefinedStorageItems.STORAGE_HOUSING), - 'C', new ItemStack(RefinedStorageItems.CORE, 1, ItemCore.TYPE_CONSTRUCTION), - 'M', new ItemStack(RefinedStorageBlocks.MACHINE_CASING), - 'D', new ItemStack(RefinedStorageItems.CORE, 1, ItemCore.TYPE_DESTRUCTION) + '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) ); } @@ -665,7 +665,7 @@ public class CommonProxy { } private void registerTile(Class tile, String id) { - GameRegistry.registerTileEntity(tile, RefinedStorage.ID + ":" + id); + GameRegistry.registerTileEntity(tile, RS.ID + ":" + id); try { TileBase tileInstance = tile.newInstance(); diff --git a/src/main/java/refinedstorage/tile/TileCable.java b/src/main/java/refinedstorage/tile/TileCable.java index f511f60d2..7f5959230 100755 --- a/src/main/java/refinedstorage/tile/TileCable.java +++ b/src/main/java/refinedstorage/tile/TileCable.java @@ -1,11 +1,11 @@ package refinedstorage.tile; -import refinedstorage.RefinedStorage; +import refinedstorage.RS; public class TileCable extends TileMultipartNode { @Override public int getEnergyUsage() { - return RefinedStorage.INSTANCE.config.cableUsage; + return RS.INSTANCE.config.cableUsage; } @Override diff --git a/src/main/java/refinedstorage/tile/TileConstructor.java b/src/main/java/refinedstorage/tile/TileConstructor.java index 67562b11d..483719497 100755 --- a/src/main/java/refinedstorage/tile/TileConstructor.java +++ b/src/main/java/refinedstorage/tile/TileConstructor.java @@ -15,7 +15,7 @@ import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.items.CapabilityItemHandler; import net.minecraftforge.items.IItemHandler; -import refinedstorage.RefinedStorage; +import refinedstorage.RS; import refinedstorage.api.network.NetworkUtils; import refinedstorage.api.storage.CompareUtils; import refinedstorage.container.slot.SlotSpecimen; @@ -66,7 +66,7 @@ public class TileConstructor extends TileMultipartNode implements IComparable, I @Override public int getEnergyUsage() { - return RefinedStorage.INSTANCE.config.constructorUsage + upgrades.getEnergyUsage(); + return RS.INSTANCE.config.constructorUsage + upgrades.getEnergyUsage(); } @Override diff --git a/src/main/java/refinedstorage/tile/TileController.java b/src/main/java/refinedstorage/tile/TileController.java index c945e7257..8f1b73958 100755 --- a/src/main/java/refinedstorage/tile/TileController.java +++ b/src/main/java/refinedstorage/tile/TileController.java @@ -18,8 +18,8 @@ import net.minecraftforge.common.util.Constants; import net.minecraftforge.energy.CapabilityEnergy; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.items.ItemHandlerHelper; -import refinedstorage.RefinedStorage; -import refinedstorage.RefinedStorageBlocks; +import refinedstorage.RS; +import refinedstorage.RSBlocks; import refinedstorage.api.autocrafting.ICraftingPattern; import refinedstorage.api.autocrafting.ICraftingPatternContainer; import refinedstorage.api.autocrafting.task.ICraftingTask; @@ -180,7 +180,7 @@ public class TileController extends TileBase implements INetworkMaster, IEnergyR private List craftingTasksToCancel = new ArrayList<>(); private List craftingTasksToRead = new ArrayList<>(); - private EnergyStorage energy = new EnergyStorage(RefinedStorage.INSTANCE.config.controllerCapacity); + private EnergyStorage energy = new EnergyStorage(RS.INSTANCE.config.controllerCapacity); private ControllerEnergyForge energyForge = new ControllerEnergyForge(this); private IControllerEnergyIC2 energyEU; private ControllerEnergyTesla energyTesla; @@ -294,7 +294,7 @@ public class TileController extends TileBase implements INetworkMaster, IEnergyR wirelessGridHandler.update(); if (getType() == EnumControllerType.NORMAL) { - if (!RefinedStorage.INSTANCE.config.controllerUsesEnergy) { + if (!RS.INSTANCE.config.controllerUsesEnergy) { energy.setEnergyStored(energy.getMaxEnergyStored()); } else if (energy.getEnergyStored() - getEnergyUsage() >= 0) { energy.extractEnergy(getEnergyUsage(), false); @@ -463,14 +463,14 @@ public class TileController extends TileBase implements INetworkMaster, IEnergyR @Override public void sendItemStorageToClient(EntityPlayerMP player) { - RefinedStorage.INSTANCE.network.sendTo(new MessageGridItemUpdate(this), player); + RS.INSTANCE.network.sendTo(new MessageGridItemUpdate(this), player); } @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 -> RefinedStorage.INSTANCE.network.sendTo(new MessageGridItemDelta(this, stack, delta), player)); + .forEach(player -> RS.INSTANCE.network.sendTo(new MessageGridItemDelta(this, stack, delta), player)); } @Override @@ -482,14 +482,14 @@ public class TileController extends TileBase implements INetworkMaster, IEnergyR @Override public void sendFluidStorageToClient(EntityPlayerMP player) { - RefinedStorage.INSTANCE.network.sendTo(new MessageGridFluidUpdate(this), player); + RS.INSTANCE.network.sendTo(new MessageGridFluidUpdate(this), player); } @Override public void sendFluidStorageDeltaToClient(FluidStack stack, int delta) { worldObj.getMinecraftServer().getPlayerList().getPlayerList().stream() .filter(player -> isWatchingGrid(player, EnumGridType.FLUID)) - .forEach(player -> RefinedStorage.INSTANCE.network.sendTo(new MessageGridFluidDelta(stack, delta), player)); + .forEach(player -> RS.INSTANCE.network.sendTo(new MessageGridFluidDelta(stack, delta), player)); } private boolean isWatchingGrid(EntityPlayer player, EnumGridType... types) { @@ -763,7 +763,7 @@ public class TileController extends TileBase implements INetworkMaster, IEnergyR @Override public int getEnergyUsage() { - int usage = RefinedStorage.INSTANCE.config.controllerBaseUsage; + int usage = RS.INSTANCE.config.controllerBaseUsage; for (INetworkNode node : nodeGraph.all()) { if (node.canUpdate()) { @@ -775,7 +775,7 @@ public class TileController extends TileBase implements INetworkMaster, IEnergyR } public EnumControllerType getType() { - if (type == null && worldObj.getBlockState(pos).getBlock() == RefinedStorageBlocks.CONTROLLER) { + if (type == null && worldObj.getBlockState(pos).getBlock() == RSBlocks.CONTROLLER) { this.type = (EnumControllerType) worldObj.getBlockState(pos).getValue(BlockController.TYPE); } diff --git a/src/main/java/refinedstorage/tile/TileCrafter.java b/src/main/java/refinedstorage/tile/TileCrafter.java index 6ff79e946..240959484 100755 --- a/src/main/java/refinedstorage/tile/TileCrafter.java +++ b/src/main/java/refinedstorage/tile/TileCrafter.java @@ -8,7 +8,7 @@ import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.items.CapabilityItemHandler; import net.minecraftforge.items.IItemHandler; import net.minecraftforge.items.wrapper.CombinedInvWrapper; -import refinedstorage.RefinedStorage; +import refinedstorage.RS; import refinedstorage.api.autocrafting.ICraftingPattern; import refinedstorage.api.autocrafting.ICraftingPatternContainer; import refinedstorage.api.autocrafting.ICraftingPatternProvider; @@ -85,11 +85,11 @@ public class TileCrafter extends TileNode implements ICraftingPatternContainer { @Override public int getEnergyUsage() { - int usage = RefinedStorage.INSTANCE.config.crafterUsage + upgrades.getEnergyUsage(); + int usage = RS.INSTANCE.config.crafterUsage + upgrades.getEnergyUsage(); for (int i = 0; i < patterns.getSlots(); ++i) { if (patterns.getStackInSlot(i) != null) { - usage += RefinedStorage.INSTANCE.config.crafterPerPatternUsage; + usage += RS.INSTANCE.config.crafterPerPatternUsage; } } diff --git a/src/main/java/refinedstorage/tile/TileCraftingMonitor.java b/src/main/java/refinedstorage/tile/TileCraftingMonitor.java index dfb1bb0f9..0d7adf808 100755 --- a/src/main/java/refinedstorage/tile/TileCraftingMonitor.java +++ b/src/main/java/refinedstorage/tile/TileCraftingMonitor.java @@ -1,6 +1,6 @@ package refinedstorage.tile; -import refinedstorage.RefinedStorage; +import refinedstorage.RS; import refinedstorage.api.autocrafting.craftingmonitor.ICraftingMonitorElement; import refinedstorage.tile.data.ITileDataProducer; import refinedstorage.tile.data.RefinedStorageSerializers; @@ -28,7 +28,7 @@ public class TileCraftingMonitor extends TileNode { @Override public int getEnergyUsage() { - return RefinedStorage.INSTANCE.config.craftingMonitorUsage; + return RS.INSTANCE.config.craftingMonitorUsage; } @Override diff --git a/src/main/java/refinedstorage/tile/TileDestructor.java b/src/main/java/refinedstorage/tile/TileDestructor.java index 1148f3ba1..5c387521f 100755 --- a/src/main/java/refinedstorage/tile/TileDestructor.java +++ b/src/main/java/refinedstorage/tile/TileDestructor.java @@ -18,7 +18,7 @@ import net.minecraftforge.fluids.capability.wrappers.BlockLiquidWrapper; import net.minecraftforge.fluids.capability.wrappers.FluidBlockWrapper; import net.minecraftforge.items.CapabilityItemHandler; import net.minecraftforge.items.IItemHandler; -import refinedstorage.RefinedStorage; +import refinedstorage.RS; import refinedstorage.api.storage.CompareUtils; import refinedstorage.inventory.ItemHandlerBasic; import refinedstorage.inventory.ItemHandlerFluid; @@ -64,7 +64,7 @@ public class TileDestructor extends TileMultipartNode implements IComparable, IF @Override public int getEnergyUsage() { - return RefinedStorage.INSTANCE.config.destructorUsage + upgrades.getEnergyUsage(); + return RS.INSTANCE.config.destructorUsage + upgrades.getEnergyUsage(); } @Override diff --git a/src/main/java/refinedstorage/tile/TileDetector.java b/src/main/java/refinedstorage/tile/TileDetector.java index 25d02247e..147892371 100755 --- a/src/main/java/refinedstorage/tile/TileDetector.java +++ b/src/main/java/refinedstorage/tile/TileDetector.java @@ -9,8 +9,8 @@ import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fml.common.FMLCommonHandler; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.items.IItemHandler; -import refinedstorage.RefinedStorage; -import refinedstorage.RefinedStorageBlocks; +import refinedstorage.RS; +import refinedstorage.RSBlocks; import refinedstorage.api.autocrafting.task.ICraftingTask; import refinedstorage.api.network.INetworkMaster; import refinedstorage.api.storage.CompareUtils; @@ -99,7 +99,7 @@ public class TileDetector extends TileNode implements IComparable, IType { @Override public int getEnergyUsage() { - return RefinedStorage.INSTANCE.config.detectorUsage; + return RS.INSTANCE.config.detectorUsage; } @Override @@ -154,7 +154,7 @@ public class TileDetector extends TileNode implements IComparable, IType { if (powered != wasPowered) { wasPowered = powered; - worldObj.notifyNeighborsOfStateChange(pos, RefinedStorageBlocks.DETECTOR); + worldObj.notifyNeighborsOfStateChange(pos, RSBlocks.DETECTOR); updateBlock(); } diff --git a/src/main/java/refinedstorage/tile/TileDiskDrive.java b/src/main/java/refinedstorage/tile/TileDiskDrive.java index 519022bd5..2538ee61f 100755 --- a/src/main/java/refinedstorage/tile/TileDiskDrive.java +++ b/src/main/java/refinedstorage/tile/TileDiskDrive.java @@ -10,8 +10,8 @@ import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.items.CapabilityItemHandler; import net.minecraftforge.items.IItemHandler; import net.minecraftforge.items.ItemHandlerHelper; -import refinedstorage.RefinedStorage; -import refinedstorage.RefinedStorageItems; +import refinedstorage.RS; +import refinedstorage.RSItems; import refinedstorage.api.network.INetworkMaster; import refinedstorage.api.storage.CompareUtils; import refinedstorage.api.storage.fluid.IFluidStorage; @@ -157,11 +157,11 @@ public class TileDiskDrive extends TileNode implements IItemStorageProvider, IFl @Override public int getEnergyUsage() { - int usage = RefinedStorage.INSTANCE.config.diskDriveUsage; + int usage = RS.INSTANCE.config.diskDriveUsage; for (int i = 0; i < disks.getSlots(); ++i) { if (disks.getStackInSlot(i) != null) { - usage += RefinedStorage.INSTANCE.config.diskDrivePerDiskUsage; + usage += RS.INSTANCE.config.diskDrivePerDiskUsage; } } @@ -324,13 +324,13 @@ public class TileDiskDrive extends TileNode implements IItemStorageProvider, IFl ItemStack disk = disks.getStackInSlot(i); if (disk != null) { - int diskCapacity = disk.getItem() == RefinedStorageItems.STORAGE_DISK ? EnumItemStorageType.getById(disk.getItemDamage()).getCapacity() : EnumFluidStorageType.getById(disk.getItemDamage()).getCapacity(); + int diskCapacity = disk.getItem() == RSItems.STORAGE_DISK ? EnumItemStorageType.getById(disk.getItemDamage()).getCapacity() : EnumFluidStorageType.getById(disk.getItemDamage()).getCapacity(); if (diskCapacity == -1) { return 0; } - stored += disk.getItem() == RefinedStorageItems.STORAGE_DISK ? ItemStorageNBT.getStoredFromNBT(disk.getTagCompound()) : FluidStorageNBT.getStoredFromNBT(disk.getTagCompound()); + stored += disk.getItem() == RSItems.STORAGE_DISK ? ItemStorageNBT.getStoredFromNBT(disk.getTagCompound()) : FluidStorageNBT.getStoredFromNBT(disk.getTagCompound()); capacity += diskCapacity; } } @@ -395,7 +395,7 @@ public class TileDiskDrive extends TileNode implements IItemStorageProvider, IFl ItemStack disk = disks.getStackInSlot(i); if (disk != null) { - stored += disk.getItem() == RefinedStorageItems.STORAGE_DISK ? ItemStorageNBT.getStoredFromNBT(disk.getTagCompound()) : FluidStorageNBT.getStoredFromNBT(disk.getTagCompound()); + stored += disk.getItem() == RSItems.STORAGE_DISK ? ItemStorageNBT.getStoredFromNBT(disk.getTagCompound()) : FluidStorageNBT.getStoredFromNBT(disk.getTagCompound()); } } @@ -410,7 +410,7 @@ public class TileDiskDrive extends TileNode implements IItemStorageProvider, IFl ItemStack disk = disks.getStackInSlot(i); if (disk != null) { - int diskCapacity = disk.getItem() == RefinedStorageItems.STORAGE_DISK ? EnumItemStorageType.getById(disk.getItemDamage()).getCapacity() : EnumFluidStorageType.getById(disk.getItemDamage()).getCapacity(); + int diskCapacity = disk.getItem() == RSItems.STORAGE_DISK ? EnumItemStorageType.getById(disk.getItemDamage()).getCapacity() : EnumFluidStorageType.getById(disk.getItemDamage()).getCapacity(); if (diskCapacity == -1) { return -1; diff --git a/src/main/java/refinedstorage/tile/TileDiskManipulator.java b/src/main/java/refinedstorage/tile/TileDiskManipulator.java index d214af781..85a382a8e 100755 --- a/src/main/java/refinedstorage/tile/TileDiskManipulator.java +++ b/src/main/java/refinedstorage/tile/TileDiskManipulator.java @@ -11,7 +11,7 @@ import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.items.CapabilityItemHandler; import net.minecraftforge.items.IItemHandler; import net.minecraftforge.items.ItemHandlerHelper; -import refinedstorage.RefinedStorage; +import refinedstorage.RS; import refinedstorage.api.storage.CompareUtils; import refinedstorage.apiimpl.storage.NBTStorage; import refinedstorage.apiimpl.storage.fluid.FluidStorageNBT; @@ -164,7 +164,7 @@ public class TileDiskManipulator extends TileNode implements IComparable, IFilte @Override public int getEnergyUsage() { - return RefinedStorage.INSTANCE.config.diskManipulatorUsage + upgrades.getEnergyUsage(); + return RS.INSTANCE.config.diskManipulatorUsage + upgrades.getEnergyUsage(); } @Override diff --git a/src/main/java/refinedstorage/tile/TileExporter.java b/src/main/java/refinedstorage/tile/TileExporter.java index 024f46329..81f60681d 100755 --- a/src/main/java/refinedstorage/tile/TileExporter.java +++ b/src/main/java/refinedstorage/tile/TileExporter.java @@ -11,7 +11,7 @@ import net.minecraftforge.fluids.capability.IFluidHandler; import net.minecraftforge.items.CapabilityItemHandler; import net.minecraftforge.items.IItemHandler; import net.minecraftforge.items.ItemHandlerHelper; -import refinedstorage.RefinedStorage; +import refinedstorage.RS; import refinedstorage.api.network.NetworkUtils; import refinedstorage.api.storage.CompareUtils; import refinedstorage.inventory.ItemHandlerBasic; @@ -49,7 +49,7 @@ public class TileExporter extends TileMultipartNode implements IComparable, ITyp @Override public int getEnergyUsage() { - return RefinedStorage.INSTANCE.config.exporterUsage + upgrades.getEnergyUsage(); + return RS.INSTANCE.config.exporterUsage + upgrades.getEnergyUsage(); } @Override diff --git a/src/main/java/refinedstorage/tile/TileFluidInterface.java b/src/main/java/refinedstorage/tile/TileFluidInterface.java index c89d01282..a71f24756 100755 --- a/src/main/java/refinedstorage/tile/TileFluidInterface.java +++ b/src/main/java/refinedstorage/tile/TileFluidInterface.java @@ -8,7 +8,7 @@ import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.FluidTank; import net.minecraftforge.fluids.capability.CapabilityFluidHandler; -import refinedstorage.RefinedStorage; +import refinedstorage.RS; import refinedstorage.api.storage.CompareUtils; import refinedstorage.apiimpl.storage.fluid.FluidUtils; import refinedstorage.inventory.ItemHandlerBasic; @@ -141,7 +141,7 @@ public class TileFluidInterface extends TileNode implements IComparable { @Override public int getEnergyUsage() { - return RefinedStorage.INSTANCE.config.fluidInterfaceUsage; + return RS.INSTANCE.config.fluidInterfaceUsage; } @Override diff --git a/src/main/java/refinedstorage/tile/TileFluidStorage.java b/src/main/java/refinedstorage/tile/TileFluidStorage.java index eb17c6d59..1de6dc98a 100755 --- a/src/main/java/refinedstorage/tile/TileFluidStorage.java +++ b/src/main/java/refinedstorage/tile/TileFluidStorage.java @@ -3,8 +3,8 @@ package refinedstorage.tile; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.datasync.DataSerializers; import net.minecraftforge.fluids.FluidStack; -import refinedstorage.RefinedStorage; -import refinedstorage.RefinedStorageBlocks; +import refinedstorage.RS; +import refinedstorage.RSBlocks; import refinedstorage.api.network.INetworkMaster; import refinedstorage.api.storage.CompareUtils; import refinedstorage.api.storage.fluid.IFluidStorage; @@ -80,7 +80,7 @@ public class TileFluidStorage extends TileNode implements IFluidStorageProvider, @Override public int getEnergyUsage() { - return RefinedStorage.INSTANCE.config.fluidStorageUsage; + return RS.INSTANCE.config.fluidStorageUsage; } @Override @@ -163,7 +163,7 @@ public class TileFluidStorage extends TileNode implements IFluidStorageProvider, } public EnumFluidStorageType getType() { - if (type == null && worldObj.getBlockState(pos).getBlock() == RefinedStorageBlocks.FLUID_STORAGE) { + if (type == null && worldObj.getBlockState(pos).getBlock() == RSBlocks.FLUID_STORAGE) { this.type = ((EnumFluidStorageType) worldObj.getBlockState(pos).getValue(BlockFluidStorage.TYPE)); } diff --git a/src/main/java/refinedstorage/tile/TileImporter.java b/src/main/java/refinedstorage/tile/TileImporter.java index 8b815cc28..9b38b5806 100755 --- a/src/main/java/refinedstorage/tile/TileImporter.java +++ b/src/main/java/refinedstorage/tile/TileImporter.java @@ -10,7 +10,7 @@ import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.capability.IFluidHandler; import net.minecraftforge.items.CapabilityItemHandler; import net.minecraftforge.items.IItemHandler; -import refinedstorage.RefinedStorage; +import refinedstorage.RS; import refinedstorage.api.storage.CompareUtils; import refinedstorage.inventory.ItemHandlerBasic; import refinedstorage.inventory.ItemHandlerFluid; @@ -54,7 +54,7 @@ public class TileImporter extends TileMultipartNode implements IComparable, IFil @Override public int getEnergyUsage() { - return RefinedStorage.INSTANCE.config.importerUsage + upgrades.getEnergyUsage(); + return RS.INSTANCE.config.importerUsage + upgrades.getEnergyUsage(); } @Override diff --git a/src/main/java/refinedstorage/tile/TileInterface.java b/src/main/java/refinedstorage/tile/TileInterface.java index d608ac896..3b3ae7d09 100755 --- a/src/main/java/refinedstorage/tile/TileInterface.java +++ b/src/main/java/refinedstorage/tile/TileInterface.java @@ -7,7 +7,7 @@ import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.items.CapabilityItemHandler; import net.minecraftforge.items.IItemHandler; import net.minecraftforge.items.wrapper.CombinedInvWrapper; -import refinedstorage.RefinedStorage; +import refinedstorage.RS; import refinedstorage.api.network.NetworkUtils; import refinedstorage.api.storage.CompareUtils; import refinedstorage.inventory.ItemHandlerBasic; @@ -36,7 +36,7 @@ public class TileInterface extends TileNode implements IComparable { @Override public int getEnergyUsage() { - return RefinedStorage.INSTANCE.config.interfaceUsage + upgrades.getEnergyUsage(); + return RS.INSTANCE.config.interfaceUsage + upgrades.getEnergyUsage(); } @Override diff --git a/src/main/java/refinedstorage/tile/TileMultipartNode.java b/src/main/java/refinedstorage/tile/TileMultipartNode.java index 5232494db..0fd00ea0f 100755 --- a/src/main/java/refinedstorage/tile/TileMultipartNode.java +++ b/src/main/java/refinedstorage/tile/TileMultipartNode.java @@ -16,7 +16,7 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.common.capabilities.Capability; -import refinedstorage.RefinedStorageBlocks; +import refinedstorage.RSBlocks; import refinedstorage.api.network.NetworkUtils; public abstract class TileMultipartNode extends TileNode implements IMicroblockContainerTile, ISlottedCapabilityProvider { @@ -73,7 +73,7 @@ public abstract class TileMultipartNode extends TileNode implements IMicroblockC if (network != null) { NetworkUtils.rebuildGraph(network); } else if (worldObj != null) { - RefinedStorageBlocks.CABLE.attemptConnect(worldObj, pos); + RSBlocks.CABLE.attemptConnect(worldObj, pos); } } diff --git a/src/main/java/refinedstorage/tile/TileNetworkReceiver.java b/src/main/java/refinedstorage/tile/TileNetworkReceiver.java index d7cb54227..d7ed75052 100755 --- a/src/main/java/refinedstorage/tile/TileNetworkReceiver.java +++ b/src/main/java/refinedstorage/tile/TileNetworkReceiver.java @@ -1,6 +1,6 @@ package refinedstorage.tile; -import refinedstorage.RefinedStorage; +import refinedstorage.RS; import refinedstorage.tile.config.RedstoneMode; public class TileNetworkReceiver extends TileNode { @@ -10,7 +10,7 @@ public class TileNetworkReceiver extends TileNode { @Override public int getEnergyUsage() { - return RefinedStorage.INSTANCE.config.networkReceiverUsage; + return RS.INSTANCE.config.networkReceiverUsage; } @Override diff --git a/src/main/java/refinedstorage/tile/TileNetworkTransmitter.java b/src/main/java/refinedstorage/tile/TileNetworkTransmitter.java index 0e171f5e5..20a0e460f 100755 --- a/src/main/java/refinedstorage/tile/TileNetworkTransmitter.java +++ b/src/main/java/refinedstorage/tile/TileNetworkTransmitter.java @@ -6,8 +6,8 @@ import net.minecraft.network.datasync.DataSerializers; import net.minecraft.util.math.BlockPos; import net.minecraftforge.items.IItemHandler; import net.minecraftforge.items.wrapper.CombinedInvWrapper; -import refinedstorage.RefinedStorage; -import refinedstorage.RefinedStorageItems; +import refinedstorage.RS; +import refinedstorage.RSItems; import refinedstorage.api.network.NetworkUtils; import refinedstorage.inventory.ItemHandlerBasic; import refinedstorage.inventory.ItemHandlerUpgrade; @@ -50,7 +50,7 @@ public class TileNetworkTransmitter extends TileNode { } }; - private ItemHandlerBasic networkCard = new ItemHandlerBasic(1, this, new ItemValidatorBasic(RefinedStorageItems.NETWORK_CARD)) { + private ItemHandlerBasic networkCard = new ItemHandlerBasic(1, this, new ItemValidatorBasic(RSItems.NETWORK_CARD)) { @Override protected void onContentsChanged(int slot) { super.onContentsChanged(slot); @@ -109,7 +109,7 @@ public class TileNetworkTransmitter extends TileNode { @Override public int getEnergyUsage() { - return RefinedStorage.INSTANCE.config.networkTransmitterUsage + (isSameDimension() ? (int) Math.ceil(RefinedStorage.INSTANCE.config.networkTransmitterPerBlockUsage * getDistance()) : 0) + upgrades.getEnergyUsage(); + return RS.INSTANCE.config.networkTransmitterUsage + (isSameDimension() ? (int) Math.ceil(RS.INSTANCE.config.networkTransmitterPerBlockUsage * getDistance()) : 0) + upgrades.getEnergyUsage(); } public ItemHandlerBasic getNetworkCard() { diff --git a/src/main/java/refinedstorage/tile/TileProcessingPatternEncoder.java b/src/main/java/refinedstorage/tile/TileProcessingPatternEncoder.java index 8b96dc9e4..5b69bd7d2 100755 --- a/src/main/java/refinedstorage/tile/TileProcessingPatternEncoder.java +++ b/src/main/java/refinedstorage/tile/TileProcessingPatternEncoder.java @@ -7,13 +7,13 @@ import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.items.CapabilityItemHandler; import net.minecraftforge.items.IItemHandler; import net.minecraftforge.items.ItemHandlerHelper; -import refinedstorage.RefinedStorageItems; +import refinedstorage.RSItems; import refinedstorage.inventory.ItemHandlerBasic; import refinedstorage.inventory.ItemValidatorBasic; import refinedstorage.item.ItemPattern; public class TileProcessingPatternEncoder extends TileBase { - private ItemHandlerBasic patterns = new ItemHandlerBasic(2, this, new ItemValidatorBasic(RefinedStorageItems.PATTERN)); + private ItemHandlerBasic patterns = new ItemHandlerBasic(2, this, new ItemValidatorBasic(RSItems.PATTERN)); private ItemHandlerBasic configuration = new ItemHandlerBasic(9 * 2, this); @Override @@ -36,7 +36,7 @@ public class TileProcessingPatternEncoder extends TileBase { public void onCreatePattern() { if (canCreatePattern()) { - ItemStack pattern = new ItemStack(RefinedStorageItems.PATTERN); + ItemStack pattern = new ItemStack(RSItems.PATTERN); for (int i = 0; i < 18; ++i) { if (configuration.getStackInSlot(i) != null) { diff --git a/src/main/java/refinedstorage/tile/TileRelay.java b/src/main/java/refinedstorage/tile/TileRelay.java index 190d4cf51..a58055ffa 100755 --- a/src/main/java/refinedstorage/tile/TileRelay.java +++ b/src/main/java/refinedstorage/tile/TileRelay.java @@ -1,7 +1,7 @@ package refinedstorage.tile; import net.minecraft.util.EnumFacing; -import refinedstorage.RefinedStorage; +import refinedstorage.RS; import refinedstorage.tile.config.RedstoneMode; public class TileRelay extends TileNode { @@ -13,7 +13,7 @@ public class TileRelay extends TileNode { @Override public int getEnergyUsage() { - return getRedstoneMode() == RedstoneMode.IGNORE ? 0 : RefinedStorage.INSTANCE.config.relayUsage; + return getRedstoneMode() == RedstoneMode.IGNORE ? 0 : RS.INSTANCE.config.relayUsage; } @Override diff --git a/src/main/java/refinedstorage/tile/TileSolderer.java b/src/main/java/refinedstorage/tile/TileSolderer.java index 4139bdc1c..97c05f888 100755 --- a/src/main/java/refinedstorage/tile/TileSolderer.java +++ b/src/main/java/refinedstorage/tile/TileSolderer.java @@ -8,8 +8,8 @@ import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.items.CapabilityItemHandler; import net.minecraftforge.items.IItemHandler; import net.minecraftforge.items.wrapper.CombinedInvWrapper; -import refinedstorage.RefinedStorage; -import refinedstorage.api.RefinedStorageAPI; +import refinedstorage.RS; +import refinedstorage.api.RSAPI; import refinedstorage.api.network.INetworkMaster; import refinedstorage.api.solderer.ISoldererRecipe; import refinedstorage.api.storage.CompareUtils; @@ -52,7 +52,7 @@ public class TileSolderer extends TileNode { public ItemStack insertItem(int slot, ItemStack stack, boolean simulate) { Set possibleSlots = new HashSet<>(); - for (ISoldererRecipe recipe : RefinedStorageAPI.instance().getSoldererRegistry().getRecipes()) { + 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)) { possibleSlots.add(i); @@ -84,7 +84,7 @@ public class TileSolderer extends TileNode { @Override public int getEnergyUsage() { - return RefinedStorage.INSTANCE.config.soldererUsage + upgrades.getEnergyUsage(); + return RS.INSTANCE.config.soldererUsage + upgrades.getEnergyUsage(); } @Override @@ -92,7 +92,7 @@ public class TileSolderer extends TileNode { if (items.getStackInSlot(1) == null && items.getStackInSlot(2) == null && result.getStackInSlot(0) == null) { stop(); } else { - ISoldererRecipe newRecipe = RefinedStorageAPI.instance().getSoldererRegistry().getRecipe(items); + ISoldererRecipe newRecipe = RSAPI.instance().getSoldererRegistry().getRecipe(items); if (newRecipe == null) { stop(); @@ -157,7 +157,7 @@ public class TileSolderer extends TileNode { readItems(upgrades, 1, tag); readItems(result, 2, tag); - recipe = RefinedStorageAPI.instance().getSoldererRegistry().getRecipe(items); + recipe = RSAPI.instance().getSoldererRegistry().getRecipe(items); if (tag.hasKey(NBT_WORKING)) { working = tag.getBoolean(NBT_WORKING); diff --git a/src/main/java/refinedstorage/tile/TileStorage.java b/src/main/java/refinedstorage/tile/TileStorage.java index 92992b998..44d9fc9cc 100755 --- a/src/main/java/refinedstorage/tile/TileStorage.java +++ b/src/main/java/refinedstorage/tile/TileStorage.java @@ -4,8 +4,8 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.datasync.DataSerializers; import net.minecraftforge.items.ItemHandlerHelper; -import refinedstorage.RefinedStorage; -import refinedstorage.RefinedStorageBlocks; +import refinedstorage.RS; +import refinedstorage.RSBlocks; import refinedstorage.api.network.INetworkMaster; import refinedstorage.api.storage.CompareUtils; import refinedstorage.api.storage.item.IItemStorage; @@ -80,7 +80,7 @@ public class TileStorage extends TileNode implements IItemStorageProvider, IStor @Override public int getEnergyUsage() { - return RefinedStorage.INSTANCE.config.storageUsage; + return RS.INSTANCE.config.storageUsage; } @Override @@ -163,7 +163,7 @@ public class TileStorage extends TileNode implements IItemStorageProvider, IStor } public EnumItemStorageType getType() { - if (type == null && worldObj.getBlockState(pos).getBlock() == RefinedStorageBlocks.STORAGE) { + if (type == null && worldObj.getBlockState(pos).getBlock() == RSBlocks.STORAGE) { this.type = ((EnumItemStorageType) worldObj.getBlockState(pos).getValue(BlockStorage.TYPE)); } diff --git a/src/main/java/refinedstorage/tile/TileWirelessTransmitter.java b/src/main/java/refinedstorage/tile/TileWirelessTransmitter.java index 29374aa7d..1cb2535ad 100755 --- a/src/main/java/refinedstorage/tile/TileWirelessTransmitter.java +++ b/src/main/java/refinedstorage/tile/TileWirelessTransmitter.java @@ -7,7 +7,7 @@ import net.minecraft.util.math.BlockPos; import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.items.CapabilityItemHandler; import net.minecraftforge.items.IItemHandler; -import refinedstorage.RefinedStorage; +import refinedstorage.RS; import refinedstorage.api.network.IWirelessTransmitter; import refinedstorage.inventory.ItemHandlerBasic; import refinedstorage.inventory.ItemHandlerUpgrade; @@ -31,7 +31,7 @@ public class TileWirelessTransmitter extends TileNode implements IWirelessTransm @Override public int getEnergyUsage() { - return RefinedStorage.INSTANCE.config.wirelessTransmitterUsage + upgrades.getEnergyUsage(); + return RS.INSTANCE.config.wirelessTransmitterUsage + upgrades.getEnergyUsage(); } @Override @@ -56,7 +56,7 @@ public class TileWirelessTransmitter extends TileNode implements IWirelessTransm @Override public int getRange() { - return RefinedStorage.INSTANCE.config.wirelessTransmitterBaseRange + (upgrades.getUpgradeCount(ItemUpgrade.TYPE_RANGE) * RefinedStorage.INSTANCE.config.wirelessTransmitterRangePerUpgrade); + return RS.INSTANCE.config.wirelessTransmitterBaseRange + (upgrades.getUpgradeCount(ItemUpgrade.TYPE_RANGE) * RS.INSTANCE.config.wirelessTransmitterRangePerUpgrade); } @Override diff --git a/src/main/java/refinedstorage/tile/data/RefinedStorageSerializers.java b/src/main/java/refinedstorage/tile/data/RefinedStorageSerializers.java index d6fe5b173..ce765381f 100755 --- a/src/main/java/refinedstorage/tile/data/RefinedStorageSerializers.java +++ b/src/main/java/refinedstorage/tile/data/RefinedStorageSerializers.java @@ -7,7 +7,7 @@ import net.minecraft.network.datasync.DataSerializer; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fml.common.network.ByteBufUtils; -import refinedstorage.api.RefinedStorageAPI; +import refinedstorage.api.RSAPI; import refinedstorage.api.autocrafting.craftingmonitor.ICraftingMonitorElement; import refinedstorage.tile.ClientNode; @@ -67,7 +67,7 @@ public final class RefinedStorageSerializers { int size = buf.readInt(); for (int i = 0; i < size; ++i) { - Function factory = RefinedStorageAPI.instance().getCraftingMonitorElementRegistry().getFactory(ByteBufUtils.readUTF8String(buf)); + Function factory = RSAPI.instance().getCraftingMonitorElementRegistry().getFactory(ByteBufUtils.readUTF8String(buf)); if (factory != null) { elements.add(factory.apply(buf)); diff --git a/src/main/java/refinedstorage/tile/data/TileDataManager.java b/src/main/java/refinedstorage/tile/data/TileDataManager.java index a051bee4e..33664845f 100755 --- a/src/main/java/refinedstorage/tile/data/TileDataManager.java +++ b/src/main/java/refinedstorage/tile/data/TileDataManager.java @@ -4,7 +4,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.inventory.Container; import net.minecraft.tileentity.TileEntity; -import refinedstorage.RefinedStorage; +import refinedstorage.RS; import refinedstorage.container.ContainerBase; import refinedstorage.network.MessageTileDataParameter; import refinedstorage.network.MessageTileDataParameterUpdate; @@ -35,7 +35,7 @@ public class TileDataManager { } public static void setParameter(TileDataParameter parameter, T value) { - RefinedStorage.INSTANCE.network.sendToServer(new MessageTileDataParameterUpdate(parameter, value)); + RS.INSTANCE.network.sendToServer(new MessageTileDataParameterUpdate(parameter, value)); } private TileEntity tile; @@ -81,7 +81,7 @@ public class TileDataManager { } public void sendParameter(EntityPlayerMP player, TileDataParameter parameter) { - RefinedStorage.INSTANCE.network.sendTo(new MessageTileDataParameter(tile, parameter), player); + RS.INSTANCE.network.sendTo(new MessageTileDataParameter(tile, parameter), player); } public void sendParameterToWatchers(TileDataParameter parameter) { diff --git a/src/main/java/refinedstorage/tile/externalstorage/TileExternalStorage.java b/src/main/java/refinedstorage/tile/externalstorage/TileExternalStorage.java index c145aaf7d..2205d835d 100755 --- a/src/main/java/refinedstorage/tile/externalstorage/TileExternalStorage.java +++ b/src/main/java/refinedstorage/tile/externalstorage/TileExternalStorage.java @@ -10,7 +10,7 @@ import net.minecraftforge.fluids.capability.IFluidHandler; import net.minecraftforge.fluids.capability.IFluidTankProperties; import net.minecraftforge.items.IItemHandler; import powercrystals.minefactoryreloaded.api.IDeepStorageUnit; -import refinedstorage.RefinedStorage; +import refinedstorage.RS; import refinedstorage.api.network.INetworkMaster; import refinedstorage.api.storage.CompareUtils; import refinedstorage.api.storage.fluid.IFluidStorage; @@ -105,7 +105,7 @@ public class TileExternalStorage extends TileMultipartNode implements IItemStora @Override public int getEnergyUsage() { - return RefinedStorage.INSTANCE.config.externalStorageUsage + ((itemStorages.size() + fluidStorages.size()) * RefinedStorage.INSTANCE.config.externalStoragePerStorageUsage); + return RS.INSTANCE.config.externalStorageUsage + ((itemStorages.size() + fluidStorages.size()) * RS.INSTANCE.config.externalStoragePerStorageUsage); } @Override diff --git a/src/main/java/refinedstorage/tile/grid/TileGrid.java b/src/main/java/refinedstorage/tile/grid/TileGrid.java index b609e6ebc..0e848a85e 100755 --- a/src/main/java/refinedstorage/tile/grid/TileGrid.java +++ b/src/main/java/refinedstorage/tile/grid/TileGrid.java @@ -13,9 +13,9 @@ import net.minecraftforge.items.IItemHandler; import net.minecraftforge.items.ItemHandlerHelper; import net.minecraftforge.items.wrapper.CombinedInvWrapper; import net.minecraftforge.items.wrapper.InvWrapper; -import refinedstorage.RefinedStorage; -import refinedstorage.RefinedStorageBlocks; -import refinedstorage.RefinedStorageItems; +import refinedstorage.RS; +import refinedstorage.RSBlocks; +import refinedstorage.RSItems; import refinedstorage.api.network.NetworkUtils; import refinedstorage.api.network.grid.IFluidGridHandler; import refinedstorage.api.network.grid.IItemGridHandler; @@ -141,7 +141,7 @@ public class TileGrid extends TileNode implements IGrid { private InventoryCrafting matrix = new InventoryCrafting(craftingContainer, 3, 3); private InventoryCraftResult result = new InventoryCraftResult(); - private ItemHandlerBasic patterns = new ItemHandlerBasic(2, this, new ItemValidatorBasic(RefinedStorageItems.PATTERN)); + private ItemHandlerBasic patterns = new ItemHandlerBasic(2, this, new ItemValidatorBasic(RSItems.PATTERN)); private List filteredItems = new ArrayList<>(); private ItemHandlerGridFilterInGrid filter = new ItemHandlerGridFilterInGrid(filteredItems); @@ -163,13 +163,13 @@ public class TileGrid extends TileNode implements IGrid { public int getEnergyUsage() { switch (getType()) { case NORMAL: - return RefinedStorage.INSTANCE.config.gridUsage; + return RS.INSTANCE.config.gridUsage; case CRAFTING: - return RefinedStorage.INSTANCE.config.craftingGridUsage; + return RS.INSTANCE.config.craftingGridUsage; case PATTERN: - return RefinedStorage.INSTANCE.config.patternGridUsage; + return RS.INSTANCE.config.patternGridUsage; case FLUID: - return RefinedStorage.INSTANCE.config.fluidGridUsage; + return RS.INSTANCE.config.fluidGridUsage; default: return 0; } @@ -180,7 +180,7 @@ public class TileGrid extends TileNode implements IGrid { } public EnumGridType getType() { - if (type == null && worldObj.getBlockState(pos).getBlock() == RefinedStorageBlocks.GRID) { + if (type == null && worldObj.getBlockState(pos).getBlock() == RSBlocks.GRID) { this.type = (EnumGridType) worldObj.getBlockState(pos).getValue(BlockGrid.TYPE); } @@ -306,7 +306,7 @@ public class TileGrid extends TileNode implements IGrid { if (canCreatePattern()) { patterns.extractItem(0, 1, false); - ItemStack pattern = new ItemStack(RefinedStorageItems.PATTERN); + ItemStack pattern = new ItemStack(RSItems.PATTERN); for (int i = 0; i < 9; ++i) { ItemStack ingredient = matrix.getStackInSlot(i); diff --git a/src/main/java/refinedstorage/tile/grid/WirelessGrid.java b/src/main/java/refinedstorage/tile/grid/WirelessGrid.java index 1f7c2a330..a3ae9cbdd 100755 --- a/src/main/java/refinedstorage/tile/grid/WirelessGrid.java +++ b/src/main/java/refinedstorage/tile/grid/WirelessGrid.java @@ -9,7 +9,7 @@ import net.minecraft.world.World; import net.minecraftforge.common.DimensionManager; import net.minecraftforge.fml.common.FMLCommonHandler; import net.minecraftforge.fml.relauncher.Side; -import refinedstorage.RefinedStorage; +import refinedstorage.RS; import refinedstorage.api.network.grid.IFluidGridHandler; import refinedstorage.api.network.grid.IItemGridHandler; import refinedstorage.block.EnumGridType; @@ -124,7 +124,7 @@ public class WirelessGrid implements IGrid { @Override public void onViewTypeChanged(int type) { - RefinedStorage.INSTANCE.network.sendToServer(new MessageWirelessGridSettingsUpdate(type, getSortingDirection(), getSortingType(), getSearchBoxMode())); + RS.INSTANCE.network.sendToServer(new MessageWirelessGridSettingsUpdate(type, getSortingDirection(), getSortingType(), getSearchBoxMode())); this.viewType = type; @@ -133,7 +133,7 @@ public class WirelessGrid implements IGrid { @Override public void onSortingTypeChanged(int type) { - RefinedStorage.INSTANCE.network.sendToServer(new MessageWirelessGridSettingsUpdate(getViewType(), getSortingDirection(), type, getSearchBoxMode())); + RS.INSTANCE.network.sendToServer(new MessageWirelessGridSettingsUpdate(getViewType(), getSortingDirection(), type, getSearchBoxMode())); this.sortingType = type; @@ -142,7 +142,7 @@ public class WirelessGrid implements IGrid { @Override public void onSortingDirectionChanged(int direction) { - RefinedStorage.INSTANCE.network.sendToServer(new MessageWirelessGridSettingsUpdate(getViewType(), direction, getSortingType(), getSearchBoxMode())); + RS.INSTANCE.network.sendToServer(new MessageWirelessGridSettingsUpdate(getViewType(), direction, getSortingType(), getSearchBoxMode())); this.sortingDirection = direction; @@ -151,7 +151,7 @@ public class WirelessGrid implements IGrid { @Override public void onSearchBoxModeChanged(int searchBoxMode) { - RefinedStorage.INSTANCE.network.sendToServer(new MessageWirelessGridSettingsUpdate(getViewType(), getSortingDirection(), getSortingType(), searchBoxMode)); + RS.INSTANCE.network.sendToServer(new MessageWirelessGridSettingsUpdate(getViewType(), getSortingDirection(), getSortingType(), searchBoxMode)); this.searchBoxMode = searchBoxMode; } From 57954276da155faa713042ddf15c25492b790ce9 Mon Sep 17 00:00:00 2001 From: Raoul Van den Berge Date: Fri, 7 Oct 2016 02:31:17 +0200 Subject: [PATCH 6/8] Ancients legends didn't say anything about forgetfulness --- src/main/java/refinedstorage/gui/grid/GuiGrid.java | 4 ++-- .../jei/{RefinedStorageJEIPlugin.java => RSJEIPlugin.java} | 4 ++-- src/main/java/refinedstorage/tile/TileController.java | 4 ++-- src/main/java/refinedstorage/tile/TileCraftingMonitor.java | 4 ++-- src/main/java/refinedstorage/tile/TileFluidInterface.java | 6 +++--- .../{RefinedStorageSerializers.java => RSSerializers.java} | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) rename src/main/java/refinedstorage/integration/jei/{RefinedStorageJEIPlugin.java => RSJEIPlugin.java} (92%) rename src/main/java/refinedstorage/tile/data/{RefinedStorageSerializers.java => RSSerializers.java} (98%) diff --git a/src/main/java/refinedstorage/gui/grid/GuiGrid.java b/src/main/java/refinedstorage/gui/grid/GuiGrid.java index 9ae48aa9d..0b637bd8e 100755 --- a/src/main/java/refinedstorage/gui/grid/GuiGrid.java +++ b/src/main/java/refinedstorage/gui/grid/GuiGrid.java @@ -28,7 +28,7 @@ import refinedstorage.gui.grid.stack.ClientStackItem; import refinedstorage.gui.grid.stack.IClientStack; import refinedstorage.gui.sidebutton.*; import refinedstorage.integration.jei.IntegrationJEI; -import refinedstorage.integration.jei.RefinedStorageJEIPlugin; +import refinedstorage.integration.jei.RSJEIPlugin; import refinedstorage.network.*; import refinedstorage.tile.grid.IGrid; import refinedstorage.tile.grid.TileGrid; @@ -417,7 +417,7 @@ public class GuiGrid extends GuiBase { private void updateJEI() { if (IntegrationJEI.isLoaded() && (grid.getSearchBoxMode() == TileGrid.SEARCH_BOX_MODE_JEI_SYNCHRONIZED || grid.getSearchBoxMode() == TileGrid.SEARCH_BOX_MODE_JEI_SYNCHRONIZED_AUTOSELECTED)) { - RefinedStorageJEIPlugin.INSTANCE.getRuntime().getItemListOverlay().setFilterText(searchField.getText()); + RSJEIPlugin.INSTANCE.getRuntime().getItemListOverlay().setFilterText(searchField.getText()); } } diff --git a/src/main/java/refinedstorage/integration/jei/RefinedStorageJEIPlugin.java b/src/main/java/refinedstorage/integration/jei/RSJEIPlugin.java similarity index 92% rename from src/main/java/refinedstorage/integration/jei/RefinedStorageJEIPlugin.java rename to src/main/java/refinedstorage/integration/jei/RSJEIPlugin.java index 033db65dc..fd483b9c9 100755 --- a/src/main/java/refinedstorage/integration/jei/RefinedStorageJEIPlugin.java +++ b/src/main/java/refinedstorage/integration/jei/RSJEIPlugin.java @@ -9,8 +9,8 @@ import refinedstorage.RSBlocks; import refinedstorage.container.ContainerSolderer; @JEIPlugin -public class RefinedStorageJEIPlugin extends BlankModPlugin { - public static RefinedStorageJEIPlugin INSTANCE; +public class RSJEIPlugin extends BlankModPlugin { + public static RSJEIPlugin INSTANCE; private IJeiRuntime runtime; diff --git a/src/main/java/refinedstorage/tile/TileController.java b/src/main/java/refinedstorage/tile/TileController.java index 8f1b73958..0d871840d 100755 --- a/src/main/java/refinedstorage/tile/TileController.java +++ b/src/main/java/refinedstorage/tile/TileController.java @@ -57,7 +57,7 @@ import refinedstorage.network.MessageGridItemUpdate; import refinedstorage.tile.config.IRedstoneConfigurable; import refinedstorage.tile.config.RedstoneMode; import refinedstorage.tile.data.ITileDataProducer; -import refinedstorage.tile.data.RefinedStorageSerializers; +import refinedstorage.tile.data.RSSerializers; import refinedstorage.tile.data.TileDataParameter; import refinedstorage.tile.externalstorage.FluidStorageExternal; import refinedstorage.tile.externalstorage.ItemStorageExternal; @@ -91,7 +91,7 @@ public class TileController extends TileBase implements INetworkMaster, IEnergyR } }); - public static final TileDataParameter> NODES = new TileDataParameter<>(RefinedStorageSerializers.CLIENT_NODE_SERIALIZER, new ArrayList<>(), new ITileDataProducer, TileController>() { + public static final TileDataParameter> NODES = new TileDataParameter<>(RSSerializers.CLIENT_NODE_SERIALIZER, new ArrayList<>(), new ITileDataProducer, TileController>() { @Override public List getValue(TileController tile) { List nodes = new ArrayList<>(); diff --git a/src/main/java/refinedstorage/tile/TileCraftingMonitor.java b/src/main/java/refinedstorage/tile/TileCraftingMonitor.java index 0d7adf808..fc7e8043e 100755 --- a/src/main/java/refinedstorage/tile/TileCraftingMonitor.java +++ b/src/main/java/refinedstorage/tile/TileCraftingMonitor.java @@ -3,7 +3,7 @@ package refinedstorage.tile; import refinedstorage.RS; import refinedstorage.api.autocrafting.craftingmonitor.ICraftingMonitorElement; import refinedstorage.tile.data.ITileDataProducer; -import refinedstorage.tile.data.RefinedStorageSerializers; +import refinedstorage.tile.data.RSSerializers; import refinedstorage.tile.data.TileDataParameter; import java.util.Collections; @@ -11,7 +11,7 @@ import java.util.List; import java.util.stream.Collectors; public class TileCraftingMonitor extends TileNode { - public static final TileDataParameter> ELEMENTS = new TileDataParameter<>(RefinedStorageSerializers.CRAFTING_MONITOR_ELEMENT_SERIALIZER, Collections.emptyList(), new ITileDataProducer, TileCraftingMonitor>() { + public static final TileDataParameter> ELEMENTS = new TileDataParameter<>(RSSerializers.CRAFTING_MONITOR_ELEMENT_SERIALIZER, Collections.emptyList(), new ITileDataProducer, TileCraftingMonitor>() { @Override public List getValue(TileCraftingMonitor tile) { if (tile.connected) { diff --git a/src/main/java/refinedstorage/tile/TileFluidInterface.java b/src/main/java/refinedstorage/tile/TileFluidInterface.java index a71f24756..56971dfde 100755 --- a/src/main/java/refinedstorage/tile/TileFluidInterface.java +++ b/src/main/java/refinedstorage/tile/TileFluidInterface.java @@ -17,7 +17,7 @@ import refinedstorage.inventory.ItemHandlerUpgrade; import refinedstorage.item.ItemUpgrade; import refinedstorage.tile.config.IComparable; import refinedstorage.tile.data.ITileDataProducer; -import refinedstorage.tile.data.RefinedStorageSerializers; +import refinedstorage.tile.data.RSSerializers; import refinedstorage.tile.data.TileDataParameter; public class TileFluidInterface extends TileNode implements IComparable { @@ -25,14 +25,14 @@ public class TileFluidInterface extends TileNode implements IComparable { public static final TileDataParameter COMPARE = IComparable.createParameter(); - public static final TileDataParameter TANK_IN = new TileDataParameter<>(RefinedStorageSerializers.FLUID_STACK_SERIALIZER, null, new ITileDataProducer() { + public static final TileDataParameter TANK_IN = new TileDataParameter<>(RSSerializers.FLUID_STACK_SERIALIZER, null, new ITileDataProducer() { @Override public FluidStack getValue(TileFluidInterface tile) { return tile.tankIn.getFluid(); } }); - public static final TileDataParameter TANK_OUT = new TileDataParameter<>(RefinedStorageSerializers.FLUID_STACK_SERIALIZER, null, new ITileDataProducer() { + public static final TileDataParameter TANK_OUT = new TileDataParameter<>(RSSerializers.FLUID_STACK_SERIALIZER, null, new ITileDataProducer() { @Override public FluidStack getValue(TileFluidInterface tile) { return tile.tankOut.getFluid(); diff --git a/src/main/java/refinedstorage/tile/data/RefinedStorageSerializers.java b/src/main/java/refinedstorage/tile/data/RSSerializers.java similarity index 98% rename from src/main/java/refinedstorage/tile/data/RefinedStorageSerializers.java rename to src/main/java/refinedstorage/tile/data/RSSerializers.java index ce765381f..73269248c 100755 --- a/src/main/java/refinedstorage/tile/data/RefinedStorageSerializers.java +++ b/src/main/java/refinedstorage/tile/data/RSSerializers.java @@ -16,7 +16,7 @@ import java.util.ArrayList; import java.util.List; import java.util.function.Function; -public final class RefinedStorageSerializers { +public final class RSSerializers { public static final DataSerializer> CLIENT_NODE_SERIALIZER = new DataSerializer>() { @Override public void write(PacketBuffer buf, List nodes) { From ae1117f8beb7202407928b7ea366808f50143dbd Mon Sep 17 00:00:00 2001 From: Raoul Van den Berge Date: Fri, 7 Oct 2016 02:46:59 +0200 Subject: [PATCH 7/8] Remove CompareUtils - it's now in IComparer --- src/main/java/refinedstorage/api/IAPI.java | 7 + .../api/network/INetworkMaster.java | 1 - .../api/network/NetworkUtils.java | 10 +- .../api/storage/fluid/IFluidStorage.java | 1 - .../storage/fluid/IGroupedFluidStorage.java | 4 +- .../api/storage/item/IItemStorage.java | 1 - .../refinedstorage/api/util/IComparer.java | 73 +++ src/main/java/refinedstorage/apiimpl/API.java | 9 + .../apiimpl/autocrafting/CraftingPattern.java | 14 +- .../autocrafting/task/CraftingTaskNormal.java | 26 +- .../autocrafting/task/Processable.java | 4 +- .../network/grid/FluidGridHandler.java | 4 +- .../apiimpl/network/grid/ItemGridHandler.java | 4 +- .../solderer/SoldererRecipeFluidStorage.java | 6 +- .../solderer/SoldererRecipeProcessor.java | 2 +- .../solderer/SoldererRecipeStorage.java | 6 +- .../solderer/SoldererRecipeUpgrade.java | 2 +- .../apiimpl/solderer/SoldererRegistry.java | 4 +- .../storage/fluid/FluidStorageNBT.java | 4 +- .../apiimpl/storage/fluid/FluidUtils.java | 4 +- .../storage/fluid/GroupedFluidStorage.java | 4 +- .../apiimpl/storage/item/ItemStorageNBT.java | 6 +- .../util/Comparer.java} | 78 +-- .../apiimpl/util/ItemStackList.java | 8 +- .../container/ContainerBase.java | 4 +- .../container/ContainerDiskManipulator.java | 2 +- .../ContainerProcessingPatternEncoder.java | 2 +- .../refinedstorage/gui/GuiConstructor.java | 6 +- .../refinedstorage/gui/GuiDestructor.java | 6 +- .../java/refinedstorage/gui/GuiDetector.java | 6 +- .../gui/GuiDiskManipulator.java | 6 +- .../java/refinedstorage/gui/GuiExporter.java | 6 +- .../refinedstorage/gui/GuiFluidInterface.java | 4 +- .../refinedstorage/gui/GuiGridFilter.java | 10 +- .../java/refinedstorage/gui/GuiImporter.java | 6 +- .../java/refinedstorage/gui/GuiInterface.java | 6 +- .../java/refinedstorage/gui/GuiStorage.java | 6 +- .../gui/config/ModGuiConfig.java | 10 +- .../java/refinedstorage/gui/grid/GuiGrid.java | 4 +- .../gui/sidebutton/SideButtonCompare.java | 6 +- .../refinedstorage/item/ItemGridFilter.java | 4 +- .../java/refinedstorage/item/ItemPattern.java | 4 +- .../refinedstorage/proxy/ClientProxy.java | 64 +- .../refinedstorage/proxy/CommonProxy.java | 558 +++++++++--------- .../java/refinedstorage/tile/ClientNode.java | 4 +- .../refinedstorage/tile/TileConstructor.java | 4 +- .../refinedstorage/tile/TileController.java | 33 +- .../java/refinedstorage/tile/TileCrafter.java | 4 +- .../refinedstorage/tile/TileDestructor.java | 6 +- .../refinedstorage/tile/TileDetector.java | 7 +- .../refinedstorage/tile/TileDiskDrive.java | 4 +- .../tile/TileDiskManipulator.java | 4 +- .../refinedstorage/tile/TileExporter.java | 4 +- .../tile/TileFluidInterface.java | 4 +- .../refinedstorage/tile/TileFluidStorage.java | 4 +- .../refinedstorage/tile/TileImporter.java | 4 +- .../refinedstorage/tile/TileInterface.java | 4 +- .../refinedstorage/tile/TileSolderer.java | 5 +- .../java/refinedstorage/tile/TileStorage.java | 4 +- .../tile/config/IFilterable.java | 10 +- .../externalstorage/FluidStorageExternal.java | 7 +- .../tile/externalstorage/ItemStorageDSU.java | 6 +- .../externalstorage/ItemStorageDrawer.java | 4 +- .../externalstorage/ItemStorageExternal.java | 4 +- .../ItemStorageItemHandler.java | 4 +- .../externalstorage/TileExternalStorage.java | 4 +- .../refinedstorage/tile/grid/TileGrid.java | 6 +- 67 files changed, 588 insertions(+), 554 deletions(-) create mode 100755 src/main/java/refinedstorage/api/util/IComparer.java rename src/main/java/refinedstorage/{api/storage/CompareUtils.java => apiimpl/util/Comparer.java} (50%) mode change 100644 => 100755 src/main/java/refinedstorage/container/ContainerDiskManipulator.java diff --git a/src/main/java/refinedstorage/api/IAPI.java b/src/main/java/refinedstorage/api/IAPI.java index c85e52638..3cf834c9d 100755 --- a/src/main/java/refinedstorage/api/IAPI.java +++ b/src/main/java/refinedstorage/api/IAPI.java @@ -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 */ diff --git a/src/main/java/refinedstorage/api/network/INetworkMaster.java b/src/main/java/refinedstorage/api/network/INetworkMaster.java index 4d0b81139..71d2b9632 100755 --- a/src/main/java/refinedstorage/api/network/INetworkMaster.java +++ b/src/main/java/refinedstorage/api/network/INetworkMaster.java @@ -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; diff --git a/src/main/java/refinedstorage/api/network/NetworkUtils.java b/src/main/java/refinedstorage/api/network/NetworkUtils.java index 1f40d2cbd..d43b29796 100755 --- a/src/main/java/refinedstorage/api/network/NetworkUtils.java +++ b/src/main/java/refinedstorage/api/network/NetworkUtils.java @@ -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++; } } diff --git a/src/main/java/refinedstorage/api/storage/fluid/IFluidStorage.java b/src/main/java/refinedstorage/api/storage/fluid/IFluidStorage.java index 2351c2e47..edeed4e90 100755 --- a/src/main/java/refinedstorage/api/storage/fluid/IFluidStorage.java +++ b/src/main/java/refinedstorage/api/storage/fluid/IFluidStorage.java @@ -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; diff --git a/src/main/java/refinedstorage/api/storage/fluid/IGroupedFluidStorage.java b/src/main/java/refinedstorage/api/storage/fluid/IGroupedFluidStorage.java index 03fbd5f69..202e3e887 100755 --- a/src/main/java/refinedstorage/api/storage/fluid/IGroupedFluidStorage.java +++ b/src/main/java/refinedstorage/api/storage/fluid/IGroupedFluidStorage.java @@ -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}. *

* Refined Storage uses this class mainly for use in Grids and Detectors to avoid querying diff --git a/src/main/java/refinedstorage/api/storage/item/IItemStorage.java b/src/main/java/refinedstorage/api/storage/item/IItemStorage.java index 1f8c9910e..f6d1ee2b9 100755 --- a/src/main/java/refinedstorage/api/storage/item/IItemStorage.java +++ b/src/main/java/refinedstorage/api/storage/item/IItemStorage.java @@ -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; diff --git a/src/main/java/refinedstorage/api/util/IComparer.java b/src/main/java/refinedstorage/api/util/IComparer.java new file mode 100755 index 000000000..a589cc39a --- /dev/null +++ b/src/main/java/refinedstorage/api/util/IComparer.java @@ -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); +} diff --git a/src/main/java/refinedstorage/apiimpl/API.java b/src/main/java/refinedstorage/apiimpl/API.java index c4e02fdf2..2957bc66b 100755 --- a/src/main/java/refinedstorage/apiimpl/API.java +++ b/src/main/java/refinedstorage/apiimpl/API.java @@ -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() { diff --git a/src/main/java/refinedstorage/apiimpl/autocrafting/CraftingPattern.java b/src/main/java/refinedstorage/apiimpl/autocrafting/CraftingPattern.java index 98b4d2a90..b37995795 100755 --- a/src/main/java/refinedstorage/apiimpl/autocrafting/CraftingPattern.java +++ b/src/main/java/refinedstorage/apiimpl/autocrafting/CraftingPattern.java @@ -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 + + '}'; } } diff --git a/src/main/java/refinedstorage/apiimpl/autocrafting/task/CraftingTaskNormal.java b/src/main/java/refinedstorage/apiimpl/autocrafting/task/CraftingTaskNormal.java index b58aedb36..8b320f5ef 100755 --- a/src/main/java/refinedstorage/apiimpl/autocrafting/task/CraftingTaskNormal.java +++ b/src/main/java/refinedstorage/apiimpl/autocrafting/task/CraftingTaskNormal.java @@ -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 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) { diff --git a/src/main/java/refinedstorage/apiimpl/autocrafting/task/Processable.java b/src/main/java/refinedstorage/apiimpl/autocrafting/task/Processable.java index 0b3098708..c745a5288 100755 --- a/src/main/java/refinedstorage/apiimpl/autocrafting/task/Processable.java +++ b/src/main/java/refinedstorage/apiimpl/autocrafting/task/Processable.java @@ -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; diff --git a/src/main/java/refinedstorage/apiimpl/network/grid/FluidGridHandler.java b/src/main/java/refinedstorage/apiimpl/network/grid/FluidGridHandler.java index afae15666..fb6a1df3a 100755 --- a/src/main/java/refinedstorage/apiimpl/network/grid/FluidGridHandler.java +++ b/src/main/java/refinedstorage/apiimpl/network/grid/FluidGridHandler.java @@ -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); diff --git a/src/main/java/refinedstorage/apiimpl/network/grid/ItemGridHandler.java b/src/main/java/refinedstorage/apiimpl/network/grid/ItemGridHandler.java index ea21f8ba3..eb3f7e51c 100755 --- a/src/main/java/refinedstorage/apiimpl/network/grid/ItemGridHandler.java +++ b/src/main/java/refinedstorage/apiimpl/network/grid/ItemGridHandler.java @@ -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) { diff --git a/src/main/java/refinedstorage/apiimpl/solderer/SoldererRecipeFluidStorage.java b/src/main/java/refinedstorage/apiimpl/solderer/SoldererRecipeFluidStorage.java index 4f2a2f931..7f1d9beb1 100755 --- a/src/main/java/refinedstorage/apiimpl/solderer/SoldererRecipeFluidStorage.java +++ b/src/main/java/refinedstorage/apiimpl/solderer/SoldererRecipeFluidStorage.java @@ -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) }; } diff --git a/src/main/java/refinedstorage/apiimpl/solderer/SoldererRecipeProcessor.java b/src/main/java/refinedstorage/apiimpl/solderer/SoldererRecipeProcessor.java index aa525ec03..acb2f03d3 100755 --- a/src/main/java/refinedstorage/apiimpl/solderer/SoldererRecipeProcessor.java +++ b/src/main/java/refinedstorage/apiimpl/solderer/SoldererRecipeProcessor.java @@ -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) }; } diff --git a/src/main/java/refinedstorage/apiimpl/solderer/SoldererRecipeStorage.java b/src/main/java/refinedstorage/apiimpl/solderer/SoldererRecipeStorage.java index 1302a5255..987099502 100755 --- a/src/main/java/refinedstorage/apiimpl/solderer/SoldererRecipeStorage.java +++ b/src/main/java/refinedstorage/apiimpl/solderer/SoldererRecipeStorage.java @@ -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) }; } diff --git a/src/main/java/refinedstorage/apiimpl/solderer/SoldererRecipeUpgrade.java b/src/main/java/refinedstorage/apiimpl/solderer/SoldererRecipeUpgrade.java index 4cf7b02e5..49da21811 100755 --- a/src/main/java/refinedstorage/apiimpl/solderer/SoldererRecipeUpgrade.java +++ b/src/main/java/refinedstorage/apiimpl/solderer/SoldererRecipeUpgrade.java @@ -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) }; } diff --git a/src/main/java/refinedstorage/apiimpl/solderer/SoldererRegistry.java b/src/main/java/refinedstorage/apiimpl/solderer/SoldererRegistry.java index b7518343a..3096873a7 100755 --- a/src/main/java/refinedstorage/apiimpl/solderer/SoldererRegistry.java +++ b/src/main/java/refinedstorage/apiimpl/solderer/SoldererRegistry.java @@ -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; } diff --git a/src/main/java/refinedstorage/apiimpl/storage/fluid/FluidStorageNBT.java b/src/main/java/refinedstorage/apiimpl/storage/fluid/FluidStorageNBT.java index 359351c63..22bc21c1a 100755 --- a/src/main/java/refinedstorage/apiimpl/storage/fluid/FluidStorageNBT.java +++ b/src/main/java/refinedstorage/apiimpl/storage/fluid/FluidStorageNBT.java @@ -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; } diff --git a/src/main/java/refinedstorage/apiimpl/storage/fluid/FluidUtils.java b/src/main/java/refinedstorage/apiimpl/storage/fluid/FluidUtils.java index ac2f73356..236001e2c 100755 --- a/src/main/java/refinedstorage/apiimpl/storage/fluid/FluidUtils.java +++ b/src/main/java/refinedstorage/apiimpl/storage/fluid/FluidUtils.java @@ -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); } } } diff --git a/src/main/java/refinedstorage/apiimpl/storage/fluid/GroupedFluidStorage.java b/src/main/java/refinedstorage/apiimpl/storage/fluid/GroupedFluidStorage.java index f143a562e..677abd46c 100755 --- a/src/main/java/refinedstorage/apiimpl/storage/fluid/GroupedFluidStorage.java +++ b/src/main/java/refinedstorage/apiimpl/storage/fluid/GroupedFluidStorage.java @@ -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; } } diff --git a/src/main/java/refinedstorage/apiimpl/storage/item/ItemStorageNBT.java b/src/main/java/refinedstorage/apiimpl/storage/item/ItemStorageNBT.java index 281bd8149..8fa43d25b 100755 --- a/src/main/java/refinedstorage/apiimpl/storage/item/ItemStorageNBT.java +++ b/src/main/java/refinedstorage/apiimpl/storage/item/ItemStorageNBT.java @@ -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; } diff --git a/src/main/java/refinedstorage/api/storage/CompareUtils.java b/src/main/java/refinedstorage/apiimpl/util/Comparer.java similarity index 50% rename from src/main/java/refinedstorage/api/storage/CompareUtils.java rename to src/main/java/refinedstorage/apiimpl/util/Comparer.java index 247cda5e7..f23d2d379 100755 --- a/src/main/java/refinedstorage/api/storage/CompareUtils.java +++ b/src/main/java/refinedstorage/apiimpl/util/Comparer.java @@ -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; } diff --git a/src/main/java/refinedstorage/apiimpl/util/ItemStackList.java b/src/main/java/refinedstorage/apiimpl/util/ItemStackList.java index d8fd848e3..59ef39f8b 100755 --- a/src/main/java/refinedstorage/apiimpl/util/ItemStackList.java +++ b/src/main/java/refinedstorage/apiimpl/util/ItemStackList.java @@ -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; } } diff --git a/src/main/java/refinedstorage/container/ContainerBase.java b/src/main/java/refinedstorage/container/ContainerBase.java index 6e6953cd2..7ae6590b2 100755 --- a/src/main/java/refinedstorage/container/ContainerBase.java +++ b/src/main/java/refinedstorage/container/ContainerBase.java @@ -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; } } diff --git a/src/main/java/refinedstorage/container/ContainerDiskManipulator.java b/src/main/java/refinedstorage/container/ContainerDiskManipulator.java old mode 100644 new mode 100755 index 4a25d399e..86b812080 --- a/src/main/java/refinedstorage/container/ContainerDiskManipulator.java +++ b/src/main/java/refinedstorage/container/ContainerDiskManipulator.java @@ -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) { diff --git a/src/main/java/refinedstorage/container/ContainerProcessingPatternEncoder.java b/src/main/java/refinedstorage/container/ContainerProcessingPatternEncoder.java index 9e792f342..0e7b882fc 100755 --- a/src/main/java/refinedstorage/container/ContainerProcessingPatternEncoder.java +++ b/src/main/java/refinedstorage/container/ContainerProcessingPatternEncoder.java @@ -76,7 +76,7 @@ public class ContainerProcessingPatternEncoder extends ContainerBase { } public void setInputs(Collection stacks) { - setSlots(stacks, 2 , 2 + 9); + setSlots(stacks, 2, 2 + 9); } public void setOutputs(Collection stacks) { diff --git a/src/main/java/refinedstorage/gui/GuiConstructor.java b/src/main/java/refinedstorage/gui/GuiConstructor.java index 3cfff4f2b..ceb9d0a18 100755 --- a/src/main/java/refinedstorage/gui/GuiConstructor.java +++ b/src/main/java/refinedstorage/gui/GuiConstructor.java @@ -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 diff --git a/src/main/java/refinedstorage/gui/GuiDestructor.java b/src/main/java/refinedstorage/gui/GuiDestructor.java index 5a8023ea7..061a1b4d3 100755 --- a/src/main/java/refinedstorage/gui/GuiDestructor.java +++ b/src/main/java/refinedstorage/gui/GuiDestructor.java @@ -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 diff --git a/src/main/java/refinedstorage/gui/GuiDetector.java b/src/main/java/refinedstorage/gui/GuiDetector.java index c1e12abdb..0cef4e7ce 100755 --- a/src/main/java/refinedstorage/gui/GuiDetector.java +++ b/src/main/java/refinedstorage/gui/GuiDetector.java @@ -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())); diff --git a/src/main/java/refinedstorage/gui/GuiDiskManipulator.java b/src/main/java/refinedstorage/gui/GuiDiskManipulator.java index 9530f39ed..334b39f72 100755 --- a/src/main/java/refinedstorage/gui/GuiDiskManipulator.java +++ b/src/main/java/refinedstorage/gui/GuiDiskManipulator.java @@ -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 diff --git a/src/main/java/refinedstorage/gui/GuiExporter.java b/src/main/java/refinedstorage/gui/GuiExporter.java index 1101b1a25..6f58b71df 100755 --- a/src/main/java/refinedstorage/gui/GuiExporter.java +++ b/src/main/java/refinedstorage/gui/GuiExporter.java @@ -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 diff --git a/src/main/java/refinedstorage/gui/GuiFluidInterface.java b/src/main/java/refinedstorage/gui/GuiFluidInterface.java index 6ae5f6ce9..fd5abc8f8 100755 --- a/src/main/java/refinedstorage/gui/GuiFluidInterface.java +++ b/src/main/java/refinedstorage/gui/GuiFluidInterface.java @@ -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 diff --git a/src/main/java/refinedstorage/gui/GuiGridFilter.java b/src/main/java/refinedstorage/gui/GuiGridFilter.java index d6a14050f..e726c5eec 100755 --- a/src/main/java/refinedstorage/gui/GuiGridFilter.java +++ b/src/main/java/refinedstorage/gui/GuiGridFilter.java @@ -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)); diff --git a/src/main/java/refinedstorage/gui/GuiImporter.java b/src/main/java/refinedstorage/gui/GuiImporter.java index b6cc33877..955c45e3c 100755 --- a/src/main/java/refinedstorage/gui/GuiImporter.java +++ b/src/main/java/refinedstorage/gui/GuiImporter.java @@ -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 diff --git a/src/main/java/refinedstorage/gui/GuiInterface.java b/src/main/java/refinedstorage/gui/GuiInterface.java index 5a058b9e0..51a06d025 100755 --- a/src/main/java/refinedstorage/gui/GuiInterface.java +++ b/src/main/java/refinedstorage/gui/GuiInterface.java @@ -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 diff --git a/src/main/java/refinedstorage/gui/GuiStorage.java b/src/main/java/refinedstorage/gui/GuiStorage.java index b263ee3fe..de75a20eb 100755 --- a/src/main/java/refinedstorage/gui/GuiStorage.java +++ b/src/main/java/refinedstorage/gui/GuiStorage.java @@ -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); diff --git a/src/main/java/refinedstorage/gui/config/ModGuiConfig.java b/src/main/java/refinedstorage/gui/config/ModGuiConfig.java index 1d07456c9..d76cd90af 100755 --- a/src/main/java/refinedstorage/gui/config/ModGuiConfig.java +++ b/src/main/java/refinedstorage/gui/config/ModGuiConfig.java @@ -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())); } } diff --git a/src/main/java/refinedstorage/gui/grid/GuiGrid.java b/src/main/java/refinedstorage/gui/grid/GuiGrid.java index 0b637bd8e..c1508a5db 100755 --- a/src/main/java/refinedstorage/gui/grid/GuiGrid.java +++ b/src/main/java/refinedstorage/gui/grid/GuiGrid.java @@ -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; diff --git a/src/main/java/refinedstorage/gui/sidebutton/SideButtonCompare.java b/src/main/java/refinedstorage/gui/sidebutton/SideButtonCompare.java index 140f70d68..d4768b40f 100755 --- a/src/main/java/refinedstorage/gui/sidebutton/SideButtonCompare.java +++ b/src/main/java/refinedstorage/gui/sidebutton/SideButtonCompare.java @@ -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; } diff --git a/src/main/java/refinedstorage/item/ItemGridFilter.java b/src/main/java/refinedstorage/item/ItemGridFilter.java index 97dda1051..3683fc987 100755 --- a/src/main/java/refinedstorage/item/ItemGridFilter.java +++ b/src/main/java/refinedstorage/item/ItemGridFilter.java @@ -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) { diff --git a/src/main/java/refinedstorage/item/ItemPattern.java b/src/main/java/refinedstorage/item/ItemPattern.java index a8a04ddf9..bd45e7392 100755 --- a/src/main/java/refinedstorage/item/ItemPattern.java +++ b/src/main/java/refinedstorage/item/ItemPattern.java @@ -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); diff --git a/src/main/java/refinedstorage/proxy/ClientProxy.java b/src/main/java/refinedstorage/proxy/ClientProxy.java index 13b21abff..77e39cead 100755 --- a/src/main/java/refinedstorage/proxy/ClientProxy.java +++ b/src/main/java/refinedstorage/proxy/ClientProxy.java @@ -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 diff --git a/src/main/java/refinedstorage/proxy/CommonProxy.java b/src/main/java/refinedstorage/proxy/CommonProxy.java index 927708ebe..9d4d6b505 100755 --- a/src/main/java/refinedstorage/proxy/CommonProxy.java +++ b/src/main/java/refinedstorage/proxy/CommonProxy.java @@ -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) ); } diff --git a/src/main/java/refinedstorage/tile/ClientNode.java b/src/main/java/refinedstorage/tile/ClientNode.java index 47723884e..b09cb9ccf 100755 --- a/src/main/java/refinedstorage/tile/ClientNode.java +++ b/src/main/java/refinedstorage/tile/ClientNode.java @@ -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 diff --git a/src/main/java/refinedstorage/tile/TileConstructor.java b/src/main/java/refinedstorage/tile/TileConstructor.java index 483719497..a7a7440f3 100755 --- a/src/main/java/refinedstorage/tile/TileConstructor.java +++ b/src/main/java/refinedstorage/tile/TileConstructor.java @@ -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; diff --git a/src/main/java/refinedstorage/tile/TileController.java b/src/main/java/refinedstorage/tile/TileController.java index 0d871840d..719dd7576 100755 --- a/src/main/java/refinedstorage/tile/TileController.java +++ b/src/main/java/refinedstorage/tile/TileController.java @@ -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); } } diff --git a/src/main/java/refinedstorage/tile/TileCrafter.java b/src/main/java/refinedstorage/tile/TileCrafter.java index 240959484..0a9ed69a6 100755 --- a/src/main/java/refinedstorage/tile/TileCrafter.java +++ b/src/main/java/refinedstorage/tile/TileCrafter.java @@ -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); } } } diff --git a/src/main/java/refinedstorage/tile/TileDestructor.java b/src/main/java/refinedstorage/tile/TileDestructor.java index 5c387521f..9569247ad 100755 --- a/src/main/java/refinedstorage/tile/TileDestructor.java +++ b/src/main/java/refinedstorage/tile/TileDestructor.java @@ -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); diff --git a/src/main/java/refinedstorage/tile/TileDetector.java b/src/main/java/refinedstorage/tile/TileDetector.java index 147892371..70e00b82d 100755 --- a/src/main/java/refinedstorage/tile/TileDetector.java +++ b/src/main/java/refinedstorage/tile/TileDetector.java @@ -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; diff --git a/src/main/java/refinedstorage/tile/TileDiskDrive.java b/src/main/java/refinedstorage/tile/TileDiskDrive.java index 2538ee61f..e1be73076 100755 --- a/src/main/java/refinedstorage/tile/TileDiskDrive.java +++ b/src/main/java/refinedstorage/tile/TileDiskDrive.java @@ -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; diff --git a/src/main/java/refinedstorage/tile/TileDiskManipulator.java b/src/main/java/refinedstorage/tile/TileDiskManipulator.java index 85a382a8e..7569c72e4 100755 --- a/src/main/java/refinedstorage/tile/TileDiskManipulator.java +++ b/src/main/java/refinedstorage/tile/TileDiskManipulator.java @@ -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; diff --git a/src/main/java/refinedstorage/tile/TileExporter.java b/src/main/java/refinedstorage/tile/TileExporter.java index 81f60681d..6b898ba4e 100755 --- a/src/main/java/refinedstorage/tile/TileExporter.java +++ b/src/main/java/refinedstorage/tile/TileExporter.java @@ -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() { diff --git a/src/main/java/refinedstorage/tile/TileFluidInterface.java b/src/main/java/refinedstorage/tile/TileFluidInterface.java index 56971dfde..71dabbccb 100755 --- a/src/main/java/refinedstorage/tile/TileFluidInterface.java +++ b/src/main/java/refinedstorage/tile/TileFluidInterface.java @@ -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 diff --git a/src/main/java/refinedstorage/tile/TileFluidStorage.java b/src/main/java/refinedstorage/tile/TileFluidStorage.java index 1de6dc98a..537eb52da 100755 --- a/src/main/java/refinedstorage/tile/TileFluidStorage.java +++ b/src/main/java/refinedstorage/tile/TileFluidStorage.java @@ -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() { diff --git a/src/main/java/refinedstorage/tile/TileImporter.java b/src/main/java/refinedstorage/tile/TileImporter.java index 9b38b5806..0b1b6198e 100755 --- a/src/main/java/refinedstorage/tile/TileImporter.java +++ b/src/main/java/refinedstorage/tile/TileImporter.java @@ -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; diff --git a/src/main/java/refinedstorage/tile/TileInterface.java b/src/main/java/refinedstorage/tile/TileInterface.java index 3b3ae7d09..2e355ea42 100755 --- a/src/main/java/refinedstorage/tile/TileInterface.java +++ b/src/main/java/refinedstorage/tile/TileInterface.java @@ -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; diff --git a/src/main/java/refinedstorage/tile/TileSolderer.java b/src/main/java/refinedstorage/tile/TileSolderer.java index 97c05f888..78f0d9619 100755 --- a/src/main/java/refinedstorage/tile/TileSolderer.java +++ b/src/main/java/refinedstorage/tile/TileSolderer.java @@ -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; diff --git a/src/main/java/refinedstorage/tile/TileStorage.java b/src/main/java/refinedstorage/tile/TileStorage.java index 44d9fc9cc..908bae3d6 100755 --- a/src/main/java/refinedstorage/tile/TileStorage.java +++ b/src/main/java/refinedstorage/tile/TileStorage.java @@ -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() { diff --git a/src/main/java/refinedstorage/tile/config/IFilterable.java b/src/main/java/refinedstorage/tile/config/IFilterable.java index 8ca11e802..ee34b5a99 100755 --- a/src/main/java/refinedstorage/tile/config/IFilterable.java +++ b/src/main/java/refinedstorage/tile/config/IFilterable.java @@ -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; } } diff --git a/src/main/java/refinedstorage/tile/externalstorage/FluidStorageExternal.java b/src/main/java/refinedstorage/tile/externalstorage/FluidStorageExternal.java index 4d889e96a..d7362c418 100755 --- a/src/main/java/refinedstorage/tile/externalstorage/FluidStorageExternal.java +++ b/src/main/java/refinedstorage/tile/externalstorage/FluidStorageExternal.java @@ -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; diff --git a/src/main/java/refinedstorage/tile/externalstorage/ItemStorageDSU.java b/src/main/java/refinedstorage/tile/externalstorage/ItemStorageDSU.java index 4523fe739..adca87414 100755 --- a/src/main/java/refinedstorage/tile/externalstorage/ItemStorageDSU.java +++ b/src/main/java/refinedstorage/tile/externalstorage/ItemStorageDSU.java @@ -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; } diff --git a/src/main/java/refinedstorage/tile/externalstorage/ItemStorageDrawer.java b/src/main/java/refinedstorage/tile/externalstorage/ItemStorageDrawer.java index c40f38c22..41d57eae0 100755 --- a/src/main/java/refinedstorage/tile/externalstorage/ItemStorageDrawer.java +++ b/src/main/java/refinedstorage/tile/externalstorage/ItemStorageDrawer.java @@ -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(); } diff --git a/src/main/java/refinedstorage/tile/externalstorage/ItemStorageExternal.java b/src/main/java/refinedstorage/tile/externalstorage/ItemStorageExternal.java index 5973d041b..eec94cefa 100755 --- a/src/main/java/refinedstorage/tile/externalstorage/ItemStorageExternal.java +++ b/src/main/java/refinedstorage/tile/externalstorage/ItemStorageExternal.java @@ -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; diff --git a/src/main/java/refinedstorage/tile/externalstorage/ItemStorageItemHandler.java b/src/main/java/refinedstorage/tile/externalstorage/ItemStorageItemHandler.java index efa400c2a..a78939f68 100755 --- a/src/main/java/refinedstorage/tile/externalstorage/ItemStorageItemHandler.java +++ b/src/main/java/refinedstorage/tile/externalstorage/ItemStorageItemHandler.java @@ -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) { diff --git a/src/main/java/refinedstorage/tile/externalstorage/TileExternalStorage.java b/src/main/java/refinedstorage/tile/externalstorage/TileExternalStorage.java index 2205d835d..e2646bd56 100755 --- a/src/main/java/refinedstorage/tile/externalstorage/TileExternalStorage.java +++ b/src/main/java/refinedstorage/tile/externalstorage/TileExternalStorage.java @@ -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; diff --git a/src/main/java/refinedstorage/tile/grid/TileGrid.java b/src/main/java/refinedstorage/tile/grid/TileGrid.java index 0e848a85e..2298e123b 100755 --- a/src/main/java/refinedstorage/tile/grid/TileGrid.java +++ b/src/main/java/refinedstorage/tile/grid/TileGrid.java @@ -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); From f86f5d5553f968db2db488dad9107427c8ec0922 Mon Sep 17 00:00:00 2001 From: Raoul Van den Berge Date: Fri, 7 Oct 2016 03:11:29 +0200 Subject: [PATCH 8/8] Remove NetworkUtils - it's now default methods all the way! --- src/main/java/refinedstorage/RSUtils.java | 45 +++++++ src/main/java/refinedstorage/api/IAPI.java | 14 +++ .../api/network/INetworkMaster.java | 86 +++++++++++++ .../api/network/INetworkNodeGraph.java | 12 +- .../api/network/NetworkUtils.java | 114 ------------------ .../api/util/IItemStackList.java | 11 ++ src/main/java/refinedstorage/apiimpl/API.java | 12 ++ .../autocrafting/task/CraftingTaskNormal.java | 12 +- .../apiimpl/network/NetworkNodeGraph.java | 4 + .../network/grid/FluidGridHandler.java | 3 +- .../apiimpl/network/grid/ItemGridHandler.java | 5 +- .../apiimpl/storage/NBTStorage.java | 23 ---- .../apiimpl/storage/fluid/FluidUtils.java | 9 +- .../storage/fluid/GroupedFluidStorage.java | 3 +- .../storage/item/GroupedItemStorage.java | 3 +- .../apiimpl/util/ItemStackList.java | 3 +- .../java/refinedstorage/block/BlockCable.java | 5 +- .../refinedstorage/block/BlockController.java | 3 +- .../java/refinedstorage/block/BlockNode.java | 5 +- .../jei/RecipeTransferHandlerPattern.java | 4 +- .../network/MessageGridFluidDelta.java | 4 +- .../network/MessageGridFluidUpdate.java | 4 +- .../network/MessageGridItemDelta.java | 4 +- .../network/MessageGridItemUpdate.java | 4 +- .../refinedstorage/tile/TileConstructor.java | 3 +- .../refinedstorage/tile/TileController.java | 32 ++++- .../java/refinedstorage/tile/TileCrafter.java | 3 +- .../refinedstorage/tile/TileDiskDrive.java | 4 +- .../tile/TileDiskManipulator.java | 4 +- .../refinedstorage/tile/TileExporter.java | 3 +- .../refinedstorage/tile/TileInterface.java | 3 +- .../tile/TileMultipartNode.java | 3 +- .../tile/TileNetworkTransmitter.java | 5 +- .../java/refinedstorage/tile/TileNode.java | 3 +- .../refinedstorage/tile/grid/TileGrid.java | 5 +- 35 files changed, 255 insertions(+), 205 deletions(-) create mode 100755 src/main/java/refinedstorage/RSUtils.java delete mode 100755 src/main/java/refinedstorage/api/network/NetworkUtils.java delete mode 100755 src/main/java/refinedstorage/apiimpl/storage/NBTStorage.java diff --git a/src/main/java/refinedstorage/RSUtils.java b/src/main/java/refinedstorage/RSUtils.java new file mode 100755 index 000000000..f7b0708b1 --- /dev/null +++ b/src/main/java/refinedstorage/RSUtils.java @@ -0,0 +1,45 @@ +package refinedstorage; + +import io.netty.buffer.ByteBuf; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fml.common.network.ByteBufUtils; +import refinedstorage.api.RSAPI; +import refinedstorage.api.network.INetworkMaster; +import refinedstorage.apiimpl.storage.fluid.FluidStorageNBT; +import refinedstorage.apiimpl.storage.item.ItemStorageNBT; + +import java.util.function.Function; + +public final class RSUtils { + public static void writeItemStack(ByteBuf buf, INetworkMaster network, ItemStack stack) { + buf.writeInt(Item.getIdFromItem(stack.getItem())); + buf.writeInt(stack.stackSize); + buf.writeInt(stack.getItemDamage()); + ByteBufUtils.writeTag(buf, stack.getTagCompound()); + buf.writeInt(RSAPI.instance().getItemStackHashCode(stack)); + buf.writeBoolean(network.hasPattern(stack)); + } + + public static void writeFluidStack(ByteBuf buf, FluidStack stack) { + buf.writeInt(RSAPI.instance().getFluidStackHashCode(stack)); + ByteBufUtils.writeUTF8String(buf, FluidRegistry.getFluidName(stack.getFluid())); + buf.writeInt(stack.amount); + ByteBufUtils.writeTag(buf, stack.tag); + } + + public static void constructFromDrive(ItemStack disk, int slot, ItemStorageNBT[] itemStorages, FluidStorageNBT[] fluidStorages, Function itemStorageSupplier, Function fluidStorageNBTSupplier) { + if (disk == null) { + itemStorages[slot] = null; + fluidStorages[slot] = null; + } else { + if (disk.getItem() == RSItems.STORAGE_DISK) { + itemStorages[slot] = itemStorageSupplier.apply(disk); + } else if (disk.getItem() == RSItems.FLUID_STORAGE_DISK) { + fluidStorages[slot] = fluidStorageNBTSupplier.apply(disk); + } + } + } +} diff --git a/src/main/java/refinedstorage/api/IAPI.java b/src/main/java/refinedstorage/api/IAPI.java index 3cf834c9d..cf5eee741 100755 --- a/src/main/java/refinedstorage/api/IAPI.java +++ b/src/main/java/refinedstorage/api/IAPI.java @@ -1,5 +1,7 @@ package refinedstorage.api; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; import refinedstorage.api.autocrafting.craftingmonitor.ICraftingMonitorElementRegistry; import refinedstorage.api.autocrafting.registry.ICraftingTaskRegistry; import refinedstorage.api.solderer.ISoldererRegistry; @@ -41,4 +43,16 @@ public interface IAPI { */ @Nonnull IItemStackList createItemStackList(); + + /** + * @param stack the stack + * @return a hashcode for the given stack + */ + int getItemStackHashCode(ItemStack stack); + + /** + * @param stack the stack + * @return a hashcode for the given stack + */ + int getFluidStackHashCode(FluidStack stack); } diff --git a/src/main/java/refinedstorage/api/network/INetworkMaster.java b/src/main/java/refinedstorage/api/network/INetworkMaster.java index 71d2b9632..929ead866 100755 --- a/src/main/java/refinedstorage/api/network/INetworkMaster.java +++ b/src/main/java/refinedstorage/api/network/INetworkMaster.java @@ -6,12 +6,14 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraftforge.fluids.FluidStack; +import refinedstorage.api.RSAPI; 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.fluid.IGroupedFluidStorage; import refinedstorage.api.storage.item.IGroupedItemStorage; +import refinedstorage.api.util.IComparer; import javax.annotation.Nonnull; import javax.annotation.Nullable; @@ -122,6 +124,68 @@ public interface INetworkMaster { @Nullable ICraftingPattern getPattern(ItemStack pattern, int flags); + /** + * Returns a crafting pattern for an item stack. + * This returns a single crafting pattern, as opposed to {@link INetworkMaster#getPatterns(ItemStack, int)}. + * Internally, this makes a selection out of the available patterns. + * It makes this selection based on the item count of the pattern outputs in the system. + * + * @param pattern the stack to get a pattern for + * @return the pattern, or null if the pattern is not found + */ + default ICraftingPattern getPattern(ItemStack pattern) { + return getPattern(pattern, IComparer.COMPARE_DAMAGE | IComparer.COMPARE_NBT); + } + + /** + * Returns if there is a pattern with a given stack as output. + * + * @param stack the stack + * @return true if there is a pattern, false otherwise + */ + default boolean hasPattern(ItemStack stack) { + return getPattern(stack) != null; + } + + /** + * Creates a crafting task. + * + * @param stack the stack to create a task for + * @param pattern the pattern + * @param quantity the quantity + * @return the crafting task + */ + default ICraftingTask createCraftingTask(@Nullable ItemStack stack, ICraftingPattern pattern, int quantity) { + return RSAPI.instance().getCraftingTaskRegistry().getFactory(pattern.getId()).create(getNetworkWorld(), this, stack, pattern, quantity, null); + } + + /** + * Schedules a crafting task if the task isn't scheduled yet. + * + * @param stack the stack + * @param toSchedule the amount of tasks to schedule + * @param compare the compare value to find patterns + */ + default void scheduleCraftingTaskIfUnscheduled(ItemStack stack, int toSchedule, int compare) { + int alreadyScheduled = 0; + + for (ICraftingTask task : getCraftingTasks()) { + for (ItemStack output : task.getPattern().getOutputs()) { + if (RSAPI.instance().getComparer().isEqual(output, stack, compare)) { + alreadyScheduled++; + } + } + } + + for (int i = 0; i < toSchedule - alreadyScheduled; ++i) { + ICraftingPattern pattern = getPattern(stack, compare); + + if (pattern != null) { + addCraftingTask(createCraftingTask(stack, pattern, 1)); + } + } + } + /** * Sends a grid update packet with all the items to all clients that are watching a grid connected to this network. */ @@ -180,6 +244,17 @@ public interface INetworkMaster { @Nullable ItemStack extractItem(@Nonnull ItemStack stack, int size, int flags); + /** + * Extracts an item from this network. + * + * @param stack the prototype of the stack to extract, do NOT modify + * @param size the amount of that prototype that has to be extracted + * @return null if we didn't extract anything, or a stack with the result + */ + default ItemStack extractItem(ItemStack stack, int size) { + return extractItem(stack, size, IComparer.COMPARE_DAMAGE | IComparer.COMPARE_NBT); + } + /** * Inserts a fluid in this network. * @@ -202,6 +277,17 @@ public interface INetworkMaster { @Nullable FluidStack extractFluid(@Nonnull FluidStack stack, int size, int flags); + /** + * Extracts a fluid from this network. + * + * @param stack the prototype of the stack to extract, do NOT modify + * @param size the amount of that prototype that has to be extracted + * @return null if we didn't extract anything, or a stack with the result + */ + default FluidStack extractFluid(FluidStack stack, int size) { + return extractFluid(stack, size, IComparer.COMPARE_NBT); + } + /** * @return the world where this network is in */ diff --git a/src/main/java/refinedstorage/api/network/INetworkNodeGraph.java b/src/main/java/refinedstorage/api/network/INetworkNodeGraph.java index fd3c36d6e..b7b80f36e 100755 --- a/src/main/java/refinedstorage/api/network/INetworkNodeGraph.java +++ b/src/main/java/refinedstorage/api/network/INetworkNodeGraph.java @@ -2,6 +2,7 @@ package refinedstorage.api.network; import net.minecraft.util.math.BlockPos; +import javax.annotation.Nullable; import java.util.List; /** @@ -11,10 +12,17 @@ public interface INetworkNodeGraph { /** * Rebuilds the node graph. * - * @param start the starting position to start looking for nodes + * @param start the starting position to start looking for nodes, or null to start at network begin position * @param notify true to notify the nodes of a connection change, false to not notify */ - void rebuild(BlockPos start, boolean notify); + void rebuild(@Nullable BlockPos start, boolean notify); + + /** + * Rebuilds the network graph. + */ + default void rebuild() { + rebuild(null, true); + } /** * @return a list of all connected nodes diff --git a/src/main/java/refinedstorage/api/network/NetworkUtils.java b/src/main/java/refinedstorage/api/network/NetworkUtils.java deleted file mode 100755 index d43b29796..000000000 --- a/src/main/java/refinedstorage/api/network/NetworkUtils.java +++ /dev/null @@ -1,114 +0,0 @@ -package refinedstorage.api.network; - -import io.netty.buffer.ByteBuf; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.World; -import net.minecraftforge.fluids.FluidRegistry; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fml.common.network.ByteBufUtils; -import refinedstorage.api.RSAPI; -import refinedstorage.api.autocrafting.ICraftingPattern; -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.util.IComparer; - -import javax.annotation.Nullable; - -/** - * Utilities for network manipulation. - */ -public final class NetworkUtils { - public static ItemStack extractItem(INetworkMaster network, ItemStack stack, int size) { - 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, IComparer.COMPARE_NBT); - } - - public static ICraftingPattern getPattern(INetworkMaster network, ItemStack stack) { - return network.getPattern(stack, IComparer.COMPARE_DAMAGE | IComparer.COMPARE_NBT); - } - - public static ICraftingTask createCraftingTask(INetworkMaster network, @Nullable ItemStack stack, ICraftingPattern pattern, int quantity) { - return RSAPI.instance().getCraftingTaskRegistry().getFactory(pattern.getId()).create(network.getNetworkWorld(), network, stack, pattern, quantity, null); - } - - public static boolean hasPattern(INetworkMaster network, ItemStack stack) { - return getPattern(network, stack) != null; - } - - public static void rebuildGraph(INetworkMaster network) { - network.getNodeGraph().rebuild(network.getPosition(), true); - } - - public static int getItemStackHashCode(ItemStack stack) { - return stack.getItem().hashCode() * (stack.getItemDamage() + 1) * (stack.hasTagCompound() ? stack.getTagCompound().hashCode() : 1); - } - - public static int getFluidStackHashCode(FluidStack stack) { - return stack.getFluid().hashCode() * (stack.tag != null ? stack.tag.hashCode() : 1); - } - - public static void scheduleCraftingTaskIfUnscheduled(INetworkMaster network, ItemStack stack, int toSchedule, int compare) { - int alreadyScheduled = 0; - - for (ICraftingTask task : network.getCraftingTasks()) { - for (ItemStack output : task.getPattern().getOutputs()) { - if (RSAPI.instance().getComparer().isEqual(output, stack, compare)) { - alreadyScheduled++; - } - } - } - - for (int i = 0; i < toSchedule - alreadyScheduled; ++i) { - ICraftingPattern pattern = network.getPattern(stack, compare); - - if (pattern != null) { - network.addCraftingTask(createCraftingTask(network, stack, pattern, 1)); - } - } - } - - public static ICraftingTask readCraftingTask(World world, INetworkMaster network, NBTTagCompound tag) { - ItemStack stack = ItemStack.loadItemStackFromNBT(tag.getCompoundTag(ICraftingTask.NBT_PATTERN_STACK)); - - if (stack != null && stack.getItem() instanceof ICraftingPatternProvider) { - TileEntity container = world.getTileEntity(BlockPos.fromLong(tag.getLong(ICraftingTask.NBT_PATTERN_CONTAINER))); - - if (container instanceof ICraftingPatternContainer) { - ICraftingPattern pattern = ((ICraftingPatternProvider) stack.getItem()).create(world, stack, (ICraftingPatternContainer) container); - - ICraftingTaskFactory factory = RSAPI.instance().getCraftingTaskRegistry().getFactory(tag.getString(ICraftingTask.NBT_PATTERN_ID)); - - if (factory != null) { - return factory.create(world, network, null, pattern, tag.getInteger(ICraftingTask.NBT_QUANTITY), tag); - } - } - } - - return null; - } - - public static void writeItemStack(ByteBuf buf, INetworkMaster network, ItemStack stack) { - buf.writeInt(Item.getIdFromItem(stack.getItem())); - buf.writeInt(stack.stackSize); - buf.writeInt(stack.getItemDamage()); - ByteBufUtils.writeTag(buf, stack.getTagCompound()); - buf.writeInt(getItemStackHashCode(stack)); - buf.writeBoolean(hasPattern(network, stack)); - } - - public static void writeFluidStack(ByteBuf buf, FluidStack stack) { - buf.writeInt(getFluidStackHashCode(stack)); - ByteBufUtils.writeUTF8String(buf, FluidRegistry.getFluidName(stack.getFluid())); - buf.writeInt(stack.amount); - ByteBufUtils.writeTag(buf, stack.tag); - } -} diff --git a/src/main/java/refinedstorage/api/util/IItemStackList.java b/src/main/java/refinedstorage/api/util/IItemStackList.java index 9e7380623..d33bb3687 100755 --- a/src/main/java/refinedstorage/api/util/IItemStackList.java +++ b/src/main/java/refinedstorage/api/util/IItemStackList.java @@ -26,6 +26,17 @@ public interface IItemStackList { */ boolean remove(@Nonnull ItemStack stack, boolean removeIfReachedZero); + /** + * Returns a stack. + * + * @param stack the stack to search for + * @return the stack, or null if no stack was found + */ + @Nullable + default ItemStack get(@Nonnull ItemStack stack) { + return get(stack, IComparer.COMPARE_DAMAGE | IComparer.COMPARE_NBT); + } + /** * Returns a stack. * diff --git a/src/main/java/refinedstorage/apiimpl/API.java b/src/main/java/refinedstorage/apiimpl/API.java index 2957bc66b..09e87682f 100755 --- a/src/main/java/refinedstorage/apiimpl/API.java +++ b/src/main/java/refinedstorage/apiimpl/API.java @@ -1,5 +1,7 @@ package refinedstorage.apiimpl; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; import refinedstorage.api.IAPI; import refinedstorage.api.autocrafting.craftingmonitor.ICraftingMonitorElementRegistry; import refinedstorage.api.autocrafting.registry.ICraftingTaskRegistry; @@ -51,4 +53,14 @@ public class API implements IAPI { public IItemStackList createItemStackList() { return new ItemStackList(); } + + @Override + public int getItemStackHashCode(ItemStack stack) { + return stack.getItem().hashCode() * (stack.getItemDamage() + 1) * (stack.hasTagCompound() ? stack.getTagCompound().hashCode() : 1); + } + + @Override + public int getFluidStackHashCode(FluidStack stack) { + return stack.getFluid().hashCode() * (stack.tag != null ? stack.tag.hashCode() : 1); + } } diff --git a/src/main/java/refinedstorage/apiimpl/autocrafting/task/CraftingTaskNormal.java b/src/main/java/refinedstorage/apiimpl/autocrafting/task/CraftingTaskNormal.java index 8b320f5ef..e9ca55be6 100755 --- a/src/main/java/refinedstorage/apiimpl/autocrafting/task/CraftingTaskNormal.java +++ b/src/main/java/refinedstorage/apiimpl/autocrafting/task/CraftingTaskNormal.java @@ -9,8 +9,6 @@ import refinedstorage.api.autocrafting.craftingmonitor.ICraftingMonitorElement; 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.util.IComparer; import refinedstorage.api.util.IItemStackList; import refinedstorage.apiimpl.autocrafting.craftingmonitor.CraftingMonitorElementRoot; import refinedstorage.apiimpl.autocrafting.craftingmonitor.CraftingMonitorElementToTake; @@ -56,13 +54,13 @@ public class CraftingTaskNormal implements ICraftingTask { } for (ItemStack input : pattern.getInputs()) { - ItemStack inputInNetwork = list.get(input, IComparer.COMPARE_DAMAGE | IComparer.COMPARE_NBT); + ItemStack inputInNetwork = list.get(input); if (inputInNetwork == null || inputInNetwork.stackSize == 0) { - if (extras.get(input, IComparer.COMPARE_DAMAGE | IComparer.COMPARE_NBT) != null) { + if (extras.get(input) != null) { decrOrRemoveExtras(input); } else { - ICraftingPattern inputPattern = NetworkUtils.getPattern(network, input); + ICraftingPattern inputPattern = network.getPattern(input); if (inputPattern != null) { for (ItemStack output : inputPattern.getOutputs()) { @@ -105,7 +103,7 @@ public class CraftingTaskNormal implements ICraftingTask { public boolean update() { for (IProcessable processable : toProcess) { if (processable.getPattern().getContainer().getFacingInventory() != null && processable.getStackToInsert() != null) { - ItemStack toInsert = NetworkUtils.extractItem(network, processable.getStackToInsert(), 1); + ItemStack toInsert = network.extractItem(processable.getStackToInsert(), 1); if (ItemHandlerHelper.insertItem(processable.getPattern().getContainer().getFacingInventory(), toInsert, true) == null) { ItemHandlerHelper.insertItem(processable.getPattern().getContainer().getFacingInventory(), toInsert, false); @@ -116,7 +114,7 @@ public class CraftingTaskNormal implements ICraftingTask { } if (!toTake.isEmpty()) { - ItemStack took = NetworkUtils.extractItem(network, toTake.peek(), 1); + ItemStack took = network.extractItem(toTake.peek(), 1); if (took != null) { toTake.pop(); diff --git a/src/main/java/refinedstorage/apiimpl/network/NetworkNodeGraph.java b/src/main/java/refinedstorage/apiimpl/network/NetworkNodeGraph.java index 9c701eb40..c42ffa4cc 100755 --- a/src/main/java/refinedstorage/apiimpl/network/NetworkNodeGraph.java +++ b/src/main/java/refinedstorage/apiimpl/network/NetworkNodeGraph.java @@ -26,6 +26,10 @@ public class NetworkNodeGraph implements INetworkNodeGraph { @Override public void rebuild(BlockPos start, boolean notify) { + if (start == null) { + start = controller.getPosition(); + } + if (!controller.canRun()) { if (!nodes.isEmpty()) { disconnectAll(); diff --git a/src/main/java/refinedstorage/apiimpl/network/grid/FluidGridHandler.java b/src/main/java/refinedstorage/apiimpl/network/grid/FluidGridHandler.java index fb6a1df3a..d97ab3168 100755 --- a/src/main/java/refinedstorage/apiimpl/network/grid/FluidGridHandler.java +++ b/src/main/java/refinedstorage/apiimpl/network/grid/FluidGridHandler.java @@ -8,7 +8,6 @@ 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.apiimpl.storage.fluid.FluidUtils; @@ -43,7 +42,7 @@ public class FluidGridHandler implements IFluidGridHandler { } if (bucket != null) { - bucket.getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, null).fill(NetworkUtils.extractFluid(network, stack, Fluid.BUCKET_VOLUME), true); + bucket.getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, null).fill(network.extractFluid(stack, Fluid.BUCKET_VOLUME), true); if (shift) { if (!player.inventory.addItemStackToInventory(bucket.copy())) { diff --git a/src/main/java/refinedstorage/apiimpl/network/grid/ItemGridHandler.java b/src/main/java/refinedstorage/apiimpl/network/grid/ItemGridHandler.java index eb3f7e51c..ef85630ac 100755 --- a/src/main/java/refinedstorage/apiimpl/network/grid/ItemGridHandler.java +++ b/src/main/java/refinedstorage/apiimpl/network/grid/ItemGridHandler.java @@ -9,7 +9,6 @@ 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.apiimpl.autocrafting.task.CraftingTaskNormal; @@ -58,7 +57,7 @@ public class ItemGridHandler implements IItemGridHandler { size = Math.min(size, item.getItem().getItemStackLimit(item)); - ItemStack took = NetworkUtils.extractItem(network, item, size); + ItemStack took = network.extractItem(item, size); if (took != null) { if ((flags & EXTRACT_SHIFT) == EXTRACT_SHIFT) { @@ -123,7 +122,7 @@ public class ItemGridHandler implements IItemGridHandler { ItemStack stack = network.getItemStorage().getList().get(hash); if (stack != null) { - CraftingTaskNormal task = new CraftingTaskNormal(network, stack, NetworkUtils.getPattern(network, stack), quantity); + CraftingTaskNormal task = new CraftingTaskNormal(network, stack, network.getPattern(stack), quantity); task.calculate(); diff --git a/src/main/java/refinedstorage/apiimpl/storage/NBTStorage.java b/src/main/java/refinedstorage/apiimpl/storage/NBTStorage.java deleted file mode 100755 index ad3193f08..000000000 --- a/src/main/java/refinedstorage/apiimpl/storage/NBTStorage.java +++ /dev/null @@ -1,23 +0,0 @@ -package refinedstorage.apiimpl.storage; - -import net.minecraft.item.ItemStack; -import refinedstorage.RSItems; -import refinedstorage.apiimpl.storage.fluid.FluidStorageNBT; -import refinedstorage.apiimpl.storage.item.ItemStorageNBT; - -import java.util.function.Function; - -public final class NBTStorage { - public static void constructFromDrive(ItemStack disk, int slot, ItemStorageNBT[] itemStorages, FluidStorageNBT[] fluidStorages, Function itemStorageSupplier, Function fluidStorageNBTSupplier) { - if (disk == null) { - itemStorages[slot] = null; - fluidStorages[slot] = null; - } else { - if (disk.getItem() == RSItems.STORAGE_DISK) { - itemStorages[slot] = itemStorageSupplier.apply(disk); - } else if (disk.getItem() == RSItems.FLUID_STORAGE_DISK) { - fluidStorages[slot] = fluidStorageNBTSupplier.apply(disk); - } - } - } -} diff --git a/src/main/java/refinedstorage/apiimpl/storage/fluid/FluidUtils.java b/src/main/java/refinedstorage/apiimpl/storage/fluid/FluidUtils.java index 236001e2c..0f5cae010 100755 --- a/src/main/java/refinedstorage/apiimpl/storage/fluid/FluidUtils.java +++ b/src/main/java/refinedstorage/apiimpl/storage/fluid/FluidUtils.java @@ -8,7 +8,6 @@ import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.IFluidContainerItem; import net.minecraftforge.fluids.capability.CapabilityFluidHandler; import refinedstorage.api.network.INetworkMaster; -import refinedstorage.api.network.NetworkUtils; import refinedstorage.api.util.IComparer; public final class FluidUtils { @@ -40,7 +39,7 @@ public final class FluidUtils { } public static ItemStack extractItemOrIfBucketLookInFluids(INetworkMaster network, ItemStack stack, int size) { - ItemStack result = NetworkUtils.extractItem(network, stack, size); + ItemStack result = network.extractItem(stack, size); if (result == null && stack.hasCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, null)) { FluidStack fluidStack = getFluidFromStack(stack, true); @@ -49,9 +48,9 @@ public final class FluidUtils { result = extractBucket(network); if (result != null) { - result.getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, null).fill(NetworkUtils.extractFluid(network, fluidStack, Fluid.BUCKET_VOLUME), true); + result.getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, null).fill(network.extractFluid(fluidStack, Fluid.BUCKET_VOLUME), true); } else { - NetworkUtils.scheduleCraftingTaskIfUnscheduled(network, EMPTY_BUCKET, 1, IComparer.COMPARE_DAMAGE | IComparer.COMPARE_NBT); + network.scheduleCraftingTaskIfUnscheduled(EMPTY_BUCKET, 1, IComparer.COMPARE_DAMAGE | IComparer.COMPARE_NBT); } } } @@ -60,6 +59,6 @@ public final class FluidUtils { } public static ItemStack extractBucket(INetworkMaster network) { - return NetworkUtils.extractItem(network, EMPTY_BUCKET, 1); + return network.extractItem(EMPTY_BUCKET, 1); } } diff --git a/src/main/java/refinedstorage/apiimpl/storage/fluid/GroupedFluidStorage.java b/src/main/java/refinedstorage/apiimpl/storage/fluid/GroupedFluidStorage.java index 677abd46c..f5b42d12a 100755 --- a/src/main/java/refinedstorage/apiimpl/storage/fluid/GroupedFluidStorage.java +++ b/src/main/java/refinedstorage/apiimpl/storage/fluid/GroupedFluidStorage.java @@ -6,7 +6,6 @@ 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.fluid.IFluidStorage; import refinedstorage.api.storage.fluid.IFluidStorageProvider; import refinedstorage.api.storage.fluid.IGroupedFluidStorage; @@ -99,7 +98,7 @@ public class GroupedFluidStorage implements IGroupedFluidStorage { @Nullable public FluidStack get(int hash) { for (FluidStack stack : this.stacks.values()) { - if (NetworkUtils.getFluidStackHashCode(stack) == hash) { + if (RSAPI.instance().getFluidStackHashCode(stack) == hash) { return stack; } } diff --git a/src/main/java/refinedstorage/apiimpl/storage/item/GroupedItemStorage.java b/src/main/java/refinedstorage/apiimpl/storage/item/GroupedItemStorage.java index df260003a..89777c570 100755 --- a/src/main/java/refinedstorage/apiimpl/storage/item/GroupedItemStorage.java +++ b/src/main/java/refinedstorage/apiimpl/storage/item/GroupedItemStorage.java @@ -4,7 +4,6 @@ import net.minecraft.item.ItemStack; import refinedstorage.api.RSAPI; import refinedstorage.api.autocrafting.ICraftingPattern; import refinedstorage.api.network.INetworkMaster; -import refinedstorage.api.network.NetworkUtils; import refinedstorage.api.storage.item.IGroupedItemStorage; import refinedstorage.api.storage.item.IItemStorage; import refinedstorage.api.storage.item.IItemStorageProvider; @@ -61,7 +60,7 @@ public class GroupedItemStorage implements IGroupedItemStorage { @Override public void remove(@Nonnull ItemStack stack) { - if (list.remove(stack, !NetworkUtils.hasPattern(network, stack))) { + if (list.remove(stack, !network.hasPattern(stack))) { network.sendItemStorageDeltaToClient(stack, -stack.stackSize); } } diff --git a/src/main/java/refinedstorage/apiimpl/util/ItemStackList.java b/src/main/java/refinedstorage/apiimpl/util/ItemStackList.java index 59ef39f8b..c54c37e78 100755 --- a/src/main/java/refinedstorage/apiimpl/util/ItemStackList.java +++ b/src/main/java/refinedstorage/apiimpl/util/ItemStackList.java @@ -5,7 +5,6 @@ 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.util.IItemStackList; import javax.annotation.Nonnull; @@ -57,7 +56,7 @@ public class ItemStackList implements IItemStackList { @Nullable public ItemStack get(int hash) { for (ItemStack stack : this.stacks.values()) { - if (NetworkUtils.getItemStackHashCode(stack) == hash) { + if (RSAPI.instance().getItemStackHashCode(stack) == hash) { return stack; } } diff --git a/src/main/java/refinedstorage/block/BlockCable.java b/src/main/java/refinedstorage/block/BlockCable.java index bce4131d1..920a97fba 100755 --- a/src/main/java/refinedstorage/block/BlockCable.java +++ b/src/main/java/refinedstorage/block/BlockCable.java @@ -25,7 +25,6 @@ import net.minecraftforge.items.IItemHandler; import refinedstorage.RS; import refinedstorage.api.network.INetworkMaster; import refinedstorage.api.network.INetworkNode; -import refinedstorage.api.network.NetworkUtils; import refinedstorage.tile.TileBase; import refinedstorage.tile.TileCable; import refinedstorage.tile.TileMultipartNode; @@ -281,7 +280,7 @@ public class BlockCable extends BlockCoverable { TileEntity tile = world.getTileEntity(pos.offset(facing)); if (tile instanceof TileNode && ((TileNode) tile).isConnected()) { - NetworkUtils.rebuildGraph(((TileNode) tile).getNetwork()); + ((TileNode) tile).getNetwork().getNodeGraph().rebuild(); break; } @@ -314,7 +313,7 @@ public class BlockCable extends BlockCoverable { super.breakBlock(world, pos, state); if (network != null) { - NetworkUtils.rebuildGraph(network); + network.getNodeGraph().rebuild(); } } diff --git a/src/main/java/refinedstorage/block/BlockController.java b/src/main/java/refinedstorage/block/BlockController.java index a516f1f1c..3b8cf5a58 100755 --- a/src/main/java/refinedstorage/block/BlockController.java +++ b/src/main/java/refinedstorage/block/BlockController.java @@ -20,7 +20,6 @@ import net.minecraft.world.World; import refinedstorage.RS; import refinedstorage.RSBlocks; import refinedstorage.RSGui; -import refinedstorage.api.network.NetworkUtils; import refinedstorage.item.ItemBlockController; import refinedstorage.tile.TileController; @@ -118,7 +117,7 @@ public class BlockController extends BlockBase { super.neighborChanged(state, world, pos, block); if (!world.isRemote) { - NetworkUtils.rebuildGraph((TileController) world.getTileEntity(pos)); + ((TileController) world.getTileEntity(pos)).getNodeGraph().rebuild(); } } diff --git a/src/main/java/refinedstorage/block/BlockNode.java b/src/main/java/refinedstorage/block/BlockNode.java index aabd9d3b9..69191c25f 100755 --- a/src/main/java/refinedstorage/block/BlockNode.java +++ b/src/main/java/refinedstorage/block/BlockNode.java @@ -11,7 +11,6 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import refinedstorage.api.network.INetworkMaster; -import refinedstorage.api.network.NetworkUtils; import refinedstorage.tile.TileNode; public abstract class BlockNode extends BlockBase { @@ -60,7 +59,7 @@ public abstract class BlockNode extends BlockBase { TileEntity tile = world.getTileEntity(pos.offset(facing)); if (tile instanceof TileNode && ((TileNode) tile).isConnected()) { - NetworkUtils.rebuildGraph(((TileNode) tile).getNetwork()); + ((TileNode) tile).getNetwork().getNodeGraph().rebuild(); break; } @@ -83,7 +82,7 @@ public abstract class BlockNode extends BlockBase { super.breakBlock(world, pos, state); if (network != null) { - NetworkUtils.rebuildGraph(network); + network.getNodeGraph().rebuild(); } } diff --git a/src/main/java/refinedstorage/integration/jei/RecipeTransferHandlerPattern.java b/src/main/java/refinedstorage/integration/jei/RecipeTransferHandlerPattern.java index 15083d8f4..a73dc5951 100755 --- a/src/main/java/refinedstorage/integration/jei/RecipeTransferHandlerPattern.java +++ b/src/main/java/refinedstorage/integration/jei/RecipeTransferHandlerPattern.java @@ -7,7 +7,7 @@ import mezz.jei.api.recipe.transfer.IRecipeTransferHandler; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import refinedstorage.RS; -import refinedstorage.api.network.NetworkUtils; +import refinedstorage.api.RSAPI; import refinedstorage.container.ContainerProcessingPatternEncoder; import refinedstorage.network.MessageProcessingPatternEncoderTransfer; @@ -37,7 +37,7 @@ public class RecipeTransferHandlerPattern implements IRecipeTransferHandler new ItemStorage(s), s -> new FluidStorage(s)); + RSUtils.constructFromDrive(getStackInSlot(slot), slot, itemStorages, fluidStorages, s -> new ItemStorage(s), s -> new FluidStorage(s)); if (network != null) { network.getItemStorage().rebuild(); diff --git a/src/main/java/refinedstorage/tile/TileDiskManipulator.java b/src/main/java/refinedstorage/tile/TileDiskManipulator.java index 7569c72e4..e24af68ac 100755 --- a/src/main/java/refinedstorage/tile/TileDiskManipulator.java +++ b/src/main/java/refinedstorage/tile/TileDiskManipulator.java @@ -12,8 +12,8 @@ import net.minecraftforge.items.CapabilityItemHandler; import net.minecraftforge.items.IItemHandler; import net.minecraftforge.items.ItemHandlerHelper; import refinedstorage.RS; +import refinedstorage.RSUtils; import refinedstorage.api.util.IComparer; -import refinedstorage.apiimpl.storage.NBTStorage; import refinedstorage.apiimpl.storage.fluid.FluidStorageNBT; import refinedstorage.apiimpl.storage.fluid.FluidUtils; import refinedstorage.apiimpl.storage.item.ItemStorageNBT; @@ -82,7 +82,7 @@ public class TileDiskManipulator extends TileNode implements IComparable, IFilte super.onContentsChanged(slot); if (FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER && slot < 6) { - NBTStorage.constructFromDrive(getStackInSlot(slot), slot, itemStorages, fluidStorages, s -> new ItemStorage(s), s -> new FluidStorage(s)); + RSUtils.constructFromDrive(getStackInSlot(slot), slot, itemStorages, fluidStorages, s -> new ItemStorage(s), s -> new FluidStorage(s)); } } diff --git a/src/main/java/refinedstorage/tile/TileExporter.java b/src/main/java/refinedstorage/tile/TileExporter.java index 6b898ba4e..6f07068a7 100755 --- a/src/main/java/refinedstorage/tile/TileExporter.java +++ b/src/main/java/refinedstorage/tile/TileExporter.java @@ -12,7 +12,6 @@ import net.minecraftforge.items.CapabilityItemHandler; import net.minecraftforge.items.IItemHandler; import net.minecraftforge.items.ItemHandlerHelper; import refinedstorage.RS; -import refinedstorage.api.network.NetworkUtils; import refinedstorage.api.util.IComparer; import refinedstorage.inventory.ItemHandlerBasic; import refinedstorage.inventory.ItemHandlerFluid; @@ -74,7 +73,7 @@ public class TileExporter extends TileMultipartNode implements IComparable, ITyp network.insertItem(remainder, remainder.stackSize, false); } } else if (upgrades.hasUpgrade(ItemUpgrade.TYPE_CRAFTING)) { - NetworkUtils.scheduleCraftingTaskIfUnscheduled(network, slot, 1, compare); + network.scheduleCraftingTaskIfUnscheduled(slot, 1, compare); } } } diff --git a/src/main/java/refinedstorage/tile/TileInterface.java b/src/main/java/refinedstorage/tile/TileInterface.java index 2e355ea42..4f15051b8 100755 --- a/src/main/java/refinedstorage/tile/TileInterface.java +++ b/src/main/java/refinedstorage/tile/TileInterface.java @@ -8,7 +8,6 @@ import net.minecraftforge.items.CapabilityItemHandler; import net.minecraftforge.items.IItemHandler; import net.minecraftforge.items.wrapper.CombinedInvWrapper; import refinedstorage.RS; -import refinedstorage.api.network.NetworkUtils; import refinedstorage.api.util.IComparer; import refinedstorage.inventory.ItemHandlerBasic; import refinedstorage.inventory.ItemHandlerUpgrade; @@ -82,7 +81,7 @@ public class TileInterface extends TileNode implements IComparable { exportItems.getStackInSlot(i).stackSize += result.stackSize; } } else { - NetworkUtils.scheduleCraftingTaskIfUnscheduled(network, wanted, delta, compare); + network.scheduleCraftingTaskIfUnscheduled(wanted, delta, compare); } } else if (delta < 0) { ItemStack remainder = network.insertItem(got, Math.abs(delta), false); diff --git a/src/main/java/refinedstorage/tile/TileMultipartNode.java b/src/main/java/refinedstorage/tile/TileMultipartNode.java index 0fd00ea0f..e89d8d37d 100755 --- a/src/main/java/refinedstorage/tile/TileMultipartNode.java +++ b/src/main/java/refinedstorage/tile/TileMultipartNode.java @@ -17,7 +17,6 @@ import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.common.capabilities.Capability; import refinedstorage.RSBlocks; -import refinedstorage.api.network.NetworkUtils; public abstract class TileMultipartNode extends TileNode implements IMicroblockContainerTile, ISlottedCapabilityProvider { private MicroblockContainer container; @@ -71,7 +70,7 @@ public abstract class TileMultipartNode extends TileNode implements IMicroblockC markDirty(); if (network != null) { - NetworkUtils.rebuildGraph(network); + network.getNodeGraph().rebuild(); } else if (worldObj != null) { RSBlocks.CABLE.attemptConnect(worldObj, pos); } diff --git a/src/main/java/refinedstorage/tile/TileNetworkTransmitter.java b/src/main/java/refinedstorage/tile/TileNetworkTransmitter.java index 20a0e460f..84e8cce76 100755 --- a/src/main/java/refinedstorage/tile/TileNetworkTransmitter.java +++ b/src/main/java/refinedstorage/tile/TileNetworkTransmitter.java @@ -8,7 +8,6 @@ import net.minecraftforge.items.IItemHandler; import net.minecraftforge.items.wrapper.CombinedInvWrapper; import refinedstorage.RS; import refinedstorage.RSItems; -import refinedstorage.api.network.NetworkUtils; import refinedstorage.inventory.ItemHandlerBasic; import refinedstorage.inventory.ItemHandlerUpgrade; import refinedstorage.inventory.ItemValidatorBasic; @@ -45,7 +44,7 @@ public class TileNetworkTransmitter extends TileNode { super.onContentsChanged(slot); if (network != null) { - NetworkUtils.rebuildGraph(network); + network.getNodeGraph().rebuild(); } } }; @@ -65,7 +64,7 @@ public class TileNetworkTransmitter extends TileNode { } if (network != null) { - NetworkUtils.rebuildGraph(network); + network.getNodeGraph().rebuild(); } } }; diff --git a/src/main/java/refinedstorage/tile/TileNode.java b/src/main/java/refinedstorage/tile/TileNode.java index 33e501ab0..379b441c0 100755 --- a/src/main/java/refinedstorage/tile/TileNode.java +++ b/src/main/java/refinedstorage/tile/TileNode.java @@ -7,7 +7,6 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import refinedstorage.api.network.INetworkMaster; import refinedstorage.api.network.INetworkNode; -import refinedstorage.api.network.NetworkUtils; import refinedstorage.tile.config.IRedstoneConfigurable; import refinedstorage.tile.config.RedstoneMode; import refinedstorage.tile.data.TileDataParameter; @@ -65,7 +64,7 @@ public abstract class TileNode extends TileBase implements INetworkNode, IRedsto onConnectionChange(network, update); if (rebuildOnUpdateChange) { - NetworkUtils.rebuildGraph(network); + network.getNodeGraph().rebuild(); } } diff --git a/src/main/java/refinedstorage/tile/grid/TileGrid.java b/src/main/java/refinedstorage/tile/grid/TileGrid.java index 2298e123b..925ef6d35 100755 --- a/src/main/java/refinedstorage/tile/grid/TileGrid.java +++ b/src/main/java/refinedstorage/tile/grid/TileGrid.java @@ -17,7 +17,6 @@ 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.block.BlockGrid; @@ -264,7 +263,7 @@ public class TileGrid extends TileNode implements IGrid { } else { if (slot != null) { if (slot.stackSize == 1 && isConnected()) { - matrix.setInventorySlotContents(i, NetworkUtils.extractItem(network, slot, 1)); + matrix.setInventorySlotContents(i, network.extractItem(slot, 1)); } else { matrix.decrStackSize(i, 1); } @@ -350,7 +349,7 @@ public class TileGrid extends TileNode implements IGrid { boolean found = false; for (ItemStack possibility : possibilities) { - ItemStack took = NetworkUtils.extractItem(network, possibility, 1); + ItemStack took = network.extractItem(possibility, 1); if (took != null) { matrix.setInventorySlotContents(i, took);