From 8b23fa996ccf3412dff4692275f2d318f32d2a56 Mon Sep 17 00:00:00 2001 From: lothrazar Date: Fri, 29 Nov 2024 17:09:03 -0800 Subject: [PATCH] expanded feature: add remote version of expanded gui --- .../storagenetwork/StorageNetworkMod.java | 4 +- .../block/AbstractNetworkScreen.java | 5 +- .../ScreenNetworkInventoryExpanded.java | 41 ++----- .../storagenetwork/emi/EMIPlugin.java | 7 +- .../storagenetwork/gui/NetworkScreenSize.java | 5 +- .../storagenetwork/gui/NetworkWidget.java | 37 ++++++- .../ContainerNetworkExpandedRemote.java | 99 +++++++++++++++++ .../remote/ItemStorageCraftingRemote.java | 6 +- .../remote/ScreenNetworkCraftingRemote.java | 19 ++-- .../remote/ScreenNetworkExpandedRemote.java | 102 ++++++++++++++++++ .../item/remote/ScreenNetworkRemote.java | 2 +- .../storagenetwork/registry/SsnRegistry.java | 5 + 12 files changed, 275 insertions(+), 57 deletions(-) create mode 100644 src/main/java/com/lothrazar/storagenetwork/item/remote/ContainerNetworkExpandedRemote.java create mode 100644 src/main/java/com/lothrazar/storagenetwork/item/remote/ScreenNetworkExpandedRemote.java diff --git a/src/main/java/com/lothrazar/storagenetwork/StorageNetworkMod.java b/src/main/java/com/lothrazar/storagenetwork/StorageNetworkMod.java index cf86bde8..56808ed9 100644 --- a/src/main/java/com/lothrazar/storagenetwork/StorageNetworkMod.java +++ b/src/main/java/com/lothrazar/storagenetwork/StorageNetworkMod.java @@ -10,6 +10,7 @@ import com.lothrazar.storagenetwork.block.inventory.ScreenNetworkInventory; import com.lothrazar.storagenetwork.block.request.ScreenNetworkTable; import com.lothrazar.storagenetwork.item.remote.ScreenNetworkCraftingRemote; +import com.lothrazar.storagenetwork.item.remote.ScreenNetworkExpandedRemote; import com.lothrazar.storagenetwork.item.remote.ScreenNetworkRemote; import com.lothrazar.storagenetwork.registry.ClientEventRegistry; import com.lothrazar.storagenetwork.registry.ConfigRegistry; @@ -63,8 +64,9 @@ private void setupClient(final FMLClientSetupEvent event) { MenuScreens.register(SsnRegistry.Menus.INVENTORY_REMOTE.get(), ScreenNetworkRemote::new); MenuScreens.register(SsnRegistry.Menus.CRAFTING_REMOTE.get(), ScreenNetworkCraftingRemote::new); MenuScreens.register(SsnRegistry.Menus.INVENTORY.get(), ScreenNetworkInventory::new); - MenuScreens.register(SsnRegistry.Menus.INVENTORY_EXPANDED.get(), ScreenNetworkInventoryExpanded::new); MenuScreens.register(SsnRegistry.Menus.COLLECTOR.get(), ScreenCollectionFilter::new); + MenuScreens.register(SsnRegistry.Menus.INVENTORY_EXPANDED.get(), ScreenNetworkInventoryExpanded::new); + MenuScreens.register(SsnRegistry.Menus.EXPANDED_REMOTE.get(), ScreenNetworkExpandedRemote::new); } private void registerMapping(final RegisterKeyMappingsEvent event) { diff --git a/src/main/java/com/lothrazar/storagenetwork/block/AbstractNetworkScreen.java b/src/main/java/com/lothrazar/storagenetwork/block/AbstractNetworkScreen.java index 4e8db9f1..de297521 100644 --- a/src/main/java/com/lothrazar/storagenetwork/block/AbstractNetworkScreen.java +++ b/src/main/java/com/lothrazar/storagenetwork/block/AbstractNetworkScreen.java @@ -108,9 +108,9 @@ public boolean mouseClicked(double mouseX, double mouseY, int mouseButton) { rectX = 63; rectY = 110 + 200; } - System.out.println(mouseX + "," + mouseY); + // TODO: revise above .out.println(mouseX + "," + mouseY); if (isHovering(rectX, rectY, 7, 7, mouseX, mouseY)) { - System.out.println("clear!"); + PacketRegistry.INSTANCE.sendToServer(new ClearRecipeMessage()); PacketRegistry.INSTANCE.sendToServer(new RequestMessage(0, ItemStack.EMPTY, false, false)); return true; @@ -119,6 +119,7 @@ public boolean mouseClicked(double mouseX, double mouseY, int mouseButton) { return true; } + @Deprecated protected void blitSegment(GuiGraphics ms, TileableTexture tt, int xpos, int ypos) { ms.blit(tt.texture(), xpos, ypos, 0, 0, tt.width(), tt.height()); } diff --git a/src/main/java/com/lothrazar/storagenetwork/block/expand/ScreenNetworkInventoryExpanded.java b/src/main/java/com/lothrazar/storagenetwork/block/expand/ScreenNetworkInventoryExpanded.java index 4cc9d02e..a0c5d3bb 100644 --- a/src/main/java/com/lothrazar/storagenetwork/block/expand/ScreenNetworkInventoryExpanded.java +++ b/src/main/java/com/lothrazar/storagenetwork/block/expand/ScreenNetworkInventoryExpanded.java @@ -17,15 +17,6 @@ public class ScreenNetworkInventoryExpanded extends AbstractNetworkScreen { - protected int W = 256; - //i know they could all be in the same png file and i pull out sprites from it, but split images is easier to work with - private TileableTexture head = new TileableTexture(new ResourceLocation(StorageNetworkMod.MODID, "textures/gui/expandable_head.png"), W, 10); - private TileableTexture head_right = new TileableTexture(new ResourceLocation(StorageNetworkMod.MODID, "textures/gui/expandable_head_right.png"), W, 10); - private TileableTexture row = new TileableTexture(new ResourceLocation(StorageNetworkMod.MODID, "textures/gui/expandable_row.png"), W, SsnConsts.SQ); - private TileableTexture row_right = new TileableTexture(new ResourceLocation(StorageNetworkMod.MODID, "textures/gui/expandable_row_right.png"), W, SsnConsts.SQ); - private TileableTexture crafting = new TileableTexture(new ResourceLocation(StorageNetworkMod.MODID, "textures/gui/expandable_crafting.png"), W, 66); - private TileableTexture crafting_right = new TileableTexture(new ResourceLocation(StorageNetworkMod.MODID, "textures/gui/expandable_crafting_right.png"), W, 66); - private TileableTexture player = new TileableTexture(new ResourceLocation(StorageNetworkMod.MODID, "textures/gui/expandable_player.png"), 176, 84); protected final NetworkWidget network; private TileInventoryExpanded tile; @@ -33,10 +24,11 @@ public ScreenNetworkInventoryExpanded(ContainerNetworkInventoryExpanded containe super(container, inv, name); tile = container.tile; network = new NetworkWidget(this, NetworkScreenSize.EXPANDED); - imageHeight = player.height() + crafting.height() - + row.height() * NetworkScreenSize.EXPANDED.lines() - + head.height(); - imageWidth = W + 12 * 18;//scrollWidth + //TODO: refactor this calculation + imageHeight = NetworkWidget.player.height() + NetworkWidget.crafting.height() + + NetworkWidget.row.height() * network.getSize().lines() + + NetworkWidget.head.height(); + imageWidth = 256 + 12 * 18;//scrollWidth } @Override @@ -59,32 +51,11 @@ public void renderBg(GuiGraphics ms, float partialTicks, int mouseX, int mouseY) //get center points from screen size final int xCenter = (width - imageWidth) / 2; final int yCenter = (height - imageHeight) / 2; - //render the top - int xpos = xCenter; - int ypos = yCenter; - blitSegment(ms, head, xpos, ypos); - blitSegment(ms, head_right, xpos + W, ypos); - ypos += head.height(); - //render the rows - for (int line = 0; line < network.getLines(); line++) { - blitSegment(ms, row, xpos, ypos); - blitSegment(ms, row_right, xpos + W, ypos); - ypos += row.height(); - } - blitSegment(ms, crafting, xpos, ypos); - blitSegment(ms, crafting_right, xpos + W, ypos); - ypos += crafting.height() - 4; - blitSegment(ms, player, xpos, ypos); + network.renderBgExpanded(ms, partialTicks, mouseX, mouseY, xCenter, yCenter); //update network network.applySearchTextToSlots(); network.renderItemSlots(ms, mouseX, mouseY, font); } - - @Override - public void resize(Minecraft mc, int w, int h) { - super.resize(mc, w, h); - network.resize(mc, w, h); - } // all the IGUINETWORK implementations @Override diff --git a/src/main/java/com/lothrazar/storagenetwork/emi/EMIPlugin.java b/src/main/java/com/lothrazar/storagenetwork/emi/EMIPlugin.java index 7d5bafb4..7d3c2211 100644 --- a/src/main/java/com/lothrazar/storagenetwork/emi/EMIPlugin.java +++ b/src/main/java/com/lothrazar/storagenetwork/emi/EMIPlugin.java @@ -1,12 +1,15 @@ package com.lothrazar.storagenetwork.emi; +import com.lothrazar.storagenetwork.block.expand.ContainerNetworkInventoryExpanded; import com.lothrazar.storagenetwork.block.expand.ScreenNetworkInventoryExpanded; import com.lothrazar.storagenetwork.block.request.ContainerNetworkCraftingTable; import com.lothrazar.storagenetwork.block.request.ScreenNetworkTable; import com.lothrazar.storagenetwork.gui.ISearchHandler; import com.lothrazar.storagenetwork.gui.NetworkWidget; import com.lothrazar.storagenetwork.item.remote.ContainerNetworkCraftingRemote; +import com.lothrazar.storagenetwork.item.remote.ContainerNetworkExpandedRemote; import com.lothrazar.storagenetwork.item.remote.ScreenNetworkCraftingRemote; +import com.lothrazar.storagenetwork.item.remote.ScreenNetworkExpandedRemote; import com.lothrazar.storagenetwork.registry.SsnRegistry; import dev.emi.emi.api.EmiApi; import dev.emi.emi.api.EmiEntrypoint; @@ -25,9 +28,11 @@ public void register(EmiRegistry registry) { registry.addWorkstation(VanillaEmiRecipeCategories.CRAFTING, EmiStack.of(SsnRegistry.Blocks.REQUEST.get())); registry.addRecipeHandler(SsnRegistry.Menus.REQUEST.get(), new EmiTransferHandler()); registry.addRecipeHandler(SsnRegistry.Menus.CRAFTING_REMOTE.get(), new EmiTransferHandler()); + registry.addRecipeHandler(SsnRegistry.Menus.INVENTORY_EXPANDED.get(), new EmiTransferHandler()); + registry.addRecipeHandler(SsnRegistry.Menus.EXPANDED_REMOTE.get(), new EmiTransferHandler()); // registry.addGenericDragDropHandler(new EmiGhostIngredientHandler()); registry.addGenericStackProvider((scr, x, y) -> { - if (scr instanceof ScreenNetworkTable || scr instanceof ScreenNetworkCraftingRemote || scr instanceof ScreenNetworkInventoryExpanded) { + if (scr instanceof ScreenNetworkTable || scr instanceof ScreenNetworkCraftingRemote || scr instanceof ScreenNetworkInventoryExpanded || scr instanceof ScreenNetworkExpandedRemote) { net.minecraft.world.inventory.Slot sl = ((AbstractContainerScreen) scr).getSlotUnderMouse(); if (sl != null) return new EmiStackInteraction(EmiStack.of(sl.getItem()), null, false); } diff --git a/src/main/java/com/lothrazar/storagenetwork/gui/NetworkScreenSize.java b/src/main/java/com/lothrazar/storagenetwork/gui/NetworkScreenSize.java index e04058d1..7e17291e 100644 --- a/src/main/java/com/lothrazar/storagenetwork/gui/NetworkScreenSize.java +++ b/src/main/java/com/lothrazar/storagenetwork/gui/NetworkScreenSize.java @@ -1,5 +1,6 @@ package com.lothrazar.storagenetwork.gui; public enum NetworkScreenSize { + //normal has the crafting table //large is the original inventory and remote with no crafting table NORMAL, LARGE, EXPANDED; @@ -9,9 +10,9 @@ public int lines() { case NORMAL: return 4; case LARGE: - return 4 * 2; + return 8; case EXPANDED: - return 4 * 5 + 1; + return 21; } return 0; } diff --git a/src/main/java/com/lothrazar/storagenetwork/gui/NetworkWidget.java b/src/main/java/com/lothrazar/storagenetwork/gui/NetworkWidget.java index 1ddec49c..93b99ebb 100644 --- a/src/main/java/com/lothrazar/storagenetwork/gui/NetworkWidget.java +++ b/src/main/java/com/lothrazar/storagenetwork/gui/NetworkWidget.java @@ -55,7 +55,7 @@ public class NetworkWidget { private int lines = 4; private int columns = 9; public int scrollHeight = 152; - public int scrollWidth = 176; + public int scrollWidth = 176;//defaults to WIDTH // public int xNetwork = 8; public int yNetwork = 10; @@ -84,7 +84,7 @@ private void setScreenSize() { case EXPANDED: buffer = -10; this.xNetwork = 10; // head.height(); - this.scrollWidth = 256 + 12 * 18; //imageWidth + this.scrollWidth = W + 12 * 18; //imageWidth break; } scrollHeight = (SsnConsts.SQ + 1) * this.getLines() + buffer; @@ -465,4 +465,37 @@ public void render() { jeiBtn.setTextureId(gui.isJeiSearchSynced() ? TextureEnum.JEI_GREEN : TextureEnum.JEI_RED); } } + + protected static final int W = 256; + //i know they could all be in the same png file and i pull out sprites from it, but split images is easier to work with + public static final TileableTexture head = new TileableTexture(new ResourceLocation(StorageNetworkMod.MODID, "textures/gui/expandable_head.png"), W, 10); + public static final TileableTexture head_right = new TileableTexture(new ResourceLocation(StorageNetworkMod.MODID, "textures/gui/expandable_head_right.png"), W, 10); + public static final TileableTexture row = new TileableTexture(new ResourceLocation(StorageNetworkMod.MODID, "textures/gui/expandable_row.png"), W, SsnConsts.SQ); + public static final TileableTexture row_right = new TileableTexture(new ResourceLocation(StorageNetworkMod.MODID, "textures/gui/expandable_row_right.png"), W, SsnConsts.SQ); + public static final TileableTexture crafting = new TileableTexture(new ResourceLocation(StorageNetworkMod.MODID, "textures/gui/expandable_crafting.png"), W, 66); + public static final TileableTexture crafting_right = new TileableTexture(new ResourceLocation(StorageNetworkMod.MODID, "textures/gui/expandable_crafting_right.png"), W, 66); + public static final TileableTexture player = new TileableTexture(new ResourceLocation(StorageNetworkMod.MODID, "textures/gui/expandable_player.png"), 176, 84); + + protected void blitSegment(GuiGraphics ms, TileableTexture tt, int xpos, int ypos) { + ms.blit(tt.texture(), xpos, ypos, 0, 0, tt.width(), tt.height()); + } + + public void renderBgExpanded(GuiGraphics ms, float partialTicks, int mouseX, int mouseY, int xCenter, int yCenter) { + //render the top + int xpos = xCenter; + int ypos = yCenter; + blitSegment(ms, head, xpos, ypos); + blitSegment(ms, head_right, xpos + W, ypos); + ypos += head.height(); + //render the rows + for (int line = 0; line < this.getLines(); line++) { + blitSegment(ms, row, xpos, ypos); + blitSegment(ms, row_right, xpos + W, ypos); + ypos += row.height(); + } + blitSegment(ms, crafting, xpos, ypos); + blitSegment(ms, crafting_right, xpos + W, ypos); + ypos += crafting.height() - 4; + blitSegment(ms, player, xpos, ypos); + } } diff --git a/src/main/java/com/lothrazar/storagenetwork/item/remote/ContainerNetworkExpandedRemote.java b/src/main/java/com/lothrazar/storagenetwork/item/remote/ContainerNetworkExpandedRemote.java new file mode 100644 index 00000000..43fa4692 --- /dev/null +++ b/src/main/java/com/lothrazar/storagenetwork/item/remote/ContainerNetworkExpandedRemote.java @@ -0,0 +1,99 @@ +package com.lothrazar.storagenetwork.item.remote; + +import com.lothrazar.storagenetwork.StorageNetworkMod; +import com.lothrazar.storagenetwork.api.DimPos; +import com.lothrazar.storagenetwork.block.main.TileMain; +import com.lothrazar.storagenetwork.gui.ContainerNetwork; +import com.lothrazar.storagenetwork.gui.NetworkCraftingInventory; +import com.lothrazar.storagenetwork.gui.slot.SlotCraftingNetwork; +import com.lothrazar.storagenetwork.registry.SsnRegistry; +import com.lothrazar.storagenetwork.util.UtilInventory; +import net.minecraft.world.Container; +import net.minecraft.world.entity.player.Inventory; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.item.ItemStack; +import org.apache.commons.lang3.tuple.Triple; +import java.util.HashMap; +import java.util.Map; + +public class ContainerNetworkExpandedRemote extends ContainerNetwork { + + Map matrixStacks = new HashMap<>(); + private TileMain root; + private ItemStack remote; + + public ContainerNetworkExpandedRemote(int id, Inventory pInv) { + super(SsnRegistry.Menus.EXPANDED_REMOTE.get(), id); + this.yPlayer = 256 + 196; + this.yCrafting = this.yPlayer - 64 + 7; + this.player = pInv.player; + this.remote = pInv.player.getMainHandItem(); + if (this.remote.getItem() != SsnRegistry.Items.EXPANDED_REMOTE.get()) { + Triple result = UtilInventory.getCurioRemote(player, SsnRegistry.Items.EXPANDED_REMOTE.get()); + this.remote = result.getRight(); + } + DimPos dp = DimPos.getPosStored(remote); + if (dp == null) { + StorageNetworkMod.LOGGER.error("Remote opening with null pos Stored {} ", remote); + } + else { + this.root = dp.getTileEntity(TileMain.class, player.level()); + } + setCraftMatrix(new NetworkCraftingInventory(this, matrixStacks)); + this.playerInv = pInv; + SlotCraftingNetwork slotCraftOutput = new SlotCraftingNetwork(this, playerInv.player, getCraftMatrix(), resultInventory, 0, + 101, yPlayer - 46 + 7); + slotCraftOutput.setTileMain(getTileMain()); + addSlot(slotCraftOutput); + bindGrid(); + bindPlayerInvo(this.playerInv); + bindHotbar(); + slotsChanged(getCraftMatrix()); + } + + @Override + public boolean stillValid(Player playerIn) { + return !remote.isEmpty(); + } + + @Override + public TileMain getTileMain() { + if (root == null) { + DimPos dp = DimPos.getPosStored(remote); + if (dp != null) { + root = dp.getTileEntity(TileMain.class, player.level()); + } + } + return root; + } + + @Override + public void slotsChanged(Container inventoryIn) { + if (recipeLocked) { + // StorageNetwork.log("recipe locked so onCraftMatrixChanged cancelled"); + return; + } + // findMatchingRecipe(matrix); + super.slotsChanged(inventoryIn); + } + + @Override + public void removed(Player playerIn) { + super.removed(playerIn); + for (int i = 0; i < getCraftMatrix().getContainerSize(); i++) { + UtilInventory.dropItem(player.level(), playerIn.blockPosition(), getCraftMatrix().getItem(i)); + } + } + + @Override + public void slotChanged() {} + + @Override + public boolean isCrafting() { + return true; + } + + public ItemStack getRemote() { + return remote; + } +} diff --git a/src/main/java/com/lothrazar/storagenetwork/item/remote/ItemStorageCraftingRemote.java b/src/main/java/com/lothrazar/storagenetwork/item/remote/ItemStorageCraftingRemote.java index c83779de..e7984015 100644 --- a/src/main/java/com/lothrazar/storagenetwork/item/remote/ItemStorageCraftingRemote.java +++ b/src/main/java/com/lothrazar/storagenetwork/item/remote/ItemStorageCraftingRemote.java @@ -177,7 +177,11 @@ public Component getDisplayName() { @Override public AbstractContainerMenu createMenu(int id, Inventory inv, Player player) { boolean crafting = (this == SsnRegistry.Items.CRAFTING_REMOTE.get()); - if (crafting) { + boolean expanded = (this == SsnRegistry.Items.EXPANDED_REMOTE.get()); + if (expanded) { + return new ContainerNetworkExpandedRemote(id, inv); + } + else if (crafting) { return new ContainerNetworkCraftingRemote(id, inv); } else { diff --git a/src/main/java/com/lothrazar/storagenetwork/item/remote/ScreenNetworkCraftingRemote.java b/src/main/java/com/lothrazar/storagenetwork/item/remote/ScreenNetworkCraftingRemote.java index 4f762a4c..acbc3a58 100644 --- a/src/main/java/com/lothrazar/storagenetwork/item/remote/ScreenNetworkCraftingRemote.java +++ b/src/main/java/com/lothrazar/storagenetwork/item/remote/ScreenNetworkCraftingRemote.java @@ -13,7 +13,7 @@ import net.minecraft.world.item.ItemStack; import net.minecraftforge.fml.ModList; -public class ScreenNetworkCraftingRemote extends AbstractNetworkScreen { // extends AbstractContainerScreen implements IGuiNetwork { +public class ScreenNetworkCraftingRemote extends AbstractNetworkScreen { private static final int HEIGHT = 256; private static final int WIDTH = 176; @@ -24,10 +24,10 @@ public class ScreenNetworkCraftingRemote extends AbstractNetworkScreen { + + private final NetworkWidget network; + private final ItemStack remote; + + public ScreenNetworkExpandedRemote(ContainerNetworkExpandedRemote screenContainer, Inventory inv, Component titleIn) { + super(screenContainer, inv, titleIn); + //since the rightclick action forces only MAIN_HAND openings, is ok + this.remote = screenContainer.getRemote(); + network = new NetworkWidget(this, NetworkScreenSize.EXPANDED); + imageHeight = NetworkWidget.player.height() + NetworkWidget.crafting.height() + + NetworkWidget.row.height() * network.getSize().lines() + + NetworkWidget.head.height(); + imageWidth = 256 + 12 * 18;//scrollWidth + } + + @Override + public void init() { + super.init(); + network.init(this.font); + addRenderableWidget(network.directionBtn); + addRenderableWidget(network.sortBtn); + addRenderableWidget(network.focusBtn); + if (this.getAutoFocus()) { + network.searchBar.setFocused(true); + } + if (ModList.get().isLoaded("jei")) { + addRenderableWidget(network.jeiBtn); + } + } + + @Override + protected void renderBg(GuiGraphics ms, float partialTicks, int mouseX, int mouseY) { + final int xCenter = (this.width - this.imageWidth) / 2; + final int yCenter = (this.height - this.imageHeight) / 2; + network.renderBgExpanded(ms, partialTicks, mouseX, mouseY, xCenter, yCenter); + network.applySearchTextToSlots(); + //update network + network.applySearchTextToSlots(); + network.renderItemSlots(ms, mouseX, mouseY, font); + } + + @Override + public boolean getDownwards() { + return ItemStorageCraftingRemote.getDownwards(remote); + } + + @Override + public void setDownwards(boolean val) { + ItemStorageCraftingRemote.setDownwards(remote, val); + } + + @Override + public EnumSortType getSort() { + return ItemStorageCraftingRemote.getSort(remote); + } + + @Override + public void setSort(EnumSortType val) { + ItemStorageCraftingRemote.setSort(remote, val); + } + + @Override + public boolean isJeiSearchSynced() { + return ItemStorageCraftingRemote.isJeiSearchSynced(remote); + } + + @Override + public void setJeiSearchSynced(boolean val) { + ItemStorageCraftingRemote.setJeiSearchSynced(remote, val); + } + + @Override + public boolean getAutoFocus() { + return ItemStorageCraftingRemote.getAutoFocus(remote); + } + + @Override + public void setAutoFocus(boolean b) { + ItemStorageCraftingRemote.setAutoFocus(remote, b); + } + + @Override + public NetworkWidget getNetwork() { + return network; + } +} diff --git a/src/main/java/com/lothrazar/storagenetwork/item/remote/ScreenNetworkRemote.java b/src/main/java/com/lothrazar/storagenetwork/item/remote/ScreenNetworkRemote.java index a60b11b8..b1f76eba 100644 --- a/src/main/java/com/lothrazar/storagenetwork/item/remote/ScreenNetworkRemote.java +++ b/src/main/java/com/lothrazar/storagenetwork/item/remote/ScreenNetworkRemote.java @@ -13,7 +13,7 @@ import net.minecraft.world.item.ItemStack; import net.minecraftforge.fml.ModList; -public class ScreenNetworkRemote extends AbstractNetworkScreen {// extends AbstractContainerScreen implements IGuiNetwork { +public class ScreenNetworkRemote extends AbstractNetworkScreen { private static final int HEIGHT = 256; private static final int WIDTH = 176; diff --git a/src/main/java/com/lothrazar/storagenetwork/registry/SsnRegistry.java b/src/main/java/com/lothrazar/storagenetwork/registry/SsnRegistry.java index a18930b6..d38728f9 100644 --- a/src/main/java/com/lothrazar/storagenetwork/registry/SsnRegistry.java +++ b/src/main/java/com/lothrazar/storagenetwork/registry/SsnRegistry.java @@ -37,6 +37,7 @@ import com.lothrazar.storagenetwork.item.ItemPicker; import com.lothrazar.storagenetwork.item.ItemUpgrade; import com.lothrazar.storagenetwork.item.remote.ContainerNetworkCraftingRemote; +import com.lothrazar.storagenetwork.item.remote.ContainerNetworkExpandedRemote; import com.lothrazar.storagenetwork.item.remote.ContainerNetworkRemote; import com.lothrazar.storagenetwork.item.remote.ItemStorageCraftingRemote; import net.minecraft.world.inventory.MenuType; @@ -102,6 +103,7 @@ public static class Items { public static final RegistryObject PICKER_REMOTE = ITEMS.register("picker_remote", () -> new ItemPicker(new Item.Properties())); public static final RegistryObject COLLECTOR_REMOTE = ITEMS.register("collector_remote", () -> new ItemCollector(new Item.Properties())); public static final RegistryObject BUILDER_REMOTE = ITEMS.register("builder_remote", () -> new ItemBuilder(new Item.Properties())); + public static final RegistryObject EXPANDED_REMOTE = ITEMS.register("expanded_remote", () -> new ItemStorageCraftingRemote(new Item.Properties())); } @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD) @@ -151,5 +153,8 @@ public static class Menus { public static final RegistryObject> CRAFTING_REMOTE = CONTAINERS.register("crafting_remote", () -> IForgeMenuType.create((windowId, inv, data) -> { return new ContainerNetworkCraftingRemote(windowId, inv.player.getInventory()); })); + public static final RegistryObject> EXPANDED_REMOTE = CONTAINERS.register("expanded_remote", () -> IForgeMenuType.create((windowId, inv, data) -> { + return new ContainerNetworkExpandedRemote(windowId, inv.player.getInventory()); + })); } }