Dynamic portable grid model
@@ -4,6 +4,7 @@ import com.raoulvdberge.refinedstorage.RS;
|
|||||||
import com.raoulvdberge.refinedstorage.RSGui;
|
import com.raoulvdberge.refinedstorage.RSGui;
|
||||||
import com.raoulvdberge.refinedstorage.item.ItemBlockPortableGrid;
|
import com.raoulvdberge.refinedstorage.item.ItemBlockPortableGrid;
|
||||||
import com.raoulvdberge.refinedstorage.tile.grid.portable.TilePortableGrid;
|
import com.raoulvdberge.refinedstorage.tile.grid.portable.TilePortableGrid;
|
||||||
|
import net.minecraft.block.properties.PropertyBool;
|
||||||
import net.minecraft.block.properties.PropertyEnum;
|
import net.minecraft.block.properties.PropertyEnum;
|
||||||
import net.minecraft.block.state.BlockStateContainer;
|
import net.minecraft.block.state.BlockStateContainer;
|
||||||
import net.minecraft.block.state.IBlockState;
|
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);
|
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 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() {
|
public BlockPortableGrid() {
|
||||||
super("portable_grid");
|
super("portable_grid");
|
||||||
@@ -89,10 +92,21 @@ public class BlockPortableGrid extends BlockBase {
|
|||||||
return drops;
|
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
|
@Override
|
||||||
protected BlockStateContainer createBlockState() {
|
protected BlockStateContainer createBlockState() {
|
||||||
return createBlockStateBuilder()
|
return createBlockStateBuilder()
|
||||||
.add(TYPE)
|
.add(TYPE)
|
||||||
|
.add(DISK_STATE)
|
||||||
|
.add(CONNECTED)
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -15,6 +15,8 @@ import com.raoulvdberge.refinedstorage.render.ModelDiskManipulator;
|
|||||||
import com.raoulvdberge.refinedstorage.render.TileEntitySpecialRendererStorageMonitor;
|
import com.raoulvdberge.refinedstorage.render.TileEntitySpecialRendererStorageMonitor;
|
||||||
import com.raoulvdberge.refinedstorage.tile.TileController;
|
import com.raoulvdberge.refinedstorage.tile.TileController;
|
||||||
import com.raoulvdberge.refinedstorage.tile.TileStorageMonitor;
|
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.Block;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.client.Minecraft;
|
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.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.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.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() {
|
ModelLoaderRegistry.registerLoader(new ICustomModelLoader() {
|
||||||
@Override
|
@Override
|
||||||
@@ -253,6 +254,12 @@ public class ProxyClient extends ProxyCommon {
|
|||||||
|
|
||||||
return new ModelResourceLocation("refinedstorage:controller", "direction=north,energy=" + energy);
|
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
|
@Override
|
||||||
|
|||||||
@@ -1,22 +1,26 @@
|
|||||||
package com.raoulvdberge.refinedstorage.tile.grid.portable;
|
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.IStorageCache;
|
||||||
|
import com.raoulvdberge.refinedstorage.api.storage.IStorageDisk;
|
||||||
import com.raoulvdberge.refinedstorage.inventory.ItemHandlerBase;
|
import com.raoulvdberge.refinedstorage.inventory.ItemHandlerBase;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
import javax.annotation.Nullable;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public interface IPortableGrid {
|
public interface IPortableGrid {
|
||||||
IStorageCache<ItemStack> getCache();
|
IStorageCache<ItemStack> getCache();
|
||||||
|
|
||||||
IStorage<ItemStack> getStorage();
|
@Nullable
|
||||||
|
IStorageDisk<ItemStack> getStorage();
|
||||||
|
|
||||||
List<EntityPlayer> getWatchers();
|
List<EntityPlayer> getWatchers();
|
||||||
|
|
||||||
void drainEnergy(int energy);
|
void drainEnergy(int energy);
|
||||||
|
|
||||||
|
int getEnergy();
|
||||||
|
|
||||||
ItemHandlerBase getDisk();
|
ItemHandlerBase getDisk();
|
||||||
|
|
||||||
ItemHandlerBase getFilter();
|
ItemHandlerBase getFilter();
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import com.raoulvdberge.refinedstorage.gui.grid.GuiGrid;
|
|||||||
import com.raoulvdberge.refinedstorage.inventory.ItemHandlerBase;
|
import com.raoulvdberge.refinedstorage.inventory.ItemHandlerBase;
|
||||||
import com.raoulvdberge.refinedstorage.inventory.ItemHandlerFilter;
|
import com.raoulvdberge.refinedstorage.inventory.ItemHandlerFilter;
|
||||||
import com.raoulvdberge.refinedstorage.item.ItemBlockPortableGrid;
|
import com.raoulvdberge.refinedstorage.item.ItemBlockPortableGrid;
|
||||||
|
import com.raoulvdberge.refinedstorage.item.ItemEnergyItem;
|
||||||
import com.raoulvdberge.refinedstorage.item.ItemWirelessGrid;
|
import com.raoulvdberge.refinedstorage.item.ItemWirelessGrid;
|
||||||
import com.raoulvdberge.refinedstorage.item.filter.Filter;
|
import com.raoulvdberge.refinedstorage.item.filter.Filter;
|
||||||
import com.raoulvdberge.refinedstorage.item.filter.FilterTab;
|
import com.raoulvdberge.refinedstorage.item.filter.FilterTab;
|
||||||
@@ -82,14 +83,19 @@ public class PortableGrid implements IGrid, IPortableGrid {
|
|||||||
IStorageDiskProvider provider = (IStorageDiskProvider) getStackInSlot(slot).getItem();
|
IStorageDiskProvider provider = (IStorageDiskProvider) getStackInSlot(slot).getItem();
|
||||||
|
|
||||||
storage = new StorageDiskItemPortable(provider.create(getStackInSlot(slot)), PortableGrid.this);
|
storage = new StorageDiskItemPortable(provider.create(getStackInSlot(slot)), PortableGrid.this);
|
||||||
storage.readFromNBT();
|
|
||||||
storage.onPassContainerContext(() -> {
|
if (player != null) {
|
||||||
}, () -> false, () -> AccessType.INSERT_EXTRACT);
|
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.player = player;
|
||||||
this.stack = stack;
|
this.stack = stack;
|
||||||
|
|
||||||
this.sortingType = ItemWirelessGrid.getSortingType(stack);
|
if (player != null) {
|
||||||
this.sortingDirection = ItemWirelessGrid.getSortingDirection(stack);
|
this.sortingType = ItemWirelessGrid.getSortingType(stack);
|
||||||
this.searchBoxMode = ItemWirelessGrid.getSearchBoxMode(stack);
|
this.sortingDirection = ItemWirelessGrid.getSortingDirection(stack);
|
||||||
this.tabSelected = ItemWirelessGrid.getTabSelected(stack);
|
this.searchBoxMode = ItemWirelessGrid.getSearchBoxMode(stack);
|
||||||
this.size = ItemWirelessGrid.getSize(stack);
|
this.tabSelected = ItemWirelessGrid.getTabSelected(stack);
|
||||||
|
this.size = ItemWirelessGrid.getSize(stack);
|
||||||
|
}
|
||||||
|
|
||||||
if (!stack.hasTagCompound()) {
|
if (!stack.hasTagCompound()) {
|
||||||
stack.setTagCompound(new NBTTagCompound());
|
stack.setTagCompound(new NBTTagCompound());
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < 4; ++i) {
|
if (player != null) {
|
||||||
RSUtils.readItems(filter, i, stack.getTagCompound());
|
for (int i = 0; i < 4; ++i) {
|
||||||
|
RSUtils.readItems(filter, i, stack.getTagCompound());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RSUtils.readItems(disk, 4, 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 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()) {
|
if (!player.getEntityWorld().isRemote && disk.getStackInSlot(0).isEmpty()) {
|
||||||
cache.invalidate();
|
cache.invalidate();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -136,10 +148,12 @@ public class PortableGrid implements IGrid, IPortableGrid {
|
|||||||
return stack;
|
return stack;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public StorageCacheItemPortable getCache() {
|
public StorageCacheItemPortable getCache() {
|
||||||
return cache;
|
return cache;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
@Nullable
|
@Nullable
|
||||||
public IStorageDisk<ItemStack> getStorage() {
|
public IStorageDisk<ItemStack> getStorage() {
|
||||||
return storage;
|
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() {
|
public ItemHandlerBase getDisk() {
|
||||||
return disk;
|
return disk;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import com.raoulvdberge.refinedstorage.apiimpl.storage.StorageCacheItemPortable;
|
|||||||
import com.raoulvdberge.refinedstorage.apiimpl.storage.StorageDiskItemPortable;
|
import com.raoulvdberge.refinedstorage.apiimpl.storage.StorageDiskItemPortable;
|
||||||
import com.raoulvdberge.refinedstorage.block.BlockPortableGrid;
|
import com.raoulvdberge.refinedstorage.block.BlockPortableGrid;
|
||||||
import com.raoulvdberge.refinedstorage.block.GridType;
|
import com.raoulvdberge.refinedstorage.block.GridType;
|
||||||
|
import com.raoulvdberge.refinedstorage.block.PortableGridDiskState;
|
||||||
import com.raoulvdberge.refinedstorage.block.PortableGridType;
|
import com.raoulvdberge.refinedstorage.block.PortableGridType;
|
||||||
import com.raoulvdberge.refinedstorage.gui.grid.GuiGrid;
|
import com.raoulvdberge.refinedstorage.gui.grid.GuiGrid;
|
||||||
import com.raoulvdberge.refinedstorage.integration.forgeenergy.EnergyForge;
|
import com.raoulvdberge.refinedstorage.integration.forgeenergy.EnergyForge;
|
||||||
@@ -146,6 +147,8 @@ public class TilePortableGrid extends TileBase implements IGrid, IPortableGrid,
|
|||||||
public static final TileDataParameter<Integer> REDSTONE_MODE = RedstoneMode.createParameter();
|
public static final TileDataParameter<Integer> REDSTONE_MODE = RedstoneMode.createParameter();
|
||||||
|
|
||||||
private static final String NBT_ENERGY = "Energy";
|
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 EnergyForge energyStorage = new EnergyForge(ItemEnergyItem.CAPACITY);
|
||||||
private PortableGridType type;
|
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 = new StorageDiskItemPortable(provider.create(getStackInSlot(slot)), TilePortableGrid.this);
|
||||||
storage.readFromNBT();
|
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();
|
cache.invalidate();
|
||||||
|
|
||||||
|
checkIfDiskStateChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -196,6 +204,8 @@ public class TilePortableGrid extends TileBase implements IGrid, IPortableGrid,
|
|||||||
private IStorageDisk<ItemStack> storage;
|
private IStorageDisk<ItemStack> storage;
|
||||||
private StorageCacheItemPortable cache = new StorageCacheItemPortable(this);
|
private StorageCacheItemPortable cache = new StorageCacheItemPortable(this);
|
||||||
private ItemGridHandlerPortable handler = new ItemGridHandlerPortable(this, this);
|
private ItemGridHandlerPortable handler = new ItemGridHandlerPortable(this, this);
|
||||||
|
private PortableGridDiskState diskState = PortableGridDiskState.NONE;
|
||||||
|
private boolean connected;
|
||||||
|
|
||||||
public TilePortableGrid() {
|
public TilePortableGrid() {
|
||||||
dataManager.addWatchedParameter(ENERGY_STORED);
|
dataManager.addWatchedParameter(ENERGY_STORED);
|
||||||
@@ -207,6 +217,14 @@ public class TilePortableGrid extends TileBase implements IGrid, IPortableGrid,
|
|||||||
dataManager.addWatchedParameter(REDSTONE_MODE);
|
dataManager.addWatchedParameter(REDSTONE_MODE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public PortableGridDiskState getDiskState() {
|
||||||
|
return diskState;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isConnected() {
|
||||||
|
return connected;
|
||||||
|
}
|
||||||
|
|
||||||
public PortableGridType getPortableType() {
|
public PortableGridType getPortableType() {
|
||||||
if (type == null && world.getBlockState(pos).getBlock() == RSBlocks.PORTABLE_GRID) {
|
if (type == null && world.getBlockState(pos).getBlock() == RSBlocks.PORTABLE_GRID) {
|
||||||
this.type = (PortableGridType) world.getBlockState(pos).getValue(BlockPortableGrid.TYPE);
|
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.redstoneMode = RedstoneMode.read(stack.getTagCompound());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.diskState = getDiskState(this);
|
||||||
|
|
||||||
markDirty();
|
markDirty();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -441,7 +461,8 @@ public class TilePortableGrid extends TileBase implements IGrid, IPortableGrid,
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IStorage<ItemStack> getStorage() {
|
@Nullable
|
||||||
|
public IStorageDisk<ItemStack> getStorage() {
|
||||||
return storage;
|
return storage;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -454,6 +475,39 @@ public class TilePortableGrid extends TileBase implements IGrid, IPortableGrid,
|
|||||||
public void drainEnergy(int energy) {
|
public void drainEnergy(int energy) {
|
||||||
if (RS.INSTANCE.config.portableGridUsesEnergy && getPortableType() != PortableGridType.CREATIVE && redstoneMode.isEnabled(world, pos)) {
|
if (RS.INSTANCE.config.portableGridUsesEnergy && getPortableType() != PortableGridType.CREATIVE && redstoneMode.isEnabled(world, pos)) {
|
||||||
energyStorage.extractEnergyInternal(energy);
|
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);
|
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
|
@Override
|
||||||
@@ -552,4 +631,25 @@ public class TilePortableGrid extends TileBase implements IGrid, IPortableGrid,
|
|||||||
|
|
||||||
markDirty();
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,16 +3,16 @@
|
|||||||
"defaults": {
|
"defaults": {
|
||||||
"model": "refinedstorage:portable_grid",
|
"model": "refinedstorage:portable_grid",
|
||||||
"textures": {
|
"textures": {
|
||||||
"texture0": "refinedstorage:blocks/portable_grid_0",
|
"particle": "refinedstorage:blocks/portable_grid_1",
|
||||||
"texture1": "refinedstorage:blocks/portable_grid_1",
|
"texture0": "refinedstorage:blocks/portable_grid_1",
|
||||||
"texture2": "refinedstorage:blocks/portable_grid_2",
|
"texture2": "refinedstorage:blocks/portable_grid_3",
|
||||||
"texture3": "refinedstorage:blocks/portable_grid_3",
|
"texture3": "refinedstorage:blocks/portable_grid_4",
|
||||||
"texture4": "refinedstorage:blocks/portable_grid_4",
|
"texture4": "refinedstorage:blocks/portable_grid_5",
|
||||||
"texture5": "refinedstorage:blocks/portable_grid_5",
|
"texture5": "refinedstorage:blocks/portable_grid_6",
|
||||||
"texture6": "refinedstorage:blocks/portable_grid_6",
|
"texture6": "refinedstorage:blocks/portable_grid_7",
|
||||||
"texture7": "refinedstorage:blocks/portable_grid_7",
|
"texture7": "refinedstorage:blocks/portable_grid_8"
|
||||||
"particle": "refinedstorage:blocks/portable_grid_0"
|
|
||||||
},
|
},
|
||||||
|
"transform": "forge:default-block",
|
||||||
"uvlock": false
|
"uvlock": false
|
||||||
},
|
},
|
||||||
"variants": {
|
"variants": {
|
||||||
@@ -21,6 +21,50 @@
|
|||||||
"transform": "forge:default-block"
|
"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": {
|
"direction": {
|
||||||
"north": {
|
"north": {
|
||||||
"y": 0
|
"y": 0
|
||||||
|
|||||||
@@ -1,54 +1,20 @@
|
|||||||
{
|
{
|
||||||
"elements": [
|
"elements": [
|
||||||
{
|
{
|
||||||
|
"name": "cube",
|
||||||
"from": [
|
"from": [
|
||||||
0.0,
|
0,
|
||||||
6.0,
|
6,
|
||||||
9.0
|
5
|
||||||
],
|
],
|
||||||
"to": [
|
"to": [
|
||||||
16.0,
|
16,
|
||||||
13.0,
|
13,
|
||||||
11.0
|
7
|
||||||
],
|
],
|
||||||
"rotation": {
|
"shade": true,
|
||||||
"origin": [
|
|
||||||
8.0,
|
|
||||||
6.0,
|
|
||||||
9.0
|
|
||||||
],
|
|
||||||
"axis": "x",
|
|
||||||
"angle": -22.5
|
|
||||||
},
|
|
||||||
"faces": {
|
"faces": {
|
||||||
"down": {
|
|
||||||
"uv": [
|
|
||||||
0,
|
|
||||||
14,
|
|
||||||
16,
|
|
||||||
16
|
|
||||||
],
|
|
||||||
"texture": "#texture1"
|
|
||||||
},
|
|
||||||
"up": {
|
|
||||||
"uv": [
|
|
||||||
0,
|
|
||||||
14,
|
|
||||||
16,
|
|
||||||
16
|
|
||||||
],
|
|
||||||
"texture": "#texture0"
|
|
||||||
},
|
|
||||||
"north": {
|
"north": {
|
||||||
"uv": [
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
16,
|
|
||||||
7
|
|
||||||
],
|
|
||||||
"texture": "#texture0"
|
|
||||||
},
|
|
||||||
"south": {
|
|
||||||
"uv": [
|
"uv": [
|
||||||
0,
|
0,
|
||||||
7,
|
7,
|
||||||
@@ -57,16 +23,25 @@
|
|||||||
],
|
],
|
||||||
"texture": "#texture0"
|
"texture": "#texture0"
|
||||||
},
|
},
|
||||||
|
"east": {
|
||||||
|
"uv": [
|
||||||
|
0,
|
||||||
|
7,
|
||||||
|
2,
|
||||||
|
14
|
||||||
|
],
|
||||||
|
"texture": "#texture1"
|
||||||
|
},
|
||||||
|
"south": {
|
||||||
|
"uv": [
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
16,
|
||||||
|
7
|
||||||
|
],
|
||||||
|
"texture": "#texture0"
|
||||||
|
},
|
||||||
"west": {
|
"west": {
|
||||||
"uv": [
|
|
||||||
0,
|
|
||||||
7,
|
|
||||||
2,
|
|
||||||
14
|
|
||||||
],
|
|
||||||
"texture": "#texture1"
|
|
||||||
},
|
|
||||||
"east": {
|
|
||||||
"uv": [
|
"uv": [
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
@@ -74,97 +49,87 @@
|
|||||||
7
|
7
|
||||||
],
|
],
|
||||||
"texture": "#texture1"
|
"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": {
|
"up": {
|
||||||
"uv": [
|
"uv": [
|
||||||
2,
|
|
||||||
8,
|
|
||||||
3,
|
|
||||||
13
|
|
||||||
],
|
|
||||||
"texture": "#texture1"
|
|
||||||
},
|
|
||||||
"north": {
|
|
||||||
"uv": [
|
|
||||||
2,
|
|
||||||
0,
|
0,
|
||||||
3,
|
0,
|
||||||
|
16,
|
||||||
2
|
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": [
|
"uv": [
|
||||||
2,
|
|
||||||
2,
|
|
||||||
3,
|
3,
|
||||||
|
2,
|
||||||
|
12,
|
||||||
4
|
4
|
||||||
],
|
],
|
||||||
"texture": "#texture1"
|
"texture": "#texture1"
|
||||||
},
|
},
|
||||||
"west": {
|
"south": {
|
||||||
"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": {
|
|
||||||
"uv": [
|
"uv": [
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
16,
|
16,
|
||||||
9
|
2
|
||||||
],
|
],
|
||||||
"texture": "#texture3"
|
"texture": "#texture2"
|
||||||
|
},
|
||||||
|
"west": {
|
||||||
|
"uv": [
|
||||||
|
3,
|
||||||
|
0,
|
||||||
|
12,
|
||||||
|
2
|
||||||
|
],
|
||||||
|
"texture": "#texture1"
|
||||||
},
|
},
|
||||||
"up": {
|
"up": {
|
||||||
"uv": [
|
"uv": [
|
||||||
@@ -173,86 +138,36 @@
|
|||||||
16,
|
16,
|
||||||
11
|
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": {
|
"down": {
|
||||||
"uv": [
|
"uv": [
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
16,
|
16,
|
||||||
16
|
9
|
||||||
],
|
],
|
||||||
"texture": "#texture6"
|
"texture": "#texture3",
|
||||||
},
|
"rotation": 180
|
||||||
"up": {
|
}
|
||||||
"uv": [
|
}
|
||||||
0,
|
},
|
||||||
0,
|
{
|
||||||
16,
|
"name": "cube",
|
||||||
16
|
"from": [
|
||||||
],
|
0,
|
||||||
"texture": "#texture5"
|
0,
|
||||||
},
|
0
|
||||||
|
],
|
||||||
|
"to": [
|
||||||
|
16,
|
||||||
|
4,
|
||||||
|
16
|
||||||
|
],
|
||||||
|
"shade": true,
|
||||||
|
"faces": {
|
||||||
"north": {
|
"north": {
|
||||||
"uv": [
|
|
||||||
0,
|
|
||||||
11,
|
|
||||||
16,
|
|
||||||
15
|
|
||||||
],
|
|
||||||
"texture": "#texture2"
|
|
||||||
},
|
|
||||||
"south": {
|
|
||||||
"uv": [
|
"uv": [
|
||||||
0,
|
0,
|
||||||
9,
|
9,
|
||||||
@@ -261,7 +176,7 @@
|
|||||||
],
|
],
|
||||||
"texture": "#texture3"
|
"texture": "#texture3"
|
||||||
},
|
},
|
||||||
"west": {
|
"east": {
|
||||||
"uv": [
|
"uv": [
|
||||||
0,
|
0,
|
||||||
4,
|
4,
|
||||||
@@ -270,7 +185,16 @@
|
|||||||
],
|
],
|
||||||
"texture": "#texture4"
|
"texture": "#texture4"
|
||||||
},
|
},
|
||||||
"east": {
|
"south": {
|
||||||
|
"uv": [
|
||||||
|
0,
|
||||||
|
11,
|
||||||
|
16,
|
||||||
|
15
|
||||||
|
],
|
||||||
|
"texture": "#texture2"
|
||||||
|
},
|
||||||
|
"west": {
|
||||||
"uv": [
|
"uv": [
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
@@ -278,49 +202,44 @@
|
|||||||
4
|
4
|
||||||
],
|
],
|
||||||
"texture": "#texture4"
|
"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": {
|
"up": {
|
||||||
"uv": [
|
"uv": [
|
||||||
0,
|
0,
|
||||||
8,
|
0,
|
||||||
14,
|
|
||||||
14
|
|
||||||
],
|
|
||||||
"texture": "#texture4"
|
|
||||||
},
|
|
||||||
"north": {
|
|
||||||
"uv": [
|
|
||||||
2,
|
|
||||||
13,
|
|
||||||
16,
|
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": [
|
"uv": [
|
||||||
0,
|
0,
|
||||||
15,
|
15,
|
||||||
@@ -329,7 +248,7 @@
|
|||||||
],
|
],
|
||||||
"texture": "#texture2"
|
"texture": "#texture2"
|
||||||
},
|
},
|
||||||
"west": {
|
"east": {
|
||||||
"uv": [
|
"uv": [
|
||||||
4,
|
4,
|
||||||
9,
|
9,
|
||||||
@@ -338,7 +257,16 @@
|
|||||||
],
|
],
|
||||||
"texture": "#texture1"
|
"texture": "#texture1"
|
||||||
},
|
},
|
||||||
"east": {
|
"south": {
|
||||||
|
"uv": [
|
||||||
|
2,
|
||||||
|
13,
|
||||||
|
16,
|
||||||
|
14
|
||||||
|
],
|
||||||
|
"texture": "#texture1"
|
||||||
|
},
|
||||||
|
"west": {
|
||||||
"uv": [
|
"uv": [
|
||||||
4,
|
4,
|
||||||
8,
|
8,
|
||||||
@@ -346,21 +274,89 @@
|
|||||||
9
|
9
|
||||||
],
|
],
|
||||||
"texture": "#texture1"
|
"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": [
|
"from": [
|
||||||
12.0,
|
3,
|
||||||
4.5,
|
4.5,
|
||||||
8.0
|
6
|
||||||
],
|
],
|
||||||
"to": [
|
"to": [
|
||||||
13.0,
|
4,
|
||||||
6.5,
|
6.5,
|
||||||
10.0
|
8
|
||||||
],
|
],
|
||||||
|
"shade": true,
|
||||||
"faces": {
|
"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": {
|
"down": {
|
||||||
"uv": [
|
"uv": [
|
||||||
8,
|
8,
|
||||||
@@ -368,6 +364,59 @@
|
|||||||
9,
|
9,
|
||||||
8
|
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"
|
"texture": "#texture1"
|
||||||
},
|
},
|
||||||
"up": {
|
"up": {
|
||||||
@@ -377,58 +426,9 @@
|
|||||||
8,
|
8,
|
||||||
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": {
|
"down": {
|
||||||
"uv": [
|
"uv": [
|
||||||
8,
|
8,
|
||||||
@@ -436,52 +436,8 @@
|
|||||||
9,
|
9,
|
||||||
8
|
8
|
||||||
],
|
],
|
||||||
"texture": "#texture1"
|
"texture": "#texture1",
|
||||||
},
|
"rotation": 180
|
||||||
"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"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
Before Width: | Height: | Size: 439 B |
|
Before Width: | Height: | Size: 462 B After Width: | Height: | Size: 439 B |
|
Before Width: | Height: | Size: 616 B After Width: | Height: | Size: 462 B |
|
After Width: | Height: | Size: 557 B |
|
Before Width: | Height: | Size: 324 B After Width: | Height: | Size: 616 B |
|
Before Width: | Height: | Size: 485 B After Width: | Height: | Size: 324 B |
|
Before Width: | Height: | Size: 220 B After Width: | Height: | Size: 485 B |
|
Before Width: | Height: | Size: 522 B After Width: | Height: | Size: 220 B |
|
Before Width: | Height: | Size: 150 B After Width: | Height: | Size: 522 B |
|
After Width: | Height: | Size: 150 B |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.1 KiB |