diff --git a/build.gradle b/build.gradle index 497f0f17..1d1cfd6d 100755 --- a/build.gradle +++ b/build.gradle @@ -92,7 +92,7 @@ minecraft { property 'mixin.env.remapRefMap', 'true' property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg" property 'forge.enabledGameTestNamespaces', mod_id - args '--nogui' + // args '--nogui' } // This run config launches GameTestServer and runs all registered gametests, then exits. diff --git a/gradle.properties b/gradle.properties index 3f44dc85..f3468457 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,7 +9,7 @@ org.gradle.daemon=false mod_id=storagenetwork curse_id=268495 -mod_version=1.11.0-SNAPSHOT +mod_version=1.11.0 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 a7996231..eed5be12 100644 --- a/src/main/java/com/lothrazar/storagenetwork/block/inventory/ScreenNetworkInventory.java +++ b/src/main/java/com/lothrazar/storagenetwork/block/inventory/ScreenNetworkInventory.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.NetworkGuiSize; import com.lothrazar.storagenetwork.jei.JeiHooks; import com.lothrazar.storagenetwork.network.ClearRecipeMessage; import com.lothrazar.storagenetwork.network.RequestMessage; @@ -38,11 +39,9 @@ public class ScreenNetworkInventory extends AbstractContainerScreen slots; private final IGuiNetwork gui; private long lastClick; @@ -53,8 +53,22 @@ public class NetworkWidget { private int lines = 4; private final int columns = 9; + @Deprecated public NetworkWidget(IGuiNetwork gui) { + this(gui, NetworkGuiSize.NORMAL); + } + public NetworkWidget(IGuiNetwork gui, NetworkGuiSize size) { this.gui = gui; + switch (size) { + case LARGE: + setLines(8); + setFieldHeight(180 - 8); // the jei -8 gets fixed here now + break; + case NORMAL: + setLines(4); + setFieldHeight(90); + break; + } stacks = Lists.newArrayList(); slots = Lists.newArrayList(); PacketRegistry.INSTANCE.sendToServer(new RequestMessage()); @@ -171,7 +185,7 @@ public void rebuildItemSlots(List stacksToDisplay) { break; } int in = index; - // StorageNetwork.LOGGER.info(in + "GUI STORAGE rebuildItemSlots "+stacksToDisplay.get(in)); + slots.add(new ItemSlotNetwork(gui, stacksToDisplay.get(in), gui.getGuiLeft() + 8 + col * 18, gui.getGuiTopFixJei() + 10 + row * 18, @@ -301,21 +315,23 @@ public void mouseClicked(double mouseX, double mouseY, int mouseButton) { && (mouseButton == UtilTileEntity.MOUSE_BTN_LEFT || mouseButton == UtilTileEntity.MOUSE_BTN_RIGHT) && stackCarriedByMouse.isEmpty() && this.canClick()) { + // Request an item (from the network) if we are in the upper section of the GUI PacketRegistry.INSTANCE.sendToServer(new RequestMessage(mouseButton, this.stackUnderMouse.copy(), Screen.hasShiftDown(), Screen.hasAltDown() || Screen.hasControlDown())); this.lastClick = System.currentTimeMillis(); } else if (!stackCarriedByMouse.isEmpty() && inField((int) mouseX, (int) mouseY) && this.canClick()) { - //0 isd getDim() + // Insert the item held by the mouse into the network PacketRegistry.INSTANCE.sendToServer(new InsertMessage(0, mouseButton)); this.lastClick = System.currentTimeMillis(); } } 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); + boolean inField = mouseX > (gui.getGuiLeft() + 7) && mouseX < (gui.getGuiLeft() + ScreenNetworkTable.WIDTH - 7) + && mouseY > (gui.getGuiTopFixJei() + 7) && mouseY < (gui.getGuiTopFixJei() + getFieldHeight()); + return inField; } public void initButtons() { @@ -386,6 +402,14 @@ public void render() { } } + public int getFieldHeight() { + return fieldHeight; + } + + public void setFieldHeight(int fieldHeight) { + this.fieldHeight = fieldHeight; + } + public interface ISearchHandler { public abstract void setSearch(String set); @@ -394,4 +418,8 @@ public interface ISearchHandler { public abstract String getName(); } + + public enum NetworkGuiSize { + 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 54a23184..7606f15e 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.NetworkGuiSize; import com.lothrazar.storagenetwork.jei.JeiHooks; import com.lothrazar.storagenetwork.network.ClearRecipeMessage; import com.lothrazar.storagenetwork.network.RequestMessage; @@ -35,11 +36,10 @@ public ScreenNetworkCraftingRemote(ContainerNetworkCraftingRemote screenContaine super(screenContainer, inv, titleIn); //since the rightclick action forces only MAIN_HAND openings, is ok this.remote = screenContainer.getRemote();// inv.player.getItemInHand(InteractionHand.MAIN_HAND); - network = new NetworkWidget(this); - network.setLines(4); + network = new NetworkWidget(this, NetworkGuiSize.NORMAL); + this.imageWidth = WIDTH; this.imageHeight = HEIGHT; - network.fieldHeight = 90; } @Override 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 60146c82..d045d790 100644 --- a/src/main/java/com/lothrazar/storagenetwork/item/remote/ScreenNetworkRemote.java +++ b/src/main/java/com/lothrazar/storagenetwork/item/remote/ScreenNetworkRemote.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.NetworkGuiSize; import com.lothrazar.storagenetwork.jei.JeiHooks; import com.lothrazar.storagenetwork.network.SettingsSyncMessage; import com.lothrazar.storagenetwork.registry.PacketRegistry; @@ -32,11 +33,9 @@ public ScreenNetworkRemote(ContainerNetworkRemote screenContainer, Inventory inv super(screenContainer, inv, titleIn); //since the rightclick action forces only MAIN_HAND openings, is ok this.remote = screenContainer.getRemote();//inv.player.getItemInHand(InteractionHand.MAIN_HAND); - network = new NetworkWidget(this); - network.setLines(8); + network = new NetworkWidget(this, NetworkGuiSize.LARGE); this.imageWidth = WIDTH; this.imageHeight = HEIGHT; - network.fieldHeight = 180; } @Override diff --git a/src/main/java/com/lothrazar/storagenetwork/jei/JeiHooks.java b/src/main/java/com/lothrazar/storagenetwork/jei/JeiHooks.java index e8a298fe..622a1433 100644 --- a/src/main/java/com/lothrazar/storagenetwork/jei/JeiHooks.java +++ b/src/main/java/com/lothrazar/storagenetwork/jei/JeiHooks.java @@ -29,10 +29,6 @@ private static IJeiRuntime getRuntime() { } } - private static String getJeiTextInternal() { - return getRuntime().getIngredientFilter().getFilterText(); - } - public static void testJeiKeybind(InputConstants.Key keyCode, ItemStack stackUnderMouse) { try { if (!isJeiLoaded() || getRuntime() == null) { diff --git a/update.json b/update.json index 275aef66..1122c653 100644 --- a/update.json +++ b/update.json @@ -5,7 +5,7 @@ "1.19.2-latest": "1.7.0", "1.19.3-latest": "1.8.0", "1.19.4-latest": "1.9.0", - "1.20.1-latest": "1.10.1" + "1.20.1-latest": "1.11.0" }, "1.19.2": { "1.7.0":"Merged 1.18.2-1.7.0. Compatible with jei==11.4+, forge=43+. 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 . " @@ -22,6 +22,6 @@ "1.20.1": { "1.10.0":"Ported to 1.20.1, depends on flib-0.0.7+ . Fixed patchouli book. Port to new non-deprecated curios datapack tags. Includes pull requests merged into the 1.18 and 1.19 branches : 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.10.1":" Merge pull request #518 from ALFEECLARE: add ja_jp translation." - ,"1.10.2":" Merge pull request #536 from maxpowa : Add support for EMI mod; this also fixes crash #513. " + ,"1.11.0":" 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. Merge pull request #536 from maxpowa : Add support for EMI mod; this also fixes crash #513. " } }