diff --git a/build.gradle b/build.gradle index 2407b015..701fa9ed 100755 --- a/build.gradle +++ b/build.gradle @@ -31,7 +31,7 @@ minecraft { property 'forge.logging.console.level', 'debug' properties 'mixin.env.disableRefMap': 'true' - args '--username=ADev' + args '--username=AnotherDev' mods { storagenetwork { diff --git a/src/main/java/com/lothrazar/storagenetwork/block/inventory/ScreenNetworkInventory.java b/src/main/java/com/lothrazar/storagenetwork/block/inventory/ScreenNetworkInventory.java index 6df58d7d..bbf1fc75 100644 --- a/src/main/java/com/lothrazar/storagenetwork/block/inventory/ScreenNetworkInventory.java +++ b/src/main/java/com/lothrazar/storagenetwork/block/inventory/ScreenNetworkInventory.java @@ -5,9 +5,8 @@ import com.lothrazar.storagenetwork.api.EnumSortType; import com.lothrazar.storagenetwork.api.IGuiNetwork; import com.lothrazar.storagenetwork.gui.NetworkWidget; +import com.lothrazar.storagenetwork.gui.NetworkWidget.NetworkScreenSize; import com.lothrazar.storagenetwork.jei.JeiHooks; -import com.lothrazar.storagenetwork.network.ClearRecipeMessage; -import com.lothrazar.storagenetwork.network.RequestMessage; import com.lothrazar.storagenetwork.network.SettingsSyncMessage; import com.lothrazar.storagenetwork.registry.PacketRegistry; import com.mojang.blaze3d.platform.InputConstants; @@ -40,11 +39,9 @@ public class ScreenNetworkInventory extends AbstractContainerScreen slots; private final IGuiNetwork gui; private long lastClick; @@ -53,12 +53,27 @@ public class NetworkWidget { private int lines = 4; private final int columns = 9; + @Deprecated public NetworkWidget(IGuiNetwork gui) { + this(gui, NetworkScreenSize.NORMAL); + } + + public NetworkWidget(IGuiNetwork gui, NetworkScreenSize size) { this.gui = gui; stacks = Lists.newArrayList(); slots = Lists.newArrayList(); PacketRegistry.INSTANCE.sendToServer(new RequestMessage()); lastClick = System.currentTimeMillis(); + switch (size) { + case LARGE: + setLines(8); + setFieldHeight(180 - 8); // offset is important + break; + case NORMAL: + setLines(4); + setFieldHeight(90); + break; + } } public void applySearchTextToSlots() { @@ -310,7 +325,7 @@ else if (!stackCarriedByMouse.isEmpty() && inField((int) mouseX, (int) mouseY) & private boolean inField(int mouseX, int mouseY) { return mouseX > (gui.getGuiLeft() + 7) && mouseX < (gui.getGuiLeft() + ScreenNetworkTable.WIDTH - 7) - && mouseY > (gui.getGuiTopFixJei() + 7) && mouseY < (gui.getGuiTopFixJei() + fieldHeight); + && mouseY > (gui.getGuiTopFixJei() + 7) && mouseY < (gui.getGuiTopFixJei() + getFieldHeight()); } public void initButtons() { @@ -380,4 +395,16 @@ public void render() { jeiBtn.setTextureId(gui.isJeiSearchSynced() ? TextureEnum.JEI_GREEN : TextureEnum.JEI_RED); } } + + public int getFieldHeight() { + return fieldHeight; + } + + public void setFieldHeight(int fieldHeight) { + this.fieldHeight = fieldHeight; + } + + public enum NetworkScreenSize { + NORMAL, LARGE; + } } 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 d95415b6..b2362d80 100644 --- a/src/main/java/com/lothrazar/storagenetwork/item/remote/ScreenNetworkCraftingRemote.java +++ b/src/main/java/com/lothrazar/storagenetwork/item/remote/ScreenNetworkCraftingRemote.java @@ -5,6 +5,7 @@ import com.lothrazar.storagenetwork.api.EnumSortType; import com.lothrazar.storagenetwork.api.IGuiNetwork; import com.lothrazar.storagenetwork.gui.NetworkWidget; +import com.lothrazar.storagenetwork.gui.NetworkWidget.NetworkScreenSize; import com.lothrazar.storagenetwork.jei.JeiHooks; import com.lothrazar.storagenetwork.network.ClearRecipeMessage; import com.lothrazar.storagenetwork.network.RequestMessage; @@ -36,12 +37,10 @@ public class ScreenNetworkCraftingRemote extends AbstractContainerScreen * Used by Containers displaying network inventory as well as most other packets that perform small actions */ +@SuppressWarnings("resource") public class RefreshFilterClientMessage { private int size; diff --git a/update.json b/update.json index fcd33d03..b9aa9d9f 100644 --- a/update.json +++ b/update.json @@ -7,8 +7,9 @@ "1.19.4": { "1.9.0":"Ported to 1.19.4. Previous changelog: Community Pull Request Contributions: Merge pull request #492 from IIpragmaII/trunk/1.18 @IIpragmaII @VasurTrekkson Improved performance for export node. fix priority german translation @lightlike . Fixed recipes not showing when pressing the JEI recipe key @Demerso. Create uk_ua.json @SKZGx . " - - ,"1.9.1":"The Storage Request Table 'storagenetwork:request' block no longer saves the contents of its crafting-grid; instead items are returned to the player on close, exactly matching vanilla crafting table behavior (this was changed to prevent potential exploits. If any items are left behind in the grid during world upgrade they will be returned and not lost. No changes were made to the remotes or to other blocks) " + + ,"1.9.1":"The Storage Request Table 'storagenetwork:request' block no longer saves the contents of its crafting-grid; instead items are returned to the player on close, exactly matching vanilla crafting table behavior (this was changed to prevent potential exploits. If any items are left behind in the grid during world upgrade they will be returned and not lost. No changes were made to the remotes or to other blocks). Fix the bug when using small window sizes where the top row of player inventory items getting inserted instead of picked up when using the remote when jei is installed. Fixed a null pointer exception" + } }