diff --git a/CHANGELOG.md b/CHANGELOG.md index a67b102b6..4875e76ec 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,40 @@ # Refined Storage Changelog +### 0.8.11 +**Bugfixes** +- Fixed minor dupe bug with JEI transferring +- Fixed exporter crafting upgrades taking priority over other tasks +- Fixed NPE with incorrectly initialized disks + +**Features** +- Added X button to Processing Pattern Encoder to clear configuration of inputs and outputs +- Re-added opposite facing on shift click functionality +- Updated to Forge 2014 + +### 0.8.10 +**Bugfixes** +- Fixed not being able to get some items out of Grid +- Fixed slight glitch in Constructor and Destructor model + +### 0.8.9 +**Bugfixes** +- Fixed bug where Grid crafting doesn't handle remainder sometimes +- Fixed caching issues with External Storage +- Fixed possible crash with Disk Drives + +**Features** +- Added a model for the Constructor +- Added a model for the Destructor +- Wireless Transmitters next to each other without any cable or without being connected to a machine won't work anymore, they need to be explictly connected to a cable or other machine +- Some models / texture tweaks + ### 0.8.8 **Bugfixes** - Use ore dictionary for recipes with glass +- Fixed solderer not working with automation anymore + +**Features** +- Texture tweaks ### 0.8.7 **Bugfixes** diff --git a/build.gradle b/build.gradle index ad07360a3..95d11e44b 100755 --- a/build.gradle +++ b/build.gradle @@ -12,12 +12,12 @@ buildscript { } apply plugin: 'net.minecraftforge.gradle.forge' -version = "0.8.8" +version = "0.8.11" group = "refinedstorage" archivesBaseName = "refinedstorage" minecraft { - version = "1.10-12.18.0.2000-1.10.0" + version = "1.10.2-12.18.1.2014" runDir = "run" useDepAts = true mappings = "snapshot_20160518" @@ -37,9 +37,9 @@ repositories { } dependencies { - deobfCompile "mezz.jei:jei_1.10:3.7.+" - compile "net.darkhax.tesla:Tesla:1.9.4-1.1.0.24" - compile "net.industrial-craft:industrialcraft-2:2.6.7-ex110:api" + deobfCompile "mezz.jei:jei_1.10.2:3.7.+" + compile "net.darkhax.tesla:Tesla:1.10-1.2.0.34" + compile "net.industrial-craft:industrialcraft-2:2.6.9-ex110:api" } processResources { diff --git a/logo.png b/logo.png index b69fe6a08..308617dc9 100755 Binary files a/logo.png and b/logo.png differ diff --git a/screenshots/overview.png b/screenshots/overview.png index 81cc36423..aa699e7c0 100755 Binary files a/screenshots/overview.png and b/screenshots/overview.png differ diff --git a/screenshots/solderer_automation.png b/screenshots/solderer_automation.png index 953f274a7..e21deddd2 100755 Binary files a/screenshots/solderer_automation.png and b/screenshots/solderer_automation.png differ diff --git a/src/main/java/refinedstorage/RefinedStorage.java b/src/main/java/refinedstorage/RefinedStorage.java index 1acc2d812..d4afca352 100755 --- a/src/main/java/refinedstorage/RefinedStorage.java +++ b/src/main/java/refinedstorage/RefinedStorage.java @@ -14,7 +14,7 @@ import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.network.NetworkRegistry; import net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper; -import refinedstorage.item.ItemStorageDisk; +import refinedstorage.apiimpl.storage.ClientStack; import refinedstorage.proxy.CommonProxy; import java.util.ArrayList; @@ -23,7 +23,7 @@ import java.util.List; @Mod(modid = RefinedStorage.ID, version = RefinedStorage.VERSION) public final class RefinedStorage { public static final String ID = "refinedstorage"; - public static final String VERSION = "0.8.8"; + public static final String VERSION = "0.8.11"; @SidedProxy(clientSide = "refinedstorage.proxy.ClientProxy", serverSide = "refinedstorage.proxy.ServerProxy") public static CommonProxy PROXY; @@ -36,7 +36,7 @@ public final class RefinedStorage { public final CreativeTabs tab = new CreativeTabs(ID) { @Override public ItemStack getIconItemStack() { - return new ItemStack(RefinedStorageItems.STORAGE_DISK, 1, ItemStorageDisk.TYPE_1K); + return new ItemStack(RefinedStorageItems.STORAGE_HOUSING); } @Override @@ -45,7 +45,7 @@ public final class RefinedStorage { } }; - public List items = new ArrayList(); + public List items = new ArrayList(); public int cableUsage; public int constructorUsage; diff --git a/src/main/java/refinedstorage/RefinedStorageUtils.java b/src/main/java/refinedstorage/RefinedStorageUtils.java index 9e80a0172..8fbff4a1d 100755 --- a/src/main/java/refinedstorage/RefinedStorageUtils.java +++ b/src/main/java/refinedstorage/RefinedStorageUtils.java @@ -112,14 +112,18 @@ public final class RefinedStorageUtils { return false; } + if (left.getItem() != right.getItem()) { + return false; + } + if ((flags & CompareFlags.COMPARE_DAMAGE) == CompareFlags.COMPARE_DAMAGE) { - if (left.getMetadata() != right.getMetadata()) { + if (left.getItemDamage() != right.getItemDamage()) { return false; } } if ((flags & CompareFlags.COMPARE_NBT) == CompareFlags.COMPARE_NBT) { - if (!ItemStack.areItemStackTagsEqual(left, right)) { + if (!compareNbt(left, right)) { return false; } } @@ -130,7 +134,21 @@ public final class RefinedStorageUtils { } } - return left.getItem() == right.getItem(); + return true; + } + + public static boolean compareNbt(ItemStack left, ItemStack right) { + if (!ItemStack.areItemStackTagsEqual(left, right)) { + if (left.hasTagCompound() && !right.hasTagCompound() && left.getTagCompound().hasNoTags()) { + return true; + } else if (!left.hasTagCompound() && right.hasTagCompound() && right.getTagCompound().hasNoTags()) { + return true; + } + + return false; + } + + return true; } public static boolean compareStackNoQuantity(ItemStack left, ItemStack right) { @@ -316,10 +334,6 @@ public final class RefinedStorageUtils { return network.extractItem(stack, size, CompareFlags.COMPARE_DAMAGE | CompareFlags.COMPARE_NBT); } - public static ItemStack getItem(INetworkMaster network, ItemStack stack) { - return network.getStorage().get(stack, CompareFlags.COMPARE_DAMAGE | CompareFlags.COMPARE_NBT); - } - public static ICraftingPattern getPattern(INetworkMaster network, ItemStack stack) { return network.getPattern(stack, CompareFlags.COMPARE_DAMAGE | CompareFlags.COMPARE_NBT); } @@ -329,14 +343,6 @@ public final class RefinedStorageUtils { } public static int getItemStackHashCode(ItemStack stack) { - return getItemStackHashCode(stack, stack == null ? 0 : stack.stackSize); - } - - public static int getItemStackHashCode(ItemStack stack, int stackSize) { - if (stack == null) { - return 0; - } - - return stack.getItem().hashCode() + Math.max(1, stackSize) * (stack.hasTagCompound() ? stack.getTagCompound().hashCode() : 1); + return stack.getItem().hashCode() * (stack.getItemDamage() + 1) * (stack.hasTagCompound() ? stack.getTagCompound().hashCode() : 1); } } diff --git a/src/main/java/refinedstorage/api/network/IGridHandler.java b/src/main/java/refinedstorage/api/network/IGridHandler.java index b79760c3d..373c28e2f 100755 --- a/src/main/java/refinedstorage/api/network/IGridHandler.java +++ b/src/main/java/refinedstorage/api/network/IGridHandler.java @@ -12,11 +12,11 @@ public interface IGridHandler { /** * Called when a player tries to extract an item from the grid. * - * @param stack The item we're trying to extract + * @param id The ID of the item we're trying to extract * @param flags How we are extracting, see {@link GridExtractFlags} * @param player The player that is attempting the extraction */ - void onExtract(ItemStack stack, int flags, EntityPlayerMP player); + void onExtract(int id, int flags, EntityPlayerMP player); /** * Called when a player tries to insert an item to the grid. @@ -38,10 +38,10 @@ public interface IGridHandler { /** * Called when a player requested crafting for an item. * - * @param stack The item we're requesting crafting for + * @param id The ID of the item we're requesting crafting for * @param quantity The amount of that item that has to be crafted */ - void onCraftingRequested(ItemStack stack, int quantity); + void onCraftingRequested(int id, int quantity); /** * Called when a player wants to cancel a crafting task. diff --git a/src/main/java/refinedstorage/api/network/IWirelessGridConsumer.java b/src/main/java/refinedstorage/api/network/IWirelessGridConsumer.java new file mode 100755 index 000000000..df4259e2b --- /dev/null +++ b/src/main/java/refinedstorage/api/network/IWirelessGridConsumer.java @@ -0,0 +1,25 @@ +package refinedstorage.api.network; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumHand; + +/** + * Represents a player using a wireless grid. + */ +public interface IWirelessGridConsumer { + /** + * @return The hand this wireless grid is opened with + */ + EnumHand getHand(); + + /** + * @return The player using the wireless grid + */ + EntityPlayer getPlayer(); + + /** + * @return The wireless grid stack + */ + ItemStack getStack(); +} diff --git a/src/main/java/refinedstorage/api/network/IWirelessGridHandler.java b/src/main/java/refinedstorage/api/network/IWirelessGridHandler.java index 7913dcef3..412bc1961 100755 --- a/src/main/java/refinedstorage/api/network/IWirelessGridHandler.java +++ b/src/main/java/refinedstorage/api/network/IWirelessGridHandler.java @@ -39,11 +39,11 @@ public interface IWirelessGridHandler { void drainEnergy(EntityPlayer player, int energy); /** - * Returns a {@link WirelessGridConsumer} for a player. + * Returns a {@link IWirelessGridConsumer} for a player. * * @param player The player to get the wireless grid consumer for - * @return The {@link IWirelessGridHandler} that corresponds to a player, or null if the player isn't using a wireless grid + * @return The {@link IWirelessGridConsumer} that corresponds to a player, or null if the player isn't using a wireless grid */ @Nullable - WirelessGridConsumer getConsumer(EntityPlayer player); + IWirelessGridConsumer getConsumer(EntityPlayer player); } diff --git a/src/main/java/refinedstorage/api/network/WirelessGridConsumer.java b/src/main/java/refinedstorage/api/network/WirelessGridConsumer.java deleted file mode 100755 index ea17c74c1..000000000 --- a/src/main/java/refinedstorage/api/network/WirelessGridConsumer.java +++ /dev/null @@ -1,46 +0,0 @@ -package refinedstorage.api.network; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumHand; - -/** - * Represents a player using a wireless grid. - */ -public class WirelessGridConsumer { - private EntityPlayer player; - private EnumHand hand; - private ItemStack wirelessGrid; - - /** - * @param player The player using this wireless grid - * @param hand The hand that this wireless grid is opened with - * @param wirelessGrid The wireless grid {@link ItemStack} in the player's inventory - */ - public WirelessGridConsumer(EntityPlayer player, EnumHand hand, ItemStack wirelessGrid) { - this.player = player; - this.hand = hand; - this.wirelessGrid = wirelessGrid; - } - - /** - * @return The wireless grid {@link ItemStack} - */ - public ItemStack getWirelessGrid() { - return wirelessGrid; - } - - /** - * @return The hand this wireless grid is opened with - */ - public EnumHand getHand() { - return hand; - } - - /** - * @return The player using the wireless grid - */ - public EntityPlayer getPlayer() { - return player; - } -} \ No newline at end of file diff --git a/src/main/java/refinedstorage/api/storage/IGroupedStorage.java b/src/main/java/refinedstorage/api/storage/IGroupedStorage.java index cf173150f..0d349f98d 100755 --- a/src/main/java/refinedstorage/api/storage/IGroupedStorage.java +++ b/src/main/java/refinedstorage/api/storage/IGroupedStorage.java @@ -19,9 +19,10 @@ public interface IGroupedStorage { /** * Adds an item to the network. Will merge it with another item if it already exists. * - * @param stack The stack to add, do NOT modify + * @param stack The stack to add, do NOT modify + * @param rebuilding Whether this method is called while the storage is rebuilding */ - void add(ItemStack stack); + void add(ItemStack stack, boolean rebuilding); /** * Removes a item from the network. @@ -39,6 +40,13 @@ public interface IGroupedStorage { */ ItemStack get(ItemStack stack, int flags); + /** + * Gets an item from the network by ID. + * + * @return The {@link ItemStack}, do NOT modify + */ + ItemStack get(int id); + /** * @return All items in this storage network */ diff --git a/src/main/java/refinedstorage/apiimpl/autocrafting/CraftingTaskScheduler.java b/src/main/java/refinedstorage/apiimpl/autocrafting/CraftingTaskScheduler.java index 9386ede6a..201779bc7 100755 --- a/src/main/java/refinedstorage/apiimpl/autocrafting/CraftingTaskScheduler.java +++ b/src/main/java/refinedstorage/apiimpl/autocrafting/CraftingTaskScheduler.java @@ -2,6 +2,7 @@ package refinedstorage.apiimpl.autocrafting; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; import refinedstorage.RefinedStorageUtils; import refinedstorage.api.autocrafting.ICraftingPattern; import refinedstorage.api.network.INetworkMaster; @@ -9,8 +10,13 @@ import refinedstorage.api.network.INetworkMaster; public class CraftingTaskScheduler { private static final String NBT_SCHEDULED = "CraftingTaskScheduled"; + private TileEntity tile; private ItemStack scheduledItem; + public CraftingTaskScheduler(TileEntity tile) { + this.tile = tile; + } + public boolean canSchedule(int compare, ItemStack item) { return scheduledItem == null || !RefinedStorageUtils.compareStack(scheduledItem, item, compare); } @@ -21,12 +27,16 @@ public class CraftingTaskScheduler { if (pattern != null) { scheduledItem = item; - network.addCraftingTask(network.createCraftingTask(pattern)); + network.addCraftingTaskAsLast(network.createCraftingTask(pattern)); + + tile.markDirty(); } } public void resetSchedule() { - this.scheduledItem = null; + scheduledItem = null; + + tile.markDirty(); } public void writeToNBT(NBTTagCompound tag) { diff --git a/src/main/java/refinedstorage/apiimpl/autocrafting/ProcessingCraftingTask.java b/src/main/java/refinedstorage/apiimpl/autocrafting/ProcessingCraftingTask.java index 62f8b1809..70368b580 100755 --- a/src/main/java/refinedstorage/apiimpl/autocrafting/ProcessingCraftingTask.java +++ b/src/main/java/refinedstorage/apiimpl/autocrafting/ProcessingCraftingTask.java @@ -90,14 +90,16 @@ public class ProcessingCraftingTask implements ICraftingTask { return true; } - public void onInserted(ItemStack inserted) { + public boolean onInserted(ItemStack stack) { for (int i = 0; i < pattern.getOutputs().length; ++i) { - if (!satisfied[i] && RefinedStorageUtils.compareStackNoQuantity(inserted, pattern.getOutputs()[i])) { + if (!satisfied[i] && RefinedStorageUtils.compareStackNoQuantity(stack, pattern.getOutputs()[i])) { satisfied[i] = true; - return; + return true; } } + + return false; } @Override diff --git a/src/main/java/refinedstorage/apiimpl/network/GridHandler.java b/src/main/java/refinedstorage/apiimpl/network/GridHandler.java index 05e51bcc5..806811846 100755 --- a/src/main/java/refinedstorage/apiimpl/network/GridHandler.java +++ b/src/main/java/refinedstorage/apiimpl/network/GridHandler.java @@ -20,8 +20,8 @@ public class GridHandler implements IGridHandler { } @Override - public void onExtract(ItemStack stack, int flags, EntityPlayerMP player) { - ItemStack item = RefinedStorageUtils.getItem(network, stack); + public void onExtract(int id, int flags, EntityPlayerMP player) { + ItemStack item = network.getStorage().get(id); if (item == null) { return; @@ -34,7 +34,7 @@ public class GridHandler implements IGridHandler { ItemStack held = player.inventory.getItemStack(); if (single) { - if (held != null && (!RefinedStorageUtils.compareStackNoQuantity(stack, held) || held.stackSize + 1 > held.getMaxStackSize())) { + if (held != null && (!RefinedStorageUtils.compareStackNoQuantity(item, held) || held.stackSize + 1 > held.getMaxStackSize())) { return; } } else if (player.inventory.getItemStack() != null) { @@ -55,9 +55,9 @@ public class GridHandler implements IGridHandler { // NO OP, the quantity already set (64) is needed for shift } - size = Math.min(size, stack.getItem().getItemStackLimit(stack)); + size = Math.min(size, item.getItem().getItemStackLimit(item)); - ItemStack took = RefinedStorageUtils.extractItem(network, stack, size); + ItemStack took = RefinedStorageUtils.extractItem(network, item, size); if (took != null) { if ((flags & GridExtractFlags.EXTRACT_SHIFT) == GridExtractFlags.EXTRACT_SHIFT) { @@ -112,11 +112,17 @@ public class GridHandler implements IGridHandler { } @Override - public void onCraftingRequested(ItemStack stack, int quantity) { + public void onCraftingRequested(int id, int quantity) { if (quantity <= 0 || quantity > MAX_CRAFTING_PER_REQUEST) { return; } + ItemStack stack = network.getStorage().get(id); + + if (stack == null) { + return; + } + int quantityPerRequest = 0; ICraftingPattern pattern = RefinedStorageUtils.getPattern(network, stack); diff --git a/src/main/java/refinedstorage/apiimpl/network/WirelessGridConsumer.java b/src/main/java/refinedstorage/apiimpl/network/WirelessGridConsumer.java new file mode 100755 index 000000000..497642f16 --- /dev/null +++ b/src/main/java/refinedstorage/apiimpl/network/WirelessGridConsumer.java @@ -0,0 +1,33 @@ +package refinedstorage.apiimpl.network; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumHand; +import refinedstorage.api.network.IWirelessGridConsumer; + +public class WirelessGridConsumer implements IWirelessGridConsumer { + private EntityPlayer player; + private EnumHand hand; + private ItemStack stack; + + public WirelessGridConsumer(EntityPlayer player, EnumHand hand, ItemStack stack) { + this.player = player; + this.hand = hand; + this.stack = stack; + } + + @Override + public EnumHand getHand() { + return hand; + } + + @Override + public EntityPlayer getPlayer() { + return player; + } + + @Override + public ItemStack getStack() { + return stack; + } +} \ No newline at end of file diff --git a/src/main/java/refinedstorage/apiimpl/network/WirelessGridHandler.java b/src/main/java/refinedstorage/apiimpl/network/WirelessGridHandler.java index 34ee06f5e..ab8a566ed 100755 --- a/src/main/java/refinedstorage/apiimpl/network/WirelessGridHandler.java +++ b/src/main/java/refinedstorage/apiimpl/network/WirelessGridHandler.java @@ -22,8 +22,8 @@ public class WirelessGridHandler implements IWirelessGridHandler { private INetworkMaster network; - private List consumers = new ArrayList(); - private List consumersToRemove = new ArrayList(); + private List consumers = new ArrayList(); + private List consumersToRemove = new ArrayList(); public WirelessGridHandler(INetworkMaster network) { this.network = network; @@ -34,12 +34,12 @@ public class WirelessGridHandler implements IWirelessGridHandler { consumers.removeAll(consumersToRemove); consumersToRemove.clear(); - Iterator it = consumers.iterator(); + Iterator it = consumers.iterator(); while (it.hasNext()) { - WirelessGridConsumer consumer = it.next(); + IWirelessGridConsumer consumer = it.next(); - if (!RefinedStorageUtils.compareStack(consumer.getWirelessGrid(), consumer.getPlayer().getHeldItem(consumer.getHand()))) { + if (!RefinedStorageUtils.compareStack(consumer.getStack(), consumer.getPlayer().getHeldItem(consumer.getHand()))) { /** * This will call {@link net.minecraft.inventory.Container#onContainerClosed(EntityPlayer)} so the consumer is removed from the list. */ @@ -83,7 +83,7 @@ public class WirelessGridHandler implements IWirelessGridHandler { @Override public void onClose(EntityPlayer player) { - WirelessGridConsumer consumer = getConsumer(player); + IWirelessGridConsumer consumer = getConsumer(player); if (consumer != null) { consumersToRemove.add(consumer); @@ -92,7 +92,7 @@ public class WirelessGridHandler implements IWirelessGridHandler { @Override public void drainEnergy(EntityPlayer player, int energy) { - WirelessGridConsumer consumer = getConsumer(player); + IWirelessGridConsumer consumer = getConsumer(player); if (consumer != null) { ItemWirelessGrid item = RefinedStorageItems.WIRELESS_GRID; @@ -110,11 +110,11 @@ public class WirelessGridHandler implements IWirelessGridHandler { } @Override - public WirelessGridConsumer getConsumer(EntityPlayer player) { - Iterator it = consumers.iterator(); + public IWirelessGridConsumer getConsumer(EntityPlayer player) { + Iterator it = consumers.iterator(); while (it.hasNext()) { - WirelessGridConsumer consumer = it.next(); + IWirelessGridConsumer consumer = it.next(); if (consumer.getPlayer() == player) { return consumer; diff --git a/src/main/java/refinedstorage/apiimpl/storage/ClientStack.java b/src/main/java/refinedstorage/apiimpl/storage/ClientStack.java new file mode 100755 index 000000000..0b568540c --- /dev/null +++ b/src/main/java/refinedstorage/apiimpl/storage/ClientStack.java @@ -0,0 +1,53 @@ +package refinedstorage.apiimpl.storage; + +import io.netty.buffer.ByteBuf; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fml.common.network.ByteBufUtils; +import refinedstorage.RefinedStorageUtils; +import refinedstorage.api.network.INetworkMaster; + +public class ClientStack { + private int id; + private ItemStack stack; + private boolean craftable; + + public ClientStack(int id, ItemStack stack, boolean craftable) { + this.id = id; + this.stack = stack; + this.craftable = craftable; + } + + public ClientStack(ByteBuf buf) { + stack = new ItemStack(Item.getItemById(buf.readInt()), buf.readInt(), buf.readInt()); + stack.setTagCompound(ByteBufUtils.readTag(buf)); + id = buf.readInt(); + craftable = buf.readBoolean(); + } + + public int getId() { + return id; + } + + public ItemStack getStack() { + return stack; + } + + public boolean isCraftable() { + return craftable; + } + + @Override + public boolean equals(Object obj) { + return obj instanceof ClientStack && ((ClientStack) obj).getId() == id; + } + + public static void write(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(RefinedStorageUtils.getItemStackHashCode(stack)); + buf.writeBoolean(RefinedStorageUtils.hasPattern(network, stack)); + } +} diff --git a/src/main/java/refinedstorage/apiimpl/storage/GroupedStorage.java b/src/main/java/refinedstorage/apiimpl/storage/GroupedStorage.java index 4ebba6e50..21855ae17 100755 --- a/src/main/java/refinedstorage/apiimpl/storage/GroupedStorage.java +++ b/src/main/java/refinedstorage/apiimpl/storage/GroupedStorage.java @@ -39,7 +39,7 @@ public class GroupedStorage implements IGroupedStorage { for (IStorage storage : storages) { for (ItemStack stack : storage.getItems()) { - add(stack); + add(stack, true); } } @@ -47,7 +47,7 @@ public class GroupedStorage implements IGroupedStorage { for (ItemStack output : pattern.getOutputs()) { ItemStack patternStack = output.copy(); patternStack.stackSize = 0; - add(patternStack); + add(patternStack, true); } } @@ -55,12 +55,14 @@ public class GroupedStorage implements IGroupedStorage { } @Override - public void add(ItemStack stack) { + public void add(ItemStack stack, boolean rebuilding) { for (ItemStack otherStack : stacks.get(stack.getItem())) { if (RefinedStorageUtils.compareStackNoQuantity(otherStack, stack)) { otherStack.stackSize += stack.stackSize; - network.sendStorageDeltaToClient(stack, stack.stackSize); + if (!rebuilding) { + network.sendStorageDeltaToClient(stack, stack.stackSize); + } return; } @@ -68,7 +70,9 @@ public class GroupedStorage implements IGroupedStorage { stacks.put(stack.getItem(), stack.copy()); - network.sendStorageDeltaToClient(stack, stack.stackSize); + if (!rebuilding) { + network.sendStorageDeltaToClient(stack, stack.stackSize); + } } @Override @@ -101,6 +105,17 @@ public class GroupedStorage implements IGroupedStorage { return null; } + @Override + public ItemStack get(int id) { + for (ItemStack stack : this.stacks.values()) { + if (RefinedStorageUtils.getItemStackHashCode(stack) == id) { + return stack; + } + } + + return null; + } + @Override public Collection getStacks() { return stacks.values(); diff --git a/src/main/java/refinedstorage/apiimpl/storage/NBTStorage.java b/src/main/java/refinedstorage/apiimpl/storage/NBTStorage.java index 7521f7fe5..8d85afe15 100755 --- a/src/main/java/refinedstorage/apiimpl/storage/NBTStorage.java +++ b/src/main/java/refinedstorage/apiimpl/storage/NBTStorage.java @@ -43,7 +43,7 @@ public abstract class NBTStorage implements IStorage { /** * @param tag The NBT tag we are reading from and writing the amount stored to, has to be initialized with {@link NBTStorage#createNBT()} if it doesn't exist yet * @param capacity The capacity of this storage, -1 for infinite capacity - * @param tile A {@link TileEntity} that the NBT storage is in, will be marked dirty when storage changes + * @param tile A {@link TileEntity} that the NBT storage is in, will be marked dirty when the storage changes */ public NBTStorage(NBTTagCompound tag, int capacity, @Nullable TileEntity tile) { this.tag = tag; @@ -238,6 +238,10 @@ public abstract class NBTStorage implements IStorage { return tag; } + public static boolean isValid(ItemStack stack) { + return stack.hasTagCompound() && stack.getTagCompound().hasKey(NBT_ITEMS) && stack.getTagCompound().hasKey(NBT_STORED); + } + /** * @param stack The {@link ItemStack} to populate with the NBT tags from {@link NBTStorage#createNBT()} * @return The provided {@link ItemStack} with NBT tags from {@link NBTStorage#createNBT()} diff --git a/src/main/java/refinedstorage/block/BlockConstructor.java b/src/main/java/refinedstorage/block/BlockConstructor.java index d7d2ebd88..d5a879d85 100755 --- a/src/main/java/refinedstorage/block/BlockConstructor.java +++ b/src/main/java/refinedstorage/block/BlockConstructor.java @@ -12,7 +12,7 @@ import refinedstorage.RefinedStorage; import refinedstorage.RefinedStorageGui; import refinedstorage.tile.TileConstructor; -public class BlockConstructor extends BlockNode { +public class BlockConstructor extends BlockCable { public BlockConstructor() { super("constructor"); } diff --git a/src/main/java/refinedstorage/block/BlockCraftingMonitor.java b/src/main/java/refinedstorage/block/BlockCraftingMonitor.java index ad465fa74..1eb575fb3 100755 --- a/src/main/java/refinedstorage/block/BlockCraftingMonitor.java +++ b/src/main/java/refinedstorage/block/BlockCraftingMonitor.java @@ -30,4 +30,9 @@ public class BlockCraftingMonitor extends BlockNode { return true; } + + @Override + public boolean hasConnectivityState() { + return true; + } } diff --git a/src/main/java/refinedstorage/block/BlockDestructor.java b/src/main/java/refinedstorage/block/BlockDestructor.java index 6a2ef7fb2..77f81f85c 100755 --- a/src/main/java/refinedstorage/block/BlockDestructor.java +++ b/src/main/java/refinedstorage/block/BlockDestructor.java @@ -12,7 +12,7 @@ import refinedstorage.RefinedStorage; import refinedstorage.RefinedStorageGui; import refinedstorage.tile.TileDestructor; -public class BlockDestructor extends BlockNode { +public class BlockDestructor extends BlockCable { public BlockDestructor() { super("destructor"); } diff --git a/src/main/java/refinedstorage/block/BlockGrid.java b/src/main/java/refinedstorage/block/BlockGrid.java index 90d172b24..e653dd5b6 100755 --- a/src/main/java/refinedstorage/block/BlockGrid.java +++ b/src/main/java/refinedstorage/block/BlockGrid.java @@ -66,6 +66,11 @@ public class BlockGrid extends BlockNode { return true; } + @Override + public boolean hasConnectivityState() { + return true; + } + @Override public Item createItem() { return new ItemBlockBase(this, true); diff --git a/src/main/java/refinedstorage/block/BlockInterface.java b/src/main/java/refinedstorage/block/BlockInterface.java index 77be4f4d5..9200f7802 100755 --- a/src/main/java/refinedstorage/block/BlockInterface.java +++ b/src/main/java/refinedstorage/block/BlockInterface.java @@ -31,6 +31,11 @@ public class BlockInterface extends BlockNode { return true; } + @Override + public boolean hasConnectivityState() { + return true; + } + @Override public EnumPlacementType getPlacementType() { return null; diff --git a/src/main/java/refinedstorage/block/BlockSolderer.java b/src/main/java/refinedstorage/block/BlockSolderer.java index 8533380f9..b3f81f07a 100755 --- a/src/main/java/refinedstorage/block/BlockSolderer.java +++ b/src/main/java/refinedstorage/block/BlockSolderer.java @@ -69,6 +69,6 @@ public class BlockSolderer extends BlockNode { @Override public EnumPlacementType getPlacementType() { - return null; + return EnumPlacementType.HORIZONTAL; } } diff --git a/src/main/java/refinedstorage/block/EnumPlacementType.java b/src/main/java/refinedstorage/block/EnumPlacementType.java index c90feb8e0..5d61a53d5 100755 --- a/src/main/java/refinedstorage/block/EnumPlacementType.java +++ b/src/main/java/refinedstorage/block/EnumPlacementType.java @@ -25,7 +25,9 @@ public enum EnumPlacementType { EnumFacing getFrom(BlockPos pos, EntityLivingBase entity) { switch (this) { case ANY: - return BlockPistonBase.getFacingFromEntity(pos, entity); + EnumFacing facing = BlockPistonBase.getFacingFromEntity(pos, entity); + + return entity.isSneaking() ? facing.getOpposite() : facing; case HORIZONTAL: return entity.getHorizontalFacing().getOpposite(); default: diff --git a/src/main/java/refinedstorage/container/ContainerSolderer.java b/src/main/java/refinedstorage/container/ContainerSolderer.java index 78a2fcfc6..ee672a684 100755 --- a/src/main/java/refinedstorage/container/ContainerSolderer.java +++ b/src/main/java/refinedstorage/container/ContainerSolderer.java @@ -4,6 +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.container.slot.SlotOutput; import refinedstorage.tile.TileSolderer; @@ -46,8 +47,12 @@ public class ContainerSolderer extends ContainerBase { if (!mergeItemStack(stack, 4 + 4, inventorySlots.size(), false)) { return null; } - } else if (!mergeItemStack(stack, 0, 3, false)) { // 0 - 3 because we can't shift click to output slot - return null; + } else { + if (stack.getItem() != RefinedStorageItems.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; + } + } } if (stack.stackSize == 0) { diff --git a/src/main/java/refinedstorage/container/slot/SlotGridCraftingResult.java b/src/main/java/refinedstorage/container/slot/SlotGridCraftingResult.java index 842adae4a..391e65560 100755 --- a/src/main/java/refinedstorage/container/slot/SlotGridCraftingResult.java +++ b/src/main/java/refinedstorage/container/slot/SlotGridCraftingResult.java @@ -25,7 +25,7 @@ public class SlotGridCraftingResult extends SlotCrafting { onCrafting(stack); if (!player.worldObj.isRemote) { - grid.onCrafted(); + grid.onCrafted(player); container.sendCraftingSlots(); } diff --git a/src/main/java/refinedstorage/gui/GuiCraftingSettings.java b/src/main/java/refinedstorage/gui/GuiCraftingSettings.java index c7fc7d96e..634d9369c 100755 --- a/src/main/java/refinedstorage/gui/GuiCraftingSettings.java +++ b/src/main/java/refinedstorage/gui/GuiCraftingSettings.java @@ -4,11 +4,11 @@ import com.google.common.primitives.Ints; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiTextField; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; import net.minecraftforge.fml.client.FMLClientHandler; import org.lwjgl.input.Keyboard; import refinedstorage.RefinedStorage; import refinedstorage.apiimpl.network.GridHandler; +import refinedstorage.apiimpl.storage.ClientStack; import refinedstorage.container.ContainerCraftingSettings; import refinedstorage.network.MessageGridCraftingStart; @@ -19,13 +19,13 @@ public class GuiCraftingSettings extends GuiBase { private GuiTextField amountField; private GuiGrid gui; - private ItemStack stack; + private ClientStack stack; private GuiButton startButton; private GuiButton cancelButton; private GuiButton[] incrementButtons = new GuiButton[6]; - public GuiCraftingSettings(GuiGrid gui, EntityPlayer player, ItemStack stack) { - super(new ContainerCraftingSettings(player, stack), 172, 99); + public GuiCraftingSettings(GuiGrid gui, EntityPlayer player, ClientStack stack) { + super(new ContainerCraftingSettings(player, stack.getStack()), 172, 99); this.gui = gui; this.stack = stack; @@ -124,7 +124,7 @@ public class GuiCraftingSettings extends GuiBase { Integer quantity = Ints.tryParse(amountField.getText()); if (quantity != null && quantity > 0 && quantity <= GridHandler.MAX_CRAFTING_PER_REQUEST) { - RefinedStorage.INSTANCE.network.sendToServer(new MessageGridCraftingStart(stack, quantity)); + RefinedStorage.INSTANCE.network.sendToServer(new MessageGridCraftingStart(stack.getId(), quantity)); close(); } diff --git a/src/main/java/refinedstorage/gui/GuiGrid.java b/src/main/java/refinedstorage/gui/GuiGrid.java index f05cbbf6d..5b904435a 100755 --- a/src/main/java/refinedstorage/gui/GuiGrid.java +++ b/src/main/java/refinedstorage/gui/GuiGrid.java @@ -13,6 +13,7 @@ import net.minecraftforge.fml.common.FMLCommonHandler; import org.apache.commons.lang3.StringUtils; import refinedstorage.RefinedStorage; import refinedstorage.api.network.GridExtractFlags; +import refinedstorage.apiimpl.storage.ClientStack; import refinedstorage.block.EnumGridType; import refinedstorage.container.ContainerGrid; import refinedstorage.gui.sidebutton.SideButtonGridSearchBoxMode; @@ -32,11 +33,11 @@ import java.io.IOException; import java.util.*; public class GuiGrid extends GuiBase { - private Comparator quantityComparator = new Comparator() { + private Comparator quantityComparator = new Comparator() { @Override - public int compare(ItemStack left, ItemStack right) { - int leftSize = left.stackSize; - int rightSize = right.stackSize; + public int compare(ClientStack left, ClientStack right) { + int leftSize = left.getStack().stackSize; + int rightSize = right.getStack().stackSize; if (leftSize == rightSize) { return 0; @@ -52,13 +53,13 @@ public class GuiGrid extends GuiBase { } }; - private Comparator nameComparator = new Comparator() { + private Comparator nameComparator = new Comparator() { @Override - public int compare(ItemStack left, ItemStack right) { + public int compare(ClientStack left, ClientStack right) { if (grid.getSortingDirection() == TileGrid.SORTING_DIRECTION_ASCENDING) { - return left.getDisplayName().compareTo(right.getDisplayName()); + return left.getStack().getDisplayName().compareTo(right.getStack().getDisplayName()); } else if (grid.getSortingDirection() == TileGrid.SORTING_DIRECTION_DESCENDING) { - return right.getDisplayName().compareTo(left.getDisplayName()); + return right.getStack().getDisplayName().compareTo(left.getStack().getDisplayName()); } return 0; @@ -68,7 +69,7 @@ public class GuiGrid extends GuiBase { private GuiTextField searchField; private ContainerGrid container; - private List items = new ArrayList(); + private List items = new ArrayList(); private IGrid grid; private int slotNumber; @@ -123,10 +124,10 @@ public class GuiGrid extends GuiBase { String query = searchField.getText().trim().toLowerCase(); if (!query.isEmpty()) { - Iterator t = items.iterator(); + Iterator t = items.iterator(); while (t.hasNext()) { - ItemStack item = t.next(); + ItemStack item = t.next().getStack(); if (query.startsWith("@")) { String[] parts = query.split(" "); @@ -175,11 +176,11 @@ public class GuiGrid extends GuiBase { getScrollbar().setScrollDelta((float) getScrollbar().getScrollbarHeight() / (float) getRows()); } - public int getOffset() { + private int getOffset() { return (int) Math.ceil(getScrollbar().getCurrentScroll() / 70f * (float) getRows()); } - public int getRows() { + private int getRows() { int max = (int) Math.ceil((float) items.size() / 9f); return max < 0 ? 0 : max; @@ -197,11 +198,11 @@ public class GuiGrid extends GuiBase { return inBounds(7, 19, 162, 18 * getVisibleRows(), mouseX, mouseY); } - public int getVisibleRows() { + private int getVisibleRows() { return (grid.getType() == EnumGridType.CRAFTING || grid.getType() == EnumGridType.PATTERN) ? 4 : 5; } - public boolean isOverClear(int mouseX, int mouseY) { + private boolean isOverClear(int mouseX, int mouseY) { switch (grid.getType()) { case CRAFTING: return inBounds(82, 95, 7, 7, mouseX, mouseY); @@ -212,7 +213,7 @@ public class GuiGrid extends GuiBase { } } - public boolean isOverCreatePattern(int mouseX, int mouseY) { + private boolean isOverCreatePattern(int mouseX, int mouseY) { return grid.getType() == EnumGridType.PATTERN && inBounds(152, 114, 16, 16, mouseX, mouseY) && ((TileGrid) grid).canCreatePattern(); } @@ -265,9 +266,7 @@ public class GuiGrid extends GuiBase { } if (slot < items.size()) { - ItemStack stack = items.get(slot); - - drawItem(x, y, stack, true, formatQuantity(stack.stackSize, slot)); + drawItem(x, y, items.get(slot).getStack(), true, formatQuantity(items.get(slot).getStack().stackSize, slot)); } if (inBounds(x, y, 16, 16, mouseX, mouseY) || !grid.isConnected()) { @@ -295,7 +294,7 @@ public class GuiGrid extends GuiBase { } if (isOverSlotWithItem()) { - drawTooltip(mouseX, mouseY, items.get(slotNumber)); + drawTooltip(mouseX, mouseY, items.get(slotNumber).getStack()); } if (isOverClear(mouseX, mouseY)) { @@ -357,7 +356,7 @@ public class GuiGrid extends GuiBase { } if (isOverSlotWithItem() && (held == null || (held != null && clickedButton == 2))) { - if (items.get(slotNumber).stackSize == 0 || (GuiScreen.isShiftKeyDown() && GuiScreen.isCtrlKeyDown())) { + if (items.get(slotNumber).isCraftable() && (items.get(slotNumber).getStack().stackSize == 0 || (GuiScreen.isShiftKeyDown() && GuiScreen.isCtrlKeyDown()))) { FMLCommonHandler.instance().showGuiScreen(new GuiCraftingSettings(this, container.getPlayer(), items.get(slotNumber))); } else { int flags = 0; @@ -374,7 +373,7 @@ public class GuiGrid extends GuiBase { flags |= GridExtractFlags.EXTRACT_SINGLE; } - RefinedStorage.INSTANCE.network.sendToServer(new MessageGridPull(items.get(slotNumber), flags)); + RefinedStorage.INSTANCE.network.sendToServer(new MessageGridPull(items.get(slotNumber).getId(), flags)); } } } diff --git a/src/main/java/refinedstorage/gui/GuiProcessingPatternEncoder.java b/src/main/java/refinedstorage/gui/GuiProcessingPatternEncoder.java index 71594f7ce..62f3e1e0c 100755 --- a/src/main/java/refinedstorage/gui/GuiProcessingPatternEncoder.java +++ b/src/main/java/refinedstorage/gui/GuiProcessingPatternEncoder.java @@ -5,6 +5,7 @@ import net.minecraft.init.SoundEvents; import refinedstorage.RefinedStorage; import refinedstorage.container.ContainerProcessingPatternEncoder; import refinedstorage.network.MessageGridPatternCreate; +import refinedstorage.network.MessageProcessingPatternEncoderClear; import refinedstorage.tile.TileProcessingPatternEncoder; import java.io.IOException; @@ -26,10 +27,14 @@ public class GuiProcessingPatternEncoder extends GuiBase { public void update(int x, int y) { } - public boolean isHoveringOverCreatePattern(int mouseX, int mouseY) { + private boolean isOverCreatePattern(int mouseX, int mouseY) { return inBounds(152, 38, 16, 16, mouseX, mouseY) && processingPatternEncoder.canCreatePattern(); } + private boolean isOverClear(int mouseX, int mouseY) { + return inBounds(136, 75, 7, 7, mouseX, mouseY); + } + @Override public void drawBackground(int x, int y, int mouseX, int mouseY) { bindTexture("gui/processing_pattern_encoder.png"); @@ -38,7 +43,7 @@ public class GuiProcessingPatternEncoder extends GuiBase { int ty = 0; - if (isHoveringOverCreatePattern(mouseX - guiLeft, mouseY - guiTop)) { + if (isOverCreatePattern(mouseX - guiLeft, mouseY - guiTop)) { ty = 1; } @@ -54,18 +59,26 @@ public class GuiProcessingPatternEncoder extends GuiBase { drawString(7, 7, t("gui.refinedstorage:processing_pattern_encoder")); drawString(7, 78, t("container.inventory")); - if (isHoveringOverCreatePattern(mouseX, mouseY)) { + if (isOverCreatePattern(mouseX, mouseY)) { drawTooltip(mouseX, mouseY, t("gui.refinedstorage:processing_pattern_encoder.pattern_create")); } + + if (isOverClear(mouseX, mouseY)) { + drawTooltip(mouseX, mouseY, t("misc.refinedstorage:clear")); + } } @Override protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException { super.mouseClicked(mouseX, mouseY, mouseButton); - if (isHoveringOverCreatePattern(mouseX - guiLeft, mouseY - guiTop)) { + if (isOverCreatePattern(mouseX - guiLeft, mouseY - guiTop)) { RefinedStorage.INSTANCE.network.sendToServer(new MessageGridPatternCreate(processingPatternEncoder.getPos().getX(), processingPatternEncoder.getPos().getY(), processingPatternEncoder.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(processingPatternEncoder)); + mc.getSoundHandler().playSound(PositionedSoundRecord.getMasterRecord(SoundEvents.UI_BUTTON_CLICK, 1.0F)); } } diff --git a/src/main/java/refinedstorage/item/ItemStorageDisk.java b/src/main/java/refinedstorage/item/ItemStorageDisk.java index 59b028fee..622fb1950 100755 --- a/src/main/java/refinedstorage/item/ItemStorageDisk.java +++ b/src/main/java/refinedstorage/item/ItemStorageDisk.java @@ -93,19 +93,21 @@ public class ItemStorageDisk extends ItemBase { @Override public void addInformation(ItemStack disk, EntityPlayer player, List list, boolean b) { - int capacity = EnumStorageType.getById(disk.getItemDamage()).getCapacity(); + if (NBTStorage.isValid(disk)) { + int capacity = EnumStorageType.getById(disk.getItemDamage()).getCapacity(); - if (capacity == -1) { - list.add(I18n.format("misc.refinedstorage:storage.stored", NBTStorage.getStoredFromNBT(disk.getTagCompound()))); - } else { - list.add(I18n.format("misc.refinedstorage:storage.stored_capacity", NBTStorage.getStoredFromNBT(disk.getTagCompound()), capacity)); + if (capacity == -1) { + list.add(I18n.format("misc.refinedstorage:storage.stored", NBTStorage.getStoredFromNBT(disk.getTagCompound()))); + } else { + list.add(I18n.format("misc.refinedstorage:storage.stored_capacity", NBTStorage.getStoredFromNBT(disk.getTagCompound()), capacity)); + } } } @Override - public ActionResult onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand) { - if (!world.isRemote && player.isSneaking() && NBTStorage.getStoredFromNBT(stack.getTagCompound()) == 0 && stack.getMetadata() != TYPE_CREATIVE) { - ItemStack storagePart = new ItemStack(RefinedStorageItems.STORAGE_PART, 1, stack.getMetadata()); + public ActionResult onItemRightClick(ItemStack disk, World world, EntityPlayer player, EnumHand hand) { + if (!world.isRemote && player.isSneaking() && NBTStorage.isValid(disk) && NBTStorage.getStoredFromNBT(disk.getTagCompound()) == 0 && disk.getMetadata() != TYPE_CREATIVE) { + ItemStack storagePart = new ItemStack(RefinedStorageItems.STORAGE_PART, 1, disk.getMetadata()); if (!player.inventory.addItemStackToInventory(storagePart.copy())) { InventoryHelper.spawnItemStack(world, player.getPosition().getX(), player.getPosition().getY(), player.getPosition().getZ(), storagePart); @@ -114,7 +116,7 @@ public class ItemStorageDisk extends ItemBase { return new ActionResult(EnumActionResult.SUCCESS, new ItemStack(RefinedStorageItems.STORAGE_HOUSING)); } - return new ActionResult(EnumActionResult.PASS, stack); + return new ActionResult(EnumActionResult.PASS, disk); } @Override diff --git a/src/main/java/refinedstorage/network/MessageGridCraftingStart.java b/src/main/java/refinedstorage/network/MessageGridCraftingStart.java index 4c09de335..e0d610f9e 100755 --- a/src/main/java/refinedstorage/network/MessageGridCraftingStart.java +++ b/src/main/java/refinedstorage/network/MessageGridCraftingStart.java @@ -3,33 +3,31 @@ package refinedstorage.network; import io.netty.buffer.ByteBuf; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.inventory.Container; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fml.common.network.ByteBufUtils; import net.minecraftforge.fml.common.network.simpleimpl.IMessage; import refinedstorage.api.network.IGridHandler; import refinedstorage.container.ContainerGrid; public class MessageGridCraftingStart extends MessageHandlerPlayerToServer implements IMessage { - private ItemStack stack; + private int id; private int quantity; public MessageGridCraftingStart() { } - public MessageGridCraftingStart(ItemStack stack, int quantity) { - this.stack = stack; + public MessageGridCraftingStart(int id, int quantity) { + this.id = id; this.quantity = quantity; } @Override public void fromBytes(ByteBuf buf) { - stack = ByteBufUtils.readItemStack(buf); + id = buf.readInt(); quantity = buf.readInt(); } @Override public void toBytes(ByteBuf buf) { - ByteBufUtils.writeItemStack(buf, stack); + buf.writeInt(id); buf.writeInt(quantity); } @@ -41,7 +39,7 @@ public class MessageGridCraftingStart extends MessageHandlerPlayerToServer { + private INetworkMaster network; private ItemStack stack; private int delta; - private boolean craftable; + + private ClientStack clientStack; public MessageGridDelta() { } - public MessageGridDelta(ItemStack stack, int delta, boolean craftable) { + public MessageGridDelta(INetworkMaster network, ItemStack stack, int delta) { + this.network = network; this.stack = stack; this.delta = delta; - this.craftable = craftable; } @Override public void fromBytes(ByteBuf buf) { - stack = ByteBufUtils.readItemStack(buf); + clientStack = new ClientStack(buf); delta = buf.readInt(); - craftable = buf.readBoolean(); } @Override public void toBytes(ByteBuf buf) { - ByteBufUtils.writeItemStack(buf, stack); + ClientStack.write(buf, network, stack); buf.writeInt(delta); - buf.writeBoolean(craftable); } @Override public IMessage onMessage(MessageGridDelta message, MessageContext ctx) { - for (ItemStack stack : RefinedStorage.INSTANCE.items) { - if (RefinedStorageUtils.compareStackNoQuantity(stack, message.stack)) { - if (stack.stackSize + message.delta == 0 && !message.craftable) { + for (ClientStack stack : RefinedStorage.INSTANCE.items) { + if (stack.equals(message.clientStack)) { + if (stack.getStack().stackSize + message.delta == 0 && !message.clientStack.isCraftable()) { RefinedStorage.INSTANCE.items.remove(stack); } else { - stack.stackSize += message.delta; + stack.getStack().stackSize += message.delta; } return null; } } - RefinedStorage.INSTANCE.items.add(ItemHandlerHelper.copyStackWithSize(message.stack, message.delta)); + RefinedStorage.INSTANCE.items.add(message.clientStack); return null; } diff --git a/src/main/java/refinedstorage/network/MessageGridPull.java b/src/main/java/refinedstorage/network/MessageGridPull.java index 9e3b7c088..fae730e05 100755 --- a/src/main/java/refinedstorage/network/MessageGridPull.java +++ b/src/main/java/refinedstorage/network/MessageGridPull.java @@ -3,33 +3,31 @@ package refinedstorage.network; import io.netty.buffer.ByteBuf; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.inventory.Container; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fml.common.network.ByteBufUtils; import net.minecraftforge.fml.common.network.simpleimpl.IMessage; import refinedstorage.api.network.IGridHandler; import refinedstorage.container.ContainerGrid; public class MessageGridPull extends MessageHandlerPlayerToServer implements IMessage { - private ItemStack stack; + private int id; private int flags; public MessageGridPull() { } - public MessageGridPull(ItemStack stack, int flags) { - this.stack = stack; + public MessageGridPull(int id, int flags) { + this.id = id; this.flags = flags; } @Override public void fromBytes(ByteBuf buf) { - stack = ByteBufUtils.readItemStack(buf); + id = buf.readInt(); flags = buf.readInt(); } @Override public void toBytes(ByteBuf buf) { - ByteBufUtils.writeItemStack(buf, stack); + buf.writeInt(id); buf.writeInt(flags); } @@ -41,7 +39,7 @@ public class MessageGridPull extends MessageHandlerPlayerToServer { private INetworkMaster network; - private List items = new ArrayList(); + private List items = new ArrayList(); public MessageGridUpdate() { } @@ -28,10 +28,7 @@ public class MessageGridUpdate implements IMessage, IMessageHandler implements IMessage { + private int x; + private int y; + private int z; + + public MessageProcessingPatternEncoderClear() { + } + + public MessageProcessingPatternEncoderClear(TileProcessingPatternEncoder processingPatternEncoder) { + this.x = processingPatternEncoder.getPos().getX(); + this.y = processingPatternEncoder.getPos().getY(); + this.z = processingPatternEncoder.getPos().getZ(); + } + + @Override + public void fromBytes(ByteBuf buf) { + x = buf.readInt(); + y = buf.readInt(); + z = buf.readInt(); + } + + @Override + public void toBytes(ByteBuf buf) { + buf.writeInt(x); + buf.writeInt(y); + buf.writeInt(z); + } + + @Override + public void handle(MessageProcessingPatternEncoderClear message, EntityPlayerMP player) { + TileEntity tile = player.worldObj.getTileEntity(new BlockPos(message.x, message.y, message.z)); + + if (tile instanceof TileProcessingPatternEncoder) { + TileProcessingPatternEncoder processingPatternEncoder = (TileProcessingPatternEncoder) tile; + + for (int i = 0; i < processingPatternEncoder.getConfiguration().getSlots(); ++i) { + processingPatternEncoder.getConfiguration().setStackInSlot(i, null); + } + } + } +} + diff --git a/src/main/java/refinedstorage/proxy/ClientProxy.java b/src/main/java/refinedstorage/proxy/ClientProxy.java index 9df90ace4..51a02b210 100755 --- a/src/main/java/refinedstorage/proxy/ClientProxy.java +++ b/src/main/java/refinedstorage/proxy/ClientProxy.java @@ -104,7 +104,8 @@ public class ClientProxy extends CommonProxy { // Blocks ModelLoader.setCustomStateMapper(RefinedStorageBlocks.GRID, (new StateMap.Builder()) .ignore(RefinedStorageBlocks.GRID.TYPE) - .build()); + .build() + ); 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", "inventory")); diff --git a/src/main/java/refinedstorage/proxy/CommonProxy.java b/src/main/java/refinedstorage/proxy/CommonProxy.java index 6a3123093..8383ba7fe 100755 --- a/src/main/java/refinedstorage/proxy/CommonProxy.java +++ b/src/main/java/refinedstorage/proxy/CommonProxy.java @@ -57,6 +57,7 @@ public class CommonProxy { RefinedStorage.INSTANCE.network.registerMessage(MessageCraftingMonitorCancel.class, MessageCraftingMonitorCancel.class, id++, Side.SERVER); RefinedStorage.INSTANCE.network.registerMessage(MessageGridUpdate.class, MessageGridUpdate.class, id++, Side.CLIENT); RefinedStorage.INSTANCE.network.registerMessage(MessageGridDelta.class, MessageGridDelta.class, id++, Side.CLIENT); + RefinedStorage.INSTANCE.network.registerMessage(MessageProcessingPatternEncoderClear.class, MessageProcessingPatternEncoderClear.class, id++, Side.SERVER); NetworkRegistry.INSTANCE.registerGuiHandler(RefinedStorage.INSTANCE, new GuiHandler()); @@ -309,7 +310,7 @@ public class CommonProxy { 'E', new ItemStack(RefinedStorageItems.QUARTZ_ENRICHED_IRON), 'D', new ItemStack(RefinedStorageItems.CORE, 1, ItemCore.TYPE_DESTRUCTION), 'R', new ItemStack(Items.REDSTONE), - 'M', new ItemStack(RefinedStorageBlocks.MACHINE_CASING), + 'M', new ItemStack(RefinedStorageBlocks.CABLE), 'I', new ItemStack(RefinedStorageItems.PROCESSOR, 1, ItemProcessor.TYPE_IMPROVED) ); @@ -321,7 +322,7 @@ public class CommonProxy { 'E', new ItemStack(RefinedStorageItems.QUARTZ_ENRICHED_IRON), 'C', new ItemStack(RefinedStorageItems.CORE, 1, ItemCore.TYPE_CONSTRUCTION), 'R', new ItemStack(Items.REDSTONE), - 'M', new ItemStack(RefinedStorageBlocks.MACHINE_CASING), + 'M', new ItemStack(RefinedStorageBlocks.CABLE), 'I', new ItemStack(RefinedStorageItems.PROCESSOR, 1, ItemProcessor.TYPE_IMPROVED) ); diff --git a/src/main/java/refinedstorage/tile/TileConstructor.java b/src/main/java/refinedstorage/tile/TileConstructor.java index 692268651..59b73e4d4 100755 --- a/src/main/java/refinedstorage/tile/TileConstructor.java +++ b/src/main/java/refinedstorage/tile/TileConstructor.java @@ -46,7 +46,7 @@ public class TileConstructor extends TileNode implements ICompareConfig { private int compare = 0; private IBlockState block; - private CraftingTaskScheduler scheduler = new CraftingTaskScheduler(); + private CraftingTaskScheduler scheduler = new CraftingTaskScheduler(this); @Override public int getEnergyUsage() { diff --git a/src/main/java/refinedstorage/tile/TileDiskDrive.java b/src/main/java/refinedstorage/tile/TileDiskDrive.java index cc5972dfb..2ff45cb73 100755 --- a/src/main/java/refinedstorage/tile/TileDiskDrive.java +++ b/src/main/java/refinedstorage/tile/TileDiskDrive.java @@ -6,6 +6,8 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumFacing; import net.minecraftforge.common.capabilities.Capability; +import net.minecraftforge.fml.common.FMLCommonHandler; +import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.items.CapabilityItemHandler; import net.minecraftforge.items.IItemHandler; import net.minecraftforge.items.ItemHandlerHelper; @@ -51,21 +53,31 @@ public class TileDiskDrive extends TileNode implements IStorageProvider, IStorag private static final String NBT_MODE = "Mode"; private static final String NBT_STORED = "Stored"; - private BasicItemHandler disks = new BasicItemHandler(8, this, new BasicItemValidator(RefinedStorageItems.STORAGE_DISK)) { + private BasicItemHandler disks = new BasicItemHandler(8, this, new BasicItemValidator(RefinedStorageItems.STORAGE_DISK) { + @Override + public boolean isValid(ItemStack disk) { + return super.isValid(disk) && NBTStorage.isValid(disk); + } + }) { @Override protected void onContentsChanged(int slot) { super.onContentsChanged(slot); - ItemStack disk = getStackInSlot(slot); + /** + * Can't use {@link net.minecraft.world.World#isRemote} here because when {@link TileDiskDrive#readFromNBT(NBTTagCompound)} is called there is no world set yet. + */ + if (FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER) { + ItemStack disk = getStackInSlot(slot); - if (disk == null) { - storages[slot] = null; - } else { - storages[slot] = new Storage(disk); - } + if (disk == null) { + storages[slot] = null; + } else { + storages[slot] = new Storage(disk); + } - if (network != null) { - network.getStorage().rebuild(); + if (network != null) { + network.getStorage().rebuild(); + } } } diff --git a/src/main/java/refinedstorage/tile/TileExporter.java b/src/main/java/refinedstorage/tile/TileExporter.java index d3693e9c4..808975969 100755 --- a/src/main/java/refinedstorage/tile/TileExporter.java +++ b/src/main/java/refinedstorage/tile/TileExporter.java @@ -33,7 +33,7 @@ public class TileExporter extends TileNode implements ICompareConfig { private int compare = 0; - private CraftingTaskScheduler scheduler = new CraftingTaskScheduler(); + private CraftingTaskScheduler scheduler = new CraftingTaskScheduler(this); @Override public int getEnergyUsage() { diff --git a/src/main/java/refinedstorage/tile/TileWirelessTransmitter.java b/src/main/java/refinedstorage/tile/TileWirelessTransmitter.java index 098900c02..b92221410 100755 --- a/src/main/java/refinedstorage/tile/TileWirelessTransmitter.java +++ b/src/main/java/refinedstorage/tile/TileWirelessTransmitter.java @@ -68,6 +68,11 @@ public class TileWirelessTransmitter extends TileNode implements IWirelessTransm return upgrades; } + @Override + public boolean canConduct() { + return false; + } + @Override public T getCapability(Capability capability, EnumFacing facing) { if (capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) { diff --git a/src/main/java/refinedstorage/tile/controller/TileController.java b/src/main/java/refinedstorage/tile/controller/TileController.java index 22f6a9ee7..af94298e1 100755 --- a/src/main/java/refinedstorage/tile/controller/TileController.java +++ b/src/main/java/refinedstorage/tile/controller/TileController.java @@ -31,6 +31,7 @@ import refinedstorage.api.network.IGridHandler; import refinedstorage.api.network.INetworkMaster; import refinedstorage.api.network.INetworkNode; import refinedstorage.api.network.IWirelessGridHandler; +import refinedstorage.api.storage.CompareFlags; import refinedstorage.api.storage.IGroupedStorage; import refinedstorage.api.storage.IStorage; import refinedstorage.apiimpl.autocrafting.BasicCraftingTask; @@ -168,19 +169,7 @@ public class TileController extends TileBase implements INetworkMaster, IEnergyR craftingTasksToAddAsLast.clear(); - if (!craftingTasks.empty()) { - markDirty(); - - ICraftingTask top = craftingTasks.peek(); - - ICraftingPatternContainer container = top.getPattern().getContainer(worldObj); - - if (container != null && (ticks % container.getSpeed()) == 0 && top.update(worldObj, this)) { - top.onDone(this); - - craftingTasks.pop(); - } - } + updateTopCraftingTask(true); } wirelessGridHandler.update(); @@ -219,6 +208,22 @@ public class TileController extends TileBase implements INetworkMaster, IEnergyR super.update(); } + private void updateTopCraftingTask(boolean withSpeed) { + if (!craftingTasks.empty()) { + markDirty(); + + ICraftingTask top = craftingTasks.peek(); + + ICraftingPatternContainer container = top.getPattern().getContainer(worldObj); + + if (container != null && (!withSpeed || (ticks % container.getSpeed()) == 0) && top.update(worldObj, this)) { + top.onDone(this); + + craftingTasks.pop(); + } + } + } + public void disconnectAll() { for (INetworkNode node : nodes) { if (node.isConnected()) { @@ -341,7 +346,7 @@ public class TileController extends TileBase implements INetworkMaster, IEnergyR int score = 0; for (ItemStack input : patterns.get(i).getInputs()) { - ItemStack stored = RefinedStorageUtils.getItem(this, input); + ItemStack stored = storage.get(input, CompareFlags.COMPARE_DAMAGE | CompareFlags.COMPARE_NBT); score += stored != null ? stored.stackSize : 0; } @@ -470,7 +475,7 @@ public class TileController extends TileBase implements INetworkMaster, IEnergyR public void sendStorageDeltaToClient(ItemStack stack, int delta) { for (EntityPlayer player : worldObj.playerEntities) { if (isWatchingGrid(player)) { - RefinedStorage.INSTANCE.network.sendTo(new MessageGridDelta(stack, delta, RefinedStorageUtils.hasPattern(this, stack)), (EntityPlayerMP) player); + RefinedStorage.INSTANCE.network.sendTo(new MessageGridDelta(this, stack, delta), (EntityPlayerMP) player); } } } @@ -493,7 +498,7 @@ public class TileController extends TileBase implements INetworkMaster, IEnergyR remainder = storage.insertItem(remainder, size, simulate); if (storage instanceof ExternalStorage && !simulate) { - ((ExternalStorage) storage).setHash(); + ((ExternalStorage) storage).updateCacheForcefully(); } if (remainder == null) { @@ -507,16 +512,14 @@ public class TileController extends TileBase implements INetworkMaster, IEnergyR if (!simulate && inserted > 0) { for (int i = 0; i < inserted; ++i) { - if (!craftingTasks.empty()) { - ICraftingTask top = craftingTasks.peek(); - - if (top instanceof ProcessingCraftingTask) { - ((ProcessingCraftingTask) top).onInserted(stack); + if (!craftingTasks.empty() && craftingTasks.peek() instanceof ProcessingCraftingTask) { + if (((ProcessingCraftingTask) craftingTasks.peek()).onInserted(stack)) { + updateTopCraftingTask(false); } } } - storage.add(ItemHandlerHelper.copyStackWithSize(stack, inserted)); + storage.add(ItemHandlerHelper.copyStackWithSize(stack, inserted), false); } return remainder; @@ -532,11 +535,11 @@ public class TileController extends TileBase implements INetworkMaster, IEnergyR for (IStorage storage : this.storage.getStorages()) { ItemStack took = storage.extractItem(stack, requested - received, flags); - if (storage instanceof ExternalStorage) { - ((ExternalStorage) storage).setHash(); - } - if (took != null) { + if (storage instanceof ExternalStorage) { + ((ExternalStorage) storage).updateCacheForcefully(); + } + if (newStack == null) { newStack = took; } else { diff --git a/src/main/java/refinedstorage/tile/externalstorage/DeepStorageUnitStorage.java b/src/main/java/refinedstorage/tile/externalstorage/DeepStorageUnitStorage.java index f3372e4b0..3ed8b7352 100755 --- a/src/main/java/refinedstorage/tile/externalstorage/DeepStorageUnitStorage.java +++ b/src/main/java/refinedstorage/tile/externalstorage/DeepStorageUnitStorage.java @@ -17,8 +17,6 @@ public class DeepStorageUnitStorage extends ExternalStorage { public DeepStorageUnitStorage(TileExternalStorage externalStorage, IDeepStorageUnit unit) { this.externalStorage = externalStorage; this.unit = unit; - - setHash(); } @Override @@ -26,11 +24,6 @@ public class DeepStorageUnitStorage extends ExternalStorage { return unit.getMaxStoredCount(); } - @Override - public int getHash() { - return RefinedStorageUtils.getItemStackHashCode(unit.getStoredItemType()); - } - @Override public List getItems() { if (unit.getStoredItemType() != null && unit.getStoredItemType().stackSize > 0) { diff --git a/src/main/java/refinedstorage/tile/externalstorage/DrawerStorage.java b/src/main/java/refinedstorage/tile/externalstorage/DrawerStorage.java index 3f0666aab..c25924744 100755 --- a/src/main/java/refinedstorage/tile/externalstorage/DrawerStorage.java +++ b/src/main/java/refinedstorage/tile/externalstorage/DrawerStorage.java @@ -17,8 +17,6 @@ public class DrawerStorage extends ExternalStorage { public DrawerStorage(TileExternalStorage externalStorage, IDrawer drawer) { this.externalStorage = externalStorage; this.drawer = drawer; - - setHash(); } @Override @@ -26,11 +24,6 @@ public class DrawerStorage extends ExternalStorage { return drawer.getMaxCapacity(); } - @Override - public int getHash() { - return RefinedStorageUtils.getItemStackHashCode(drawer.getStoredItemPrototype(), drawer.getStoredItemCount()); - } - @Override public List getItems() { if (!drawer.isEmpty() && drawer.getStoredItemCount() > 0) { diff --git a/src/main/java/refinedstorage/tile/externalstorage/ExternalStorage.java b/src/main/java/refinedstorage/tile/externalstorage/ExternalStorage.java index 59b8a9b1e..19f7832c5 100755 --- a/src/main/java/refinedstorage/tile/externalstorage/ExternalStorage.java +++ b/src/main/java/refinedstorage/tile/externalstorage/ExternalStorage.java @@ -1,25 +1,39 @@ package refinedstorage.tile.externalstorage; +import net.minecraft.item.ItemStack; +import refinedstorage.RefinedStorageUtils; import refinedstorage.api.storage.IStorage; +import java.util.List; + public abstract class ExternalStorage implements IStorage { - private int hash = -1; + private List cache; public abstract int getCapacity(); - public void setHash() { - this.hash = getHash(); - } + public boolean updateCache() { + List items = getItems(); - public abstract int getHash(); - - public boolean isDirty() { - if (hash != -1 && hash != getHash()) { - hash = getHash(); + if (cache == null) { + cache = items; + } else if (items.size() != cache.size()) { + cache = items; return true; + } else { + for (int i = 0; i < items.size(); ++i) { + if (!RefinedStorageUtils.compareStack(items.get(i), cache.get(i))) { + cache = items; + + return true; + } + } } return false; } + + public void updateCacheForcefully() { + cache = getItems(); + } } diff --git a/src/main/java/refinedstorage/tile/externalstorage/ItemHandlerStorage.java b/src/main/java/refinedstorage/tile/externalstorage/ItemHandlerStorage.java index aa1309d80..f56af7c1e 100755 --- a/src/main/java/refinedstorage/tile/externalstorage/ItemHandlerStorage.java +++ b/src/main/java/refinedstorage/tile/externalstorage/ItemHandlerStorage.java @@ -16,8 +16,6 @@ public class ItemHandlerStorage extends ExternalStorage { public ItemHandlerStorage(TileExternalStorage externalStorage, IItemHandler handler) { this.externalStorage = externalStorage; this.handler = handler; - - setHash(); } @Override @@ -25,19 +23,6 @@ public class ItemHandlerStorage extends ExternalStorage { return handler.getSlots() * 64; } - @Override - public int getHash() { - int code = 0; - - for (int i = 0; i < handler.getSlots(); ++i) { - if (handler.getStackInSlot(i) != null && handler.getStackInSlot(i).getItem() != null) { - code += RefinedStorageUtils.getItemStackHashCode(handler.getStackInSlot(i)); - } - } - - return code; - } - @Override public List getItems() { List items = new ArrayList(); diff --git a/src/main/java/refinedstorage/tile/externalstorage/TileExternalStorage.java b/src/main/java/refinedstorage/tile/externalstorage/TileExternalStorage.java index e7044a3ee..d22304d3d 100755 --- a/src/main/java/refinedstorage/tile/externalstorage/TileExternalStorage.java +++ b/src/main/java/refinedstorage/tile/externalstorage/TileExternalStorage.java @@ -64,11 +64,17 @@ public class TileExternalStorage extends TileNode implements IStorageProvider, I @Override public void update() { if (!worldObj.isRemote && network != null) { - for (ExternalStorage storage : storages) { - if (storage.isDirty()) { - updateStorage(network); + if (ticks % (20 * 4) == 0) { + boolean shouldRebuild = false; - break; + for (ExternalStorage storage : storages) { + if (storage.updateCache()) { + shouldRebuild = true; + } + } + + if (shouldRebuild) { + network.getStorage().rebuild(); } } diff --git a/src/main/java/refinedstorage/tile/grid/TileGrid.java b/src/main/java/refinedstorage/tile/grid/TileGrid.java index 3e6df548f..eb8145489 100755 --- a/src/main/java/refinedstorage/tile/grid/TileGrid.java +++ b/src/main/java/refinedstorage/tile/grid/TileGrid.java @@ -126,15 +126,23 @@ public class TileGrid extends TileNode implements IGrid { result.setInventorySlotContents(0, CraftingManager.getInstance().findMatchingRecipe(matrix, worldObj)); } - public void onCrafted() { + public void onCrafted(EntityPlayer player) { ItemStack[] remainder = CraftingManager.getInstance().getRemainingItems(matrix, worldObj); for (int i = 0; i < matrix.getSizeInventory(); ++i) { - if (i < remainder.length && remainder[i] != null) { - matrix.setInventorySlotContents(i, remainder[i].copy()); - } else { - ItemStack slot = matrix.getStackInSlot(i); + ItemStack slot = matrix.getStackInSlot(i); + if (i < remainder.length && remainder[i] != null) { + if (slot != null && slot.stackSize > 1) { + if (!player.inventory.addItemStackToInventory(remainder[i].copy())) { + InventoryHelper.spawnItemStack(player.worldObj, player.getPosition().getX(), player.getPosition().getY(), player.getPosition().getZ(), remainder[i].copy()); + } + + matrix.decrStackSize(i, 1); + } else { + matrix.setInventorySlotContents(i, remainder[i].copy()); + } + } else { if (slot != null) { if (slot.stackSize == 1 && isConnected()) { matrix.setInventorySlotContents(i, RefinedStorageUtils.extractItem(network, slot, 1)); @@ -154,7 +162,7 @@ public class TileGrid extends TileNode implements IGrid { ItemStack crafted = result.getStackInSlot(0); while (true) { - onCrafted(); + onCrafted(player); craftedItemsList.add(crafted.copy()); @@ -234,7 +242,7 @@ public class TileGrid extends TileNode implements IGrid { ItemStack took = RefinedStorageUtils.extractItem(network, possibility, 1); if (took != null) { - matrix.setInventorySlotContents(i, possibility); + matrix.setInventorySlotContents(i, took); break; } diff --git a/src/main/resources/assets/refinedstorage/blockstates/constructor.json b/src/main/resources/assets/refinedstorage/blockstates/constructor.json index 830825acf..147bb6734 100755 --- a/src/main/resources/assets/refinedstorage/blockstates/constructor.json +++ b/src/main/resources/assets/refinedstorage/blockstates/constructor.json @@ -1,38 +1,82 @@ { "forge_marker": 1, "defaults": { - "model": "orientable", "textures": { - "side": "refinedstorage:blocks/side", - "top": "refinedstorage:blocks/side", - "front": "refinedstorage:blocks/constructor" - } + "all": "refinedstorage:blocks/cable", + "particle": "refinedstorage:blocks/cable", + "front": "refinedstorage:blocks/constructor", + "line": "refinedstorage:blocks/importer_exporter_external_storage" + }, + "model": "refinedstorage:cable_core", + "uvlock": true }, "variants": { "inventory": [ { - "y": 0, + "model": "refinedstorage:constructor_destructor", "transform": "forge:default-block" } ], "direction": { "north": { - "y": 0 + "submodel": "refinedstorage:constructor_destructor_north" }, "east": { - "y": 90 + "submodel": "refinedstorage:constructor_destructor_east" }, "south": { - "y": 180 + "submodel": "refinedstorage:constructor_destructor_south" }, "west": { - "y": 270 + "submodel": "refinedstorage:constructor_destructor_west" }, "up": { - "x": 270 + "submodel": "refinedstorage:constructor_destructor_up" }, "down": { - "x": 90 + "submodel": "refinedstorage:constructor_destructor_down" + } + }, + "north": { + "true": { + "submodel": "refinedstorage:cable_north" + }, + "false": { + } + }, + "east": { + "true": { + "submodel": "refinedstorage:cable_east" + }, + "false": { + } + }, + "south": { + "true": { + "submodel": "refinedstorage:cable_south" + }, + "false": { + } + }, + "west": { + "true": { + "submodel": "refinedstorage:cable_west" + }, + "false": { + } + }, + "up": { + "true": { + "submodel": "refinedstorage:cable_up" + }, + "false": { + } + }, + "down": { + "true": { + "submodel": "refinedstorage:cable_down" + }, + "false": { } } } diff --git a/src/main/resources/assets/refinedstorage/blockstates/crafting_monitor.json b/src/main/resources/assets/refinedstorage/blockstates/crafting_monitor.json index dd86afd54..9b4d8f33a 100755 --- a/src/main/resources/assets/refinedstorage/blockstates/crafting_monitor.json +++ b/src/main/resources/assets/refinedstorage/blockstates/crafting_monitor.json @@ -5,7 +5,7 @@ "textures": { "side": "refinedstorage:blocks/side", "top": "refinedstorage:blocks/side", - "front": "refinedstorage:blocks/crafting_monitor" + "front": "refinedstorage:blocks/crafting_monitor_disconnected" } }, "variants": { @@ -15,6 +15,15 @@ "y": 0 } ], + "connected": { + "true": { + "textures": { + "front": "refinedstorage:blocks/crafting_monitor_connected" + } + }, + "false": { + } + }, "direction": { "north": { "y": 0 diff --git a/src/main/resources/assets/refinedstorage/blockstates/destructor.json b/src/main/resources/assets/refinedstorage/blockstates/destructor.json index c36786296..b8f2b82f7 100755 --- a/src/main/resources/assets/refinedstorage/blockstates/destructor.json +++ b/src/main/resources/assets/refinedstorage/blockstates/destructor.json @@ -1,38 +1,82 @@ { "forge_marker": 1, "defaults": { - "model": "orientable", "textures": { - "side": "refinedstorage:blocks/side", - "top": "refinedstorage:blocks/side", - "front": "refinedstorage:blocks/destructor" - } + "all": "refinedstorage:blocks/cable", + "particle": "refinedstorage:blocks/cable", + "front": "refinedstorage:blocks/destructor", + "line": "refinedstorage:blocks/importer_exporter_external_storage" + }, + "model": "refinedstorage:cable_core", + "uvlock": true }, "variants": { "inventory": [ { - "y": 0, + "model": "refinedstorage:constructor_destructor", "transform": "forge:default-block" } ], "direction": { "north": { - "y": 0 + "submodel": "refinedstorage:constructor_destructor_north" }, "east": { - "y": 90 + "submodel": "refinedstorage:constructor_destructor_east" }, "south": { - "y": 180 + "submodel": "refinedstorage:constructor_destructor_south" }, "west": { - "y": 270 + "submodel": "refinedstorage:constructor_destructor_west" }, "up": { - "x": 270 + "submodel": "refinedstorage:constructor_destructor_up" }, "down": { - "x": 90 + "submodel": "refinedstorage:constructor_destructor_down" + } + }, + "north": { + "true": { + "submodel": "refinedstorage:cable_north" + }, + "false": { + } + }, + "east": { + "true": { + "submodel": "refinedstorage:cable_east" + }, + "false": { + } + }, + "south": { + "true": { + "submodel": "refinedstorage:cable_south" + }, + "false": { + } + }, + "west": { + "true": { + "submodel": "refinedstorage:cable_west" + }, + "false": { + } + }, + "up": { + "true": { + "submodel": "refinedstorage:cable_up" + }, + "false": { + } + }, + "down": { + "true": { + "submodel": "refinedstorage:cable_down" + }, + "false": { } } } diff --git a/src/main/resources/assets/refinedstorage/blockstates/grid.json b/src/main/resources/assets/refinedstorage/blockstates/grid.json index e8da5155c..d7f25ab10 100755 --- a/src/main/resources/assets/refinedstorage/blockstates/grid.json +++ b/src/main/resources/assets/refinedstorage/blockstates/grid.json @@ -5,7 +5,7 @@ "textures": { "side": "refinedstorage:blocks/side", "top": "refinedstorage:blocks/side", - "front": "refinedstorage:blocks/grid" + "front": "refinedstorage:blocks/grid_disconnected" } }, "variants": { @@ -15,6 +15,15 @@ "y": 0 } ], + "connected": { + "true": { + "textures": { + "front": "refinedstorage:blocks/grid_connected" + } + }, + "false": { + } + }, "direction": { "north": { "y": 0 diff --git a/src/main/resources/assets/refinedstorage/blockstates/interface.json b/src/main/resources/assets/refinedstorage/blockstates/interface.json index bbe118c50..028bd4033 100755 --- a/src/main/resources/assets/refinedstorage/blockstates/interface.json +++ b/src/main/resources/assets/refinedstorage/blockstates/interface.json @@ -3,7 +3,7 @@ "defaults": { "model": "cube_all", "textures": { - "all": "refinedstorage:blocks/interface" + "all": "refinedstorage:blocks/interface_disconnected" } }, "variants": { @@ -12,8 +12,14 @@ "transform": "forge:default-block" } ], - "normal": { - "model": "cube_all" + "connected": { + "true": { + "textures": { + "all": "refinedstorage:blocks/interface_connected" + } + }, + "false": { + } } } } \ No newline at end of file diff --git a/src/main/resources/assets/refinedstorage/blockstates/solderer.json b/src/main/resources/assets/refinedstorage/blockstates/solderer.json index 6009430ca..11d8c6313 100755 --- a/src/main/resources/assets/refinedstorage/blockstates/solderer.json +++ b/src/main/resources/assets/refinedstorage/blockstates/solderer.json @@ -25,6 +25,26 @@ }, "false": { } + }, + "direction": { + "north": { + "y": 0 + }, + "east": { + "y": 90 + }, + "south": { + "y": 180 + }, + "west": { + "y": 270 + }, + "up": { + "x": 270 + }, + "down": { + "x": 90 + } } } } \ No newline at end of file diff --git a/src/main/resources/assets/refinedstorage/models/block/constructor_destructor.json b/src/main/resources/assets/refinedstorage/models/block/constructor_destructor.json new file mode 100755 index 000000000..ebf21ce0b --- /dev/null +++ b/src/main/resources/assets/refinedstorage/models/block/constructor_destructor.json @@ -0,0 +1,350 @@ +{ + "__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)", + "elements": [ + { + "name": "Line1", + "from": [ + 7.0, + 7.0, + 2.0 + ], + "to": [ + 9.0, + 9.0, + 6.0 + ], + "faces": { + "north": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 4.0, + 4.0 + ] + }, + "east": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 2.0, + 4.0 + ] + }, + "south": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 4.0, + 4.0 + ] + }, + "west": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 2.0, + 4.0 + ] + }, + "up": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 4.0, + 2.0 + ] + }, + "down": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 4.0, + 2.0 + ] + } + } + }, + { + "name": "Line2", + "from": [ + 0.0, + 0.0, + 0.0 + ], + "to": [ + 16.0, + 16.0, + 2.0 + ], + "faces": { + "north": { + "texture": "#front", + "uv": [ + 0.0, + 0.0, + 16.0, + 16.0 + ] + }, + "east": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 16.0, + 16.0 + ] + }, + "south": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 16.0, + 16.0 + ] + }, + "west": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 16.0, + 16.0 + ] + }, + "up": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 16.0, + 16.0 + ] + }, + "down": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 16.0, + 16.0 + ] + } + } + }, + { + "name": "Core", + "from": [ + 6.0, + 6.0, + 6.0 + ], + "to": [ + 10.0, + 10.0, + 10.0 + ], + "faces": { + "north": { + "texture": "#all", + "uv": [ + 4.0, + 4.0, + 8.0, + 8.0 + ] + }, + "east": { + "texture": "#all", + "uv": [ + 0.0, + 4.0, + 4.0, + 8.0 + ] + }, + "south": { + "texture": "#all", + "uv": [ + 12.0, + 4.0, + 16.0, + 8.0 + ] + }, + "west": { + "texture": "#all", + "uv": [ + 8.0, + 4.0, + 12.0, + 8.0 + ] + }, + "up": { + "texture": "#all", + "uv": [ + 8.0, + 4.0, + 4.0, + 0.0 + ] + }, + "down": { + "texture": "#all", + "uv": [ + 12.0, + 0.0, + 8.0, + 4.0 + ] + } + } + }, + { + "name": "East", + "from": [ + 10.0, + 6.0, + 6.0 + ], + "to": [ + 16.0, + 10.0, + 10.0 + ], + "faces": { + "north": { + "texture": "#all", + "uv": [ + 4.0, + 4.0, + 8.0, + 8.0 + ] + }, + "east": { + "texture": "#all", + "uv": [ + 0.0, + 4.0, + 4.0, + 8.0 + ] + }, + "south": { + "texture": "#all", + "uv": [ + 12.0, + 4.0, + 16.0, + 8.0 + ] + }, + "west": { + "texture": "#all", + "uv": [ + 8.0, + 4.0, + 12.0, + 8.0 + ] + }, + "up": { + "texture": "#all", + "uv": [ + 8.0, + 4.0, + 4.0, + 0.0 + ] + }, + "down": { + "texture": "#all", + "uv": [ + 12.0, + 0.0, + 8.0, + 4.0 + ] + } + } + }, + { + "name": "West", + "from": [ + 0.0, + 6.0, + 6.0 + ], + "to": [ + 6.0, + 10.0, + 10.0 + ], + "faces": { + "north": { + "texture": "#all", + "uv": [ + 4.0, + 4.0, + 8.0, + 8.0 + ] + }, + "east": { + "texture": "#all", + "uv": [ + 0.0, + 4.0, + 4.0, + 8.0 + ] + }, + "south": { + "texture": "#all", + "uv": [ + 12.0, + 4.0, + 16.0, + 8.0 + ] + }, + "west": { + "texture": "#all", + "uv": [ + 8.0, + 4.0, + 12.0, + 8.0 + ] + }, + "up": { + "texture": "#all", + "uv": [ + 8.0, + 4.0, + 4.0, + 0.0 + ] + }, + "down": { + "texture": "#all", + "uv": [ + 12.0, + 0.0, + 8.0, + 4.0 + ] + } + } + } + ] +} diff --git a/src/main/resources/assets/refinedstorage/models/block/constructor_destructor_down.json b/src/main/resources/assets/refinedstorage/models/block/constructor_destructor_down.json new file mode 100755 index 000000000..9f035e4b6 --- /dev/null +++ b/src/main/resources/assets/refinedstorage/models/block/constructor_destructor_down.json @@ -0,0 +1,145 @@ +{ + "__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)", + "textures": { + }, + "elements": [ + { + "name": "Line1", + "from": [ + 7.0, + 2.0, + 7.0 + ], + "to": [ + 9.0, + 6.0, + 9.0 + ], + "faces": { + "north": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 4.0, + 4.0 + ] + }, + "east": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 2.0, + 4.0 + ] + }, + "south": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 4.0, + 4.0 + ] + }, + "west": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 2.0, + 4.0 + ] + }, + "up": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 4.0, + 2.0 + ] + }, + "down": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 4.0, + 2.0 + ] + } + } + }, + { + "name": "Line2", + "from": [ + 0.0, + 0.0, + 0.0 + ], + "to": [ + 16.0, + 2.0, + 16.0 + ], + "faces": { + "north": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 16.0, + 16.0 + ] + }, + "east": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 16.0, + 16.0 + ] + }, + "south": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 16.0, + 16.0 + ] + }, + "west": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 16.0, + 16.0 + ] + }, + "up": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 16.0, + 16.0 + ] + }, + "down": { + "texture": "#front", + "uv": [ + 0.0, + 0.0, + 16.0, + 16.0 + ] + } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/refinedstorage/models/block/constructor_destructor_east.json b/src/main/resources/assets/refinedstorage/models/block/constructor_destructor_east.json new file mode 100755 index 000000000..40b6af3cd --- /dev/null +++ b/src/main/resources/assets/refinedstorage/models/block/constructor_destructor_east.json @@ -0,0 +1,145 @@ +{ + "__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)", + "textures": { + }, + "elements": [ + { + "name": "Line1", + "from": [ + 10.0, + 7.0, + 7.0 + ], + "to": [ + 14.0, + 9.0, + 9.0 + ], + "faces": { + "north": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 4.0, + 4.0 + ] + }, + "east": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 2.0, + 4.0 + ] + }, + "south": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 4.0, + 4.0 + ] + }, + "west": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 2.0, + 4.0 + ] + }, + "up": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 4.0, + 2.0 + ] + }, + "down": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 4.0, + 2.0 + ] + } + } + }, + { + "name": "Line2", + "from": [ + 14.0, + 0.0, + 0.0 + ], + "to": [ + 16.0, + 16.0, + 16.0 + ], + "faces": { + "north": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 16.0, + 16.0 + ] + }, + "east": { + "texture": "#front", + "uv": [ + 0.0, + 0.0, + 16.0, + 16.0 + ] + }, + "south": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 16.0, + 16.0 + ] + }, + "west": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 16.0, + 16.0 + ] + }, + "up": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 16.0, + 16.0 + ] + }, + "down": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 16.0, + 16.0 + ] + } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/refinedstorage/models/block/constructor_destructor_north.json b/src/main/resources/assets/refinedstorage/models/block/constructor_destructor_north.json new file mode 100755 index 000000000..6d505f45e --- /dev/null +++ b/src/main/resources/assets/refinedstorage/models/block/constructor_destructor_north.json @@ -0,0 +1,145 @@ +{ + "__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)", + "textures": { + }, + "elements": [ + { + "name": "Line1", + "from": [ + 7.0, + 7.0, + 2.0 + ], + "to": [ + 9.0, + 9.0, + 6.0 + ], + "faces": { + "north": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 4.0, + 4.0 + ] + }, + "east": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 2.0, + 4.0 + ] + }, + "south": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 4.0, + 4.0 + ] + }, + "west": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 2.0, + 4.0 + ] + }, + "up": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 4.0, + 2.0 + ] + }, + "down": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 4.0, + 2.0 + ] + } + } + }, + { + "name": "Line2", + "from": [ + 0.0, + 0.0, + 0.0 + ], + "to": [ + 16.0, + 16.0, + 2.0 + ], + "faces": { + "north": { + "texture": "#front", + "uv": [ + 0.0, + 0.0, + 16.0, + 16.0 + ] + }, + "east": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 16.0, + 16.0 + ] + }, + "south": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 16.0, + 16.0 + ] + }, + "west": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 16.0, + 16.0 + ] + }, + "up": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 16.0, + 16.0 + ] + }, + "down": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 16.0, + 16.0 + ] + } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/refinedstorage/models/block/constructor_destructor_south.json b/src/main/resources/assets/refinedstorage/models/block/constructor_destructor_south.json new file mode 100755 index 000000000..3f803eb7f --- /dev/null +++ b/src/main/resources/assets/refinedstorage/models/block/constructor_destructor_south.json @@ -0,0 +1,145 @@ +{ + "__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)", + "textures": { + }, + "elements": [ + { + "name": "Line1", + "from": [ + 7.0, + 7.0, + 10.0 + ], + "to": [ + 9.0, + 9.0, + 14.0 + ], + "faces": { + "north": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 4.0, + 4.0 + ] + }, + "east": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 2.0, + 4.0 + ] + }, + "south": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 4.0, + 4.0 + ] + }, + "west": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 2.0, + 4.0 + ] + }, + "up": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 4.0, + 2.0 + ] + }, + "down": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 4.0, + 2.0 + ] + } + } + }, + { + "name": "Line2", + "from": [ + 0.0, + 0.0, + 14.0 + ], + "to": [ + 16.0, + 16.0, + 16.0 + ], + "faces": { + "north": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 16.0, + 16.0 + ] + }, + "east": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 16.0, + 16.0 + ] + }, + "south": { + "texture": "#front", + "uv": [ + 0.0, + 0.0, + 16.0, + 16.0 + ] + }, + "west": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 16.0, + 16.0 + ] + }, + "up": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 16.0, + 16.0 + ] + }, + "down": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 16.0, + 16.0 + ] + } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/refinedstorage/models/block/constructor_destructor_up.json b/src/main/resources/assets/refinedstorage/models/block/constructor_destructor_up.json new file mode 100755 index 000000000..0fcd3795d --- /dev/null +++ b/src/main/resources/assets/refinedstorage/models/block/constructor_destructor_up.json @@ -0,0 +1,145 @@ +{ + "__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)", + "textures": { + }, + "elements": [ + { + "name": "Line1", + "from": [ + 7.0, + 10.0, + 7.0 + ], + "to": [ + 9.0, + 14.0, + 9.0 + ], + "faces": { + "north": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 4.0, + 4.0 + ] + }, + "east": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 2.0, + 4.0 + ] + }, + "south": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 4.0, + 4.0 + ] + }, + "west": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 2.0, + 4.0 + ] + }, + "up": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 4.0, + 2.0 + ] + }, + "down": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 4.0, + 2.0 + ] + } + } + }, + { + "name": "Line2", + "from": [ + 0.0, + 14.0, + 0.0 + ], + "to": [ + 16.0, + 16.0, + 16.0 + ], + "faces": { + "north": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 16.0, + 16.0 + ] + }, + "east": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 16.0, + 16.0 + ] + }, + "south": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 16.0, + 16.0 + ] + }, + "west": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 16.0, + 10.0 + ] + }, + "up": { + "texture": "#front", + "uv": [ + 0.0, + 0.0, + 16.0, + 16.0 + ] + }, + "down": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 16.0, + 16.0 + ] + } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/refinedstorage/models/block/constructor_destructor_west.json b/src/main/resources/assets/refinedstorage/models/block/constructor_destructor_west.json new file mode 100755 index 000000000..fd17c53e4 --- /dev/null +++ b/src/main/resources/assets/refinedstorage/models/block/constructor_destructor_west.json @@ -0,0 +1,145 @@ +{ + "__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)", + "textures": { + }, + "elements": [ + { + "name": "Line1", + "from": [ + 2.0, + 7.0, + 7.0 + ], + "to": [ + 6.0, + 9.0, + 9.0 + ], + "faces": { + "north": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 4.0, + 4.0 + ] + }, + "east": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 2.0, + 4.0 + ] + }, + "south": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 4.0, + 4.0 + ] + }, + "west": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 2.0, + 4.0 + ] + }, + "up": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 4.0, + 2.0 + ] + }, + "down": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 4.0, + 2.0 + ] + } + } + }, + { + "name": "Line2", + "from": [ + 0.0, + 0.0, + 0.0 + ], + "to": [ + 2.0, + 16.0, + 16.0 + ], + "faces": { + "north": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 16.0, + 16.0 + ] + }, + "east": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 16.0, + 16.0 + ] + }, + "south": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 16.0, + 16.0 + ] + }, + "west": { + "texture": "#front", + "uv": [ + 0.0, + 0.0, + 16.0, + 16.0 + ] + }, + "up": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 16.0, + 16.0 + ] + }, + "down": { + "texture": "#line", + "uv": [ + 0.0, + 0.0, + 16.0, + 16.0 + ] + } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/refinedstorage/textures/blocks/16k_storage_block.png b/src/main/resources/assets/refinedstorage/textures/blocks/16k_storage_block.png index 91b0eb20e..9b007f0b4 100755 Binary files a/src/main/resources/assets/refinedstorage/textures/blocks/16k_storage_block.png and b/src/main/resources/assets/refinedstorage/textures/blocks/16k_storage_block.png differ diff --git a/src/main/resources/assets/refinedstorage/textures/blocks/1k_storage_block.png b/src/main/resources/assets/refinedstorage/textures/blocks/1k_storage_block.png index dc7662154..e69c21afa 100755 Binary files a/src/main/resources/assets/refinedstorage/textures/blocks/1k_storage_block.png and b/src/main/resources/assets/refinedstorage/textures/blocks/1k_storage_block.png differ diff --git a/src/main/resources/assets/refinedstorage/textures/blocks/4k_storage_block.png b/src/main/resources/assets/refinedstorage/textures/blocks/4k_storage_block.png index 4f42da994..5bd206ac9 100755 Binary files a/src/main/resources/assets/refinedstorage/textures/blocks/4k_storage_block.png and b/src/main/resources/assets/refinedstorage/textures/blocks/4k_storage_block.png differ diff --git a/src/main/resources/assets/refinedstorage/textures/blocks/64k_storage_block.png b/src/main/resources/assets/refinedstorage/textures/blocks/64k_storage_block.png index d120a0729..770e2656c 100755 Binary files a/src/main/resources/assets/refinedstorage/textures/blocks/64k_storage_block.png and b/src/main/resources/assets/refinedstorage/textures/blocks/64k_storage_block.png differ diff --git a/src/main/resources/assets/refinedstorage/textures/blocks/constructor.png b/src/main/resources/assets/refinedstorage/textures/blocks/constructor.png index 1f97a5617..44719621a 100755 Binary files a/src/main/resources/assets/refinedstorage/textures/blocks/constructor.png and b/src/main/resources/assets/refinedstorage/textures/blocks/constructor.png differ diff --git a/src/main/resources/assets/refinedstorage/textures/blocks/crafting_monitor.png b/src/main/resources/assets/refinedstorage/textures/blocks/crafting_monitor_connected.png similarity index 100% rename from src/main/resources/assets/refinedstorage/textures/blocks/crafting_monitor.png rename to src/main/resources/assets/refinedstorage/textures/blocks/crafting_monitor_connected.png diff --git a/src/main/resources/assets/refinedstorage/textures/blocks/creative_storage_block.png b/src/main/resources/assets/refinedstorage/textures/blocks/creative_storage_block.png index 7390afd4b..550df8c68 100755 Binary files a/src/main/resources/assets/refinedstorage/textures/blocks/creative_storage_block.png and b/src/main/resources/assets/refinedstorage/textures/blocks/creative_storage_block.png differ diff --git a/src/main/resources/assets/refinedstorage/textures/blocks/destructor.png b/src/main/resources/assets/refinedstorage/textures/blocks/destructor.png index 8595ea11e..21033289f 100755 Binary files a/src/main/resources/assets/refinedstorage/textures/blocks/destructor.png and b/src/main/resources/assets/refinedstorage/textures/blocks/destructor.png differ diff --git a/src/main/resources/assets/refinedstorage/textures/blocks/grid.png b/src/main/resources/assets/refinedstorage/textures/blocks/grid_connected.png similarity index 100% rename from src/main/resources/assets/refinedstorage/textures/blocks/grid.png rename to src/main/resources/assets/refinedstorage/textures/blocks/grid_connected.png diff --git a/src/main/resources/assets/refinedstorage/textures/blocks/grid_disconnected.png b/src/main/resources/assets/refinedstorage/textures/blocks/grid_disconnected.png index 31d89c761..909631862 100644 Binary files a/src/main/resources/assets/refinedstorage/textures/blocks/grid_disconnected.png and b/src/main/resources/assets/refinedstorage/textures/blocks/grid_disconnected.png differ diff --git a/src/main/resources/assets/refinedstorage/textures/blocks/importer_exporter_external_storage.png b/src/main/resources/assets/refinedstorage/textures/blocks/importer_exporter_external_storage.png old mode 100644 new mode 100755 index 5783d502f..a0c07decf Binary files a/src/main/resources/assets/refinedstorage/textures/blocks/importer_exporter_external_storage.png and b/src/main/resources/assets/refinedstorage/textures/blocks/importer_exporter_external_storage.png differ diff --git a/src/main/resources/assets/refinedstorage/textures/blocks/interface_connected.png b/src/main/resources/assets/refinedstorage/textures/blocks/interface_connected.png new file mode 100755 index 000000000..24d133c7e Binary files /dev/null and b/src/main/resources/assets/refinedstorage/textures/blocks/interface_connected.png differ diff --git a/src/main/resources/assets/refinedstorage/textures/blocks/interface.png b/src/main/resources/assets/refinedstorage/textures/blocks/interface_disconnected.png similarity index 91% rename from src/main/resources/assets/refinedstorage/textures/blocks/interface.png rename to src/main/resources/assets/refinedstorage/textures/blocks/interface_disconnected.png index ac9291c8c..e3fa3c48d 100755 Binary files a/src/main/resources/assets/refinedstorage/textures/blocks/interface.png and b/src/main/resources/assets/refinedstorage/textures/blocks/interface_disconnected.png differ diff --git a/src/main/resources/assets/refinedstorage/textures/gui/processing_pattern_encoder.png b/src/main/resources/assets/refinedstorage/textures/gui/processing_pattern_encoder.png index d24f82b4d..f6fcdb0b5 100755 Binary files a/src/main/resources/assets/refinedstorage/textures/gui/processing_pattern_encoder.png and b/src/main/resources/assets/refinedstorage/textures/gui/processing_pattern_encoder.png differ diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info index a04dd7f32..8509f28dc 100755 --- a/src/main/resources/mcmod.info +++ b/src/main/resources/mcmod.info @@ -3,8 +3,8 @@ "modid": "refinedstorage", "name": "Refined Storage", "description": "A Minecraft mod all about storage.", - "version": "0.8.8", - "mcversion": "1.10", + "version": "0.8.11", + "mcversion": "1.10.2", "url": "", "updateUrl": "", "authorList": ["Refined Storage contributors"],