Merge pull request #2 from raoulvdberge/mc1.10

Update to master
This commit is contained in:
Mikael Rozee
2016-07-18 23:22:22 +01:00
committed by GitHub
79 changed files with 1912 additions and 313 deletions

View File

@@ -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**

View File

@@ -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 {

BIN
logo.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 154 KiB

After

Width:  |  Height:  |  Size: 158 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 161 KiB

After

Width:  |  Height:  |  Size: 178 KiB

View File

@@ -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<ItemStack> items = new ArrayList<ItemStack>();
public List<ClientStack> items = new ArrayList<ClientStack>();
public int cableUsage;
public int constructorUsage;

View File

@@ -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);
}
}

View File

@@ -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.

View File

@@ -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();
}

View File

@@ -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);
}

View File

@@ -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;
}
}

View File

@@ -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
*/

View File

@@ -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) {

View File

@@ -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

View File

@@ -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);

View File

@@ -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;
}
}

View File

@@ -22,8 +22,8 @@ public class WirelessGridHandler implements IWirelessGridHandler {
private INetworkMaster network;
private List<WirelessGridConsumer> consumers = new ArrayList<WirelessGridConsumer>();
private List<WirelessGridConsumer> consumersToRemove = new ArrayList<WirelessGridConsumer>();
private List<IWirelessGridConsumer> consumers = new ArrayList<IWirelessGridConsumer>();
private List<IWirelessGridConsumer> consumersToRemove = new ArrayList<IWirelessGridConsumer>();
public WirelessGridHandler(INetworkMaster network) {
this.network = network;
@@ -34,12 +34,12 @@ public class WirelessGridHandler implements IWirelessGridHandler {
consumers.removeAll(consumersToRemove);
consumersToRemove.clear();
Iterator<WirelessGridConsumer> it = consumers.iterator();
Iterator<IWirelessGridConsumer> 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<WirelessGridConsumer> it = consumers.iterator();
public IWirelessGridConsumer getConsumer(EntityPlayer player) {
Iterator<IWirelessGridConsumer> it = consumers.iterator();
while (it.hasNext()) {
WirelessGridConsumer consumer = it.next();
IWirelessGridConsumer consumer = it.next();
if (consumer.getPlayer() == player) {
return consumer;

View File

@@ -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));
}
}

View File

@@ -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<ItemStack> getStacks() {
return stacks.values();

View File

@@ -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()}

View File

@@ -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");
}

View File

@@ -30,4 +30,9 @@ public class BlockCraftingMonitor extends BlockNode {
return true;
}
@Override
public boolean hasConnectivityState() {
return true;
}
}

View File

@@ -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");
}

View File

@@ -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);

View File

@@ -31,6 +31,11 @@ public class BlockInterface extends BlockNode {
return true;
}
@Override
public boolean hasConnectivityState() {
return true;
}
@Override
public EnumPlacementType getPlacementType() {
return null;

View File

@@ -69,6 +69,6 @@ public class BlockSolderer extends BlockNode {
@Override
public EnumPlacementType getPlacementType() {
return null;
return EnumPlacementType.HORIZONTAL;
}
}

View File

@@ -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:

View File

@@ -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) {

View File

@@ -25,7 +25,7 @@ public class SlotGridCraftingResult extends SlotCrafting {
onCrafting(stack);
if (!player.worldObj.isRemote) {
grid.onCrafted();
grid.onCrafted(player);
container.sendCraftingSlots();
}

View File

@@ -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();
}

View File

@@ -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<ItemStack> quantityComparator = new Comparator<ItemStack>() {
private Comparator<ClientStack> quantityComparator = new Comparator<ClientStack>() {
@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<ItemStack> nameComparator = new Comparator<ItemStack>() {
private Comparator<ClientStack> nameComparator = new Comparator<ClientStack>() {
@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<ItemStack> items = new ArrayList<ItemStack>();
private List<ClientStack> items = new ArrayList<ClientStack>();
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<ItemStack> t = items.iterator();
Iterator<ClientStack> 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));
}
}
}

View File

@@ -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));
}
}

View File

@@ -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<ItemStack> 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<ItemStack> 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

View File

@@ -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<MessageGridCraftingStart> 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<Messa
IGridHandler handler = ((ContainerGrid) container).getGrid().getGridHandler();
if (handler != null) {
handler.onCraftingRequested(message.stack, message.quantity);
handler.onCraftingRequested(message.id, message.quantity);
}
}
}

View File

@@ -2,57 +2,56 @@ package refinedstorage.network;
import io.netty.buffer.ByteBuf;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.common.network.ByteBufUtils;
import net.minecraftforge.fml.common.network.simpleimpl.IMessage;
import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler;
import net.minecraftforge.fml.common.network.simpleimpl.MessageContext;
import net.minecraftforge.items.ItemHandlerHelper;
import refinedstorage.RefinedStorage;
import refinedstorage.RefinedStorageUtils;
import refinedstorage.api.network.INetworkMaster;
import refinedstorage.apiimpl.storage.ClientStack;
public class MessageGridDelta implements IMessage, IMessageHandler<MessageGridDelta, IMessage> {
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;
}

View File

@@ -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<MessageGridPull> 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<MessageGridPul
IGridHandler handler = ((ContainerGrid) container).getGrid().getGridHandler();
if (handler != null) {
handler.onExtract(message.stack, message.flags, player);
handler.onExtract(message.id, message.flags, player);
}
}
}

View File

@@ -2,19 +2,19 @@ package refinedstorage.network;
import io.netty.buffer.ByteBuf;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.common.network.ByteBufUtils;
import net.minecraftforge.fml.common.network.simpleimpl.IMessage;
import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler;
import net.minecraftforge.fml.common.network.simpleimpl.MessageContext;
import refinedstorage.RefinedStorage;
import refinedstorage.api.network.INetworkMaster;
import refinedstorage.apiimpl.storage.ClientStack;
import java.util.ArrayList;
import java.util.List;
public class MessageGridUpdate implements IMessage, IMessageHandler<MessageGridUpdate, IMessage> {
private INetworkMaster network;
private List<ItemStack> items = new ArrayList<ItemStack>();
private List<ClientStack> items = new ArrayList<ClientStack>();
public MessageGridUpdate() {
}
@@ -28,10 +28,7 @@ public class MessageGridUpdate implements IMessage, IMessageHandler<MessageGridU
int items = buf.readInt();
for (int i = 0; i < items; ++i) {
ItemStack stack = ByteBufUtils.readItemStack(buf);
stack.stackSize = buf.readInt();
this.items.add(stack);
this.items.add(new ClientStack(buf));
}
}
@@ -40,8 +37,7 @@ public class MessageGridUpdate implements IMessage, IMessageHandler<MessageGridU
buf.writeInt(network.getStorage().getStacks().size());
for (ItemStack stack : network.getStorage().getStacks()) {
ByteBufUtils.writeItemStack(buf, stack);
buf.writeInt(stack.stackSize);
ClientStack.write(buf, network, stack);
}
}

View File

@@ -0,0 +1,51 @@
package refinedstorage.network;
import io.netty.buffer.ByteBuf;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraftforge.fml.common.network.simpleimpl.IMessage;
import refinedstorage.tile.TileProcessingPatternEncoder;
public class MessageProcessingPatternEncoderClear extends MessageHandlerPlayerToServer<MessageProcessingPatternEncoderClear> 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);
}
}
}
}

View File

@@ -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"));

View File

@@ -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)
);

View File

@@ -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() {

View File

@@ -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();
}
}
}

View File

@@ -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() {

View File

@@ -68,6 +68,11 @@ public class TileWirelessTransmitter extends TileNode implements IWirelessTransm
return upgrades;
}
@Override
public boolean canConduct() {
return false;
}
@Override
public <T> T getCapability(Capability<T> capability, EnumFacing facing) {
if (capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) {

View File

@@ -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 {

View File

@@ -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<ItemStack> getItems() {
if (unit.getStoredItemType() != null && unit.getStoredItemType().stackSize > 0) {

View File

@@ -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<ItemStack> getItems() {
if (!drawer.isEmpty() && drawer.getStoredItemCount() > 0) {

View File

@@ -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<ItemStack> cache;
public abstract int getCapacity();
public void setHash() {
this.hash = getHash();
}
public boolean updateCache() {
List<ItemStack> 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();
}
}

View File

@@ -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<ItemStack> getItems() {
List<ItemStack> items = new ArrayList<ItemStack>();

View File

@@ -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();
}
}

View File

@@ -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;
}

View File

@@ -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": {
}
}
}

View File

@@ -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

View File

@@ -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": {
}
}
}

View File

@@ -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

View File

@@ -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": {
}
}
}
}

View File

@@ -25,6 +25,26 @@
},
"false": {
}
},
"direction": {
"north": {
"y": 0
},
"east": {
"y": 90
},
"south": {
"y": 180
},
"west": {
"y": 270
},
"up": {
"x": 270
},
"down": {
"x": 90
}
}
}
}

View File

@@ -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
]
}
}
}
]
}

View File

@@ -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
]
}
}
}
]
}

View File

@@ -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
]
}
}
}
]
}

View File

@@ -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
]
}
}
}
]
}

View File

@@ -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
]
}
}
}
]
}

View File

@@ -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
]
}
}
}
]
}

View File

@@ -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
]
}
}
}
]
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 820 B

After

Width:  |  Height:  |  Size: 795 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 810 B

After

Width:  |  Height:  |  Size: 784 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 817 B

After

Width:  |  Height:  |  Size: 803 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 800 B

After

Width:  |  Height:  |  Size: 769 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 752 B

After

Width:  |  Height:  |  Size: 811 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 833 B

After

Width:  |  Height:  |  Size: 808 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 757 B

After

Width:  |  Height:  |  Size: 712 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 726 B

After

Width:  |  Height:  |  Size: 726 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 512 B

After

Width:  |  Height:  |  Size: 202 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 785 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@@ -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"],