Compare commits

..
2 Commits
Author SHA1 Message Date
Alexdoru 80cfdfd41e fixed the keybinds triggering when they are un binded (#9)
* fix keybind triggering when un binded

* translation had wrong key

* it's in the same class
2022-09-14 07:32:45 +02:00
Jason Mitchell 08a9f33dbb [ci skip] Migrate github actions to GTNH-Actions-Workflows 2022-07-16 10:52:02 -07:00
5 changed files with 52 additions and 161 deletions

No files matched your search

-9
View File
@@ -1,9 +0,0 @@
directory="run/crash-reports"
if [ -d $directory ]; then
echo "Crash reports detected:"
cat $directory/*
exit 1
else
echo "No crash reports detected"
exit 0
fi
+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 minute
run: |
mkdir run
echo "eula=true" > run/eula.txt
timeout 10 ./gradlew runServer || true
- name: Test no crashes happend
run: |
chmod +x .github/scripts/test-no-crash-reports.sh
.github/scripts/test-no-crash-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,94 +1,63 @@
package mcp.mobius.waila.client;
import java.util.List;
import org.lwjgl.input.Keyboard;
import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.InputEvent.KeyInputEvent;
import mcp.mobius.waila.api.impl.ConfigHandler;
import mcp.mobius.waila.cbcore.LangUtil;
import mcp.mobius.waila.gui.screens.config.ScreenConfig;
import mcp.mobius.waila.overlay.RayTracing;
import mcp.mobius.waila.utils.Constants;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.inventory.GuiInventory;
import net.minecraft.client.settings.KeyBinding;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ChatComponentTranslation;
import net.minecraft.util.MovingObjectPosition;
import net.minecraftforge.common.config.Configuration;
import org.lwjgl.input.Keyboard;
public class KeyEvent {
public static KeyBinding key_cfg;
public static KeyBinding key_show;
public static KeyBinding key_liquid;
public static KeyBinding key_recipe;
public static KeyBinding key_usage;
public KeyEvent() {
ClientRegistry.registerKeyBinding(key_cfg = new KeyBinding(Constants.BIND_WAILA_CFG, Keyboard.KEY_NUMPAD0, "Waila"));
ClientRegistry.registerKeyBinding(key_show = new KeyBinding(Constants.BIND_WAILA_SHOW, Keyboard.KEY_NUMPAD1, "Waila"));
ClientRegistry.registerKeyBinding(key_liquid = new KeyBinding(Constants.BIND_WAILA_LIQUID, Keyboard.KEY_NUMPAD2, "Waila"));
ClientRegistry.registerKeyBinding(key_recipe = new KeyBinding(Constants.BIND_WAILA_RECIPE, Keyboard.KEY_NUMPAD3, "Waila"));
ClientRegistry.registerKeyBinding(key_usage = new KeyBinding(Constants.BIND_WAILA_USAGE, Keyboard.KEY_NUMPAD4, "Waila"));
}
@SubscribeEvent
public void onKeyEvent(KeyInputEvent event){
int key = Keyboard.getEventKey();
Minecraft mc = Minecraft.getMinecraft();
if (Keyboard.getEventKeyState()){
if (key == key_cfg.getKeyCode()){
if(mc.currentScreen == null)
mc.displayGuiScreen(new ScreenConfig(mc.currentScreen));
public void onKeyEvent(KeyInputEvent event) {
if (key_cfg.isPressed()) {
Minecraft mc = Minecraft.getMinecraft();
if (mc.currentScreen == null) {
mc.displayGuiScreen(new ScreenConfig(null));
}
else if (key == key_show.getKeyCode() && ConfigHandler.instance().getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_MODE, false)){
boolean status = ConfigHandler.instance().getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_SHOW, true);
ConfigHandler.instance().setConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_SHOW, !status);
}
else if (key == key_show.getKeyCode() && !ConfigHandler.instance().getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_MODE, false)){
ConfigHandler.instance().setConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_SHOW, true);
}
else if (key == key_liquid.getKeyCode()){
boolean status = ConfigHandler.instance().getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_LIQUID, true);
ConfigHandler.instance().setConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_LIQUID, !status);
}
else if (key == key_recipe.getKeyCode()){
if (Loader.isModLoaded("NotEnoughItems")){
try{
Class.forName("mcp.mobius.waila.handlers.nei.NEIHandler").getDeclaredMethod("openRecipeGUI", boolean.class).invoke(null, true);
} catch (Exception e){}
} else if (key_show.isPressed() && ConfigHandler.instance().getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_MODE, false)) {
boolean status = ConfigHandler.instance().getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_SHOW, true);
ConfigHandler.instance().setConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_SHOW, !status);
} else if (key_show.isPressed() && !ConfigHandler.instance().getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_MODE, false)) {
ConfigHandler.instance().setConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_SHOW, true);
} else if (key_liquid.isPressed()) {
boolean status = ConfigHandler.instance().getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_LIQUID, true);
ConfigHandler.instance().setConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_LIQUID, !status);
} else if (key_recipe.isPressed()) {
if (Loader.isModLoaded("NotEnoughItems")) {
try {
Class.forName("mcp.mobius.waila.handlers.nei.NEIHandler").getDeclaredMethod("openRecipeGUI", boolean.class).invoke(null, true);
} catch (Exception ignored) {
}
}
else if (key == key_usage.getKeyCode()){
if (Loader.isModLoaded("NotEnoughItems")){
try{
Class.forName("mcp.mobius.waila.handlers.nei.NEIHandler").getDeclaredMethod("openRecipeGUI", boolean.class).invoke(null, false);
} catch (Exception e){}
} else if (key_usage.isPressed()) {
if (Loader.isModLoaded("NotEnoughItems")) {
try {
Class.forName("mcp.mobius.waila.handlers.nei.NEIHandler").getDeclaredMethod("openRecipeGUI", boolean.class).invoke(null, false);
} catch (Exception ignored) {
}
}
}
}
}
}
public KeyEvent(){
KeyEvent.key_cfg = new KeyBinding(Constants.BIND_WAILA_CFG, Keyboard.KEY_NUMPAD0, "Waila");
KeyEvent.key_show = new KeyBinding(Constants.BIND_WAILA_SHOW, Keyboard.KEY_NUMPAD1, "Waila");
KeyEvent.key_liquid = new KeyBinding(Constants.BIND_WAILA_LIQUID, Keyboard.KEY_NUMPAD2, "Waila");
KeyEvent.key_recipe = new KeyBinding(Constants.BIND_WAILA_RECIPE, Keyboard.KEY_NUMPAD3, "Waila");
KeyEvent.key_usage = new KeyBinding(Constants.BIND_WAILA_USAGE, Keyboard.KEY_NUMPAD4, "Waila");
ClientRegistry.registerKeyBinding(KeyEvent.key_cfg);
ClientRegistry.registerKeyBinding(KeyEvent.key_show);
ClientRegistry.registerKeyBinding(KeyEvent.key_liquid);
ClientRegistry.registerKeyBinding(KeyEvent.key_recipe);
ClientRegistry.registerKeyBinding(KeyEvent.key_usage);
/*
Minecraft.getMinecraft().gameSettings.keyBindings = (KeyBinding[])ArrayUtils.addAll(
new KeyBinding[] {KeyHandler.key_cfg, KeyHandler.key_show, KeyHandler.key_liquid},
Minecraft.getMinecraft().gameSettings.keyBindings);
*/
}
}
@@ -26,12 +26,12 @@ enchant.title.maxlvl=Max lvl
enchant.title.weight=Gewicht
enchant.label.enchantability=Enchantbaarheid
keybind.configscreen=[Waila] Configuratiescherm
keybind.showhide=[Waila] Toon/Verberg
keybind.showliquid=[Waila] Toon vloeistoffen
keybind.showrecipe=[Waila] Toon recepten
keybind.showusage=[Waila] Toon gebruik
keybind.testing=[Waila] Testen
waila.keybind.wailaconfig=[Waila] Configuratiescherm
waila.keybind.wailadisplay=[Waila] Toon/Verberg
waila.keybind.liquid=[Waila] Toon vloeistoffen
waila.keybind.recipe=[Waila] Toon recepten
waila.keybind.usage=[Waila] Toon gebruik
waila.keybind.testing=[Waila] Testen
client.msg.norecipe=Geen recept gevonden.
client.msg.nousage=Geen gebruik gevonden.
@@ -57,7 +57,7 @@ hud.msg.frequency=Frequentie
hud.msg.owner=Eigenaar
hud.msg.public=Publiek
hud.msg.restricted=Begrensd
hud.msg.private=Privé
hud.msg.private=Priv�
hud.msg.white=Wit
hud.msg.orange=Oranje