From 87a891eedcb2d87f3a2498eaed7cad1cb0a84701 Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Sun, 6 Oct 2019 19:25:22 +0200 Subject: [PATCH] Add basic grid block --- .../com/raoulvdberge/refinedstorage/RS.java | 12 ++- .../raoulvdberge/refinedstorage/RSBlocks.java | 4 +- .../raoulvdberge/refinedstorage/RSTiles.java | 8 +- .../network/grid/GridFactoryGridBlock.java | 6 +- ...workNodeGrid.java => GridNetworkNode.java} | 81 +++++++------- .../apiimpl/network/node/NetworkNode.java | 31 ++---- .../node/NetworkNodeCrafterManager.java | 5 + .../node/NetworkNodeCraftingMonitor.java | 6 ++ .../network/node/NetworkNodeReader.java | 6 ++ .../network/node/NetworkNodeWriter.java | 6 ++ .../block/{BlockGrid.java => GridBlock.java} | 95 ++++++++-------- .../refinedstorage/block/NodeBlock.java | 4 + .../container/GridContainer.java | 16 +-- .../refinedstorage/item/PatternItem.java | 6 +- .../refinedstorage/screen/grid/GuiGrid.java | 24 ++--- .../sidebutton/SideButtonGridSortingType.java | 6 +- .../refinedstorage/tile/NetworkNodeTile.java | 5 - .../grid/{TileGrid.java => GridTile.java} | 35 +++--- .../tile/grid/portable/TilePortableGrid.java | 56 +++++----- .../refinedstorage/blockstates/grid.json | 102 +++++------------- .../assets/refinedstorage/lang/en_us.json | 8 +- .../models/block/grid/normal/connected.json | 13 +++ .../block/grid/normal/disconnected.json | 13 +++ .../refinedstorage/models/item/grid.json | 3 + .../refinedstorage/recipes/grid.json | 12 +-- 25 files changed, 286 insertions(+), 277 deletions(-) rename src/main/java/com/raoulvdberge/refinedstorage/apiimpl/network/node/{NetworkNodeGrid.java => GridNetworkNode.java} (92%) mode change 100755 => 100644 rename src/main/java/com/raoulvdberge/refinedstorage/block/{BlockGrid.java => GridBlock.java} (57%) mode change 100755 => 100644 rename src/main/java/com/raoulvdberge/refinedstorage/tile/grid/{TileGrid.java => GridTile.java} (82%) mode change 100755 => 100644 mode change 100755 => 100644 src/main/resources/assets/refinedstorage/blockstates/grid.json create mode 100644 src/main/resources/assets/refinedstorage/models/block/grid/normal/connected.json create mode 100644 src/main/resources/assets/refinedstorage/models/block/grid/normal/disconnected.json create mode 100644 src/main/resources/assets/refinedstorage/models/item/grid.json rename src/main/resources/{assets => data}/refinedstorage/recipes/grid.json (61%) diff --git a/src/main/java/com/raoulvdberge/refinedstorage/RS.java b/src/main/java/com/raoulvdberge/refinedstorage/RS.java index 845a13085..ad78becdb 100755 --- a/src/main/java/com/raoulvdberge/refinedstorage/RS.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/RS.java @@ -1,8 +1,10 @@ package com.raoulvdberge.refinedstorage; +import com.raoulvdberge.refinedstorage.api.network.grid.GridType; import com.raoulvdberge.refinedstorage.apiimpl.API; import com.raoulvdberge.refinedstorage.apiimpl.network.NetworkNodeListener; import com.raoulvdberge.refinedstorage.apiimpl.network.node.CableNetworkNode; +import com.raoulvdberge.refinedstorage.apiimpl.network.node.GridNetworkNode; import com.raoulvdberge.refinedstorage.apiimpl.network.node.diskdrive.DiskDriveNetworkNode; import com.raoulvdberge.refinedstorage.apiimpl.storage.FluidStorageType; import com.raoulvdberge.refinedstorage.apiimpl.storage.ItemStorageType; @@ -25,6 +27,7 @@ import com.raoulvdberge.refinedstorage.tile.CableTile; import com.raoulvdberge.refinedstorage.tile.ControllerTile; import com.raoulvdberge.refinedstorage.tile.DiskDriveTile; import com.raoulvdberge.refinedstorage.tile.data.TileDataManager; +import com.raoulvdberge.refinedstorage.tile.grid.GridTile; import com.raoulvdberge.refinedstorage.util.BlockUtils; import net.minecraft.block.Block; import net.minecraft.inventory.container.ContainerType; @@ -67,7 +70,6 @@ public final class RS { FMLJavaModLoadingContext.get().getModEventBus().addGenericListener(Item.class, this::onRegisterItems); FMLJavaModLoadingContext.get().getModEventBus().addGenericListener(IRecipeSerializer.class, this::onRegisterRecipeSerializers); FMLJavaModLoadingContext.get().getModEventBus().addGenericListener(ContainerType.class, this::onRegisterContainers); - } @SubscribeEvent @@ -88,6 +90,8 @@ public final class RS { }); API.instance().getNetworkNodeRegistry().add(CableNetworkNode.ID, (tag, world, pos) -> new CableNetworkNode(world, pos)); + + API.instance().getNetworkNodeRegistry().add(GridNetworkNode.ID, (tag, world, pos) -> new GridNetworkNode(world, pos, GridType.NORMAL)); } @SubscribeEvent @@ -103,6 +107,7 @@ public final class RS { e.getRegistry().register(new MachineCasingBlock()); e.getRegistry().register(new CableBlock()); e.getRegistry().register(new DiskDriveBlock()); + e.getRegistry().register(new GridBlock(GridType.NORMAL)); } @SubscribeEvent @@ -119,6 +124,10 @@ public final class RS { e.getRegistry().register(registerTileDataParameters( TileEntityType.Builder.create(DiskDriveTile::new, RSBlocks.DISK_DRIVE).build(null).setRegistryName(RS.ID, "disk_drive") )); + + e.getRegistry().register(registerTileDataParameters( + TileEntityType.Builder.create(() -> new GridTile(GridType.NORMAL), RSBlocks.GRID).build(null).setRegistryName(RS.ID, "grid") + )); } private TileEntityType registerTileDataParameters(TileEntityType t) { @@ -185,6 +194,7 @@ public final class RS { e.getRegistry().register(BlockUtils.createBlockItemFor(RSBlocks.MACHINE_CASING)); e.getRegistry().register(BlockUtils.createBlockItemFor(RSBlocks.CABLE)); e.getRegistry().register(BlockUtils.createBlockItemFor(RSBlocks.DISK_DRIVE)); + e.getRegistry().register(BlockUtils.createBlockItemFor(RSBlocks.GRID)); } /* TODO diff --git a/src/main/java/com/raoulvdberge/refinedstorage/RSBlocks.java b/src/main/java/com/raoulvdberge/refinedstorage/RSBlocks.java index 0cbff412c..e121b998a 100755 --- a/src/main/java/com/raoulvdberge/refinedstorage/RSBlocks.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/RSBlocks.java @@ -4,7 +4,6 @@ import com.raoulvdberge.refinedstorage.block.*; import net.minecraftforge.registries.ObjectHolder; public final class RSBlocks { - public static final BlockGrid GRID = new BlockGrid(); public static final BlockExternalStorage EXTERNAL_STORAGE = new BlockExternalStorage(); public static final BlockImporter IMPORTER = new BlockImporter(); public static final BlockExporter EXPORTER = new BlockExporter(); @@ -43,6 +42,9 @@ public final class RSBlocks { @ObjectHolder(RS.ID + ":disk_drive") public static final DiskDriveBlock DISK_DRIVE = null; + @ObjectHolder(RS.ID + ":grid") + public static final GridBlock GRID = null; + public static final BlockStorageMonitor STORAGE_MONITOR = new BlockStorageMonitor(); public static final BlockPortableGrid PORTABLE_GRID = new BlockPortableGrid(); public static final BlockCrafterManager CRAFTER_MANAGER = new BlockCrafterManager(); diff --git a/src/main/java/com/raoulvdberge/refinedstorage/RSTiles.java b/src/main/java/com/raoulvdberge/refinedstorage/RSTiles.java index 3f430eaab..5a1598203 100644 --- a/src/main/java/com/raoulvdberge/refinedstorage/RSTiles.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/RSTiles.java @@ -2,7 +2,7 @@ package com.raoulvdberge.refinedstorage; import com.raoulvdberge.refinedstorage.tile.*; import com.raoulvdberge.refinedstorage.tile.craftingmonitor.TileCraftingMonitor; -import com.raoulvdberge.refinedstorage.tile.grid.TileGrid; +import com.raoulvdberge.refinedstorage.tile.grid.GridTile; import com.raoulvdberge.refinedstorage.tile.grid.portable.TilePortableGrid; import net.minecraft.tileentity.TileEntityType; import net.minecraftforge.registries.ObjectHolder; @@ -41,8 +41,10 @@ public class RSTiles { public static final TileEntityType FLUID_INTERFACE = null; //@ObjectHolder(RS.ID + ":fluid_storage") public static final TileEntityType FLUID_STORAGE = null; - //@ObjectHolder(RS.ID + ":grid") - public static final TileEntityType GRID = null; + + @ObjectHolder(RS.ID + ":grid") + public static final TileEntityType GRID = null; + //@ObjectHolder(RS.ID + ":importer") public static final TileEntityType IMPORTER = null; //@ObjectHolder(RS.ID + ":interface") diff --git a/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/network/grid/GridFactoryGridBlock.java b/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/network/grid/GridFactoryGridBlock.java index 02a838488..79280ec4b 100644 --- a/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/network/grid/GridFactoryGridBlock.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/network/grid/GridFactoryGridBlock.java @@ -3,7 +3,7 @@ package com.raoulvdberge.refinedstorage.apiimpl.network.grid; import com.raoulvdberge.refinedstorage.api.network.grid.GridFactoryType; import com.raoulvdberge.refinedstorage.api.network.grid.IGrid; import com.raoulvdberge.refinedstorage.api.network.grid.IGridFactory; -import com.raoulvdberge.refinedstorage.tile.grid.TileGrid; +import com.raoulvdberge.refinedstorage.tile.grid.GridTile; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; @@ -24,8 +24,8 @@ public class GridFactoryGridBlock implements IGridFactory { public IGrid createFromBlock(PlayerEntity player, BlockPos pos) { TileEntity tile = getRelevantTile(player.getEntityWorld(), pos); - if (tile instanceof TileGrid) { - return ((TileGrid) tile).getNode(); + if (tile instanceof GridTile) { + return ((GridTile) tile).getNode(); } return null; diff --git a/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/network/node/NetworkNodeGrid.java b/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/network/node/GridNetworkNode.java old mode 100755 new mode 100644 similarity index 92% rename from src/main/java/com/raoulvdberge/refinedstorage/apiimpl/network/node/NetworkNodeGrid.java rename to src/main/java/com/raoulvdberge/refinedstorage/apiimpl/network/node/GridNetworkNode.java index 4255e3a9d..d1b46b885 --- a/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/network/node/NetworkNodeGrid.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/network/node/GridNetworkNode.java @@ -1,7 +1,5 @@ package com.raoulvdberge.refinedstorage.apiimpl.network.node; -import com.raoulvdberge.refinedstorage.RS; -import com.raoulvdberge.refinedstorage.RSBlocks; import com.raoulvdberge.refinedstorage.RSItems; import com.raoulvdberge.refinedstorage.api.network.INetwork; import com.raoulvdberge.refinedstorage.api.network.grid.*; @@ -16,7 +14,7 @@ import com.raoulvdberge.refinedstorage.api.util.IFilter; import com.raoulvdberge.refinedstorage.apiimpl.API; import com.raoulvdberge.refinedstorage.apiimpl.storage.StorageCacheListenerGridFluid; import com.raoulvdberge.refinedstorage.apiimpl.storage.StorageCacheListenerGridItem; -import com.raoulvdberge.refinedstorage.block.BlockGrid; +import com.raoulvdberge.refinedstorage.block.NodeBlock; import com.raoulvdberge.refinedstorage.inventory.fluid.FluidInventory; import com.raoulvdberge.refinedstorage.inventory.item.ItemHandlerBase; import com.raoulvdberge.refinedstorage.inventory.item.ItemHandlerFilter; @@ -25,9 +23,8 @@ import com.raoulvdberge.refinedstorage.inventory.listener.ListenerNetworkNode; import com.raoulvdberge.refinedstorage.item.PatternItem; import com.raoulvdberge.refinedstorage.tile.config.IType; import com.raoulvdberge.refinedstorage.tile.data.TileDataManager; -import com.raoulvdberge.refinedstorage.tile.grid.TileGrid; +import com.raoulvdberge.refinedstorage.tile.grid.GridTile; import com.raoulvdberge.refinedstorage.util.StackUtils; -import net.minecraft.block.BlockState; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.ServerPlayerEntity; import net.minecraft.inventory.CraftResultInventory; @@ -58,7 +55,7 @@ import java.util.HashSet; import java.util.List; import java.util.Set; -public class NetworkNodeGrid extends NetworkNode implements IGridNetworkAware, IType { +public class GridNetworkNode extends NetworkNode implements IGridNetworkAware, IType { public static final String ID = "grid"; public static int FACTORY_ID = 0; @@ -102,23 +99,23 @@ public class NetworkNodeGrid extends NetworkNode implements IGridNetworkAware, I ItemStack pattern = getStackInSlot(slot); if (slot == 1 && !pattern.isEmpty()) { - /* TODO boolean isPatternProcessing = ItemPattern.isProcessing(pattern); + boolean isPatternProcessing = PatternItem.isProcessing(pattern); if (isPatternProcessing && isProcessingPattern()) { for (int i = 0; i < 9; ++i) { - processingMatrix.setStackInSlot(i, StackUtils.nullToEmpty(ItemPattern.getInputSlot(pattern, i))); - processingMatrixFluids.setFluid(i, ItemPattern.getFluidInputSlot(pattern, i)); + processingMatrix.setStackInSlot(i, StackUtils.nullToEmpty(PatternItem.getInputSlot(pattern, i))); + processingMatrixFluids.setFluid(i, PatternItem.getFluidInputSlot(pattern, i)); } for (int i = 0; i < 9; ++i) { - processingMatrix.setStackInSlot(9 + i, StackUtils.nullToEmpty(ItemPattern.getOutputSlot(pattern, i))); - processingMatrixFluids.setFluid(9 + i, ItemPattern.getFluidOutputSlot(pattern, i)); + processingMatrix.setStackInSlot(9 + i, StackUtils.nullToEmpty(PatternItem.getOutputSlot(pattern, i))); + processingMatrixFluids.setFluid(9 + i, PatternItem.getFluidOutputSlot(pattern, i)); } } else if (!isPatternProcessing && !isProcessingPattern()) { for (int i = 0; i < 9; ++i) { - matrix.setInventorySlotContents(i, StackUtils.nullToEmpty(ItemPattern.getInputSlot(pattern, i))); + matrix.setInventorySlotContents(i, StackUtils.nullToEmpty(PatternItem.getInputSlot(pattern, i))); } - }*/ + } } } @@ -161,13 +158,17 @@ public class NetworkNodeGrid extends NetworkNode implements IGridNetworkAware, I private boolean processingPattern = false; private int processingType = IType.ITEMS; - public NetworkNodeGrid(World world, BlockPos pos) { + private final GridType gridType; + + public GridNetworkNode(World world, BlockPos pos, GridType gridType) { super(world, pos); + + this.gridType = gridType; } @Override public int getEnergyUsage() { - switch (getGridType()) { + /* @TODO switch (getGridType()) { case NORMAL: return RS.INSTANCE.config.gridUsage; case CRAFTING: @@ -178,7 +179,8 @@ public class NetworkNodeGrid extends NetworkNode implements IGridNetworkAware, I return RS.INSTANCE.config.fluidGridUsage; default: return 0; - } + }*/ + return 0; } public void setViewType(int viewType) { @@ -218,7 +220,7 @@ public class NetworkNodeGrid extends NetworkNode implements IGridNetworkAware, I } public boolean isProcessingPattern() { - return world.isRemote ? TileGrid.PROCESSING_PATTERN.getValue() : processingPattern; + return world.isRemote ? GridTile.PROCESSING_PATTERN.getValue() : processingPattern; } public void setProcessingPattern(boolean processingPattern) { @@ -227,15 +229,7 @@ public class NetworkNodeGrid extends NetworkNode implements IGridNetworkAware, I @Override public GridType getGridType() { - if (type == null) { - BlockState state = world.getBlockState(pos); - - if (state.getBlock() == RSBlocks.GRID) { - type = state.get(BlockGrid.TYPE); - } - } - - return type == null ? GridType.NORMAL : type; + return gridType; } @Override @@ -454,6 +448,11 @@ public class NetworkNodeGrid extends NetworkNode implements IGridNetworkAware, I // NO OP } + @Override + public boolean isActive() { + return world.getBlockState(pos).get(NodeBlock.CONNECTED); + } + @Override public void onCrafted(PlayerEntity player) { onCrafted(this, world, player); @@ -626,37 +625,37 @@ public class NetworkNodeGrid extends NetworkNode implements IGridNetworkAware, I @Override public int getViewType() { - return world.isRemote ? TileGrid.VIEW_TYPE.getValue() : viewType; + return world.isRemote ? GridTile.VIEW_TYPE.getValue() : viewType; } @Override public int getSortingDirection() { - return world.isRemote ? TileGrid.SORTING_DIRECTION.getValue() : sortingDirection; + return world.isRemote ? GridTile.SORTING_DIRECTION.getValue() : sortingDirection; } @Override public int getSortingType() { - return world.isRemote ? TileGrid.SORTING_TYPE.getValue() : sortingType; + return world.isRemote ? GridTile.SORTING_TYPE.getValue() : sortingType; } @Override public int getSearchBoxMode() { - return world.isRemote ? TileGrid.SEARCH_BOX_MODE.getValue() : searchBoxMode; + return world.isRemote ? GridTile.SEARCH_BOX_MODE.getValue() : searchBoxMode; } @Override public int getSize() { - return world.isRemote ? TileGrid.SIZE.getValue() : size; + return world.isRemote ? GridTile.SIZE.getValue() : size; } @Override public int getTabSelected() { - return world.isRemote ? TileGrid.TAB_SELECTED.getValue() : tabSelected; + return world.isRemote ? GridTile.TAB_SELECTED.getValue() : tabSelected; } @Override public int getTabPage() { - return world.isRemote ? TileGrid.TAB_PAGE.getValue() : Math.min(tabPage, getTotalTabPages()); + return world.isRemote ? GridTile.TAB_PAGE.getValue() : Math.min(tabPage, getTotalTabPages()); } @Override @@ -666,44 +665,44 @@ public class NetworkNodeGrid extends NetworkNode implements IGridNetworkAware, I @Override public void onViewTypeChanged(int type) { - TileDataManager.setParameter(TileGrid.VIEW_TYPE, type); + TileDataManager.setParameter(GridTile.VIEW_TYPE, type); } @Override public void onSortingTypeChanged(int type) { - TileDataManager.setParameter(TileGrid.SORTING_TYPE, type); + TileDataManager.setParameter(GridTile.SORTING_TYPE, type); } @Override public void onSortingDirectionChanged(int direction) { - TileDataManager.setParameter(TileGrid.SORTING_DIRECTION, direction); + TileDataManager.setParameter(GridTile.SORTING_DIRECTION, direction); } @Override public void onSearchBoxModeChanged(int searchBoxMode) { - TileDataManager.setParameter(TileGrid.SEARCH_BOX_MODE, searchBoxMode); + TileDataManager.setParameter(GridTile.SEARCH_BOX_MODE, searchBoxMode); } @Override public void onSizeChanged(int size) { - TileDataManager.setParameter(TileGrid.SIZE, size); + TileDataManager.setParameter(GridTile.SIZE, size); } @Override public void onTabSelectionChanged(int tab) { - TileDataManager.setParameter(TileGrid.TAB_SELECTED, tab); + TileDataManager.setParameter(GridTile.TAB_SELECTED, tab); } @Override public void onTabPageChanged(int page) { if (page >= 0 && page <= getTotalTabPages()) { - TileDataManager.setParameter(TileGrid.TAB_PAGE, page); + TileDataManager.setParameter(GridTile.TAB_PAGE, page); } } @Override public int getType() { - return world.isRemote ? TileGrid.PROCESSING_TYPE.getValue() : processingType; + return world.isRemote ? GridTile.PROCESSING_TYPE.getValue() : processingType; } @Override diff --git a/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/network/node/NetworkNode.java b/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/network/node/NetworkNode.java index ee4c451aa..05ccdf39a 100755 --- a/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/network/node/NetworkNode.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/network/node/NetworkNode.java @@ -6,8 +6,8 @@ import com.raoulvdberge.refinedstorage.api.network.node.INetworkNode; import com.raoulvdberge.refinedstorage.api.util.Action; import com.raoulvdberge.refinedstorage.apiimpl.API; import com.raoulvdberge.refinedstorage.block.BaseBlock; +import com.raoulvdberge.refinedstorage.block.NodeBlock; import com.raoulvdberge.refinedstorage.tile.config.RedstoneMode; -import com.raoulvdberge.refinedstorage.util.WorldUtils; import net.minecraft.block.BlockState; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -51,8 +51,6 @@ public abstract class NetworkNode implements INetworkNode, INetworkNodeVisitor { private boolean couldUpdate; private int ticksSinceUpdateChanged; - private boolean active; - public NetworkNode(World world, BlockPos pos) { if (world == null) { throw new IllegalArgumentException("World cannot be null"); @@ -93,7 +91,11 @@ public abstract class NetworkNode implements INetworkNode, INetworkNodeVisitor { } protected void onConnectedStateChange(INetwork network, boolean state) { - // NO OP + BlockState blockState = world.getBlockState(pos); + + if (blockState.getBlock() instanceof NodeBlock && ((NodeBlock) blockState.getBlock()).hasConnectedState()) { + world.setBlockState(pos, world.getBlockState(pos).with(NodeBlock.CONNECTED, state)); + } } @Override @@ -126,6 +128,11 @@ public abstract class NetworkNode implements INetworkNode, INetworkNodeVisitor { throttlingDisabled = true; } + // @TODO: DELETE. + public boolean hasConnectivityState() { + return true; + } + @Override public void update() { ++ticks; @@ -140,10 +147,6 @@ public abstract class NetworkNode implements INetworkNode, INetworkNodeVisitor { couldUpdate = canUpdate; throttlingDisabled = false; - if (hasConnectivityState()) { - WorldUtils.updateBlock(world, pos); - } - if (network != null) { onConnectedStateChange(network, canUpdate); @@ -247,18 +250,6 @@ public abstract class NetworkNode implements INetworkNode, INetworkNodeVisitor { return false; } - public boolean hasConnectivityState() { - return false; - } - - public boolean isActive() { - return active; - } - - public void setActive(boolean active) { - this.active = active; - } - public void setOwner(@Nullable UUID owner) { this.owner = owner; diff --git a/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/network/node/NetworkNodeCrafterManager.java b/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/network/node/NetworkNodeCrafterManager.java index 2c4ff4670..3799c2784 100644 --- a/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/network/node/NetworkNodeCrafterManager.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/network/node/NetworkNodeCrafterManager.java @@ -2,6 +2,7 @@ package com.raoulvdberge.refinedstorage.apiimpl.network.node; import com.raoulvdberge.refinedstorage.RS; import com.raoulvdberge.refinedstorage.api.network.grid.IGrid; +import com.raoulvdberge.refinedstorage.block.NodeBlock; import com.raoulvdberge.refinedstorage.tile.TileCrafterManager; import net.minecraft.entity.player.ServerPlayerEntity; import net.minecraft.nbt.CompoundNBT; @@ -80,4 +81,8 @@ public class NetworkNodeCrafterManager extends NetworkNode { public boolean hasConnectivityState() { return true; } + + public boolean isActive() { + return world.getBlockState(pos).get(NodeBlock.CONNECTED); + } } diff --git a/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/network/node/NetworkNodeCraftingMonitor.java b/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/network/node/NetworkNodeCraftingMonitor.java index 411b2883f..b7a37b423 100755 --- a/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/network/node/NetworkNodeCraftingMonitor.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/network/node/NetworkNodeCraftingMonitor.java @@ -3,6 +3,7 @@ package com.raoulvdberge.refinedstorage.apiimpl.network.node; import com.raoulvdberge.refinedstorage.RS; import com.raoulvdberge.refinedstorage.api.autocrafting.ICraftingManager; import com.raoulvdberge.refinedstorage.api.autocrafting.task.ICraftingTask; +import com.raoulvdberge.refinedstorage.block.NodeBlock; import com.raoulvdberge.refinedstorage.tile.craftingmonitor.ICraftingMonitor; import com.raoulvdberge.refinedstorage.tile.craftingmonitor.TileCraftingMonitor; import com.raoulvdberge.refinedstorage.tile.data.TileDataManager; @@ -75,6 +76,11 @@ public class NetworkNodeCraftingMonitor extends NetworkNode implements ICrafting return network != null ? network.getCraftingManager() : null; } + @Override + public boolean isActive() { + return world.getBlockState(pos).get(NodeBlock.CONNECTED); + } + @Override public CompoundNBT write(CompoundNBT tag) { super.write(tag); diff --git a/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/network/node/NetworkNodeReader.java b/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/network/node/NetworkNodeReader.java index adc07fa9a..1e89870a0 100755 --- a/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/network/node/NetworkNodeReader.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/network/node/NetworkNodeReader.java @@ -3,6 +3,7 @@ package com.raoulvdberge.refinedstorage.apiimpl.network.node; import com.raoulvdberge.refinedstorage.RS; import com.raoulvdberge.refinedstorage.api.network.readerwriter.IReader; import com.raoulvdberge.refinedstorage.apiimpl.network.node.cover.CoverManager; +import com.raoulvdberge.refinedstorage.block.NodeBlock; import com.raoulvdberge.refinedstorage.tile.TileReader; import com.raoulvdberge.refinedstorage.tile.data.TileDataParameter; import net.minecraft.nbt.CompoundNBT; @@ -62,6 +63,11 @@ public class NetworkNodeReader extends NetworkNode implements IReader, IGuiReade return TileReader.REDSTONE_MODE; } + @Override + public boolean isActive() { + return world.getBlockState(pos).get(NodeBlock.CONNECTED); + } + @Override public boolean hasConnectivityState() { return true; diff --git a/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/network/node/NetworkNodeWriter.java b/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/network/node/NetworkNodeWriter.java index 3b5901bc5..048ebb1f5 100755 --- a/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/network/node/NetworkNodeWriter.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/network/node/NetworkNodeWriter.java @@ -6,6 +6,7 @@ import com.raoulvdberge.refinedstorage.api.network.readerwriter.IReaderWriterCha import com.raoulvdberge.refinedstorage.api.network.readerwriter.IReaderWriterHandler; import com.raoulvdberge.refinedstorage.api.network.readerwriter.IWriter; import com.raoulvdberge.refinedstorage.apiimpl.network.node.cover.CoverManager; +import com.raoulvdberge.refinedstorage.block.NodeBlock; import com.raoulvdberge.refinedstorage.tile.TileWriter; import com.raoulvdberge.refinedstorage.tile.data.TileDataParameter; import net.minecraft.nbt.CompoundNBT; @@ -94,6 +95,11 @@ public class NetworkNodeWriter extends NetworkNode implements IWriter, IGuiReade return TileWriter.REDSTONE_MODE; } + @Override + public boolean isActive() { + return world.getBlockState(pos).get(NodeBlock.CONNECTED); + } + @Override public boolean hasConnectivityState() { return true; diff --git a/src/main/java/com/raoulvdberge/refinedstorage/block/BlockGrid.java b/src/main/java/com/raoulvdberge/refinedstorage/block/GridBlock.java old mode 100755 new mode 100644 similarity index 57% rename from src/main/java/com/raoulvdberge/refinedstorage/block/BlockGrid.java rename to src/main/java/com/raoulvdberge/refinedstorage/block/GridBlock.java index 1c0304a88..7ce4d7420 --- a/src/main/java/com/raoulvdberge/refinedstorage/block/BlockGrid.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/block/GridBlock.java @@ -1,21 +1,58 @@ package com.raoulvdberge.refinedstorage.block; +import com.raoulvdberge.refinedstorage.RS; import com.raoulvdberge.refinedstorage.api.network.grid.GridType; -import com.raoulvdberge.refinedstorage.block.info.BlockInfoBuilder; -import com.raoulvdberge.refinedstorage.tile.grid.TileGrid; -import net.minecraft.state.EnumProperty; +import com.raoulvdberge.refinedstorage.block.info.BlockDirection; +import com.raoulvdberge.refinedstorage.tile.grid.GridTile; +import com.raoulvdberge.refinedstorage.util.BlockUtils; +import net.minecraft.block.BlockState; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.BlockRenderLayer; +import net.minecraft.world.IBlockReader; -public class BlockGrid extends BlockNode { - public static final EnumProperty TYPE = EnumProperty.create("type", GridType.class); +import javax.annotation.Nullable; - public BlockGrid() { - super(BlockInfoBuilder.forId("grid").tileEntity(TileGrid::new).create()); +public class GridBlock extends NodeBlock { + private final GridType type; + + public GridBlock(GridType type) { + super(BlockUtils.DEFAULT_ROCK_PROPERTIES); + + this.type = type; + + this.setRegistryName(RS.ID, type == GridType.NORMAL ? "grid" : type.getName() + "_grid"); } -/* + + @Override + public BlockRenderLayer getRenderLayer() { + return BlockRenderLayer.CUTOUT; + } + + @Override + public BlockDirection getDirection() { + return BlockDirection.HORIZONTAL; + } + + @Override + public boolean hasConnectedState() { + return true; + } + + @Override + public boolean hasTileEntity(BlockState state) { + return true; + } + + @Nullable + @Override + public TileEntity createTileEntity(BlockState state, IBlockReader world) { + return new GridTile(type); + } + + /* @Override @OnlyIn(Dist.CLIENT) public void registerModels(IModelRegistration modelRegistration) { - modelRegistration.setModel(this, GridType.NORMAL.getId(), new ModelResourceLocation(info.getId(), "connected=false,direction=north,type=normal")); modelRegistration.setModel(this, GridType.CRAFTING.getId(), new ModelResourceLocation(info.getId(), "connected=false,direction=north,type=crafting")); modelRegistration.setModel(this, GridType.PATTERN.getId(), new ModelResourceLocation(info.getId(), "connected=false,direction=north,type=pattern")); modelRegistration.setModel(this, GridType.FLUID.getId(), new ModelResourceLocation(info.getId(), "connected=false,direction=north,type=fluid")); @@ -29,48 +66,8 @@ public class BlockGrid extends BlockNode { )); } - @Override - public BlockRenderLayer getRenderLayer() { - return BlockRenderLayer.CUTOUT; - } - - @Override - @Nullable - public BlockDirection getDirection() { - return BlockDirection.HORIZONTAL; - } - - @Override - public void getSubBlocks(CreativeTabs tab, NonNullList items) { - for (int i = 0; i <= 3; i++) { - items.add(new ItemStack(this, 1, i)); - } - } - - @Override - protected BlockStateContainer createBlockState() { - return createBlockStateBuilder() - .add(TYPE) - .build(); - } - - @Override - public BlockState getStateFromMeta(int meta) { - return getDefaultState().withProperty(TYPE, meta == 0 ? GridType.NORMAL : (meta == 1 ? GridType.CRAFTING : (meta == 2 ? GridType.PATTERN : GridType.FLUID))); - } - - @Override - public int getMetaFromState(BlockState state) { - return state.getValue(TYPE) == GridType.NORMAL ? 0 : (state.getValue(TYPE) == GridType.CRAFTING ? 1 : (state.getValue(TYPE) == GridType.PATTERN ? 2 : 3)); - } - @Override public boolean onBlockActivated(World world, BlockPos pos, BlockState state, PlayerEntity player, EnumHand hand, Direction side, float hitX, float hitY, float hitZ) { return openNetworkGui(player, world, pos, side, () -> API.instance().getGridManager().openGrid(NetworkNodeGrid.FACTORY_ID, (ServerPlayerEntity) player, pos)); }*/ - - @Override - public boolean hasConnectedState() { - return true; - } } diff --git a/src/main/java/com/raoulvdberge/refinedstorage/block/NodeBlock.java b/src/main/java/com/raoulvdberge/refinedstorage/block/NodeBlock.java index 4c1081c72..edbbbee46 100644 --- a/src/main/java/com/raoulvdberge/refinedstorage/block/NodeBlock.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/block/NodeBlock.java @@ -24,6 +24,10 @@ public abstract class NodeBlock extends BaseBlock { public NodeBlock(Block.Properties props) { super(props); + + if (hasConnectedState()) { + this.setDefaultState(this.getStateContainer().getBaseState().with(CONNECTED, false)); + } } @Override diff --git a/src/main/java/com/raoulvdberge/refinedstorage/container/GridContainer.java b/src/main/java/com/raoulvdberge/refinedstorage/container/GridContainer.java index ca5b5a394..0cad10505 100644 --- a/src/main/java/com/raoulvdberge/refinedstorage/container/GridContainer.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/container/GridContainer.java @@ -8,7 +8,7 @@ import com.raoulvdberge.refinedstorage.api.network.grid.handler.IFluidGridHandle import com.raoulvdberge.refinedstorage.api.network.grid.handler.IItemGridHandler; import com.raoulvdberge.refinedstorage.api.storage.IStorageCache; import com.raoulvdberge.refinedstorage.api.storage.IStorageCacheListener; -import com.raoulvdberge.refinedstorage.apiimpl.network.node.NetworkNodeGrid; +import com.raoulvdberge.refinedstorage.apiimpl.network.node.GridNetworkNode; import com.raoulvdberge.refinedstorage.container.slot.filter.FilterSlot; import com.raoulvdberge.refinedstorage.container.slot.filter.FluidFilterSlot; import com.raoulvdberge.refinedstorage.container.slot.grid.CraftingGridSlot; @@ -158,10 +158,10 @@ public class GridContainer extends BaseContainer implements IGridCraftingListene private void addPatternSlots() { int headerAndSlots = display.getTopHeight() + (display.getVisibleRows() * 18); - addSlot(new SlotItemHandler(((NetworkNodeGrid) grid).getPatterns(), 0, 172, headerAndSlots + 4)); - addSlot(new SlotItemHandler(((NetworkNodeGrid) grid).getPatterns(), 1, 172, headerAndSlots + 40)); + addSlot(new SlotItemHandler(((GridNetworkNode) grid).getPatterns(), 0, 172, headerAndSlots + 4)); + addSlot(new SlotItemHandler(((GridNetworkNode) grid).getPatterns(), 1, 172, headerAndSlots + 40)); - transferManager.addBiTransfer(getPlayer().inventory, ((NetworkNodeGrid) grid).getPatterns()); + transferManager.addBiTransfer(getPlayer().inventory, ((GridNetworkNode) grid).getPatterns()); // Processing patterns int ox = 8; @@ -169,8 +169,8 @@ public class GridContainer extends BaseContainer implements IGridCraftingListene int y = headerAndSlots + 4; for (int i = 0; i < 9 * 2; ++i) { - addSlot(new FilterSlot(((NetworkNodeGrid) grid).getProcessingMatrix(), i, x, y, FilterSlot.FILTER_ALLOW_SIZE).setEnableHandler(() -> ((NetworkNodeGrid) grid).isProcessingPattern() && ((NetworkNodeGrid) grid).getType() == IType.ITEMS)); - addSlot(new FluidFilterSlot(((NetworkNodeGrid) grid).getProcessingMatrixFluids(), i, x, y, FilterSlot.FILTER_ALLOW_SIZE).setEnableHandler(() -> ((NetworkNodeGrid) grid).isProcessingPattern() && ((NetworkNodeGrid) grid).getType() == IType.FLUIDS)); + addSlot(new FilterSlot(((GridNetworkNode) grid).getProcessingMatrix(), i, x, y, FilterSlot.FILTER_ALLOW_SIZE).setEnableHandler(() -> ((GridNetworkNode) grid).isProcessingPattern() && ((GridNetworkNode) grid).getType() == IType.ITEMS)); + addSlot(new FluidFilterSlot(((GridNetworkNode) grid).getProcessingMatrixFluids(), i, x, y, FilterSlot.FILTER_ALLOW_SIZE).setEnableHandler(() -> ((GridNetworkNode) grid).isProcessingPattern() && ((GridNetworkNode) grid).getType() == IType.FLUIDS)); x += 18; @@ -191,7 +191,7 @@ public class GridContainer extends BaseContainer implements IGridCraftingListene y = headerAndSlots + 4; for (int i = 0; i < 9; ++i) { - addSlot(new FilterLegacySlot(grid.getCraftingMatrix(), i, x, y).setEnableHandler(() -> !((NetworkNodeGrid) grid).isProcessingPattern())); + addSlot(new FilterLegacySlot(grid.getCraftingMatrix(), i, x, y).setEnableHandler(() -> !((GridNetworkNode) grid).isProcessingPattern())); x += 18; @@ -201,7 +201,7 @@ public class GridContainer extends BaseContainer implements IGridCraftingListene } } - addSlot(patternResultSlot = (new DisabledLegacySlot(grid.getCraftingResult(), 0, 134, headerAndSlots + 22).setEnableHandler(() -> !((NetworkNodeGrid) grid).isProcessingPattern()))); + addSlot(patternResultSlot = (new DisabledLegacySlot(grid.getCraftingResult(), 0, 134, headerAndSlots + 22).setEnableHandler(() -> !((GridNetworkNode) grid).isProcessingPattern()))); } public IGrid getGrid() { diff --git a/src/main/java/com/raoulvdberge/refinedstorage/item/PatternItem.java b/src/main/java/com/raoulvdberge/refinedstorage/item/PatternItem.java index 1a05b9a9d..4cb8e933e 100644 --- a/src/main/java/com/raoulvdberge/refinedstorage/item/PatternItem.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/item/PatternItem.java @@ -178,12 +178,11 @@ public class PatternItem extends Item implements ICraftingPatternProvider { pattern.getTag().put(String.format(NBT_FLUID_INPUT_SLOT, slot), stack.writeToNBT(new CompoundNBT())); } - @Nullable public static FluidStack getFluidInputSlot(ItemStack pattern, int slot) { String id = String.format(NBT_FLUID_INPUT_SLOT, slot); if (!pattern.hasTag() || !pattern.getTag().contains(id)) { - return null; + return FluidStack.EMPTY; } return FluidStack.loadFluidStackFromNBT(pattern.getTag().getCompound(id)); @@ -197,12 +196,11 @@ public class PatternItem extends Item implements ICraftingPatternProvider { pattern.getTag().put(String.format(NBT_FLUID_OUTPUT_SLOT, slot), stack.writeToNBT(new CompoundNBT())); } - @Nullable public static FluidStack getFluidOutputSlot(ItemStack pattern, int slot) { String id = String.format(NBT_FLUID_OUTPUT_SLOT, slot); if (!pattern.hasTag() || !pattern.getTag().contains(id)) { - return null; + return FluidStack.EMPTY; } return FluidStack.loadFluidStackFromNBT(pattern.getTag().getCompound(id)); diff --git a/src/main/java/com/raoulvdberge/refinedstorage/screen/grid/GuiGrid.java b/src/main/java/com/raoulvdberge/refinedstorage/screen/grid/GuiGrid.java index ea87bf808..ab3e4f0fc 100644 --- a/src/main/java/com/raoulvdberge/refinedstorage/screen/grid/GuiGrid.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/screen/grid/GuiGrid.java @@ -5,7 +5,7 @@ import com.mojang.blaze3d.platform.GlStateManager; import com.raoulvdberge.refinedstorage.RS; import com.raoulvdberge.refinedstorage.api.network.grid.GridType; import com.raoulvdberge.refinedstorage.api.network.grid.IGrid; -import com.raoulvdberge.refinedstorage.apiimpl.network.node.NetworkNodeGrid; +import com.raoulvdberge.refinedstorage.apiimpl.network.node.GridNetworkNode; import com.raoulvdberge.refinedstorage.apiimpl.render.ElementDrawers; import com.raoulvdberge.refinedstorage.container.GridContainer; import com.raoulvdberge.refinedstorage.screen.BaseScreen; @@ -21,7 +21,7 @@ import com.raoulvdberge.refinedstorage.screen.widget.SearchWidget; import com.raoulvdberge.refinedstorage.screen.widget.TabListWidget; import com.raoulvdberge.refinedstorage.screen.widget.sidebutton.*; import com.raoulvdberge.refinedstorage.tile.config.IType; -import com.raoulvdberge.refinedstorage.tile.grid.TileGrid; +import com.raoulvdberge.refinedstorage.tile.grid.GridTile; import com.raoulvdberge.refinedstorage.tile.grid.portable.IPortableGrid; import com.raoulvdberge.refinedstorage.tile.grid.portable.TilePortableGrid; import com.raoulvdberge.refinedstorage.util.RenderUtils; @@ -86,8 +86,8 @@ public class GuiGrid extends BaseScreen implements IResizableDisp this.scrollbar = new ScrollbarWidget(this, 174, getTopHeight(), 12, (getVisibleRows() * 18) - 2); - if (grid instanceof NetworkNodeGrid || grid instanceof TilePortableGrid) { - addSideButton(new SideButtonRedstoneMode(this, grid instanceof NetworkNodeGrid ? TileGrid.REDSTONE_MODE : TilePortableGrid.REDSTONE_MODE)); + if (grid instanceof GridNetworkNode || grid instanceof TilePortableGrid) { + addSideButton(new SideButtonRedstoneMode(this, grid instanceof GridNetworkNode ? GridTile.REDSTONE_MODE : TilePortableGrid.REDSTONE_MODE)); } int sx = x + 80 + 1; @@ -114,20 +114,20 @@ public class GuiGrid extends BaseScreen implements IResizableDisp addSideButton(new SideButtonGridSize(this, () -> grid.getSize(), size -> grid.onSizeChanged(size))); if (grid.getGridType() == GridType.PATTERN) { - processingPattern = addCheckBox(x + 7, y + getTopHeight() + (getVisibleRows() * 18) + 60, I18n.format("misc.refinedstorage.processing"), TileGrid.PROCESSING_PATTERN.getValue(), btn -> { + processingPattern = addCheckBox(x + 7, y + getTopHeight() + (getVisibleRows() * 18) + 60, I18n.format("misc.refinedstorage.processing"), GridTile.PROCESSING_PATTERN.getValue(), btn -> { }); boolean showOredict = true; - if (((NetworkNodeGrid) grid).isProcessingPattern() && ((NetworkNodeGrid) grid).getType() == IType.FLUIDS) { + if (((GridNetworkNode) grid).isProcessingPattern() && ((GridNetworkNode) grid).getType() == IType.FLUIDS) { showOredict = false; } if (showOredict) { - oredictPattern = addCheckBox(processingPattern.x + processingPattern.getWidth() + 5, y + getTopHeight() + (getVisibleRows() * 18) + 60, I18n.format("misc.refinedstorage:oredict"), TileGrid.OREDICT_PATTERN.getValue(), btn -> { + oredictPattern = addCheckBox(processingPattern.x + processingPattern.getWidth() + 5, y + getTopHeight() + (getVisibleRows() * 18) + 60, I18n.format("misc.refinedstorage:oredict"), GridTile.OREDICT_PATTERN.getValue(), btn -> { }); } - addSideButton(new SideButtonType(this, TileGrid.PROCESSING_TYPE)); + addSideButton(new SideButtonType(this, GridTile.PROCESSING_TYPE)); } updateScrollbar(); @@ -243,7 +243,7 @@ public class GuiGrid extends BaseScreen implements IResizableDisp case CRAFTING: return RenderUtils.inBounds(82, y, 7, 7, mouseX, mouseY); case PATTERN: - if (((NetworkNodeGrid) grid).isProcessingPattern()) { + if (((GridNetworkNode) grid).isProcessingPattern()) { return RenderUtils.inBounds(154, y, 7, 7, mouseX, mouseY); } @@ -254,7 +254,7 @@ public class GuiGrid extends BaseScreen implements IResizableDisp } private boolean isOverCreatePattern(int mouseX, int mouseY) { - return grid.getGridType() == GridType.PATTERN && RenderUtils.inBounds(172, getTopHeight() + (getVisibleRows() * 18) + 22, 16, 16, mouseX, mouseY) && ((NetworkNodeGrid) grid).canCreatePattern(); + return grid.getGridType() == GridType.PATTERN && RenderUtils.inBounds(172, getTopHeight() + (getVisibleRows() * 18) + 22, 16, 16, mouseX, mouseY) && ((GridNetworkNode) grid).canCreatePattern(); } @Override @@ -266,7 +266,7 @@ public class GuiGrid extends BaseScreen implements IResizableDisp } else if (grid.getGridType() == GridType.CRAFTING) { bindTexture(RS.ID, "gui/crafting_grid.png"); } else if (grid.getGridType() == GridType.PATTERN) { - bindTexture(RS.ID, "gui/pattern_grid" + (((NetworkNodeGrid) grid).isProcessingPattern() ? "_processing" : "") + ".png"); + bindTexture(RS.ID, "gui/pattern_grid" + (((GridNetworkNode) grid).isProcessingPattern() ? "_processing" : "") + ".png"); } else { bindTexture(RS.ID, "gui/grid.png"); } @@ -297,7 +297,7 @@ public class GuiGrid extends BaseScreen implements IResizableDisp ty = 1; } - if (!((NetworkNodeGrid) grid).canCreatePattern()) { + if (!((GridNetworkNode) grid).canCreatePattern()) { ty = 2; } diff --git a/src/main/java/com/raoulvdberge/refinedstorage/screen/widget/sidebutton/SideButtonGridSortingType.java b/src/main/java/com/raoulvdberge/refinedstorage/screen/widget/sidebutton/SideButtonGridSortingType.java index 2c41b932e..937e729cd 100644 --- a/src/main/java/com/raoulvdberge/refinedstorage/screen/widget/sidebutton/SideButtonGridSortingType.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/screen/widget/sidebutton/SideButtonGridSortingType.java @@ -2,7 +2,7 @@ package com.raoulvdberge.refinedstorage.screen.widget.sidebutton; import com.raoulvdberge.refinedstorage.api.network.grid.GridType; import com.raoulvdberge.refinedstorage.api.network.grid.IGrid; -import com.raoulvdberge.refinedstorage.apiimpl.network.node.NetworkNodeGrid; +import com.raoulvdberge.refinedstorage.apiimpl.network.node.GridNetworkNode; import com.raoulvdberge.refinedstorage.screen.BaseScreen; import net.minecraft.client.resources.I18n; import net.minecraft.util.text.TextFormatting; @@ -44,13 +44,13 @@ public class SideButtonGridSortingType extends SideButton { } } else if (type == IGrid.SORTING_TYPE_ID) { type = IGrid.SORTING_TYPE_LAST_MODIFIED; - } else if (type == NetworkNodeGrid.SORTING_TYPE_LAST_MODIFIED) { + } else if (type == GridNetworkNode.SORTING_TYPE_LAST_MODIFIED) { if (grid.getGridType() == GridType.FLUID || /* TODO !Loader.isModLoaded(GridSorterInventoryTweaks.MOD_ID)*/false) { type = IGrid.SORTING_TYPE_QUANTITY; } else { type = IGrid.SORTING_TYPE_INVENTORYTWEAKS; } - } else if (type == NetworkNodeGrid.SORTING_TYPE_INVENTORYTWEAKS) { + } else if (type == GridNetworkNode.SORTING_TYPE_INVENTORYTWEAKS) { type = IGrid.SORTING_TYPE_QUANTITY; } diff --git a/src/main/java/com/raoulvdberge/refinedstorage/tile/NetworkNodeTile.java b/src/main/java/com/raoulvdberge/refinedstorage/tile/NetworkNodeTile.java index 5c1ae416d..a7a2ed131 100644 --- a/src/main/java/com/raoulvdberge/refinedstorage/tile/NetworkNodeTile.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/tile/NetworkNodeTile.java @@ -26,7 +26,6 @@ import javax.annotation.Nullable; public abstract class NetworkNodeTile extends BaseTile implements INetworkNodeProxy, IRedstoneConfigurable { public static final TileDataParameter REDSTONE_MODE = RedstoneMode.createParameter(); - private static final String NBT_ACTIVE = "Active"; private static final String NBT_COVERS = "Cover"; private N clientNode; @@ -56,8 +55,6 @@ public abstract class NetworkNodeTile extends BaseTile im tag.put(NBT_COVERS, ((ICoverable) getNode()).getCoverManager().writeToNbt()); } - tag.putBoolean(NBT_ACTIVE, getNode().canUpdate()); - return tag; } @@ -67,8 +64,6 @@ public abstract class NetworkNodeTile extends BaseTile im if (getNode() instanceof ICoverable && tag.contains(NBT_COVERS)) { ((ICoverable) getNode()).getCoverManager().readFromNbt(tag.getList(NBT_COVERS, Constants.NBT.TAG_COMPOUND)); } - - getNode().setActive(tag.getBoolean(NBT_ACTIVE)); } @Override diff --git a/src/main/java/com/raoulvdberge/refinedstorage/tile/grid/TileGrid.java b/src/main/java/com/raoulvdberge/refinedstorage/tile/grid/GridTile.java old mode 100755 new mode 100644 similarity index 82% rename from src/main/java/com/raoulvdberge/refinedstorage/tile/grid/TileGrid.java rename to src/main/java/com/raoulvdberge/refinedstorage/tile/grid/GridTile.java index be1b7ef9f..5bf3706df --- a/src/main/java/com/raoulvdberge/refinedstorage/tile/grid/TileGrid.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/tile/grid/GridTile.java @@ -1,8 +1,9 @@ package com.raoulvdberge.refinedstorage.tile.grid; import com.raoulvdberge.refinedstorage.RSTiles; +import com.raoulvdberge.refinedstorage.api.network.grid.GridType; import com.raoulvdberge.refinedstorage.api.network.grid.IGrid; -import com.raoulvdberge.refinedstorage.apiimpl.network.node.NetworkNodeGrid; +import com.raoulvdberge.refinedstorage.apiimpl.network.node.GridNetworkNode; import com.raoulvdberge.refinedstorage.screen.BaseScreen; import com.raoulvdberge.refinedstorage.screen.grid.GuiGrid; import com.raoulvdberge.refinedstorage.tile.NetworkNodeTile; @@ -14,57 +15,57 @@ import net.minecraft.world.World; import javax.annotation.Nonnull; -public class TileGrid extends NetworkNodeTile { - public static final TileDataParameter VIEW_TYPE = new TileDataParameter<>(DataSerializers.VARINT, 0, t -> t.getNode().getViewType(), (t, v) -> { +public class GridTile extends NetworkNodeTile { + public static final TileDataParameter VIEW_TYPE = new TileDataParameter<>(DataSerializers.VARINT, 0, t -> t.getNode().getViewType(), (t, v) -> { if (IGrid.isValidViewType(v)) { t.getNode().setViewType(v); t.getNode().markDirty(); } }, (initial, p) -> trySortGrid(initial)); - public static final TileDataParameter SORTING_DIRECTION = new TileDataParameter<>(DataSerializers.VARINT, 0, t -> t.getNode().getSortingDirection(), (t, v) -> { + public static final TileDataParameter SORTING_DIRECTION = new TileDataParameter<>(DataSerializers.VARINT, 0, t -> t.getNode().getSortingDirection(), (t, v) -> { if (IGrid.isValidSortingDirection(v)) { t.getNode().setSortingDirection(v); t.getNode().markDirty(); } }, (initial, p) -> trySortGrid(initial)); - public static final TileDataParameter SORTING_TYPE = new TileDataParameter<>(DataSerializers.VARINT, 0, t -> t.getNode().getSortingType(), (t, v) -> { + public static final TileDataParameter SORTING_TYPE = new TileDataParameter<>(DataSerializers.VARINT, 0, t -> t.getNode().getSortingType(), (t, v) -> { if (IGrid.isValidSortingType(v)) { t.getNode().setSortingType(v); t.getNode().markDirty(); } }, (initial, p) -> trySortGrid(initial)); - public static final TileDataParameter SEARCH_BOX_MODE = new TileDataParameter<>(DataSerializers.VARINT, 0, t -> t.getNode().getSearchBoxMode(), (t, v) -> { + public static final TileDataParameter SEARCH_BOX_MODE = new TileDataParameter<>(DataSerializers.VARINT, 0, t -> t.getNode().getSearchBoxMode(), (t, v) -> { if (IGrid.isValidSearchBoxMode(v)) { t.getNode().setSearchBoxMode(v); t.getNode().markDirty(); } }, (initial, p) -> BaseScreen.executeLater(GuiGrid.class, grid -> grid.getSearchField().setMode(p))); - public static final TileDataParameter SIZE = new TileDataParameter<>(DataSerializers.VARINT, 0, t -> t.getNode().getSize(), (t, v) -> { + public static final TileDataParameter SIZE = new TileDataParameter<>(DataSerializers.VARINT, 0, t -> t.getNode().getSize(), (t, v) -> { if (IGrid.isValidSize(v)) { t.getNode().setSize(v); t.getNode().markDirty(); } }, (initial, p) -> BaseScreen.executeLater(GuiGrid.class, BaseScreen::init)); - public static final TileDataParameter TAB_SELECTED = new TileDataParameter<>(DataSerializers.VARINT, 0, t -> t.getNode().getTabSelected(), (t, v) -> { + public static final TileDataParameter TAB_SELECTED = new TileDataParameter<>(DataSerializers.VARINT, 0, t -> t.getNode().getTabSelected(), (t, v) -> { t.getNode().setTabSelected(v == t.getNode().getTabSelected() ? -1 : v); t.getNode().markDirty(); }, (initial, p) -> BaseScreen.executeLater(GuiGrid.class, grid -> grid.getView().sort())); - public static final TileDataParameter TAB_PAGE = new TileDataParameter<>(DataSerializers.VARINT, 0, t -> t.getNode().getTabPage(), (t, v) -> { + public static final TileDataParameter TAB_PAGE = new TileDataParameter<>(DataSerializers.VARINT, 0, t -> t.getNode().getTabPage(), (t, v) -> { if (v >= 0 && v <= t.getNode().getTotalTabPages()) { t.getNode().setTabPage(v); t.getNode().markDirty(); } }); - public static final TileDataParameter OREDICT_PATTERN = new TileDataParameter<>(DataSerializers.BOOLEAN, false, t -> t.getNode().isOredictPattern(), (t, v) -> { + public static final TileDataParameter OREDICT_PATTERN = new TileDataParameter<>(DataSerializers.BOOLEAN, false, t -> t.getNode().isOredictPattern(), (t, v) -> { t.getNode().setOredictPattern(v); t.getNode().markDirty(); }, (initial, p) -> BaseScreen.executeLater(GuiGrid.class, grid -> grid.updateOredictPattern(p))); - public static final TileDataParameter PROCESSING_PATTERN = new TileDataParameter<>(DataSerializers.BOOLEAN, false, t -> t.getNode().isProcessingPattern(), (t, v) -> { + public static final TileDataParameter PROCESSING_PATTERN = new TileDataParameter<>(DataSerializers.BOOLEAN, false, t -> t.getNode().isProcessingPattern(), (t, v) -> { t.getNode().setProcessingPattern(v); t.getNode().clearMatrix(); t.getNode().markDirty(); }, (initial, p) -> BaseScreen.executeLater(GuiGrid.class, BaseScreen::init)); - public static final TileDataParameter PROCESSING_TYPE = IType.createParameter((initial, p) -> BaseScreen.executeLater(GuiGrid.class, BaseScreen::init)); + public static final TileDataParameter PROCESSING_TYPE = IType.createParameter((initial, p) -> BaseScreen.executeLater(GuiGrid.class, BaseScreen::init)); public static void trySortGrid(boolean initial) { if (!initial) { @@ -72,9 +73,13 @@ public class TileGrid extends NetworkNodeTile { } } - public TileGrid() { + private final GridType gridType; + + public GridTile(GridType gridType) { super(RSTiles.GRID); + this.gridType = gridType; + dataManager.addWatchedParameter(VIEW_TYPE); dataManager.addWatchedParameter(SORTING_DIRECTION); dataManager.addWatchedParameter(SORTING_TYPE); @@ -89,8 +94,8 @@ public class TileGrid extends NetworkNodeTile { @Override @Nonnull - public NetworkNodeGrid createNode(World world, BlockPos pos) { - return new NetworkNodeGrid(world, pos); + public GridNetworkNode createNode(World world, BlockPos pos) { + return new GridNetworkNode(world, pos, gridType); } /* TODO 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 5acbd0de0..18dd30110 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 @@ -17,7 +17,7 @@ import com.raoulvdberge.refinedstorage.api.util.IFilter; import com.raoulvdberge.refinedstorage.apiimpl.API; import com.raoulvdberge.refinedstorage.apiimpl.network.grid.handler.FluidGridHandlerPortable; import com.raoulvdberge.refinedstorage.apiimpl.network.grid.handler.ItemGridHandlerPortable; -import com.raoulvdberge.refinedstorage.apiimpl.network.node.NetworkNodeGrid; +import com.raoulvdberge.refinedstorage.apiimpl.network.node.GridNetworkNode; import com.raoulvdberge.refinedstorage.apiimpl.network.node.diskdrive.DiskDriveNetworkNode; import com.raoulvdberge.refinedstorage.apiimpl.storage.*; import com.raoulvdberge.refinedstorage.apiimpl.storage.disk.StorageDiskFluidPortable; @@ -35,7 +35,7 @@ import com.raoulvdberge.refinedstorage.tile.config.IRedstoneConfigurable; import com.raoulvdberge.refinedstorage.tile.config.RedstoneMode; import com.raoulvdberge.refinedstorage.tile.data.TileDataManager; import com.raoulvdberge.refinedstorage.tile.data.TileDataParameter; -import com.raoulvdberge.refinedstorage.tile.grid.TileGrid; +import com.raoulvdberge.refinedstorage.tile.grid.GridTile; import com.raoulvdberge.refinedstorage.util.StackUtils; import com.raoulvdberge.refinedstorage.util.WorldUtils; import net.minecraft.block.BlockState; @@ -73,13 +73,13 @@ public class TilePortableGrid extends BaseTile implements IGrid, IPortableGrid, t.setSortingDirection(v); t.markDirty(); } - }, (initial, p) -> TileGrid.trySortGrid(initial)); + }, (initial, p) -> GridTile.trySortGrid(initial)); private static final TileDataParameter SORTING_TYPE = new TileDataParameter<>(DataSerializers.VARINT, 0, TilePortableGrid::getSortingType, (t, v) -> { if (IGrid.isValidSortingType(v)) { t.setSortingType(v); t.markDirty(); } - }, (initial, p) -> TileGrid.trySortGrid(initial)); + }, (initial, p) -> GridTile.trySortGrid(initial)); private static final TileDataParameter SEARCH_BOX_MODE = new TileDataParameter<>(DataSerializers.VARINT, 0, TilePortableGrid::getSearchBoxMode, (t, v) -> { if (IGrid.isValidSearchBoxMode(v)) { t.setSearchBoxMode(v); @@ -273,12 +273,12 @@ public class TilePortableGrid extends BaseTile implements IGrid, IPortableGrid, stack.setTag(new CompoundNBT()); - stack.getTag().putInt(NetworkNodeGrid.NBT_SORTING_DIRECTION, sortingDirection); - stack.getTag().putInt(NetworkNodeGrid.NBT_SORTING_TYPE, sortingType); - stack.getTag().putInt(NetworkNodeGrid.NBT_SEARCH_BOX_MODE, searchBoxMode); - stack.getTag().putInt(NetworkNodeGrid.NBT_SIZE, size); - stack.getTag().putInt(NetworkNodeGrid.NBT_TAB_SELECTED, tabSelected); - stack.getTag().putInt(NetworkNodeGrid.NBT_TAB_PAGE, tabPage); + stack.getTag().putInt(GridNetworkNode.NBT_SORTING_DIRECTION, sortingDirection); + stack.getTag().putInt(GridNetworkNode.NBT_SORTING_TYPE, sortingType); + stack.getTag().putInt(GridNetworkNode.NBT_SEARCH_BOX_MODE, searchBoxMode); + stack.getTag().putInt(GridNetworkNode.NBT_SIZE, size); + stack.getTag().putInt(GridNetworkNode.NBT_TAB_SELECTED, tabSelected); + stack.getTag().putInt(GridNetworkNode.NBT_TAB_PAGE, tabPage); stack.getTag().put(PortableGrid.NBT_STORAGE_TRACKER, storageTracker.serializeNbt()); stack.getTag().put(PortableGrid.NBT_FLUID_STORAGE_TRACKER, fluidStorageTracker.serializeNbt()); @@ -601,12 +601,12 @@ public class TilePortableGrid extends BaseTile implements IGrid, IPortableGrid, public CompoundNBT write(CompoundNBT tag) { super.write(tag); - tag.putInt(NetworkNodeGrid.NBT_SORTING_DIRECTION, sortingDirection); - tag.putInt(NetworkNodeGrid.NBT_SORTING_TYPE, sortingType); - tag.putInt(NetworkNodeGrid.NBT_SEARCH_BOX_MODE, searchBoxMode); - tag.putInt(NetworkNodeGrid.NBT_SIZE, size); - tag.putInt(NetworkNodeGrid.NBT_TAB_SELECTED, tabSelected); - tag.putInt(NetworkNodeGrid.NBT_TAB_PAGE, tabPage); + tag.putInt(GridNetworkNode.NBT_SORTING_DIRECTION, sortingDirection); + tag.putInt(GridNetworkNode.NBT_SORTING_TYPE, sortingType); + tag.putInt(GridNetworkNode.NBT_SEARCH_BOX_MODE, searchBoxMode); + tag.putInt(GridNetworkNode.NBT_SIZE, size); + tag.putInt(GridNetworkNode.NBT_TAB_SELECTED, tabSelected); + tag.putInt(GridNetworkNode.NBT_TAB_PAGE, tabPage); StackUtils.writeItems(disk, 0, tag); StackUtils.writeItems(filter, 1, tag); @@ -629,28 +629,28 @@ public class TilePortableGrid extends BaseTile implements IGrid, IPortableGrid, public void read(CompoundNBT tag) { super.read(tag); - if (tag.contains(NetworkNodeGrid.NBT_SORTING_DIRECTION)) { - sortingDirection = tag.getInt(NetworkNodeGrid.NBT_SORTING_DIRECTION); + if (tag.contains(GridNetworkNode.NBT_SORTING_DIRECTION)) { + sortingDirection = tag.getInt(GridNetworkNode.NBT_SORTING_DIRECTION); } - if (tag.contains(NetworkNodeGrid.NBT_SORTING_TYPE)) { - sortingType = tag.getInt(NetworkNodeGrid.NBT_SORTING_TYPE); + if (tag.contains(GridNetworkNode.NBT_SORTING_TYPE)) { + sortingType = tag.getInt(GridNetworkNode.NBT_SORTING_TYPE); } - if (tag.contains(NetworkNodeGrid.NBT_SEARCH_BOX_MODE)) { - searchBoxMode = tag.getInt(NetworkNodeGrid.NBT_SEARCH_BOX_MODE); + if (tag.contains(GridNetworkNode.NBT_SEARCH_BOX_MODE)) { + searchBoxMode = tag.getInt(GridNetworkNode.NBT_SEARCH_BOX_MODE); } - if (tag.contains(NetworkNodeGrid.NBT_SIZE)) { - size = tag.getInt(NetworkNodeGrid.NBT_SIZE); + if (tag.contains(GridNetworkNode.NBT_SIZE)) { + size = tag.getInt(GridNetworkNode.NBT_SIZE); } - if (tag.contains(NetworkNodeGrid.NBT_TAB_SELECTED)) { - tabSelected = tag.getInt(NetworkNodeGrid.NBT_TAB_SELECTED); + if (tag.contains(GridNetworkNode.NBT_TAB_SELECTED)) { + tabSelected = tag.getInt(GridNetworkNode.NBT_TAB_SELECTED); } - if (tag.contains(NetworkNodeGrid.NBT_TAB_PAGE)) { - tabPage = tag.getInt(NetworkNodeGrid.NBT_TAB_PAGE); + if (tag.contains(GridNetworkNode.NBT_TAB_PAGE)) { + tabPage = tag.getInt(GridNetworkNode.NBT_TAB_PAGE); } StackUtils.readItems(disk, 0, tag); diff --git a/src/main/resources/assets/refinedstorage/blockstates/grid.json b/src/main/resources/assets/refinedstorage/blockstates/grid.json old mode 100755 new mode 100644 index 44482d3b1..4294a9932 --- a/src/main/resources/assets/refinedstorage/blockstates/grid.json +++ b/src/main/resources/assets/refinedstorage/blockstates/grid.json @@ -1,80 +1,36 @@ { - "forge_marker": 1, - "defaults": { - "model": "refinedstorage:cube_north_cutout", - "textures": { - "particle": "refinedstorage:blocks/side", - "east": "refinedstorage:blocks/grid/left", - "south": "refinedstorage:blocks/grid/back", - "west": "refinedstorage:blocks/grid/right", - "up": "refinedstorage:blocks/grid/top", - "down": "refinedstorage:blocks/bottom", - "north_normal": "refinedstorage:blocks/grid/front", - "north_crafting": "refinedstorage:blocks/grid/crafting_front", - "north_pattern": "refinedstorage:blocks/grid/pattern_front", - "north_fluid": "refinedstorage:blocks/grid/fluid_front", - "cutout_normal": "refinedstorage:blocks/grid/cutouts/front_disconnected", - "cutout_crafting": "refinedstorage:blocks/grid/cutouts/crafting_front_disconnected", - "cutout_pattern": "refinedstorage:blocks/grid/cutouts/pattern_front_disconnected", - "cutout_fluid": "refinedstorage:blocks/grid/cutouts/fluid_front_disconnected" - } - }, "variants": { - "connected": { - "true": { - "textures": { - "cutout_normal": "refinedstorage:blocks/grid/cutouts/front_connected", - "cutout_crafting": "refinedstorage:blocks/grid/cutouts/crafting_front_connected", - "cutout_pattern": "refinedstorage:blocks/grid/cutouts/pattern_front_connected", - "cutout_fluid": "refinedstorage:blocks/grid/cutouts/fluid_front_connected" - } - }, - "false": { - } + "connected=true,direction=north": { + "model": "refinedstorage:block/grid/normal/connected", + "y": 0 }, - "type": { - "normal": { - "textures": { - "north": "#north_normal", - "cutout": "#cutout_normal" - } - }, - "crafting": { - "textures": { - "north": "#north_crafting", - "cutout": "#cutout_crafting" - } - }, - "pattern": { - "textures": { - "north": "#north_pattern", - "cutout": "#cutout_pattern" - } - }, - "fluid": { - "textures": { - "north": "#north_fluid", - "cutout": "#cutout_fluid", - "east": "refinedstorage:blocks/grid/fluid_left", - "south": "refinedstorage:blocks/grid/fluid_back", - "west": "refinedstorage:blocks/grid/fluid_right", - "up": "refinedstorage:blocks/grid/fluid_top" - } - } + "connected=true,direction=east": { + "model": "refinedstorage:block/grid/normal/connected", + "y": 90 }, - "direction": { - "north": { - "y": 0 - }, - "east": { - "y": 90 - }, - "south": { - "y": 180 - }, - "west": { - "y": 270 - } + "connected=true,direction=south": { + "model": "refinedstorage:block/grid/normal/connected", + "y": 180 + }, + "connected=true,direction=west": { + "model": "refinedstorage:block/grid/normal/connected", + "y": 270 + }, + "connected=false,direction=north": { + "model": "refinedstorage:block/grid/normal/disconnected", + "y": 0 + }, + "connected=false,direction=east": { + "model": "refinedstorage:block/grid/normal/disconnected", + "y": 90 + }, + "connected=false,direction=south": { + "model": "refinedstorage:block/grid/normal/disconnected", + "y": 180 + }, + "connected=false,direction=west": { + "model": "refinedstorage:block/grid/normal/disconnected", + "y": 270 } } } \ No newline at end of file diff --git a/src/main/resources/assets/refinedstorage/lang/en_us.json b/src/main/resources/assets/refinedstorage/lang/en_us.json index 99b8d441d..6885a03ce 100644 --- a/src/main/resources/assets/refinedstorage/lang/en_us.json +++ b/src/main/resources/assets/refinedstorage/lang/en_us.json @@ -179,10 +179,10 @@ "block.refinedstorage.controller": "Controller", "block.refinedstorage.creative_controller": "Creative Controller", "block.refinedstorage.cable": "Cable", - "block.refinedstorage:grid.0": "Grid", - "block.refinedstorage:grid.1": "Crafting Grid", - "block.refinedstorage:grid.2": "Pattern Grid", - "block.refinedstorage:grid.3": "Fluid Grid", + "block.refinedstorage.grid": "Grid", + "block.refinedstorage.crafting_grid": "Crafting Grid", + "block.refinedstorage.pattern_grid": "Pattern Grid", + "block.refinedstorage.fluid_grid": "Fluid Grid", "block.refinedstorage.disk_drive": "Disk Drive", "block.refinedstorage:disk_manipulator": "Disk Manipulator", "block.refinedstorage:external_storage": "External Storage", diff --git a/src/main/resources/assets/refinedstorage/models/block/grid/normal/connected.json b/src/main/resources/assets/refinedstorage/models/block/grid/normal/connected.json new file mode 100644 index 000000000..8a647e00e --- /dev/null +++ b/src/main/resources/assets/refinedstorage/models/block/grid/normal/connected.json @@ -0,0 +1,13 @@ +{ + "parent": "refinedstorage:block/cube_north_cutout", + "textures": { + "particle": "refinedstorage:block/side", + "east": "refinedstorage:block/grid/left", + "south": "refinedstorage:block/grid/back", + "west": "refinedstorage:block/grid/right", + "up": "refinedstorage:block/grid/top", + "down": "refinedstorage:block/bottom", + "north": "refinedstorage:block/grid/front", + "cutout": "refinedstorage:block/grid/cutouts/front_connected" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/refinedstorage/models/block/grid/normal/disconnected.json b/src/main/resources/assets/refinedstorage/models/block/grid/normal/disconnected.json new file mode 100644 index 000000000..962c5ff2b --- /dev/null +++ b/src/main/resources/assets/refinedstorage/models/block/grid/normal/disconnected.json @@ -0,0 +1,13 @@ +{ + "parent": "refinedstorage:block/cube_north_cutout", + "textures": { + "particle": "refinedstorage:block/side", + "east": "refinedstorage:block/grid/left", + "south": "refinedstorage:block/grid/back", + "west": "refinedstorage:block/grid/right", + "up": "refinedstorage:block/grid/top", + "down": "refinedstorage:block/bottom", + "north": "refinedstorage:block/grid/front", + "cutout": "refinedstorage:block/grid/cutouts/front_disconnected" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/refinedstorage/models/item/grid.json b/src/main/resources/assets/refinedstorage/models/item/grid.json new file mode 100644 index 000000000..cc09c086e --- /dev/null +++ b/src/main/resources/assets/refinedstorage/models/item/grid.json @@ -0,0 +1,3 @@ +{ + "parent": "refinedstorage:block/grid/normal/disconnected" +} \ No newline at end of file diff --git a/src/main/resources/assets/refinedstorage/recipes/grid.json b/src/main/resources/data/refinedstorage/recipes/grid.json similarity index 61% rename from src/main/resources/assets/refinedstorage/recipes/grid.json rename to src/main/resources/data/refinedstorage/recipes/grid.json index d428358ee..a96af5775 100644 --- a/src/main/resources/assets/refinedstorage/recipes/grid.json +++ b/src/main/resources/data/refinedstorage/recipes/grid.json @@ -7,14 +7,13 @@ ], "key": { "P": { - "item": "#improved_processor" + "item": "refinedstorage:improved_processor" }, "C": { - "item": "#construction_core" + "item": "refinedstorage:construction_core" }, "G": { - "type": "forge:ore_dict", - "ore": "blockGlass" + "tag": "forge:glass" }, "E": { "item": "refinedstorage:quartz_enriched_iron" @@ -23,11 +22,10 @@ "item": "refinedstorage:machine_casing" }, "D": { - "item": "#destruction_core" + "item": "refinedstorage:destruction_core" } }, "result": { - "item": "refinedstorage:grid", - "data": 0 + "item": "refinedstorage:grid" } } \ No newline at end of file