Compare commits

..
5 Commits
Author SHA1 Message Date
firenoo bdf41e7ed8 findit/util/AbstractStackFinder: Add check for whether NEI Search is focused (#8)
* findit/util/AbstractStackFinder: Add check for whether NEI Search is
focused

	This adds a check to make sure that FindIt doesn't start a
search when searching in NEI

Signed-off-by: Firenoo <[email protected]>

* findit/util/AbstractStackFinder: Move key handling code to lastKeyTyped

	Moves FindIt's keyhandling code to lastKeyTyped to avoid
conflicting with textfields.

Signed-off-by: Firenoo <[email protected]>

* findit/util/AbstractStackFinder: Code cleanup

Signed-off-by: Firenoo <[email protected]>

* findit/service: Revert default keybinds to T/Y.

Signed-off-by: Firenoo <[email protected]>

Signed-off-by: Firenoo <[email protected]>
2022-08-31 10:24:49 +02:00
slprime 84f2cf1182 Add Shortcut to KeyBinding (#7) 2022-08-21 19:28:02 +02:00
Jason Mitchell 5be63a3f25 [ci skip] Migrate github actions to GTNH-Actions-Workflows 2022-07-16 10:48:09 -07:00
Zereff06 be83b0edf9 Create ru_RU.lang (#6) 2022-07-15 02:21:06 +01:00
Kiwi 4045a075a2 Create zh_CN.lang (#5) 2022-04-29 14:09:51 +08:00
8 changed files with 37 additions and 97 deletions

No files matched your search

+2 -34
View File
@@ -1,5 +1,3 @@
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
name: Build and test
@@ -11,35 +9,5 @@ on:
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up JDK 8
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'adopt'
cache: gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Setup the workspace
run: ./gradlew setupCIWorkspace
- name: Build the mod
run: ./gradlew build
- name: Run server for 1.5 minutes
run: |
mkdir run
echo "eula=true" > run/eula.txt
timeout 90 ./gradlew runServer | tee --append server.log || true
- name: Test no errors reported during server run
run: |
chmod +x .github/scripts/test-no-error-reports.sh
.github/scripts/test-no-error-reports.sh
uses: GTNewHorizons/GTNH-Actions-Workflows/.github/workflows/build-and-test.yml@master
secrets: inherit
+7 -44
View File
@@ -1,51 +1,14 @@
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
name: Release tagged build
on:
push:
tags:
- '*'
tags: [ '*' ]
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set release version
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Set up JDK 8
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'adopt'
cache: gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Setup the workspace
run: ./gradlew setupCIWorkspace
- name: Build the mod
run: ./gradlew build
- name: Release under current tag
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "${{ env.RELEASE_VERSION }}"
prerelease: false
title: "${{ env.RELEASE_VERSION }}"
files: build/libs/*.jar
- name: Publish to Maven
run: ./gradlew publish
env:
MAVEN_USER: ${{ secrets.MAVEN_USER }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
release-tags:
uses: GTNewHorizons/GTNH-Actions-Workflows/.github/workflows/release-tags.yml@master
secrets: inherit
+1 -1
View File
@@ -1,6 +1,6 @@
// Add your dependencies here
dependencies {
compile('com.github.GTNewHorizons:NotEnoughItems:2.2.6-GTNH:dev')
compile('com.github.GTNewHorizons:NotEnoughItems:2.2.27-GTNH:dev')
compile('com.github.GTNewHorizons:GT5-Unofficial:5.09.40.33:dev')
}
@@ -1,5 +1,6 @@
package com.gtnh.findit.service.blockfinder;
import codechicken.nei.NEIClientUtils;
import codechicken.nei.api.API;
import codechicken.nei.guihook.GuiContainerManager;
import com.gtnh.findit.FindIt;
@@ -15,7 +16,7 @@ import org.lwjgl.input.Keyboard;
public class ClientBlockFindService extends BlockFindService {
public ClientBlockFindService() {
API.addKeyBind("gui.findit.find_block", Keyboard.KEY_Y);
API.addHashBind("gui.findit.find_block", Keyboard.KEY_Y);
GuiContainerManager.addInputHandler(new BlockFindInputHandler());
}
@@ -1,5 +1,6 @@
package com.gtnh.findit.service.itemfinder;
import codechicken.nei.NEIClientUtils;
import codechicken.nei.api.API;
import codechicken.nei.guihook.GuiContainerManager;
import com.gtnh.findit.FindIt;
@@ -32,7 +33,7 @@ public class ClientItemFindService extends ItemFindService {
public ClientItemFindService() {
if (!FindIt.isExtraUtilitiesLoaded()) {
API.addKeyBind("gui.findit.find_item", Keyboard.KEY_T);
API.addHashBind("gui.findit.find_item", Keyboard.KEY_T);
}
GuiContainerManager.addInputHandler(new ItemFindInputHandler());
@@ -1,5 +1,6 @@
package com.gtnh.findit.util;
import appeng.client.gui.implementations.*;
import codechicken.nei.LayoutManager;
import codechicken.nei.NEIClientConfig;
import codechicken.nei.guihook.GuiContainerManager;
@@ -15,21 +16,7 @@ public abstract class AbstractStackFinder implements IContainerInputHandler {
@Override
public boolean keyTyped(GuiContainer window, char c, int key) {
int keyBinding = NEIClientConfig.getKeyBinding(getKeyBindId());
if (key != keyBinding) {
return false;
}
LayoutManager layout = LayoutManager.instance();
if (layout == null || LayoutManager.itemPanel == null || NEIClientConfig.isHidden()) {
return false;
}
ItemStack stack = GuiContainerManager.getStackMouseOver(window);
if (stack == null || stack.getItem() == null) {
return false;
}
return findStack(stack);
return false;
}
@Override
@@ -39,7 +26,20 @@ public abstract class AbstractStackFinder implements IContainerInputHandler {
@Override
public boolean lastKeyTyped(GuiContainer guiContainer, char c, int i) {
return false;
if (!NEIClientConfig.isKeyHashDown(getKeyBindId())) {
return false;
}
LayoutManager layout = LayoutManager.instance();
if (layout == null || LayoutManager.itemPanel == null || NEIClientConfig.isHidden()) {
return false;
}
ItemStack stack = GuiContainerManager.getStackMouseOver(guiContainer);
if (stack == null || stack.getItem() == null) {
return false;
}
return findStack(stack);
}
@Override
@@ -0,0 +1,3 @@
nei.options.keys.gui.findit=Find-It клавиши
nei.options.keys.gui.findit.find_block=Поиск блока поблизости
nei.options.keys.gui.findit.find_item=Поиск предмета в инвентарях поблизости
@@ -0,0 +1,4 @@
nei.options.keys.gui.findit=搜索世界
nei.options.keys.gui.findit.find_block=搜索附近的方块
nei.options.keys.gui.findit.find_item=搜索附近库存中的物品