diff --git a/src/main/java/com/raoulvdberge/refinedstorage/block/BlockPortableGrid.java b/src/main/java/com/raoulvdberge/refinedstorage/block/BlockPortableGrid.java index d32386621..2ffe5019f 100644 --- a/src/main/java/com/raoulvdberge/refinedstorage/block/BlockPortableGrid.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/block/BlockPortableGrid.java @@ -4,6 +4,7 @@ import com.raoulvdberge.refinedstorage.RS; import com.raoulvdberge.refinedstorage.RSGui; import com.raoulvdberge.refinedstorage.item.ItemBlockPortableGrid; import com.raoulvdberge.refinedstorage.tile.grid.portable.TilePortableGrid; +import net.minecraft.block.properties.PropertyBool; import net.minecraft.block.properties.PropertyEnum; import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.IBlockState; @@ -27,6 +28,8 @@ public class BlockPortableGrid extends BlockBase { private static final AxisAlignedBB PORTABLE_GRID_AABB = new AxisAlignedBB(0, 0, 0, 1, 13.2F / 16F, 1); public static final PropertyEnum TYPE = PropertyEnum.create("type", PortableGridType.class); + public static final PropertyEnum DISK_STATE = PropertyEnum.create("disk_state", PortableGridDiskState.class); + public static final PropertyBool CONNECTED = PropertyBool.create("connected"); public BlockPortableGrid() { super("portable_grid"); @@ -89,10 +92,21 @@ public class BlockPortableGrid extends BlockBase { return drops; } + @Override + public IBlockState getActualState(IBlockState state, IBlockAccess world, BlockPos pos) { + TilePortableGrid portableGrid = (TilePortableGrid) world.getTileEntity(pos); + + return super.getActualState(state, world, pos) + .withProperty(DISK_STATE, portableGrid.getDiskState()) + .withProperty(CONNECTED, portableGrid.isConnected()); + } + @Override protected BlockStateContainer createBlockState() { return createBlockStateBuilder() .add(TYPE) + .add(DISK_STATE) + .add(CONNECTED) .build(); } diff --git a/src/main/java/com/raoulvdberge/refinedstorage/block/PortableGridDiskState.java b/src/main/java/com/raoulvdberge/refinedstorage/block/PortableGridDiskState.java new file mode 100644 index 000000000..0c3b81e1a --- /dev/null +++ b/src/main/java/com/raoulvdberge/refinedstorage/block/PortableGridDiskState.java @@ -0,0 +1,44 @@ +package com.raoulvdberge.refinedstorage.block; + +import net.minecraft.util.IStringSerializable; + +public enum PortableGridDiskState implements IStringSerializable { + NORMAL(0, "normal"), + NEAR_CAPACITY(1, "near_capacity"), + FULL(2, "full"), + DISCONNECTED(3, "disconnected"), + NONE(4, "none"); + + private int id; + private String type; + + PortableGridDiskState(int id, String type) { + this.id = id; + this.type = type; + } + + public int getId() { + return id; + } + + @Override + public String getName() { + return type; + } + + @Override + public String toString() { + return type; + } + + public static PortableGridDiskState getById(int id) { + for (PortableGridDiskState diskState : values()) { + if (diskState.getId() == id) { + return diskState; + } + } + + return NONE; + } +} + diff --git a/src/main/java/com/raoulvdberge/refinedstorage/proxy/ProxyClient.java b/src/main/java/com/raoulvdberge/refinedstorage/proxy/ProxyClient.java index 2c26c322c..a6cfe7c43 100755 --- a/src/main/java/com/raoulvdberge/refinedstorage/proxy/ProxyClient.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/proxy/ProxyClient.java @@ -15,6 +15,8 @@ import com.raoulvdberge.refinedstorage.render.ModelDiskManipulator; import com.raoulvdberge.refinedstorage.render.TileEntitySpecialRendererStorageMonitor; import com.raoulvdberge.refinedstorage.tile.TileController; import com.raoulvdberge.refinedstorage.tile.TileStorageMonitor; +import com.raoulvdberge.refinedstorage.tile.grid.portable.PortableGrid; +import com.raoulvdberge.refinedstorage.tile.grid.portable.TilePortableGrid; import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; @@ -211,7 +213,6 @@ public class ProxyClient extends ProxyCommon { ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.SECURITY_MANAGER), 0, new ModelResourceLocation("refinedstorage:security_manager", "inventory")); ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.QUARTZ_ENRICHED_IRON), 0, new ModelResourceLocation("refinedstorage:quartz_enriched_iron_block", "inventory")); ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.STORAGE_MONITOR), 0, new ModelResourceLocation("refinedstorage:storage_monitor", "connected=false,direction=north")); - ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.PORTABLE_GRID), 0, new ModelResourceLocation("refinedstorage:portable_grid", "inventory")); ModelLoaderRegistry.registerLoader(new ICustomModelLoader() { @Override @@ -253,6 +254,12 @@ public class ProxyClient extends ProxyCommon { return new ModelResourceLocation("refinedstorage:controller", "direction=north,energy=" + energy); }); + + ModelLoader.setCustomMeshDefinition(Item.getItemFromBlock(RSBlocks.PORTABLE_GRID), stack -> { + PortableGrid portableGrid = new PortableGrid(null, stack); + + return new ModelResourceLocation("refinedstorage:portable_grid", "connected=" + Boolean.toString(portableGrid.getEnergy() != 0) + ",direction=north,disk_state=" + TilePortableGrid.getDiskState(portableGrid)); + }); } @Override diff --git a/src/main/java/com/raoulvdberge/refinedstorage/tile/grid/portable/IPortableGrid.java b/src/main/java/com/raoulvdberge/refinedstorage/tile/grid/portable/IPortableGrid.java index d48d82d03..3903b8cab 100644 --- a/src/main/java/com/raoulvdberge/refinedstorage/tile/grid/portable/IPortableGrid.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/tile/grid/portable/IPortableGrid.java @@ -1,22 +1,26 @@ package com.raoulvdberge.refinedstorage.tile.grid.portable; -import com.raoulvdberge.refinedstorage.api.storage.IStorage; import com.raoulvdberge.refinedstorage.api.storage.IStorageCache; +import com.raoulvdberge.refinedstorage.api.storage.IStorageDisk; import com.raoulvdberge.refinedstorage.inventory.ItemHandlerBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; +import javax.annotation.Nullable; import java.util.List; public interface IPortableGrid { IStorageCache getCache(); - IStorage getStorage(); + @Nullable + IStorageDisk getStorage(); List getWatchers(); void drainEnergy(int energy); + int getEnergy(); + ItemHandlerBase getDisk(); ItemHandlerBase getFilter(); diff --git a/src/main/java/com/raoulvdberge/refinedstorage/tile/grid/portable/PortableGrid.java b/src/main/java/com/raoulvdberge/refinedstorage/tile/grid/portable/PortableGrid.java index 9ac590a74..e31551540 100644 --- a/src/main/java/com/raoulvdberge/refinedstorage/tile/grid/portable/PortableGrid.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/tile/grid/portable/PortableGrid.java @@ -17,6 +17,7 @@ import com.raoulvdberge.refinedstorage.gui.grid.GuiGrid; import com.raoulvdberge.refinedstorage.inventory.ItemHandlerBase; import com.raoulvdberge.refinedstorage.inventory.ItemHandlerFilter; import com.raoulvdberge.refinedstorage.item.ItemBlockPortableGrid; +import com.raoulvdberge.refinedstorage.item.ItemEnergyItem; import com.raoulvdberge.refinedstorage.item.ItemWirelessGrid; import com.raoulvdberge.refinedstorage.item.filter.Filter; import com.raoulvdberge.refinedstorage.item.filter.FilterTab; @@ -82,14 +83,19 @@ public class PortableGrid implements IGrid, IPortableGrid { IStorageDiskProvider provider = (IStorageDiskProvider) getStackInSlot(slot).getItem(); storage = new StorageDiskItemPortable(provider.create(getStackInSlot(slot)), PortableGrid.this); - storage.readFromNBT(); - storage.onPassContainerContext(() -> { - }, () -> false, () -> AccessType.INSERT_EXTRACT); + + if (player != null) { + storage.readFromNBT(); + storage.onPassContainerContext(() -> { + }, () -> false, () -> AccessType.INSERT_EXTRACT); + } } - cache.invalidate(); + if (player != null) { + cache.invalidate(); - RSUtils.writeItems(this, 4, stack.getTagCompound()); + RSUtils.writeItems(this, 4, stack.getTagCompound()); + } } } @@ -104,31 +110,37 @@ public class PortableGrid implements IGrid, IPortableGrid { } }; - public PortableGrid(EntityPlayer player, ItemStack stack) { + public PortableGrid(@Nullable EntityPlayer player, ItemStack stack) { this.player = player; this.stack = stack; - this.sortingType = ItemWirelessGrid.getSortingType(stack); - this.sortingDirection = ItemWirelessGrid.getSortingDirection(stack); - this.searchBoxMode = ItemWirelessGrid.getSearchBoxMode(stack); - this.tabSelected = ItemWirelessGrid.getTabSelected(stack); - this.size = ItemWirelessGrid.getSize(stack); + if (player != null) { + this.sortingType = ItemWirelessGrid.getSortingType(stack); + this.sortingDirection = ItemWirelessGrid.getSortingDirection(stack); + this.searchBoxMode = ItemWirelessGrid.getSearchBoxMode(stack); + this.tabSelected = ItemWirelessGrid.getTabSelected(stack); + this.size = ItemWirelessGrid.getSize(stack); + } if (!stack.hasTagCompound()) { stack.setTagCompound(new NBTTagCompound()); } - for (int i = 0; i < 4; ++i) { - RSUtils.readItems(filter, i, stack.getTagCompound()); + if (player != null) { + for (int i = 0; i < 4; ++i) { + RSUtils.readItems(filter, i, stack.getTagCompound()); + } } RSUtils.readItems(disk, 4, stack.getTagCompound()); - drainEnergy(RS.INSTANCE.config.portableGridOpenUsage); + if (player != null) { + drainEnergy(RS.INSTANCE.config.portableGridOpenUsage); - // If there is no disk onContentsChanged isn't called and the update isn't sent, thus items from the previous grid view would remain clientside - if (!player.getEntityWorld().isRemote && disk.getStackInSlot(0).isEmpty()) { - cache.invalidate(); + // If there is no disk onContentsChanged isn't called and the update isn't sent, thus items from the previous grid view would remain clientside + if (!player.getEntityWorld().isRemote && disk.getStackInSlot(0).isEmpty()) { + cache.invalidate(); + } } } @@ -136,10 +148,12 @@ public class PortableGrid implements IGrid, IPortableGrid { return stack; } + @Override public StorageCacheItemPortable getCache() { return cache; } + @Override @Nullable public IStorageDisk getStorage() { return storage; @@ -157,6 +171,16 @@ public class PortableGrid implements IGrid, IPortableGrid { } } + @Override + public int getEnergy() { + if (RS.INSTANCE.config.portableGridUsesEnergy && stack.getItemDamage() != ItemBlockPortableGrid.TYPE_CREATIVE) { + return stack.getCapability(CapabilityEnergy.ENERGY, null).getEnergyStored(); + } + + return ItemEnergyItem.CAPACITY; + } + + @Override public ItemHandlerBase getDisk() { return disk; } diff --git a/src/main/java/com/raoulvdberge/refinedstorage/tile/grid/portable/TilePortableGrid.java b/src/main/java/com/raoulvdberge/refinedstorage/tile/grid/portable/TilePortableGrid.java index 5f979a617..7c3207ae7 100644 --- a/src/main/java/com/raoulvdberge/refinedstorage/tile/grid/portable/TilePortableGrid.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/tile/grid/portable/TilePortableGrid.java @@ -13,6 +13,7 @@ import com.raoulvdberge.refinedstorage.apiimpl.storage.StorageCacheItemPortable; import com.raoulvdberge.refinedstorage.apiimpl.storage.StorageDiskItemPortable; import com.raoulvdberge.refinedstorage.block.BlockPortableGrid; import com.raoulvdberge.refinedstorage.block.GridType; +import com.raoulvdberge.refinedstorage.block.PortableGridDiskState; import com.raoulvdberge.refinedstorage.block.PortableGridType; import com.raoulvdberge.refinedstorage.gui.grid.GuiGrid; import com.raoulvdberge.refinedstorage.integration.forgeenergy.EnergyForge; @@ -146,6 +147,8 @@ public class TilePortableGrid extends TileBase implements IGrid, IPortableGrid, public static final TileDataParameter REDSTONE_MODE = RedstoneMode.createParameter(); private static final String NBT_ENERGY = "Energy"; + private static final String NBT_DISK_STATE = "DiskState"; + private static final String NBT_CONNECTED = "Connected"; private EnergyForge energyStorage = new EnergyForge(ItemEnergyItem.CAPACITY); private PortableGridType type; @@ -174,10 +177,15 @@ public class TilePortableGrid extends TileBase implements IGrid, IPortableGrid, storage = new StorageDiskItemPortable(provider.create(getStackInSlot(slot)), TilePortableGrid.this); storage.readFromNBT(); - storage.onPassContainerContext(TilePortableGrid.this::markDirty, () -> false, () -> AccessType.INSERT_EXTRACT); + storage.onPassContainerContext(() -> { + TilePortableGrid.this.markDirty(); + TilePortableGrid.this.checkIfDiskStateChanged(); + }, () -> false, () -> AccessType.INSERT_EXTRACT); } cache.invalidate(); + + checkIfDiskStateChanged(); } } @@ -196,6 +204,8 @@ public class TilePortableGrid extends TileBase implements IGrid, IPortableGrid, private IStorageDisk storage; private StorageCacheItemPortable cache = new StorageCacheItemPortable(this); private ItemGridHandlerPortable handler = new ItemGridHandlerPortable(this, this); + private PortableGridDiskState diskState = PortableGridDiskState.NONE; + private boolean connected; public TilePortableGrid() { dataManager.addWatchedParameter(ENERGY_STORED); @@ -207,6 +217,14 @@ public class TilePortableGrid extends TileBase implements IGrid, IPortableGrid, dataManager.addWatchedParameter(REDSTONE_MODE); } + public PortableGridDiskState getDiskState() { + return diskState; + } + + public boolean isConnected() { + return connected; + } + public PortableGridType getPortableType() { if (type == null && world.getBlockState(pos).getBlock() == RSBlocks.PORTABLE_GRID) { this.type = (PortableGridType) world.getBlockState(pos).getValue(BlockPortableGrid.TYPE); @@ -234,6 +252,8 @@ public class TilePortableGrid extends TileBase implements IGrid, IPortableGrid, this.redstoneMode = RedstoneMode.read(stack.getTagCompound()); } + this.diskState = getDiskState(this); + markDirty(); } @@ -441,7 +461,8 @@ public class TilePortableGrid extends TileBase implements IGrid, IPortableGrid, } @Override - public IStorage getStorage() { + @Nullable + public IStorageDisk getStorage() { return storage; } @@ -454,6 +475,39 @@ public class TilePortableGrid extends TileBase implements IGrid, IPortableGrid, public void drainEnergy(int energy) { if (RS.INSTANCE.config.portableGridUsesEnergy && getPortableType() != PortableGridType.CREATIVE && redstoneMode.isEnabled(world, pos)) { energyStorage.extractEnergyInternal(energy); + + checkIfDiskStateChanged(); + } + + checkIfConnectivityChanged(); + } + + @Override + public int getEnergy() { + if (RS.INSTANCE.config.portableGridUsesEnergy && getPortableType() != PortableGridType.CREATIVE) { + return energyStorage.getEnergyStored(); + } + + return energyStorage.getMaxEnergyStored(); + } + + private void checkIfDiskStateChanged() { + PortableGridDiskState newDiskState = getDiskState(this); + + if (this.diskState != newDiskState) { + this.diskState = newDiskState; + + RSUtils.updateBlock(world, pos); + } + } + + private void checkIfConnectivityChanged() { + boolean isConnected = getEnergy() != 0; + + if (this.connected != isConnected) { + this.connected = isConnected; + + RSUtils.updateBlock(world, pos); } } @@ -518,6 +572,31 @@ public class TilePortableGrid extends TileBase implements IGrid, IPortableGrid, } redstoneMode = RedstoneMode.read(tag); + + diskState = getDiskState(this); + } + + @Override + public void onLoad() { + super.onLoad(); + + checkIfConnectivityChanged(); + } + + @Override + public NBTTagCompound writeUpdate(NBTTagCompound tag) { + tag.setInteger(NBT_DISK_STATE, diskState.getId()); + tag.setBoolean(NBT_CONNECTED, getEnergy() != 0); + + return super.writeUpdate(tag); + } + + @Override + public void readUpdate(NBTTagCompound tag) { + super.readUpdate(tag); + + diskState = PortableGridDiskState.getById(tag.getInteger(NBT_DISK_STATE)); + connected = tag.getBoolean(NBT_CONNECTED); } @Override @@ -552,4 +631,25 @@ public class TilePortableGrid extends TileBase implements IGrid, IPortableGrid, markDirty(); } + + public static PortableGridDiskState getDiskState(IPortableGrid portableGrid) { + if (portableGrid.getStorage() == null) { + return PortableGridDiskState.NONE; + } + + if (portableGrid.getEnergy() == 0) { + return PortableGridDiskState.DISCONNECTED; + } + + int stored = portableGrid.getStorage().getStored(); + int capacity = portableGrid.getStorage().getCapacity(); + + if (stored == capacity) { + return PortableGridDiskState.FULL; + } else if ((int) ((float) stored / (float) capacity * 100F) >= 85) { + return PortableGridDiskState.NEAR_CAPACITY; + } else { + return PortableGridDiskState.NORMAL; + } + } } diff --git a/src/main/resources/assets/refinedstorage/blockstates/portable_grid.json b/src/main/resources/assets/refinedstorage/blockstates/portable_grid.json index c1e0a1d52..99bf9eb10 100644 --- a/src/main/resources/assets/refinedstorage/blockstates/portable_grid.json +++ b/src/main/resources/assets/refinedstorage/blockstates/portable_grid.json @@ -3,16 +3,16 @@ "defaults": { "model": "refinedstorage:portable_grid", "textures": { - "texture0": "refinedstorage:blocks/portable_grid_0", - "texture1": "refinedstorage:blocks/portable_grid_1", - "texture2": "refinedstorage:blocks/portable_grid_2", - "texture3": "refinedstorage:blocks/portable_grid_3", - "texture4": "refinedstorage:blocks/portable_grid_4", - "texture5": "refinedstorage:blocks/portable_grid_5", - "texture6": "refinedstorage:blocks/portable_grid_6", - "texture7": "refinedstorage:blocks/portable_grid_7", - "particle": "refinedstorage:blocks/portable_grid_0" + "particle": "refinedstorage:blocks/portable_grid_1", + "texture0": "refinedstorage:blocks/portable_grid_1", + "texture2": "refinedstorage:blocks/portable_grid_3", + "texture3": "refinedstorage:blocks/portable_grid_4", + "texture4": "refinedstorage:blocks/portable_grid_5", + "texture5": "refinedstorage:blocks/portable_grid_6", + "texture6": "refinedstorage:blocks/portable_grid_7", + "texture7": "refinedstorage:blocks/portable_grid_8" }, + "transform": "forge:default-block", "uvlock": false }, "variants": { @@ -21,6 +21,50 @@ "transform": "forge:default-block" } ], + "disk_state": { + "normal": { + "textures": { + "disk0": "refinedstorage:blocks/portable_grid_disk", + "disk1": "refinedstorage:blocks/portable_grid_disk" + }, + "submodel": "refinedstorage:portable_grid_disk" + }, + "near_capacity": { + "textures": { + "disk0": "refinedstorage:blocks/portable_grid_disk_near_capacity", + "disk1": "refinedstorage:blocks/portable_grid_disk_near_capacity" + }, + "submodel": "refinedstorage:portable_grid_disk" + }, + "full": { + "textures": { + "disk0": "refinedstorage:blocks/portable_grid_disk_full", + "disk1": "refinedstorage:blocks/portable_grid_disk_full" + }, + "submodel": "refinedstorage:portable_grid_disk" + }, + "disconnected": { + "textures": { + "disk0": "refinedstorage:blocks/portable_grid_disk_disconnected", + "disk1": "refinedstorage:blocks/portable_grid_disk_disconnected" + }, + "submodel": "refinedstorage:portable_grid_disk" + }, + "none": { + } + }, + "connected": { + "true": { + "textures": { + "texture1": "refinedstorage:blocks/portable_grid_2" + } + }, + "false": { + "textures": { + "texture1": "refinedstorage:blocks/portable_grid_2_disconnected" + } + } + }, "direction": { "north": { "y": 0 diff --git a/src/main/resources/assets/refinedstorage/models/block/portable_grid.json b/src/main/resources/assets/refinedstorage/models/block/portable_grid.json index 90ca1cdcb..735dd919a 100644 --- a/src/main/resources/assets/refinedstorage/models/block/portable_grid.json +++ b/src/main/resources/assets/refinedstorage/models/block/portable_grid.json @@ -1,54 +1,20 @@ { "elements": [ { + "name": "cube", "from": [ - 0.0, - 6.0, - 9.0 + 0, + 6, + 5 ], "to": [ - 16.0, - 13.0, - 11.0 + 16, + 13, + 7 ], - "rotation": { - "origin": [ - 8.0, - 6.0, - 9.0 - ], - "axis": "x", - "angle": -22.5 - }, + "shade": true, "faces": { - "down": { - "uv": [ - 0, - 14, - 16, - 16 - ], - "texture": "#texture1" - }, - "up": { - "uv": [ - 0, - 14, - 16, - 16 - ], - "texture": "#texture0" - }, "north": { - "uv": [ - 0, - 0, - 16, - 7 - ], - "texture": "#texture0" - }, - "south": { "uv": [ 0, 7, @@ -57,16 +23,25 @@ ], "texture": "#texture0" }, + "east": { + "uv": [ + 0, + 7, + 2, + 14 + ], + "texture": "#texture1" + }, + "south": { + "uv": [ + 0, + 0, + 16, + 7 + ], + "texture": "#texture0" + }, "west": { - "uv": [ - 0, - 7, - 2, - 14 - ], - "texture": "#texture1" - }, - "east": { "uv": [ 0, 0, @@ -74,97 +49,87 @@ 7 ], "texture": "#texture1" - } - } - }, - { - "from": [ - 16.0, - 2.0, - 2.0 - ], - "to": [ - 17.0, - 4.0, - 7.0 - ], - "faces": { - "down": { - "uv": [ - 3, - 8, - 4, - 13 - ], - "texture": "#texture1" }, "up": { "uv": [ - 2, - 8, - 3, - 13 - ], - "texture": "#texture1" - }, - "north": { - "uv": [ - 2, 0, - 3, + 0, + 16, 2 ], - "texture": "#texture1" + "texture": "#texture0", + "rotation": 180 }, - "south": { + "down": { + "uv": [ + 0, + 13, + 16, + 15 + ], + "texture": "#texture1", + "rotation": 180 + } + }, + "rotation": { + "origin": [ + 8, + 6, + 7 + ], + "axis": "x", + "angle": 22.5 + } + }, + { + "name": "cube", + "from": [ + 0, + 4, + 7 + ], + "to": [ + 16, + 6, + 16 + ], + "shade": true, + "faces": { + "north": { + "uv": [ + 0, + 14, + 16, + 16 + ], + "texture": "#texture0" + }, + "east": { "uv": [ - 2, - 2, 3, + 2, + 12, 4 ], "texture": "#texture1" }, - "west": { - "uv": [ - 2, - 6, - 7, - 8 - ], - "texture": "#texture1" - }, - "east": { - "uv": [ - 2, - 4, - 7, - 6 - ], - "texture": "#texture1" - } - } - }, - { - "from": [ - 0.0, - 4.0, - 0.0 - ], - "to": [ - 16.0, - 6.0, - 9.0 - ], - "faces": { - "down": { + "south": { "uv": [ 0, 0, 16, - 9 + 2 ], - "texture": "#texture3" + "texture": "#texture2" + }, + "west": { + "uv": [ + 3, + 0, + 12, + 2 + ], + "texture": "#texture1" }, "up": { "uv": [ @@ -173,86 +138,36 @@ 16, 11 ], - "texture": "#texture2" + "texture": "#texture2", + "rotation": 180 }, - "north": { - "uv": [ - 0, - 0, - 16, - 2 - ], - "texture": "#texture2" - }, - "south": { - "uv": [ - 0, - 14, - 16, - 16 - ], - "texture": "#texture0" - }, - "west": { - "uv": [ - 3, - 2, - 12, - 4 - ], - "texture": "#texture1" - }, - "east": { - "uv": [ - 3, - 0, - 12, - 2 - ], - "texture": "#texture1" - } - } - }, - { - "from": [ - 0.0, - 0.0, - 0.0 - ], - "to": [ - 16.0, - 4.0, - 16.0 - ], - "faces": { "down": { "uv": [ 0, 0, 16, - 16 + 9 ], - "texture": "#texture6" - }, - "up": { - "uv": [ - 0, - 0, - 16, - 16 - ], - "texture": "#texture5" - }, + "texture": "#texture3", + "rotation": 180 + } + } + }, + { + "name": "cube", + "from": [ + 0, + 0, + 0 + ], + "to": [ + 16, + 4, + 16 + ], + "shade": true, + "faces": { "north": { - "uv": [ - 0, - 11, - 16, - 15 - ], - "texture": "#texture2" - }, - "south": { "uv": [ 0, 9, @@ -261,7 +176,7 @@ ], "texture": "#texture3" }, - "west": { + "east": { "uv": [ 0, 4, @@ -270,7 +185,16 @@ ], "texture": "#texture4" }, - "east": { + "south": { + "uv": [ + 0, + 11, + 16, + 15 + ], + "texture": "#texture2" + }, + "west": { "uv": [ 0, 0, @@ -278,49 +202,44 @@ 4 ], "texture": "#texture4" - } - } - }, - { - "from": [ - 1.0, - 4.0, - 9.0 - ], - "to": [ - 15.0, - 5.0, - 15.0 - ], - "faces": { - "down": { - "uv": [ - 0, - 0, - 14, - 6 - ], - "texture": "#texture7" }, "up": { "uv": [ 0, - 8, - 14, - 14 - ], - "texture": "#texture4" - }, - "north": { - "uv": [ - 2, - 13, + 0, 16, - 14 + 16 ], - "texture": "#texture1" + "texture": "#texture5", + "rotation": 180 }, - "south": { + "down": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#texture6", + "rotation": 180 + } + } + }, + { + "name": "cube", + "from": [ + 1, + 4, + 1 + ], + "to": [ + 15, + 5, + 7 + ], + "shade": true, + "faces": { + "north": { "uv": [ 0, 15, @@ -329,7 +248,7 @@ ], "texture": "#texture2" }, - "west": { + "east": { "uv": [ 4, 9, @@ -338,7 +257,16 @@ ], "texture": "#texture1" }, - "east": { + "south": { + "uv": [ + 2, + 13, + 16, + 14 + ], + "texture": "#texture1" + }, + "west": { "uv": [ 4, 8, @@ -346,21 +274,89 @@ 9 ], "texture": "#texture1" + }, + "up": { + "uv": [ + 0, + 8, + 14, + 14 + ], + "texture": "#texture4", + "rotation": 180 + }, + "down": { + "uv": [ + 0, + 0, + 14, + 6 + ], + "texture": "#texture7", + "rotation": 180 } } }, { + "name": "cube", "from": [ - 12.0, + 3, 4.5, - 8.0 + 6 ], "to": [ - 13.0, + 4, 6.5, - 10.0 + 8 ], + "shade": true, "faces": { + "north": { + "uv": [ + 5, + 10, + 6, + 12 + ], + "texture": "#texture1" + }, + "east": { + "uv": [ + 7, + 4, + 9, + 6 + ], + "texture": "#texture1" + }, + "south": { + "uv": [ + 4, + 10, + 5, + 12 + ], + "texture": "#texture1" + }, + "west": { + "uv": [ + 6, + 10, + 8, + 12 + ], + "texture": "#texture1" + }, + "up": { + "uv": [ + 7, + 6, + 8, + 8 + ], + "texture": "#texture1", + "rotation": 180 + }, "down": { "uv": [ 8, @@ -368,6 +364,59 @@ 9, 8 ], + "texture": "#texture1", + "rotation": 180 + } + } + }, + { + "name": "cube", + "from": [ + 12, + 4.5, + 6 + ], + "to": [ + 13, + 6.5, + 8 + ], + "shade": true, + "faces": { + "north": { + "uv": [ + 9, + 4, + 10, + 6 + ], + "texture": "#texture1" + }, + "east": { + "uv": [ + 9, + 10, + 11, + 12 + ], + "texture": "#texture1" + }, + "south": { + "uv": [ + 8, + 10, + 9, + 12 + ], + "texture": "#texture1" + }, + "west": { + "uv": [ + 9, + 6, + 11, + 8 + ], "texture": "#texture1" }, "up": { @@ -377,58 +426,9 @@ 8, 8 ], - "texture": "#texture1" + "texture": "#texture1", + "rotation": 180 }, - "north": { - "uv": [ - 4, - 10, - 5, - 12 - ], - "texture": "#texture1" - }, - "south": { - "uv": [ - 5, - 10, - 6, - 12 - ], - "texture": "#texture1" - }, - "west": { - "uv": [ - 7, - 4, - 9, - 6 - ], - "texture": "#texture1" - }, - "east": { - "uv": [ - 6, - 10, - 8, - 12 - ], - "texture": "#texture1" - } - } - }, - { - "from": [ - 3.0, - 4.5, - 8.0 - ], - "to": [ - 4.0, - 6.5, - 10.0 - ], - "faces": { "down": { "uv": [ 8, @@ -436,52 +436,8 @@ 9, 8 ], - "texture": "#texture1" - }, - "up": { - "uv": [ - 7, - 6, - 8, - 8 - ], - "texture": "#texture1" - }, - "north": { - "uv": [ - 8, - 10, - 9, - 12 - ], - "texture": "#texture1" - }, - "south": { - "uv": [ - 9, - 4, - 10, - 6 - ], - "texture": "#texture1" - }, - "west": { - "uv": [ - 9, - 10, - 11, - 12 - ], - "texture": "#texture1" - }, - "east": { - "uv": [ - 9, - 6, - 11, - 8 - ], - "texture": "#texture1" + "texture": "#texture1", + "rotation": 180 } } } diff --git a/src/main/resources/assets/refinedstorage/models/block/portable_grid_disk.json b/src/main/resources/assets/refinedstorage/models/block/portable_grid_disk.json new file mode 100644 index 000000000..c3f5223d4 --- /dev/null +++ b/src/main/resources/assets/refinedstorage/models/block/portable_grid_disk.json @@ -0,0 +1,110 @@ +{ + "elements": [ + { + "name": "disk", + "from": [ + -1, + 2, + 9 + ], + "to": [ + 0, + 4, + 14 + ], + "shade": true, + "faces": { + "north": { + "uv": [ + 5, + 5, + 6, + 7 + ], + "texture": "#disk1" + }, + "east": { + "uv": [ + 0, + 5, + 5, + 7 + ], + "texture": "#disk1" + }, + "south": { + "uv": [ + 11, + 5, + 12, + 7 + ], + "texture": "#disk1" + }, + "west": { + "uv": [ + 6, + 5, + 11, + 7 + ], + "texture": "#disk1" + }, + "up": { + "uv": [ + 5, + 0, + 6, + 5 + ], + "texture": "#disk1", + "rotation": 180 + }, + "down": { + "uv": [ + 6, + 0, + 7, + 5 + ], + "texture": "#disk1", + "rotation": 180 + } + } + }, + { + "name": "disk_led", + "from": [ + -1.05, + 2, + 12 + ], + "to": [ + -0.050000000000000044, + 3, + 13 + ], + "shade": true, + "faces": { + "east": { + "uv": [ + 2, + 1, + 3, + 2 + ], + "texture": "#disk1" + }, + "west": { + "uv": [ + 2, + 1, + 3, + 2 + ], + "texture": "#disk0" + } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/refinedstorage/textures/blocks/portable_grid_0.png b/src/main/resources/assets/refinedstorage/textures/blocks/portable_grid_0.png deleted file mode 100644 index a6b7645a0..000000000 Binary files a/src/main/resources/assets/refinedstorage/textures/blocks/portable_grid_0.png and /dev/null differ diff --git a/src/main/resources/assets/refinedstorage/textures/blocks/portable_grid_1.png b/src/main/resources/assets/refinedstorage/textures/blocks/portable_grid_1.png index d6ee53cd9..a6b7645a0 100644 Binary files a/src/main/resources/assets/refinedstorage/textures/blocks/portable_grid_1.png and b/src/main/resources/assets/refinedstorage/textures/blocks/portable_grid_1.png differ diff --git a/src/main/resources/assets/refinedstorage/textures/blocks/portable_grid_2.png b/src/main/resources/assets/refinedstorage/textures/blocks/portable_grid_2.png index a8bfc4a33..d6ee53cd9 100644 Binary files a/src/main/resources/assets/refinedstorage/textures/blocks/portable_grid_2.png and b/src/main/resources/assets/refinedstorage/textures/blocks/portable_grid_2.png differ diff --git a/src/main/resources/assets/refinedstorage/textures/blocks/portable_grid_2_disconnected.png b/src/main/resources/assets/refinedstorage/textures/blocks/portable_grid_2_disconnected.png new file mode 100644 index 000000000..b492fb8b9 Binary files /dev/null and b/src/main/resources/assets/refinedstorage/textures/blocks/portable_grid_2_disconnected.png differ diff --git a/src/main/resources/assets/refinedstorage/textures/blocks/portable_grid_3.png b/src/main/resources/assets/refinedstorage/textures/blocks/portable_grid_3.png index 9988b143c..a8bfc4a33 100644 Binary files a/src/main/resources/assets/refinedstorage/textures/blocks/portable_grid_3.png and b/src/main/resources/assets/refinedstorage/textures/blocks/portable_grid_3.png differ diff --git a/src/main/resources/assets/refinedstorage/textures/blocks/portable_grid_4.png b/src/main/resources/assets/refinedstorage/textures/blocks/portable_grid_4.png index caae64673..9988b143c 100644 Binary files a/src/main/resources/assets/refinedstorage/textures/blocks/portable_grid_4.png and b/src/main/resources/assets/refinedstorage/textures/blocks/portable_grid_4.png differ diff --git a/src/main/resources/assets/refinedstorage/textures/blocks/portable_grid_5.png b/src/main/resources/assets/refinedstorage/textures/blocks/portable_grid_5.png index b16403740..caae64673 100644 Binary files a/src/main/resources/assets/refinedstorage/textures/blocks/portable_grid_5.png and b/src/main/resources/assets/refinedstorage/textures/blocks/portable_grid_5.png differ diff --git a/src/main/resources/assets/refinedstorage/textures/blocks/portable_grid_6.png b/src/main/resources/assets/refinedstorage/textures/blocks/portable_grid_6.png index c36053ec1..b16403740 100644 Binary files a/src/main/resources/assets/refinedstorage/textures/blocks/portable_grid_6.png and b/src/main/resources/assets/refinedstorage/textures/blocks/portable_grid_6.png differ diff --git a/src/main/resources/assets/refinedstorage/textures/blocks/portable_grid_7.png b/src/main/resources/assets/refinedstorage/textures/blocks/portable_grid_7.png index d2e2fdcf3..c36053ec1 100644 Binary files a/src/main/resources/assets/refinedstorage/textures/blocks/portable_grid_7.png and b/src/main/resources/assets/refinedstorage/textures/blocks/portable_grid_7.png differ diff --git a/src/main/resources/assets/refinedstorage/textures/blocks/portable_grid_8.png b/src/main/resources/assets/refinedstorage/textures/blocks/portable_grid_8.png new file mode 100644 index 000000000..d2e2fdcf3 Binary files /dev/null and b/src/main/resources/assets/refinedstorage/textures/blocks/portable_grid_8.png differ diff --git a/src/main/resources/assets/refinedstorage/textures/blocks/portable_grid_disk.png b/src/main/resources/assets/refinedstorage/textures/blocks/portable_grid_disk.png new file mode 100644 index 000000000..2545c5710 Binary files /dev/null and b/src/main/resources/assets/refinedstorage/textures/blocks/portable_grid_disk.png differ diff --git a/src/main/resources/assets/refinedstorage/textures/blocks/portable_grid_disk_disconnected.png b/src/main/resources/assets/refinedstorage/textures/blocks/portable_grid_disk_disconnected.png new file mode 100644 index 000000000..e70a25007 Binary files /dev/null and b/src/main/resources/assets/refinedstorage/textures/blocks/portable_grid_disk_disconnected.png differ diff --git a/src/main/resources/assets/refinedstorage/textures/blocks/portable_grid_disk_full.png b/src/main/resources/assets/refinedstorage/textures/blocks/portable_grid_disk_full.png new file mode 100644 index 000000000..61d56f146 Binary files /dev/null and b/src/main/resources/assets/refinedstorage/textures/blocks/portable_grid_disk_full.png differ diff --git a/src/main/resources/assets/refinedstorage/textures/blocks/portable_grid_disk_near_capacity.png b/src/main/resources/assets/refinedstorage/textures/blocks/portable_grid_disk_near_capacity.png new file mode 100644 index 000000000..8ea9c1357 Binary files /dev/null and b/src/main/resources/assets/refinedstorage/textures/blocks/portable_grid_disk_near_capacity.png differ