├── src
└── main
│ ├── resources
│ ├── assets
│ │ └── joypadmod
│ │ │ ├── textures
│ │ │ ├── reticle.png
│ │ │ └── reticle2.png
│ │ │ └── lang
│ │ │ ├── sk_SK.lang
│ │ │ ├── ko_KR.lang
│ │ │ ├── hr_HR.lang
│ │ │ ├── he_IL.lang
│ │ │ ├── th_TH.lang
│ │ │ ├── ar_SA.lang
│ │ │ ├── da_DK.lang
│ │ │ ├── tlh_AA.lang
│ │ │ ├── no_NO.lang
│ │ │ ├── sv_SE.lang
│ │ │ ├── sl_SI.lang
│ │ │ ├── eo_UY.lang
│ │ │ ├── hi_IN.lang
│ │ │ ├── tr_TR.lang
│ │ │ ├── hy_AM.lang
│ │ │ ├── lb_LU.lang
│ │ │ ├── is_IS.lang
│ │ │ ├── id_ID.lang
│ │ │ ├── qya_AA.lang
│ │ │ ├── af_ZA.lang
│ │ │ ├── fa_IR.lang
│ │ │ ├── kw_GB.lang
│ │ │ ├── cs_CZ.lang
│ │ │ ├── pt_BR.lang
│ │ │ ├── cy_GB.lang
│ │ │ ├── fi_FI.lang
│ │ │ ├── fil_PH.lang
│ │ │ ├── la_LA.lang
│ │ │ ├── gl_ES.lang
│ │ │ ├── mt_MT.lang
│ │ │ ├── es_AR.lang
│ │ │ ├── et_EE.lang
│ │ │ ├── nn_NO.lang
│ │ │ ├── ca_ES.lang
│ │ │ ├── ro_RO.lang
│ │ │ ├── es_MX.lang
│ │ │ ├── uk_UA.lang
│ │ │ ├── vi_VN.lang
│ │ │ ├── es_ES.lang
│ │ │ ├── es_VE.lang
│ │ │ ├── eu_ES.lang
│ │ │ ├── oc_FR.lang
│ │ │ ├── es_UY.lang
│ │ │ ├── ms_MY.lang
│ │ │ ├── it_IT.lang
│ │ │ ├── lv_LV.lang
│ │ │ ├── bg_BG.lang
│ │ │ ├── pt_PT.lang
│ │ │ ├── ga_IE.lang
│ │ │ ├── lt_LT.lang
│ │ │ ├── ka_GE.lang
│ │ │ ├── fr_CA.lang
│ │ │ ├── el_GR.lang
│ │ │ ├── fr_FR.lang
│ │ │ ├── zh_CN.lang
│ │ │ ├── zh_TW.lang
│ │ │ ├── ja_JP.lang
│ │ │ ├── ru_RU.lang
│ │ │ ├── sr_SP.lang
│ │ │ ├── nl_NL.lang
│ │ │ ├── de_DE.lang
│ │ │ ├── hu_HU.lang
│ │ │ ├── pl_PL.lang
│ │ │ └── en_US.lang
│ └── mcmod.info
│ └── java
│ └── com
│ └── shiny
│ └── joypadmod
│ ├── utils
│ ├── McKeyBindHelper.java
│ ├── JoypadMouseHelper.java
│ ├── McObfuscationHelper.java
│ └── Customizations.java
│ ├── mappings
│ ├── DefaultAxisMappings.java
│ └── DefaultButtonMappings.java
│ ├── devices
│ ├── InputDevice.java
│ ├── InputLibrary.java
│ ├── LWJGLDeviceWrapper.java
│ ├── LWJGLibrary.java
│ ├── VirtualKeyboard.java
│ ├── XInputDeviceWrapper.java
│ ├── XInputLibrary.java
│ ├── VirtualMouse.java
│ └── JoypadMouse.java
│ ├── event
│ ├── ButtonInputEvent.java
│ ├── PovInputEvent.java
│ ├── AxisInputEvent.java
│ ├── ControllerInputEvent.java
│ └── ControllerUtils.java
│ ├── gui
│ ├── McGuiHelper.java
│ ├── GuiSlider.java
│ ├── joypad
│ │ ├── JoypadAdvancedMenu.java
│ │ ├── JoypadCalibrationList.java
│ │ └── JoypadCalibrationMenu.java
│ └── ButtonScreenTips.java
│ └── JoypadMod.java
├── .gitignore
└── README.md
/src/main/resources/assets/joypadmod/textures/reticle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ljsimin/MinecraftJoypadSplitscreenMod/HEAD/src/main/resources/assets/joypadmod/textures/reticle.png
--------------------------------------------------------------------------------
/src/main/resources/assets/joypadmod/textures/reticle2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ljsimin/MinecraftJoypadSplitscreenMod/HEAD/src/main/resources/assets/joypadmod/textures/reticle2.png
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # eclipse
2 | bin
3 | *.launch
4 | .settings
5 | .metadata
6 | .classpath
7 | .project
8 |
9 | # idea
10 | out
11 | *.ipr
12 | *.iws
13 | *.iml
14 | .idea
15 |
16 | # gradle
17 | build
18 | gradle
19 | gradlew
20 | gradlew.bat
21 | gradle.properties
22 | .gradle
23 |
24 | # other
25 | eclipse
26 | run
27 |
28 | # Files from Forge MDK
29 | forge*changelog.txt
30 |
--------------------------------------------------------------------------------
/src/main/resources/mcmod.info:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "modid": "joypadsplitscreenmod",
4 | "name": "Joypad Mod",
5 | "version": "1.12-14.21.1.2387",
6 | "description": "Play Minecraft splitscreen using gamepad controllers!!",
7 | "url": "http://github.com/ljsimin/MinecraftJoypadSplitscreenMod",
8 | "updateUrl": "http://github.com/ljsimin/MinecraftJoypadSplitscreenMod",
9 | "credits": "Forge, FML, MCP & everyone at Mojang",
10 | "authorList": ["Freeshiny", "Eastsider", "BryanBlake", "Nautigsam", "Drew"]
11 | }
12 | ]
13 |
--------------------------------------------------------------------------------
/src/main/java/com/shiny/joypadmod/utils/McKeyBindHelper.java:
--------------------------------------------------------------------------------
1 | package com.shiny.joypadmod.utils;
2 |
3 | import net.minecraft.client.Minecraft;
4 | import net.minecraft.client.settings.KeyBinding;
5 |
6 | public class McKeyBindHelper {
7 | public static KeyBinding getMinecraftKeyBind(String bindingKey) {
8 | for (KeyBinding kb : Minecraft.getMinecraft().gameSettings.keyBindings) {
9 | String keyInputString = McObfuscationHelper.getKeyDescription(kb);
10 | if (keyInputString.compareTo(bindingKey) == 0) {
11 | return kb;
12 | }
13 | }
14 | return null;
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | MinecraftJoypadMod
2 | =============================
3 |
4 | **Mod that adds support for splitscreen games and joypads in Minecraft: Java Edition.**
5 |
6 | _Notice: The mod supports as many joypads as your PC can handle, as well as supporting your keyboard and mouse._
7 |
8 |
9 | Original [mod](https://github.com/ljsimin/MinecraftJoypadSplitscreenMod)
10 | Original [forum post](http://www.minecraftforum.net/topic/1213778-162-0151-joypad-mod-usb-controller-split-screen-over-60k-downloads/)
11 |
12 | Mod Download links:
13 |
14 | 1.12
15 | http://bit.ly/2ppJvne
16 |
17 | 1.11
18 | http://bit.ly/2h5twFY
19 |
20 | 1.9.4:
21 | http://bit.ly/2i8ApHb
22 |
23 | 1.8.9:
24 | http://bit.ly/1NH0VdE
25 |
26 | 1.7.10:
27 | http://bit.ly/2joJYhm
28 |
29 | 1.7.2:
30 | http://bit.ly/1QbrUAD
31 |
32 | 1.6.4:
33 | http://bit.ly/1hlUpdB
34 |
--------------------------------------------------------------------------------
/src/main/resources/assets/joypadmod/lang/sk_SK.lang:
--------------------------------------------------------------------------------
1 | key.attack=Útočiť/ničiť
2 | key.back=Ísť dozadu
3 | key.categories.gameplay=Gameplay
4 | key.categories.inventory=Inventár
5 | key.categories.misc=Ostatné
6 | key.categories.movement=Pohybovanie
7 | key.categories.multiplayer=Hra pre viac hráčov
8 | key.categories.ui=Herné rozhranie
9 | key.chat=Otvoriť rozhovor
10 | key.command=Otvoriť príkaz
11 | key.drop=Vyhodiť položku
12 | key.forward=Ísť dopredu
13 | key.hotbar.1=Lišta-pozícia 1
14 | key.hotbar.2=Lišta-pozícia 2
15 | key.hotbar.3=Lišta- pozícia 3
16 | key.jump=Skok
17 | key.left=Ísť doľava
18 | key.mouseButton=Tlačidlo %1$s
19 | key.pickItem=Zobrať kocku
20 | key.playerlist=Zoznam hráčov
21 | key.right=Ísť doprava
22 | key.screenshot=Urobiť obrázok
23 | key.smoothCamera=Prepnúť filmové kamery
24 | key.sneak=Zakrádanie
25 | key.sprint=Šprint
26 | key.togglePerspective=Prepnúť pohľad
27 | key.use=Použiť vec/položiť kocku
28 |
--------------------------------------------------------------------------------
/src/main/resources/assets/joypadmod/lang/ko_KR.lang:
--------------------------------------------------------------------------------
1 | key.attack=공격 / 파괴
2 | key.back=뒤로 걷기
3 | key.categories.gameplay=게임플레이
4 | key.categories.inventory=인벤토리
5 | key.categories.misc=기타 아이템들
6 | key.categories.movement=조작
7 | key.categories.multiplayer=멀티플레이
8 | key.categories.ui=게임 인터페이스
9 | key.chat=대화 열기
10 | key.command=명령어 열기
11 | key.drop=아이템 떨어뜨리기
12 | key.forward=앞으로 걷기
13 | key.hotbar.1=핫바 슬롯 1
14 | key.hotbar.2=핫바 슬롯 2
15 | key.hotbar.3=핫바 슬롯 3
16 | key.hotbar.4=핫바 슬롯 4
17 | key.hotbar.5=핫바 슬롯 5
18 | key.hotbar.6=핫바 슬롯 6
19 | key.hotbar.7=핫바 슬롯 7
20 | key.hotbar.8=핫바 슬롯 8
21 | key.hotbar.9=핫바 슬롯 9
22 | key.inventory=인벤토리
23 | key.jump=점프
24 | key.left=왼쪽으로 이동
25 | key.mouseButton=버튼 %1$s
26 | key.pickItem=블록 선택
27 | key.playerlist=접속자 목록
28 | key.right=오른쪽 움직임
29 | key.screenshot=스크린샷 찍기
30 | key.smoothCamera=시네마틱 카메라 토글
31 | key.sneak=웅크리기
32 | key.sprint=달리기
33 | key.togglePerspective=시야 전환
34 | key.use=아이템 사용 / 블록 놓기
35 |
--------------------------------------------------------------------------------
/src/main/resources/assets/joypadmod/lang/hr_HR.lang:
--------------------------------------------------------------------------------
1 | key.attack=Napadanje/Uništavanje
2 | key.back=Nazad
3 | key.categories.gameplay=Općenito
4 | key.categories.inventory=Inventar
5 | key.categories.misc=Razno
6 | key.categories.movement=Kretanje
7 | key.categories.multiplayer=Mrežna Igra
8 | key.categories.ui=Sučelje
9 | key.chat=Razgovor
10 | key.command=Komanda
11 | key.drop=Baci
12 | key.forward=Naprijed
13 | key.hotbar.1=Polje 1
14 | key.hotbar.2=Polje 2
15 | key.hotbar.3=Polje 3
16 | key.hotbar.4=Polje 4
17 | key.hotbar.5=Polje 5
18 | key.hotbar.6=Polje 6
19 | key.hotbar.7=Polje 7
20 | key.hotbar.8=Polje 8
21 | key.hotbar.9=Polje 9
22 | key.inventory=Inventar
23 | key.jump=Skakanje
24 | key.left=Lijevo
25 | key.mouseButton=Klik %1$s
26 | key.pickItem=Odabir Bloka
27 | key.playerlist=Lista Igrača
28 | key.right=Desno
29 | key.screenshot=Slikanje
30 | key.smoothCamera=Filmska Kamera
31 | key.sneak=Šuljanje
32 | key.sprint=Trčanje
33 | key.togglePerspective=Perspektiva
34 | key.use=Korištenje/Postavljanje
35 |
--------------------------------------------------------------------------------
/src/main/resources/assets/joypadmod/lang/he_IL.lang:
--------------------------------------------------------------------------------
1 | key.attack=להתקיף/להרוס
2 | key.back=ללכת אחורה
3 | key.categories.gameplay=משחקיות
4 | key.categories.inventory=תיק
5 | key.categories.misc=שונות
6 | key.categories.movement=תנועה
7 | key.categories.multiplayer=רב-משתתפים
8 | key.categories.ui=ממשק
9 | key.chat=לפתוח צ'אט
10 | key.command=פתח פקודה
11 | key.drop=להפיל פריט
12 | key.forward=ללכת קדימה
13 | key.hotbar.1=בר חם 1
14 | key.hotbar.2=בר חם 2
15 | key.hotbar.3=בר חם 3
16 | key.hotbar.4=בר חם 4
17 | key.hotbar.5=בר חם 5
18 | key.hotbar.6=בר חם 6
19 | key.hotbar.7=בר חם 7
20 | key.hotbar.8=בר חם 8
21 | key.hotbar.9=בר חם 9
22 | key.inventory=תיק
23 | key.jump=קפיצה
24 | key.left=לזוז שמאלה
25 | key.mouseButton=כפתור %1$s
26 | key.pickItem=בחירת בלוק מסומן
27 | key.playerlist=רשימת שחקנים
28 | key.right=לזוז ימינה
29 | key.screenshot=קח תמונה
30 | key.smoothCamera=מצב מצלמה קולנועית
31 | key.sneak=התגנבות
32 | key.sprint=לרוץ
33 | key.togglePerspective=לשנות את נקודת מבט
34 | key.use=להשתמש בפריט/לשים בלוק
35 |
--------------------------------------------------------------------------------
/src/main/resources/assets/joypadmod/lang/th_TH.lang:
--------------------------------------------------------------------------------
1 | key.attack=โจมตี/ทำลาย
2 | key.back=เดินถอยหลัง
3 | key.categories.gameplay=การเล่นเกม
4 | key.categories.inventory=กระเป๋าเก็บของ
5 | key.categories.misc=อื่นๆ
6 | key.categories.movement=การเคลื่อนที่
7 | key.categories.multiplayer=เล่นหลายคน
8 | key.categories.ui=หน้าต่างเกม
9 | key.chat=เปิดการสนทนา
10 | key.command=เปิดคำสั่ง
11 | key.drop=ดรอปของ
12 | key.forward=เดินไปข้างหน้า
13 | key.hotbar.1=ปุ่มลัด 1
14 | key.hotbar.2=ปุ่มลัด 2
15 | key.hotbar.3=ปุ่มลัด 3
16 | key.hotbar.4=ปุ่มลัด 4
17 | key.hotbar.5=ปุ่มลัด 5
18 | key.hotbar.6=ปุ่มลัด 6
19 | key.hotbar.7=ปุ่มลัด 7
20 | key.hotbar.8=ปุ่มลัด 8
21 | key.hotbar.9=ปุ่มลัด 9
22 | key.inventory=กระเป๋าเก็บของ
23 | key.jump=กระโดด
24 | key.left=เดินไปทางซ้าย
25 | key.mouseButton=ปุ่ม %1$s
26 | key.pickItem=เลือกบล็อก
27 | key.playerlist=รายชื่อผู้เล่น
28 | key.right=เดินไปทางขวา
29 | key.screenshot=ถ่ายภาพ
30 | key.smoothCamera=เปิดโหมดกล้องภาพยนตร์
31 | key.sneak=ย่อง
32 | key.sprint=วิ่ง
33 | key.togglePerspective=สลับมุมมอง
34 | key.use=ใช้ของ/วางบล็อค
35 |
--------------------------------------------------------------------------------
/src/main/java/com/shiny/joypadmod/mappings/DefaultAxisMappings.java:
--------------------------------------------------------------------------------
1 | package com.shiny.joypadmod.mappings;
2 |
3 | public class DefaultAxisMappings {
4 |
5 |
6 | public int LSx() {
7 | return 0;
8 | }
9 |
10 | public int LSy() {
11 | return 1;
12 | }
13 |
14 | public int RSx() {
15 | return 2;
16 | }
17 |
18 | public int RSy() {
19 | return 3;
20 | }
21 |
22 | public int LT() {
23 | return 4;
24 | }
25 |
26 | public int RT() {
27 | return 5;
28 | }
29 |
30 | public static class LWJGLAxisMappings extends DefaultAxisMappings {
31 |
32 | @Override
33 | public int LSx() {
34 | return 1;
35 | }
36 |
37 | @Override
38 | public int LSy() {
39 | return 0;
40 | }
41 |
42 | @Override
43 | public int RSx() {
44 | return 3;
45 | }
46 |
47 | @Override
48 | public int RSy() {
49 | return 2;
50 | }
51 |
52 | }
53 |
54 | }
55 |
--------------------------------------------------------------------------------
/src/main/resources/assets/joypadmod/lang/ar_SA.lang:
--------------------------------------------------------------------------------
1 | key.attack=هجوم/تدمير
2 | key.back=السير الى الخلف
3 | key.categories.gameplay=اللعب
4 | key.categories.inventory=الحقيبة
5 | key.categories.misc=اخرى
6 | key.categories.movement=حركة
7 | key.categories.multiplayer=اللعب الجماعي
8 | key.categories.ui=واجهة اللعبة
9 | key.chat=فتح الدردشة
10 | key.command=فتح الأوامر
11 | key.drop=اسقط الغرض
12 | key.forward=السير الى الامام
13 | key.hotbar.1=الخانة 1
14 | key.hotbar.2=الخانة 2
15 | key.hotbar.3=الخانة 3
16 | key.hotbar.4=الخانة 4
17 | key.hotbar.5=الخانة 5
18 | key.hotbar.6=الخانة 6
19 | key.hotbar.7=الخانة 7
20 | key.hotbar.8=الخانة 8
21 | key.hotbar.9=الخانة 9
22 | key.inventory=الحقيبة
23 | key.jump=قفز
24 | key.left=السير الى الامام اليسار
25 | key.mouseButton=%1$s الزر
26 | key.pickItem=اختيار كتلة
27 | key.playerlist=قائمة اللاعبين
28 | key.right=السير الى اليمين
29 | key.screenshot=خذ صورة
30 | key.smoothCamera=تشغيل الكاميرا السينمائية
31 | key.sneak=تسلل
32 | key.sprint=الجري
33 | key.togglePerspective=تشغيل المشهد
34 | key.use=استخدام المورد/ وضع الكتلة
35 |
--------------------------------------------------------------------------------
/src/main/java/com/shiny/joypadmod/devices/InputDevice.java:
--------------------------------------------------------------------------------
1 | package com.shiny.joypadmod.devices;
2 |
3 | public abstract class InputDevice {
4 |
5 | protected int myIndex;
6 |
7 | public InputDevice(int index) {
8 | myIndex = index;
9 | }
10 |
11 | public abstract String getName();
12 |
13 | public int getIndex() {
14 | return myIndex;
15 | }
16 |
17 | public abstract int getButtonCount();
18 |
19 | public abstract int getAxisCount();
20 |
21 | public abstract float getAxisValue(int axisIndex);
22 |
23 | public abstract String getAxisName(int index);
24 |
25 | public abstract float getDeadZone(int index);
26 |
27 | public abstract String getButtonName(int index);
28 |
29 | public abstract Boolean isButtonPressed(int index);
30 |
31 | public abstract Float getPovX();
32 |
33 | public abstract Float getPovY();
34 |
35 | public abstract void setDeadZone(int axisIndex, float value);
36 |
37 | public abstract Boolean isConnected();
38 |
39 | public abstract int getBatteryLevel();
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/src/main/resources/assets/joypadmod/lang/da_DK.lang:
--------------------------------------------------------------------------------
1 | key.attack=Angrib/ødelæg
2 | key.back=Gå baglæns
3 | key.categories.gameplay=Gameplay
4 | key.categories.inventory=Inventar
5 | key.categories.misc=Diverse
6 | key.categories.movement=Bevægelse
7 | key.categories.multiplayer=Multiplayer
8 | key.categories.ui=Spil Grænseflade
9 | key.chat=Åben Chat
10 | key.command=Åben kommando
11 | key.drop=Smid ting
12 | key.forward=Gå fremad
13 | key.hotbar.1=Genvejstast 1
14 | key.hotbar.2=Genvejstast 2
15 | key.hotbar.3=Genvejstast 3
16 | key.hotbar.4=Genvejstast 4
17 | key.hotbar.5=Genvejstast 5
18 | key.hotbar.6=Genvejstast 6
19 | key.hotbar.7=Genvejstast 7
20 | key.hotbar.8=Genvejstast 8
21 | key.hotbar.9=Genvejstast 9
22 | key.inventory=Taske
23 | key.jump=Hop
24 | key.left=Gå til venstre
25 | key.mouseButton=Knap %1$s
26 | key.pickItem=Vælg blok
27 | key.playerlist=Spillerliste
28 | key.right=Gå til højre
29 | key.screenshot=Tag Skærmbillede
30 | key.smoothCamera=Skift filmisk kamera
31 | key.sneak=Snig
32 | key.sprint=Løb
33 | key.togglePerspective=Skift perspektiv
34 | key.use=Brug ting/placér blok
35 |
--------------------------------------------------------------------------------
/src/main/resources/assets/joypadmod/lang/tlh_AA.lang:
--------------------------------------------------------------------------------
1 | key.attack=HIv ghap Qaw'
2 | key.back=Backwards yIt
3 | key.categories.gameplay=gameplay
4 | key.categories.inventory=inventory
5 | key.categories.misc=miscellaneous
6 | key.categories.movement=movement
7 | key.categories.multiplayer=Multiplayer
8 | key.categories.ui=Quj Interface
9 | key.chat=jaw mInDu'lIj
10 | key.command=mInDu'lIj ra'
11 | key.drop=Item chagh
12 | key.forward=Forwards yIt
13 | key.hotbar.1=hotbar Slot 1
14 | key.hotbar.2=hotbar Slot 2
15 | key.hotbar.3=hotbar Slot 3
16 | key.hotbar.4=hotbar Slot 4
17 | key.hotbar.5=hotbar Slot 5
18 | key.hotbar.6=hotbar Slot 6
19 | key.hotbar.7=hotbar Slot 7
20 | key.hotbar.8=hotbar Slot 8
21 | key.inventory='aplo'Daq
22 | key.jump=Sup
23 | key.left=poS strafe
24 | key.mouseButton=chu'wI' %1$s
25 | key.pickItem=ngogh lo'
26 | key.playerlist=QujwI' tetlh
27 | key.right=nIH strafe
28 | key.screenshot=screenshot ghaH
29 | key.smoothCamera=mIllogh toggle Cinematic qonwI'
30 | key.sneak=yIt, tam
31 | key.sprint=sprint
32 | key.togglePerspective=toggle Perspective
33 | key.use=Item ghap Daq bot yIlo'
34 |
--------------------------------------------------------------------------------
/src/main/resources/assets/joypadmod/lang/no_NO.lang:
--------------------------------------------------------------------------------
1 | key.attack=Angrep/Ødelegge
2 | key.back=Gå baklengs
3 | key.categories.inventory=Inventar
4 | key.categories.misc=Diverse
5 | key.categories.movement=Bevegelse
6 | key.categories.multiplayer=Flerspiller
7 | key.categories.ui=Spillgrensesnitt
8 | key.chat=Åpne chat
9 | key.command=Åpne-kommandoen
10 | key.drop=Slipp Gjenstand
11 | key.forward=gå forover
12 | key.hotbar.1=Hotbar plass 1
13 | key.hotbar.2=Hotbar plass 2
14 | key.hotbar.3=Hotbar plass 3
15 | key.hotbar.4=Hotbar plass 4
16 | key.hotbar.5=Hotbar plass 5
17 | key.hotbar.6=Hotbar plass 6
18 | key.hotbar.7=Hotbar plass 7
19 | key.hotbar.8=Hotbar plass 8
20 | key.hotbar.9=Hotbar plass 9
21 | key.inventory=Inventar
22 | key.jump=Hopp
23 | key.left=Gå til venstre
24 | key.mouseButton=Knapp %1$s
25 | key.pickItem=Velg blokk
26 | key.playerlist=Liste over medspillere
27 | key.right=Gå til høyre
28 | key.screenshot=Ta Skjermbilde
29 | key.smoothCamera=Veksle Filmatisk Kamera
30 | key.sneak=Snik
31 | key.sprint=Sprint
32 | key.togglePerspective=Veksle Perspektiv
33 | key.use=Bruke Gjenstand/Plassere Blokk
34 |
--------------------------------------------------------------------------------
/src/main/resources/assets/joypadmod/lang/sv_SE.lang:
--------------------------------------------------------------------------------
1 | key.attack=Attackera/förstör
2 | key.back=Gå bakåt
3 | key.categories.gameplay=Handlingar
4 | key.categories.inventory=Utrustning
5 | key.categories.misc=Blandat
6 | key.categories.movement=Rörelse
7 | key.categories.multiplayer=Flerspelarläge
8 | key.categories.ui=Spelgränssnitt
9 | key.chat=Öppna chatt
10 | key.command=Öppna kommando
11 | key.drop=Släpp föremål
12 | key.forward=Gå framåt
13 | key.hotbar.1=Hotbarplats 1
14 | key.hotbar.2=Hotbarplats 2
15 | key.hotbar.3=Hotbarplats 3
16 | key.hotbar.4=Hotbarplats 4
17 | key.hotbar.5=Hotbarplats 5
18 | key.hotbar.6=Hotbarplats 6
19 | key.hotbar.7=Hotbarplats 7
20 | key.hotbar.8=Hotbarplats 8
21 | key.hotbar.9=Hotbarplats 9
22 | key.inventory=Utrustning
23 | key.jump=Hoppa
24 | key.left=Gå vänster
25 | key.mouseButton=Knapp %1$s
26 | key.pickItem=Välj block
27 | key.playerlist=Spelarlista
28 | key.right=Gå höger
29 | key.screenshot=Ta skärmdump
30 | key.smoothCamera=Byt kameraläge
31 | key.sneak=Smyg
32 | key.sprint=Spring
33 | key.togglePerspective=Byt perspektiv
34 | key.use=Använd föremål/placera block
35 |
--------------------------------------------------------------------------------
/src/main/resources/assets/joypadmod/lang/sl_SI.lang:
--------------------------------------------------------------------------------
1 | key.attack=Napadi/uniči
2 | key.back=Hodi nazaj
3 | key.categories.gameplay=Igranje
4 | key.categories.inventory=Nahrbtnik
5 | key.categories.misc=Razno
6 | key.categories.movement=Gibanje
7 | key.categories.multiplayer=Večigralski način
8 | key.categories.ui=Vmesnik Igre
9 | key.chat=Odpri klepet
10 | key.command=Odpri ukaz
11 | key.drop=Vzri element
12 | key.forward=Hodi naprej
13 | key.hotbar.1=Hiter meni 1
14 | key.hotbar.2=Hiter meni 2
15 | key.hotbar.3=Hiter meni 3
16 | key.hotbar.4=Hiter meni 4
17 | key.hotbar.5=Hiter meni 5
18 | key.hotbar.6=Hiter meni 6
19 | key.hotbar.7=Hiter meni 7
20 | key.hotbar.8=Hiter meni 8
21 | key.hotbar.9=Hiter meni 9
22 | key.inventory=Inventar
23 | key.jump=Skok
24 | key.left=Hodi levo
25 | key.mouseButton=Gumb %1$s
26 | key.pickItem=Izbira kocke
27 | key.playerlist=Seznam igralcev
28 | key.right=Hodi desno
29 | key.screenshot=Zajemi zaslon
30 | key.smoothCamera=Preklopi na filmsko kamero
31 | key.sneak=Skrivanje
32 | key.sprint=Šprint
33 | key.togglePerspective=Preklop prospektivo
34 | key.use=Uporabi element/Postavi kocko
35 |
--------------------------------------------------------------------------------
/src/main/resources/assets/joypadmod/lang/eo_UY.lang:
--------------------------------------------------------------------------------
1 | key.attack=Ataki/detrui
2 | key.back=Paŝi malantaŭen
3 | key.categories.gameplay=Ludo
4 | key.categories.inventory=Inventaro
5 | key.categories.misc=Diversaj
6 | key.categories.movement=Movado
7 | key.categories.multiplayer=Plurludanta modo
8 | key.categories.ui=Interfaco
9 | key.chat=Babili
10 | key.command=Fari komandon
11 | key.drop=Forĵeti objekton
12 | key.forward=Paŝi antaŭen
13 | key.hotbar.1=Objektujo 1
14 | key.hotbar.2=Objektujo 2
15 | key.hotbar.3=Objektujo 3
16 | key.hotbar.4=Objektujo 4
17 | key.hotbar.5=Objektujo 5
18 | key.hotbar.6=Objektujo 6
19 | key.hotbar.7=Objektujo 7
20 | key.hotbar.8=Objektujo 8
21 | key.hotbar.9=Objektujo 9
22 | key.inventory=Inventaro
23 | key.jump=Salti
24 | key.left=Flankpaŝi maldekstren
25 | key.mouseButton=Butono %1$s
26 | key.pickItem=Elekti blokon
27 | key.playerlist=Ludantolisto
28 | key.right=Flankpaŝi dekstren
29 | key.screenshot=Fari ekranbildon
30 | key.smoothCamera=Baskuli glatan kameraon
31 | key.sneak=Rampi
32 | key.sprint=Kuri
33 | key.togglePerspective=Ŝanĝi perspektivon
34 | key.use=Uzi objekton/meti blokon
35 |
--------------------------------------------------------------------------------
/src/main/resources/assets/joypadmod/lang/hi_IN.lang:
--------------------------------------------------------------------------------
1 | key.attack=Attack/Destroy
2 | key.back=Walk Backwards
3 | key.categories.gameplay=Gameplay
4 | key.categories.inventory=Inventory
5 | key.categories.misc=Miscellaneous
6 | key.categories.movement=Movement
7 | key.categories.multiplayer=Multiplayer
8 | key.categories.ui=Game Interface
9 | key.chat=Open Chat
10 | key.command=Open Command
11 | key.drop=Drop Item
12 | key.forward=Walk Forwards
13 | key.hotbar.1=Hotbar Slot 1
14 | key.hotbar.2=Hotbar Slot 2
15 | key.hotbar.3=Hotbar Slot 3
16 | key.hotbar.4=Hotbar Slot 4
17 | key.hotbar.5=Hotbar Slot 5
18 | key.hotbar.6=Hotbar Slot 6
19 | key.hotbar.7=Hotbar Slot 7
20 | key.hotbar.8=Hotbar Slot 8
21 | key.hotbar.9=Hotbar Slot 9
22 | key.inventory=इन्वेंटरी
23 | key.jump=छलांग
24 | key.left=Strafe Left
25 | key.mouseButton=बटन %1$s
26 | key.pickItem=ब्लॉक उठाओ
27 | key.playerlist=सूची खिलाड़ी
28 | key.right=Strafe Right
29 | key.screenshot=Take Screenshot
30 | key.smoothCamera=Toggle Cinematic Camera
31 | key.sneak=उचक्का
32 | key.sprint=Sprint
33 | key.togglePerspective=Toggle Perspective
34 | key.use=Use Item/Place Block
35 |
--------------------------------------------------------------------------------
/src/main/resources/assets/joypadmod/lang/tr_TR.lang:
--------------------------------------------------------------------------------
1 | key.attack=Saldır/Yık
2 | key.back=Geriye gitme
3 | key.categories.gameplay=Oynayış
4 | key.categories.inventory=Envanter
5 | key.categories.misc=Diğer
6 | key.categories.movement=Hareket
7 | key.categories.multiplayer=Çok Oyunculu
8 | key.categories.ui=Oyun Arayüzü
9 | key.chat=Sohbeti Aç
10 | key.command=Komutu aç
11 | key.drop=Eşya Bırak
12 | key.forward=İleriye Gitme
13 | key.hotbar.1=Slot Kısayolu 1
14 | key.hotbar.2=Slot Kısayolu 2
15 | key.hotbar.3=Slot Kısayolu 3
16 | key.hotbar.4=Slot Kısayolu 4
17 | key.hotbar.5=Slot Kısayolu 5
18 | key.hotbar.6=Slot Kısayolu 6
19 | key.hotbar.7=Slot Kısayolu 7
20 | key.hotbar.8=Slot Kısayolu 8
21 | key.hotbar.9=Slot Kısayolu 9
22 | key.inventory=Envanter
23 | key.jump=Zıpla
24 | key.left=Sola Gitme
25 | key.mouseButton=Buton %1$s
26 | key.pickItem=Blok seç
27 | key.playerlist=Oyuncuları Listele
28 | key.right=Sağa Gitme
29 | key.screenshot=Ekran Görüntüsü Al
30 | key.smoothCamera=Sinematik Kameraya geç
31 | key.sneak=Eğil
32 | key.sprint=Koşma
33 | key.togglePerspective=Perspektif geçiş
34 | key.use=Eşya Kullan/Blok Koy
35 |
--------------------------------------------------------------------------------
/src/main/java/com/shiny/joypadmod/devices/InputLibrary.java:
--------------------------------------------------------------------------------
1 | package com.shiny.joypadmod.devices;
2 |
3 | public abstract class InputLibrary {
4 |
5 |
6 | public abstract void create() throws Exception;
7 |
8 | public abstract Boolean isCreated();
9 |
10 | public abstract void clearEvents();
11 |
12 | public abstract InputDevice getController(int index);
13 |
14 | public abstract InputDevice getCurrentController();
15 |
16 | public abstract int getControllerCount();
17 |
18 | public abstract InputDevice getEventSource();
19 |
20 | public abstract int getEventControlIndex(); // todo change this name
21 |
22 | public abstract Boolean isEventButton();
23 |
24 | public abstract Boolean isEventAxis();
25 |
26 | public abstract Boolean isEventPovX();
27 |
28 | public abstract Boolean isEventPovY();
29 |
30 | public abstract Boolean next(); // returns true if there is still an event to process
31 |
32 | public abstract void poll();
33 |
34 | public abstract Boolean wasDisconnected();
35 |
36 | public abstract Boolean wasConnected();
37 |
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/src/main/resources/assets/joypadmod/lang/hy_AM.lang:
--------------------------------------------------------------------------------
1 | key.attack=Attack/Destroy
2 | key.back=Walk Backwards
3 | key.categories.gameplay=Gameplay
4 | key.categories.inventory=Inventory
5 | key.categories.misc=Miscellaneous
6 | key.categories.movement=Movement
7 | key.categories.multiplayer=Multiplayer
8 | key.categories.ui=Grnajta
9 | key.chat=Open Chat
10 | key.command=Open Command
11 | key.drop=Drop Item
12 | key.forward=Walk Forwards
13 | key.hotbar.1=Hotbar Slot 1
14 | key.hotbar.2=Hotbar Slot 2
15 | key.hotbar.3=Hotbar Slot 3
16 | key.hotbar.4=Hotbar Slot 4
17 | key.hotbar.5=Hotbar Slot 5
18 | key.hotbar.6=Hotbar Slot 6
19 | key.hotbar.7=Hotbar Slot 7
20 | key.hotbar.8=Hotbar Slot 8
21 | key.hotbar.9=Hotbar Slot 9
22 | key.inventory=Պայուսակ
23 | key.jump=Ցատկ
24 | key.left=Strafe Left
25 | key.mouseButton=Կոճակ %1$s
26 | key.pickItem=Վերցնել Բլոկը
27 | key.playerlist=Խաղացողների ցուցակ
28 | key.right=Strafe Right
29 | key.screenshot=Take Screenshot
30 | key.smoothCamera=Toggle Cinematic Camera
31 | key.sneak=Զգույշ քայլ
32 | key.sprint=Sprint
33 | key.togglePerspective=Toggle Perspective
34 | key.use=Use Item/Place Block
35 |
--------------------------------------------------------------------------------
/src/main/resources/assets/joypadmod/lang/lb_LU.lang:
--------------------------------------------------------------------------------
1 | key.attack=Attack/Destroy
2 | key.back=No hannen goen
3 | key.categories.gameplay=Gameplay
4 | key.categories.inventory=Inventaar
5 | key.categories.misc=Verschiddenes
6 | key.categories.movement=Bewegung
7 | key.categories.multiplayer=Multispiller
8 | key.categories.ui=Game Interface
9 | key.chat=Chat opmaan
10 | key.command=Kommando opmaan
11 | key.drop=Drop Item
12 | key.forward=No fier goen
13 | key.hotbar.1=Hotbar Slot 1
14 | key.hotbar.2=Hotbar Slot 2
15 | key.hotbar.3=Hotbar Slot 3
16 | key.hotbar.4=Hotbar Slot 4
17 | key.hotbar.5=Hotbar Slot 5
18 | key.hotbar.6=Hotbar Slot 6
19 | key.hotbar.7=Hotbar Slot 7
20 | key.hotbar.8=Hotbar Slot 8
21 | key.hotbar.9=Hotbar Slot 9
22 | key.inventory=Inventaar
23 | key.jump=Sprang
24 | key.left=Strafe Left
25 | key.mouseButton=Knäppchen %1$s
26 | key.pickItem=Wiel Block
27 | key.playerlist=Spiller oplëschten
28 | key.right=Strafe Right
29 | key.screenshot=Foto Huelen
30 | key.smoothCamera=Toggle Cinematic Camera
31 | key.sneak=Schléichen
32 | key.sprint=Sprint
33 | key.togglePerspective=Toggle Perspective
34 | key.use=Een Item/Block benotzen
35 |
--------------------------------------------------------------------------------
/src/main/resources/assets/joypadmod/lang/is_IS.lang:
--------------------------------------------------------------------------------
1 | key.attack=Árás/Brjóta
2 | key.back=Bakka
3 | key.categories.gameplay=Tegund leiks
4 | key.categories.inventory=Bakpoki
5 | key.categories.misc=Ýmislegt
6 | key.categories.movement=Hreyfingar
7 | key.categories.multiplayer=Netspilun
8 | key.categories.ui=Leik viðmót
9 | key.chat=Opna spjall
10 | key.command=Opna skipun
11 | key.drop=Henda hlut
12 | key.forward=Labba áfram
13 | key.hotbar.1=Stiku reitur 1
14 | key.hotbar.2=Stiku reitur 2
15 | key.hotbar.3=Stiku reitur 3
16 | key.hotbar.4=Stiku reitur 4
17 | key.hotbar.5=Stiku reitur 5
18 | key.hotbar.6=Stiku reitur 6
19 | key.hotbar.7=Stiku reitur 7
20 | key.hotbar.8=Stiku reitur 8
21 | key.hotbar.9=Stiku reitur 9
22 | key.inventory=Bakpoki
23 | key.jump=Hoppa
24 | key.left=Hliðarskref til vinstri
25 | key.mouseButton=Músartakki %1$s
26 | key.pickItem=Velja kubb
27 | key.playerlist=Leikmannalisti
28 | key.right=Hliðarskref til hægri
29 | key.screenshot=Taka skjáskot
30 | key.smoothCamera=Af/Virkja kvikmynda hreyfingar
31 | key.sneak=Læðast
32 | key.sprint=Hlaupa
33 | key.togglePerspective=Skipta um sjónarhorn
34 | key.use=Nota hlut/Setja kubb
35 |
--------------------------------------------------------------------------------
/src/main/resources/assets/joypadmod/lang/id_ID.lang:
--------------------------------------------------------------------------------
1 | key.attack=Serang/Hancurkan
2 | key.back=Berjalan mundur
3 | key.categories.gameplay=Permainan
4 | key.categories.inventory=Barang bawaan
5 | key.categories.misc=Lain-lain
6 | key.categories.movement=Gerakan
7 | key.categories.multiplayer=Bermain bersama
8 | key.categories.ui=Layar permainan
9 | key.chat=Buka Chat
10 | key.command=Buka command
11 | key.drop=Jatuhkan benda
12 | key.forward=Berjalan kedepan
13 | key.hotbar.1=Hotbar Slot 1
14 | key.hotbar.2=Hotbar Slot 2
15 | key.hotbar.3=Hotbar Slot 3
16 | key.hotbar.4=Hotbar Slot 4
17 | key.hotbar.5=Hotbar Slot 5
18 | key.hotbar.6=Hotbar Slot 6
19 | key.hotbar.7=Hotbar Slot 7
20 | key.hotbar.8=Hotbar Slot 8
21 | key.hotbar.9=Hotbar Slot 9
22 | key.inventory=Persediaan
23 | key.jump=Lompat
24 | key.left=Berjalan kekiri
25 | key.mouseButton=Tombol %1$s
26 | key.pickItem=Mengambil blok
27 | key.playerlist=Daftar pemain
28 | key.right=Berjalan kekanan
29 | key.screenshot=Ambil foto
30 | key.smoothCamera=Ganti kamera sinematik
31 | key.sneak=Jongkok
32 | key.sprint=Berlari
33 | key.togglePerspective=Ganti perspektif
34 | key.use=Gunakan Item/Pasang blok
35 |
--------------------------------------------------------------------------------
/src/main/resources/assets/joypadmod/lang/qya_AA.lang:
--------------------------------------------------------------------------------
1 | key.attack=Attack/Destroy
2 | key.back=Nanlenna
3 | key.categories.gameplay=Gameplay
4 | key.categories.inventory=Armar
5 | key.categories.misc=Miscellaneous
6 | key.categories.movement=Levië
7 | key.categories.multiplayer=Linquen
8 | key.categories.ui=Game Interface
9 | key.chat=Panta Pahta
10 | key.command=Panta Canelë
11 | key.drop=Lerya Nat
12 | key.forward=Póna Lenna
13 | key.hotbar.1=Nato Yuhtalë Nóme 1
14 | key.hotbar.2=Nato Yuhtalë Nóme 2
15 | key.hotbar.3=Nato Yuhtalë Nóme 3
16 | key.hotbar.4=Nato Yuhtalë Nóme 4
17 | key.hotbar.5=Nato Yuhtalë Nóme 5
18 | key.hotbar.6=Nato Yuhtalë Nóme 6
19 | key.hotbar.7=Nato Yuhtalë Nóme 7
20 | key.hotbar.8=Nato Yuhtalë Nóme 8
21 | key.hotbar.9=Nato Yuhtalë Nóme 9
22 | key.inventory=Armar
23 | key.jump=Capë
24 | key.left=Hyarya Levë
25 | key.mouseButton=Námas %1$s
26 | key.pickItem=Lepta Colca
27 | key.playerlist=Séyale Quenion
28 | key.right=Forya Levë
29 | key.screenshot=Take Screenshot
30 | key.smoothCamera=Toggle Cinematic Camera
31 | key.sneak=Moru
32 | key.sprint=Norë
33 | key.togglePerspective=Toggle Perspective
34 | key.use=Use Item/Place Block
35 |
--------------------------------------------------------------------------------
/src/main/resources/assets/joypadmod/lang/af_ZA.lang:
--------------------------------------------------------------------------------
1 | key.attack=Val Aan/Vernietig
2 | key.back=Loop Agteruit
3 | key.categories.gameplay=Spel
4 | key.categories.inventory=Voorraad
5 | key.categories.misc=Algemeen
6 | key.categories.movement=Beweging
7 | key.categories.multiplayer=Multispeler
8 | key.categories.ui=Spelerskoppelvlak
9 | key.chat=Maak Klets Oop
10 | key.command=Open Bevel
11 | key.drop=Laat Val Item
12 | key.forward=Loop Vorentoe
13 | key.hotbar.1=Warmbalk Gleuf 1
14 | key.hotbar.2=Warmbalk Gleuf 2
15 | key.hotbar.3=Warmbalk Gleuf 3
16 | key.hotbar.4=Warmbalk Gleuf 4
17 | key.hotbar.5=Warmbalk Gleuf 5
18 | key.hotbar.6=Warmbalk Gleuf 6
19 | key.hotbar.7=Warmbalk Gleuf 7
20 | key.hotbar.8=Warmbalk Gleuf 8
21 | key.hotbar.9=Warmbalk Gleuf 9
22 | key.inventory=Voorraad
23 | key.jump=Spring
24 | key.left=Tree Links
25 | key.mouseButton=Sleutel %1$s
26 | key.pickItem=Kies Blok
27 | key.playerlist=Lys die Spelers
28 | key.right=Tree Regs
29 | key.screenshot=Neem Skermskoot
30 | key.smoothCamera=Skakel Kinematiese Kamera
31 | key.sneak=Sluip
32 | key.sprint=Hardloop
33 | key.togglePerspective=Skakel Perspektief
34 | key.use=Gebruik Item/Plaas Blok
35 |
--------------------------------------------------------------------------------
/src/main/resources/assets/joypadmod/lang/fa_IR.lang:
--------------------------------------------------------------------------------
1 | key.attack=حمله/نابود کردن
2 | key.back=راه رفتن به عقب
3 | key.categories.gameplay=Gameplay
4 | key.categories.inventory=موجودی
5 | key.categories.misc=متفرقه
6 | key.categories.movement=راه رفتن
7 | key.categories.multiplayer=بازی چند نفره
8 | key.categories.ui=رابط بازی
9 | key.chat=باز کردن چت
10 | key.command=باز کردن دستورات
11 | key.drop=انداختن جسم
12 | key.forward=راه رفتن به جلو
13 | key.hotbar.1=Hotbar Slot 1
14 | key.hotbar.2=Hotbar Slot 2
15 | key.hotbar.3=Hotbar Slot 3
16 | key.hotbar.4=Hotbar Slot 4
17 | key.hotbar.5=Hotbar Slot 5
18 | key.hotbar.6=Hotbar Slot 6
19 | key.hotbar.7=Hotbar Slot 7
20 | key.hotbar.8=Hotbar Slot 8
21 | key.hotbar.9=Hotbar Slot 9
22 | key.inventory=موجودی
23 | key.jump=پرش
24 | key.left=Strafe Left
25 | key.mouseButton=دکمه ی %1$s
26 | key.pickItem=انتخاب بلوک
27 | key.playerlist=لیست کردن بازیکنان
28 | key.right=Strafe Right
29 | key.screenshot=گرفتن عکس از صفحه
30 | key.smoothCamera=عوض کردن دوربین سینمایی
31 | key.sneak=یواشکی حرکت کردن
32 | key.sprint=با حداکثر سرعت دویدن
33 | key.togglePerspective=عوض کردن چشم انداز
34 | key.use=استفاده از جسم/گذاشتن بلوک
35 |
--------------------------------------------------------------------------------
/src/main/resources/assets/joypadmod/lang/kw_GB.lang:
--------------------------------------------------------------------------------
1 | key.attack=Omsettya/Distrui
2 | key.back=Mos War-Dhelergh
3 | key.categories.gameplay=Gameplay
4 | key.categories.inventory=Rol
5 | key.categories.misc=A Bub Sort
6 | key.categories.movement=Gwayans
7 | key.categories.multiplayer=Liesgwarier
8 | key.categories.ui=Gwari Ynterfas
9 | key.chat=Ygeri Keskowsva
10 | key.command=Ygeri Arhadow
11 | key.drop=Droppya Tra
12 | key.forward=Mos Yn-Rag
13 | key.hotbar.1=Hedhas Snell Le 1
14 | key.hotbar.2=Hedhas Snell Le 2
15 | key.hotbar.3=Hedhas Snell Le 3
16 | key.hotbar.4=Hedhas Snell Le 4
17 | key.hotbar.5=Hedhas Snell Le 5
18 | key.hotbar.6=Hedhas Snell Le 6
19 | key.hotbar.7=Hedhas Snell Le 7
20 | key.hotbar.8=Hedhas Snell Le 8
21 | key.hotbar.9=Hedhas Snell Le 9
22 | key.inventory=Rol
23 | key.jump=Lamma
24 | key.left=Mos Kledh
25 | key.mouseButton=Boton %1$s
26 | key.pickItem=Dewis stock
27 | key.playerlist=Gul rol a warioryon
28 | key.right=Mos Dyhow
29 | key.screenshot=Sesya Skrin-Imach
30 | key.smoothCamera=Skwychya Kamera Cinemasek
31 | key.sneak=Skolkya
32 | key.sprint=Ponya
33 | key.togglePerspective=Skwychya Gologva
34 | key.use=Usya Tra/Gorra Stock
35 |
--------------------------------------------------------------------------------
/src/main/resources/assets/joypadmod/lang/cs_CZ.lang:
--------------------------------------------------------------------------------
1 | key.attack=Útok/Zničení
2 | key.back=Chůze pozpátku
3 | key.categories.gameplay=Hratelnost
4 | key.categories.inventory=Inventář
5 | key.categories.misc=Smíšené
6 | key.categories.movement=Pohyb
7 | key.categories.multiplayer=Hra více hráčů
8 | key.categories.ui=Herní rozhraní
9 | key.chat=Otevření Chatu
10 | key.command=Otevřít příkazový řádek
11 | key.drop=Odhození předmětu
12 | key.forward=Chůze dopředu
13 | key.hotbar.1=Lišta - Pozice 1
14 | key.hotbar.2=Lišta - Pozice 2
15 | key.hotbar.3=Lišta - Pozice 3
16 | key.hotbar.4=Lišta - Pozice 4
17 | key.hotbar.5=Lišta - Pozice 5
18 | key.hotbar.6=Lišta - Pozice 6
19 | key.hotbar.7=Lišta - Pozice 7
20 | key.hotbar.8=Lišta - Pozice 8
21 | key.hotbar.9=Lišta - Pozice 9
22 | key.inventory=Inventář
23 | key.jump=Skok
24 | key.left=Úkrok vlevo
25 | key.mouseButton=Tlačítko %1$s
26 | key.pickItem=Vybrat blok
27 | key.playerlist=Seznam hráčů
28 | key.right=Úkrok vpravo
29 | key.screenshot=Vyfotit hru
30 | key.smoothCamera=Přepnutí filmové kamery
31 | key.sneak=Plížení
32 | key.sprint=Běh
33 | key.togglePerspective=Přepnutí perspektivy
34 | key.use=Použití předmětu/Umístění bloku
35 |
--------------------------------------------------------------------------------
/src/main/resources/assets/joypadmod/lang/pt_BR.lang:
--------------------------------------------------------------------------------
1 | key.attack=Atacar/Destruir
2 | key.back=Andar Para Trás
3 | key.categories.gameplay=Gameplay
4 | key.categories.inventory=Inventário
5 | key.categories.misc=Miscelânea
6 | key.categories.movement=Movimento
7 | key.categories.multiplayer=Multiplayer
8 | key.categories.ui=Interface do Jogo
9 | key.chat=Abrir Chat
10 | key.command=Abrir Comando
11 | key.drop=Largar Item
12 | key.forward=Andar Para a Frente
13 | key.hotbar.1=Hotbar Slot 1
14 | key.hotbar.2=Hotbar Slot 2
15 | key.hotbar.3=Hotbar Slot 3
16 | key.hotbar.4=Hotbar Slot 4
17 | key.hotbar.5=Hotbar Slot 5
18 | key.hotbar.6=Hotbar Slot 6
19 | key.hotbar.7=Hotbar Slot 7
20 | key.hotbar.8=Hotbar Slot 8
21 | key.hotbar.9=Hotbar Slot 9
22 | key.inventory=Inventário
23 | key.jump=Pular
24 | key.left=Andar Para a Esquerda
25 | key.mouseButton=Botão %1$s
26 | key.pickItem=Escolher Bloco
27 | key.playerlist=Listar Jogadores
28 | key.right=Andar Para a Direita
29 | key.screenshot=Tirar Screenshot
30 | key.smoothCamera=Alternar Câmera Cinematográfica
31 | key.sneak=Esgueirar
32 | key.sprint=Correr
33 | key.togglePerspective=Alternar Perspectiva
34 | key.use=Usar Item/Colocar Bloco
35 |
--------------------------------------------------------------------------------
/src/main/resources/assets/joypadmod/lang/cy_GB.lang:
--------------------------------------------------------------------------------
1 | key.attack=Ymosodi/Dinistrio
2 | key.back=Cerdded yn ôl
3 | key.categories.gameplay=Chwarae'r Gêm
4 | key.categories.inventory=Rhestr Eiddo
5 | key.categories.misc=Amrywiol
6 | key.categories.movement=Symudiad
7 | key.categories.multiplayer=Aml-chwaraewr
8 | key.categories.ui=Rhyngwyneb Gêm
9 | key.chat=Agor Sgwrs
10 | key.command=Agor Gorchymyn
11 | key.drop=Gollwng Eitem
12 | key.forward=Cerdded Ymlaen
13 | key.hotbar.1=Slot Gweithred 1
14 | key.hotbar.2=Slot Gweithred 2
15 | key.hotbar.3=Slot Gweithred 3
16 | key.hotbar.4=Slot Gweithred 4
17 | key.hotbar.5=Slot Gweithred 5
18 | key.hotbar.6=Slot Gweithred 6
19 | key.hotbar.7=Slot Gweithred 7
20 | key.hotbar.8=Slot Gweithred 8
21 | key.hotbar.9=Slot Gweithred 9
22 | key.inventory=Rhestr Eiddo
23 | key.jump=Neidio
24 | key.left=Cerdded i'r chwith
25 | key.mouseButton=Botwm %1$s
26 | key.pickItem=Dewis Bloc
27 | key.playerlist=Dangos Chwaraewyr
28 | key.right=Cerdded i'r dde
29 | key.screenshot=Cymryd Sgrinlun
30 | key.smoothCamera=Toglo Camera Sinematig
31 | key.sneak=Sleifio
32 | key.sprint=Gwibio
33 | key.togglePerspective=Toglo Safbwynt
34 | key.use=Defnyddio Eitem/Gosod Bloc
35 |
--------------------------------------------------------------------------------
/src/main/resources/assets/joypadmod/lang/fi_FI.lang:
--------------------------------------------------------------------------------
1 | key.attack=Hyökkää/tuhoa
2 | key.back=Kävele taaksepäin
3 | key.categories.gameplay=Pelattavuus
4 | key.categories.inventory=Tavaraluettelo
5 | key.categories.misc=Sekalaiset
6 | key.categories.movement=Liikkuminen
7 | key.categories.multiplayer=Moninpeli
8 | key.categories.ui=Pelin käyttöliittymä
9 | key.chat=Avaa keskustelu
10 | key.command=Avaa komento
11 | key.drop=Pudota esine
12 | key.forward=Kävele eteenpäin
13 | key.hotbar.1=Pikanäppäin 1
14 | key.hotbar.2=Pikanäppäin 2
15 | key.hotbar.3=Pikanäppäin 3
16 | key.hotbar.4=Pikanäppäin 4
17 | key.hotbar.5=Pikanäppäin 5
18 | key.hotbar.6=Pikanäppäin 6
19 | key.hotbar.7=Pikanäppäin 7
20 | key.hotbar.8=Pikanäppäin 8
21 | key.hotbar.9=Pikanäppäin 9
22 | key.inventory=Tavaraluettelo
23 | key.jump=Hyppää
24 | key.left=Kävele vasemmalle
25 | key.mouseButton=Nappi %1$s
26 | key.pickItem=Valitse kuutio
27 | key.playerlist=Pelaajaluettelo
28 | key.right=Kävele oikealle
29 | key.screenshot=Ota kuvankaappaus
30 | key.smoothCamera=Vaihda elokuvamaiseen kameraan
31 | key.sneak=Hiivi
32 | key.sprint=Juokse
33 | key.togglePerspective=Vaihda näkökulma
34 | key.use=Käytä esinettä/sijoita kuutio
35 |
--------------------------------------------------------------------------------
/src/main/resources/assets/joypadmod/lang/fil_PH.lang:
--------------------------------------------------------------------------------
1 | key.attack=Bumanat/Sumira
2 | key.back=Lumakad Pabalik
3 | key.categories.gameplay=Pagkalaro
4 | key.categories.inventory=Bag
5 | key.categories.misc=Miscellaneous
6 | key.categories.movement=Pagkagalaw
7 | key.categories.multiplayer=Pang-maramihang Laro
8 | key.categories.ui=Interface ng Laro
9 | key.chat=Buksan ang Chat
10 | key.command=Command
11 | key.drop=Iwanan
12 | key.forward=Lumakad na Pasulong
13 | key.hotbar.1=Unang Slot
14 | key.hotbar.2=Ikalawang Slot
15 | key.hotbar.3=Ikatlong Slot
16 | key.hotbar.4=Ikaapat na Slot
17 | key.hotbar.5=Ikalimang Slot
18 | key.hotbar.6=Ikaanim na Slot
19 | key.hotbar.7=Ikapitong Slot
20 | key.hotbar.8=Ikawalong Slot
21 | key.hotbar.9=Ikasiyam na Slot
22 | key.inventory=Bag
23 | key.jump=Talon
24 | key.left=Kumaliwa
25 | key.mouseButton=Button %1$s
26 | key.pickItem=Ikunin ang Bloke
27 | key.playerlist=Ilista ang mga Manlalaro
28 | key.right=Kumanan
29 | key.screenshot=Kumuha ng Screenshot
30 | key.smoothCamera=Itarugo ang Cinematic Camera
31 | key.sneak=Lumabas nang Panakaw
32 | key.sprint=Tumakbo
33 | key.togglePerspective=Itarugo ang Perspective
34 | key.use=Gumamit ng Bagay/Maglagay ng Bloke
35 |
--------------------------------------------------------------------------------
/src/main/resources/assets/joypadmod/lang/la_LA.lang:
--------------------------------------------------------------------------------
1 | key.attack=Oppugna/Dele
2 | key.back=Ambula retrorsum
3 | key.categories.gameplay=Lusus
4 | key.categories.inventory=Inventarium
5 | key.categories.misc=Miscellaneus
6 | key.categories.movement=Motus
7 | key.categories.multiplayer=Ludus Multorum
8 | key.categories.ui=Iunctura ludi
9 | key.chat=Aperi Locutorium
10 | key.command=Aperi Imperium
11 | key.drop=Deice rem
12 | key.forward=Ambula prorsum
13 | key.hotbar.1=Res Vectis Arca I
14 | key.hotbar.2=Res Vectis Arca II
15 | key.hotbar.3=Res Vectis Arca III
16 | key.hotbar.4=Res Vectis Arca IV
17 | key.hotbar.5=Res Vectis Arca V
18 | key.hotbar.6=Res Vectis Arca VI
19 | key.hotbar.7=Res Vectis Arca VII
20 | key.hotbar.8=Res Vectis Arca VIII
21 | key.hotbar.9=Res Vectis Arca IX
22 | key.inventory=Inventarium
23 | key.jump=Saltare
24 | key.left=Ambula ad sinistram
25 | key.mouseButton=Botonus %1$s
26 | key.pickItem=Elige Cubum
27 | key.playerlist=Indica Lusores
28 | key.right=Ambula ad dextrum
29 | key.screenshot=Transcribe simulacrum
30 | key.smoothCamera=Apta camescopium
31 | key.sneak=Serpe
32 | key.sprint=Occurre
33 | key.togglePerspective=Apta spectaculum
34 | key.use=Uti Rem/Pone Cubum
35 |
--------------------------------------------------------------------------------
/src/main/resources/assets/joypadmod/lang/gl_ES.lang:
--------------------------------------------------------------------------------
1 | key.attack=Atacar/Destruir
2 | key.back=Camiñar Atrás
3 | key.categories.gameplay=Modo de Xogo
4 | key.categories.inventory=Inventario
5 | key.categories.misc=Miscelánea
6 | key.categories.movement=Movemento
7 | key.categories.multiplayer=Multixogador
8 | key.categories.ui=Interface de Xogo
9 | key.chat=Abrir Chat
10 | key.command=Abrir Comandos
11 | key.drop=Soltar obxecto
12 | key.forward=Camiñar Adiante
13 | key.hotbar.1=Acceso Rápido 1
14 | key.hotbar.2=Acceso Rápido 2
15 | key.hotbar.3=Acceso Rápido 3
16 | key.hotbar.4=Acceso Rápido 4
17 | key.hotbar.5=Acceso Rápido 5
18 | key.hotbar.6=Acceso Rápido 6
19 | key.hotbar.7=Acceso Rápido 7
20 | key.hotbar.8=Acceso Rápido 8
21 | key.hotbar.9=Acceso Rápido 9
22 | key.inventory=Inventario
23 | key.jump=Saltar
24 | key.left=Camiñar á Esquerda
25 | key.mouseButton=Botón %1$s
26 | key.pickItem=Coller Bloque
27 | key.playerlist=Listar Xogadores
28 | key.right=Camiñar á Dereita
29 | key.screenshot=Tomar Captura de Pantalla
30 | key.smoothCamera=Cambiar a Cámara Cinemática
31 | key.sneak=Agachar
32 | key.sprint=Correr
33 | key.togglePerspective=Cambiar Perspectiva
34 | key.use=Usar oxecto/Colocar Bloque
35 |
--------------------------------------------------------------------------------
/src/main/resources/assets/joypadmod/lang/mt_MT.lang:
--------------------------------------------------------------------------------
1 | key.attack=Tattakka/Tkisser
2 | key.back=Timxi b'Lura
3 | key.categories.gameplay=Kif Tilgħab
4 | key.categories.inventory=Inventorju
5 | key.categories.misc=Mixxellanji
6 | key.categories.movement=Moviment
7 | key.categories.multiplayer=Multiplayer
8 | key.categories.ui=Interface tal-Logħba
9 | key.chat=Tiftaħ iċ-Chat
10 | key.command=Tuża Kodiċi
11 | key.drop=Twaqqa' l-Oġġett
12 | key.forward=Timxi 'l Quddiem
13 | key.hotbar.1=Hotbar Slot 1
14 | key.hotbar.2=Hotbar Slot 2
15 | key.hotbar.3=Hotbar Slot 3
16 | key.hotbar.4=Hotbar Slot 4
17 | key.hotbar.5=Hotbar Slot 5
18 | key.hotbar.6=Hotbar Slot 6
19 | key.hotbar.7=Hotbar Slot 7
20 | key.hotbar.8=Hotbar Slot 8
21 | key.hotbar.9=Hotbar Slot 9
22 | key.inventory=Inventorju
23 | key.jump=Aqbeż
24 | key.left=Tiġbed lejn ix-Xellug
25 | key.mouseButton=Buttuna %1$s
26 | key.pickItem=Iġbor Blokka
27 | key.playerlist=Lista tal-Plejers
28 | key.right=Tiġbed lejn il-Lemin
29 | key.screenshot=Tiħu Screenshot
30 | key.smoothCamera=Tibdel il-Moviment tal-Kamera
31 | key.sneak=Imxi Nkiss Inkiss
32 | key.sprint=Tiġri
33 | key.togglePerspective=Tibdel il-Perspettiva
34 | key.use=Tuża Oġġett/Tpoġġi Blokka
35 |
--------------------------------------------------------------------------------
/src/main/resources/assets/joypadmod/lang/es_AR.lang:
--------------------------------------------------------------------------------
1 | key.attack=Atacar/Romper
2 | key.back=Caminar Atrás
3 | key.categories.gameplay=Jugabilidad
4 | key.categories.inventory=Inventario
5 | key.categories.misc=Misceláneo
6 | key.categories.movement=Movimiento
7 | key.categories.multiplayer=Multijugador
8 | key.categories.ui=Interfaz del juego
9 | key.chat=Abrir Chat
10 | key.command=Abrir Comando
11 | key.drop=Tirar Item
12 | key.forward=Caminar Adelante
13 | key.hotbar.1=Acceso Rápido 1
14 | key.hotbar.2=Acceso Rápido 2
15 | key.hotbar.3=Acceso Rápido 3
16 | key.hotbar.4=Acceso Rápido 4
17 | key.hotbar.5=Acceso Rápido 5
18 | key.hotbar.6=Acceso Rápido 6
19 | key.hotbar.7=Acceso Rápido 7
20 | key.hotbar.8=Acceso Rápido 8
21 | key.hotbar.9=Acceso Rápido 9
22 | key.inventory=Inventario
23 | key.jump=Saltar
24 | key.left=Caminar a la Izquierda
25 | key.mouseButton=Botón %1$s
26 | key.pickItem=Agarrar Bloque
27 | key.playerlist=Lista de Jugadores
28 | key.right=Caminar a la Derecha
29 | key.screenshot=Tomar Captura de Pantalla
30 | key.smoothCamera=Cambiar a Cámara Cinemática
31 | key.sneak=Agacharse
32 | key.sprint=Correr
33 | key.togglePerspective=Cambiar Perspectiva
34 | key.use=Usar Item/Colocar Bloque
35 |
--------------------------------------------------------------------------------
/src/main/resources/assets/joypadmod/lang/et_EE.lang:
--------------------------------------------------------------------------------
1 | key.attack=Ründa/hävita
2 | key.back=Kõnni tagasi
3 | key.categories.gameplay=Mängimine
4 | key.categories.inventory=Seljakott
5 | key.categories.misc=Varia
6 | key.categories.movement=Liikumine
7 | key.categories.multiplayer=Mitmikmäng
8 | key.categories.ui=Mängu kasutajaliides
9 | key.chat=Ava vestlus
10 | key.command=Ava käsklus
11 | key.drop=Viska ese maha
12 | key.forward=Kõnni edasi
13 | key.hotbar.1=Plokiriba lahter 1
14 | key.hotbar.2=Plokiriba lahter 2
15 | key.hotbar.3=Plokiriba lahter 3
16 | key.hotbar.4=Plokiriba lahter 4
17 | key.hotbar.5=Plokiriba lahter 5
18 | key.hotbar.6=Plokiriba lahter 6
19 | key.hotbar.7=Plokiriba lahter 7
20 | key.hotbar.8=Plokiriba lahter 8
21 | key.hotbar.9=Plokiriba lahter 9
22 | key.inventory=Seljakott
23 | key.jump=Hüppamine
24 | key.left=Mine vasakule
25 | key.mouseButton=Klahv %1$s
26 | key.pickItem=Vali plokk
27 | key.playerlist=Kuva mängijad
28 | key.right=Mine paremale
29 | key.screenshot=Tee ekraanipilt
30 | key.smoothCamera=Lülita kinemaatiline kaamera sisse/välja
31 | key.sneak=Hiilimine
32 | key.sprint=Sprintimine
33 | key.togglePerspective=Vaheta perspektiivi
34 | key.use=Kasuta eset/aseta plokk
35 |
--------------------------------------------------------------------------------
/src/main/resources/assets/joypadmod/lang/nn_NO.lang:
--------------------------------------------------------------------------------
1 | key.attack=Angrip/Øydelegg
2 | key.back=Gå bakover
3 | key.categories.gameplay=Speling
4 | key.categories.inventory=Inventar
5 | key.categories.misc=Diverse
6 | key.categories.movement=Rørsle
7 | key.categories.multiplayer=Fleirspelar
8 | key.categories.ui=Spelgrensesnitt
9 | key.chat=Opne chatt
10 | key.command=Opne kommando
11 | key.drop=Kast gjenstand
12 | key.forward=Gå framover
13 | key.hotbar.1=hurtig-inventar plass 1
14 | key.hotbar.2=hurtig-inventar plass 2
15 | key.hotbar.3=hurtig-inventar plass 3
16 | key.hotbar.4=hurtig-inventar plass 4
17 | key.hotbar.5=hurtig-inventar plass 5
18 | key.hotbar.6=hurtig-inventar plass 6
19 | key.hotbar.7=hurtig-inventar plass 7
20 | key.hotbar.8=hurtig-inventar plass 8
21 | key.hotbar.9=hurtig-inventar plass 9
22 | key.inventory=Inventar
23 | key.jump=Hopp
24 | key.left=Gå til venstre
25 | key.mouseButton=Knapp %1$s
26 | key.pickItem=Vel blokk
27 | key.playerlist=Spelarliste
28 | key.right=Gå til høgre
29 | key.screenshot=Ta skjermdump
30 | key.smoothCamera=Filmatisk kamera PÅ/AV
31 | key.sneak=Smyg
32 | key.sprint=Spurt
33 | key.togglePerspective=Forandre perspektiv
34 | key.use=Bruk objekt/Plasser blokk
35 |
--------------------------------------------------------------------------------
/src/main/resources/assets/joypadmod/lang/ca_ES.lang:
--------------------------------------------------------------------------------
1 | key.attack=Atacar/destruir
2 | key.back=Caminar enrere
3 | key.categories.gameplay=Jugabilitat
4 | key.categories.inventory=Inventari
5 | key.categories.misc=Miscel·lani
6 | key.categories.movement=Moviment
7 | key.categories.multiplayer=Multijugador
8 | key.categories.ui=Interfície de joc
9 | key.chat=Obrir el xat
10 | key.command=Obrir comandament
11 | key.drop=Deixar ítem
12 | key.forward=Caminar endavant
13 | key.hotbar.1=Tecla ràpida 1
14 | key.hotbar.2=Tecla ràpida 2
15 | key.hotbar.3=Tecla ràpida 3
16 | key.hotbar.4=Tecla ràpida 4
17 | key.hotbar.5=Tecla ràpida 5
18 | key.hotbar.6=Tecla ràpida 6
19 | key.hotbar.7=Tecla ràpida 7
20 | key.hotbar.8=Tecla ràpida 8
21 | key.hotbar.9=Tecla ràpida 9
22 | key.inventory=Inventari
23 | key.jump=Saltar
24 | key.left=Desplaçament lateral esquerra
25 | key.mouseButton=Botó %1$s
26 | key.pickItem=Agafar bloc
27 | key.playerlist=Llista de Jugadors
28 | key.right=Desplaçament lateral dret
29 | key.screenshot=Captura de pantalla
30 | key.smoothCamera=Canviar càmera cinemàtica
31 | key.sneak=Ajupir-se
32 | key.sprint=Córrer
33 | key.togglePerspective=Canviar perspectiva
34 | key.use=Utilitzar ítem/col·locar bloc
35 |
--------------------------------------------------------------------------------
/src/main/resources/assets/joypadmod/lang/ro_RO.lang:
--------------------------------------------------------------------------------
1 | key.attack=Atac/distruge
2 | key.back=Mers înapoi
3 | key.categories.gameplay=Gameplay-ul
4 | key.categories.inventory=Inventar
5 | key.categories.misc=Diverse
6 | key.categories.movement=Mişcare
7 | key.categories.multiplayer=Multiplayer
8 | key.categories.ui=Interfața jocului
9 | key.chat=Deschideţi Chat
10 | key.command=Introdu o comandă
11 | key.drop=Aruncă un obiect
12 | key.forward=Plimbare spre înainte
13 | key.hotbar.1=Poziția 1 din bara de inventar
14 | key.hotbar.2=Hotbar Slot 2
15 | key.hotbar.3=Hotbar Slot 3
16 | key.hotbar.4=Hotbar Slot 4
17 | key.hotbar.5=Hotbar Slot 5
18 | key.hotbar.6=Hotbar Slot 6
19 | key.hotbar.7=Hotbar Slot 7
20 | key.hotbar.8=Hotbar Slot 8
21 | key.hotbar.9=Hotbar Slot 9
22 | key.inventory=Inventar
23 | key.jump=Săritură
24 | key.left=Bombarda stânga
25 | key.mouseButton=Buton %1$s
26 | key.pickItem=Alegeți un Bloc
27 | key.playerlist=Listează Jucători
28 | key.right=Fă un pas la dreapta
29 | key.screenshot=Ia Screenshot
30 | key.smoothCamera=Comutare aparat foto cinematografic
31 | key.sneak=Furișare
32 | key.sprint=Alergat
33 | key.togglePerspective=Perspectiva de comutare
34 | key.use=Folosește obiectul/Așază blocul
35 |
--------------------------------------------------------------------------------
/src/main/resources/assets/joypadmod/lang/es_MX.lang:
--------------------------------------------------------------------------------
1 | key.attack=Atacar/Destruir
2 | key.back=Caminar hacia atrás
3 | key.categories.gameplay=Juego
4 | key.categories.inventory=Inventario
5 | key.categories.misc=Misceláneo
6 | key.categories.movement=Movimiento
7 | key.categories.multiplayer=Multijugador
8 | key.categories.ui=Interfaz del juego
9 | key.chat=Abrir Chat
10 | key.command=Abrir Comando
11 | key.drop=Tirar objeto
12 | key.forward=Caminar hacia delante
13 | key.hotbar.1=Acceso rápido 1
14 | key.hotbar.2=Acceso rápido 2
15 | key.hotbar.3=Acceso rápido 3
16 | key.hotbar.4=Acceso rápido 4
17 | key.hotbar.5=Acceso rápido 5
18 | key.hotbar.6=Acceso rápido 6
19 | key.hotbar.7=Acceso rápido 7
20 | key.hotbar.8=Acceso rápido 8
21 | key.hotbar.9=Acceso rápido 9
22 | key.inventory=Inventario
23 | key.jump=Salto
24 | key.left=Caminar hacia la izquierda
25 | key.mouseButton=Botón %1$s
26 | key.pickItem=Elegir Bloque
27 | key.playerlist=Lista de Jugadores
28 | key.right=Caminar hacia la derecha
29 | key.screenshot=Tomar captura de pantalla
30 | key.smoothCamera=Cambiar a Cámara Cinemática
31 | key.sneak=Furtivo
32 | key.sprint=Correr
33 | key.togglePerspective=Cambiar Perspectiva
34 | key.use=Usar objeto/Colocar bloque
35 |
--------------------------------------------------------------------------------
/src/main/resources/assets/joypadmod/lang/uk_UA.lang:
--------------------------------------------------------------------------------
1 | key.attack=Атакувати/Руйнувати
2 | key.back=Назад
3 | key.categories.gameplay=Ігровий процес
4 | key.categories.inventory=Інвентар
5 | key.categories.misc=Різне
6 | key.categories.movement=Рух
7 | key.categories.multiplayer=Гра у мережі
8 | key.categories.ui=Ігровий інтерфейс
9 | key.chat=Відкрити чат
10 | key.command=Відкрити команду
11 | key.drop=Викинути предмет
12 | key.forward=Вперед
13 | key.hotbar.1=Слот швидкого доступу 1
14 | key.hotbar.2=Слот швидкого доступу 2
15 | key.hotbar.3=Слот швидкого доступу 3
16 | key.hotbar.4=Слот швидкого доступу 4
17 | key.hotbar.5=Слот швидкого доступу 5
18 | key.hotbar.6=Слот швидкого доступу 6
19 | key.hotbar.7=Слот швидкого доступу 7
20 | key.hotbar.8=Слот швидкого доступу 8
21 | key.hotbar.9=Слот швидкого доступу 9
22 | key.inventory=Інвентар
23 | key.jump=Стрибок
24 | key.left=Вліво
25 | key.mouseButton=Кнопка %1$s
26 | key.pickItem=Обрати блок
27 | key.playerlist=Список гравців
28 | key.right=Вправо
29 | key.screenshot=Зробити знімок
30 | key.smoothCamera=Перемкнути кінокамеру
31 | key.sneak=Крастися
32 | key.sprint=Біг
33 | key.togglePerspective=Перемкнути перспективу
34 | key.use=Використати предмет/Встановити блок
35 |
--------------------------------------------------------------------------------
/src/main/resources/assets/joypadmod/lang/vi_VN.lang:
--------------------------------------------------------------------------------
1 | key.attack=Tấn công/Phá hủy
2 | key.back=Lùi ra phía sau
3 | key.categories.gameplay=Cách chơi
4 | key.categories.inventory=Túi đồ
5 | key.categories.misc=Khác
6 | key.categories.movement=Di chuyển
7 | key.categories.multiplayer=Chơi mạng
8 | key.categories.ui=Giao diện trò chơi
9 | key.chat=Mở khung trò chuyện
10 | key.command=Mở khung lệnh
11 | key.drop=Thả vật phẩm
12 | key.forward=Tiến về phía trước
13 | key.hotbar.1=Vật phẩm trong ô 1
14 | key.hotbar.2=Vật phẩm trong ô 2
15 | key.hotbar.3=Vật phẩm trong ô 3
16 | key.hotbar.4=Vật phẩm trong ô 4
17 | key.hotbar.5=Vật phẩm trong ô 5
18 | key.hotbar.6=Vật phẩm trong ô 6
19 | key.hotbar.7=Vật phẩm trong ô 7
20 | key.hotbar.8=Vật phẩm trong ô 8
21 | key.hotbar.9=Vật phẩm trong ô 9
22 | key.inventory=Túi đồ
23 | key.jump=Nhảy
24 | key.left=Bước ngang sang trái
25 | key.mouseButton=Chuột %1$s
26 | key.pickItem=Lựa chọn khối
27 | key.playerlist=Hiển thị danh sách người chơi
28 | key.right=Bước ngang sang phải
29 | key.screenshot=Chụp ảnh màn hình
30 | key.smoothCamera=Đổi góc nhìn kịch tính
31 | key.sneak=Đi rón rén
32 | key.sprint=Chạy nhanh
33 | key.togglePerspective=Đổi góc độ
34 | key.use=Sử dụng vật phẩm/Đặt khối
35 |
--------------------------------------------------------------------------------
/src/main/resources/assets/joypadmod/lang/es_ES.lang:
--------------------------------------------------------------------------------
1 | key.attack=Atacar/Destruir
2 | key.back=Caminar hacia atrás
3 | key.categories.gameplay=Juego
4 | key.categories.inventory=Inventario
5 | key.categories.misc=Varios
6 | key.categories.movement=Movimiento
7 | key.categories.multiplayer=Multijugador
8 | key.categories.ui=Interfaz del juego
9 | key.chat=Abrir chat
10 | key.command=Abrir comando en chat
11 | key.drop=Soltar objeto
12 | key.forward=Caminar hacia delante
13 | key.hotbar.1=Acceso rápido 1
14 | key.hotbar.2=Acceso rápido 2
15 | key.hotbar.3=Acceso rápido 3
16 | key.hotbar.4=Acceso rápido 4
17 | key.hotbar.5=Acceso rápido 5
18 | key.hotbar.6=Acceso rápido 6
19 | key.hotbar.7=Acceso rápido 7
20 | key.hotbar.8=Acceso rápido 8
21 | key.hotbar.9=Acceso rápido 9
22 | key.inventory=Inventario
23 | key.jump=Saltar
24 | key.left=Caminar hacia la izquierda
25 | key.mouseButton=Botón %1$s
26 | key.pickItem=Copiar bloque
27 | key.playerlist=Lista de jugadores
28 | key.right=Caminar hacia la derecha
29 | key.screenshot=Hacer captura de pantalla
30 | key.smoothCamera=Cambiar a cámara cinemática
31 | key.sneak=Agacharse
32 | key.sprint=Correr
33 | key.togglePerspective=Cambiar cámara
34 | key.use=Interactuar/Colocar bloque
35 |
--------------------------------------------------------------------------------
/src/main/resources/assets/joypadmod/lang/es_VE.lang:
--------------------------------------------------------------------------------
1 | key.attack=Atacar/Destruir
2 | key.back=Caminar hacia atrás
3 | key.categories.gameplay=Juego
4 | key.categories.inventory=Inventario
5 | key.categories.misc=Varios
6 | key.categories.movement=Movimiento
7 | key.categories.multiplayer=Multijugador
8 | key.categories.ui=Interfaz del juego
9 | key.chat=Abrir Chat
10 | key.command=Abrir Comando en chat
11 | key.drop=Tirar objeto
12 | key.forward=Caminar hacia delante
13 | key.hotbar.1=Acceso rápido 1
14 | key.hotbar.2=Acceso rápido 2
15 | key.hotbar.3=Acceso rápido 3
16 | key.hotbar.4=Acceso rápido 4
17 | key.hotbar.5=Acceso rápido 5
18 | key.hotbar.6=Acceso rápido 6
19 | key.hotbar.7=Acceso rápido 7
20 | key.hotbar.8=Acceso rápido 8
21 | key.hotbar.9=Acceso rápido 9
22 | key.inventory=Inventario
23 | key.jump=Saltar
24 | key.left=Caminar hacia la izquierda
25 | key.mouseButton=Botón %1$s
26 | key.pickItem=Agarrar bloque
27 | key.playerlist=Lista de Jugadores
28 | key.right=Caminar hacia la derecha
29 | key.screenshot=Tomar captura de pantalla
30 | key.smoothCamera=Cambiar a cámara cinemática
31 | key.sneak=Escabullirse
32 | key.sprint=Correr
33 | key.togglePerspective=Cambiar Perspectiva
34 | key.use=Usar objeto/Colocar bloque
35 |
--------------------------------------------------------------------------------
/src/main/resources/assets/joypadmod/lang/eu_ES.lang:
--------------------------------------------------------------------------------
1 | key.attack=Eraso/Suntsitu
2 | key.back=Atzera ibili
3 | key.categories.gameplay=Jokoa
4 | key.categories.inventory=Inbentarioa
5 | key.categories.misc=Askotariko
6 | key.categories.movement=Mugimendua
7 | key.categories.multiplayer=Multijokalaria
8 | key.categories.ui=Jokoaren interfazea
9 | key.chat=Txata ireki
10 | key.command=Agintaritza ireki
11 | key.drop=Elementua bota
12 | key.forward=Aurrera ibili
13 | key.hotbar.1=Sarbide-bizkorra 1
14 | key.hotbar.2=Sarbide-bizkorra 2
15 | key.hotbar.3=Sarbide-bizkorra 3
16 | key.hotbar.4=Sarbide-bizkorra 4
17 | key.hotbar.5=Sarbide-bizkorra 5
18 | key.hotbar.6=Sarbide-bizkorra 6
19 | key.hotbar.7=Sarbide-bizkorra 7
20 | key.hotbar.8=Sarbide-bizkorra 8
21 | key.hotbar.9=Sarbide-bizkorra 9
22 | key.inventory=Inbentarioa
23 | key.jump=Jauzi
24 | key.left=Ezkerrera mugitu
25 | key.mouseButton=%1$s botoia
26 | key.pickItem=Hartu blokea
27 | key.playerlist=Jokalari zerrenda
28 | key.right=Eskuinera mugitu
29 | key.screenshot=Atera pantaila-argazkia
30 | key.smoothCamera=Kamara zinematikoaren aldaketa
31 | key.sneak=Makurtu
32 | key.sprint=Korrika egin
33 | key.togglePerspective=Ikuspuntua aldatu
34 | key.use=Artikulua erabilli/Blokea jarri
35 |
--------------------------------------------------------------------------------
/src/main/resources/assets/joypadmod/lang/oc_FR.lang:
--------------------------------------------------------------------------------
1 | key.attack=Atacar/Destrusir
2 | key.back=Caminar Endarrièr
3 | key.categories.gameplay=Jogabilitat
4 | key.categories.inventory=Inventari
5 | key.categories.misc=Divèrs
6 | key.categories.movement=Movement
7 | key.categories.multiplayer=Multijogaire
8 | key.categories.ui=Interfàcia del Jòc
9 | key.chat=Dobrir lo Chat
10 | key.command=Dobrir la Comanda
11 | key.drop=Escampar un Objècte
12 | key.forward=Caminar Tot Drech
13 | key.hotbar.1=Accès Rapid 1
14 | key.hotbar.2=Accès Rapid 2
15 | key.hotbar.3=Accès Rapid 3
16 | key.hotbar.4=Accès Rapid 4
17 | key.hotbar.5=Accès Rapid 5
18 | key.hotbar.6=Accès Rapid 6
19 | key.hotbar.7=Accès Rapid 7
20 | key.hotbar.8=Accès Rapid 8
21 | key.hotbar.9=Accès Rapid 9
22 | key.inventory=Inventari
23 | key.jump=Sautar
24 | key.left=Se Desplaçar a Esquèrra
25 | key.mouseButton=Boton %1$s
26 | key.pickItem=Causir un Blòc
27 | key.playerlist=Tièira dels Jogaires
28 | key.right=Se Desplaçar a Drecha
29 | key.screenshot=Captura d'Ecran
30 | key.smoothCamera=Activar/Desactivar lo mòde cimematic per la camèra
31 | key.sneak=S'agrovar
32 | key.sprint=Córrer
33 | key.togglePerspective=Cambiar Perspectiva
34 | key.use=Emplegar un Objècte/Pausar un Blòc
35 |
--------------------------------------------------------------------------------
/src/main/resources/assets/joypadmod/lang/es_UY.lang:
--------------------------------------------------------------------------------
1 | key.attack=Atacar/Destruir
2 | key.back=Caminar hacia atrás
3 | key.categories.gameplay=Juego
4 | key.categories.inventory=Inventario
5 | key.categories.misc=Misceláneo
6 | key.categories.movement=Movimiento
7 | key.categories.multiplayer=Multijugador
8 | key.categories.ui=Interfaz del juego
9 | key.chat=Abrir el Chat
10 | key.command=Abrir Comando en chat
11 | key.drop=Tirar objeto
12 | key.forward=Caminar hacia adelante
13 | key.hotbar.1=Acceso Rápido 1
14 | key.hotbar.2=Acceso Rápido 2
15 | key.hotbar.3=Acceso Rápido 3
16 | key.hotbar.4=Acceso Rápido 4
17 | key.hotbar.5=Acceso Rápido 5
18 | key.hotbar.6=Acceso Rápido 6
19 | key.hotbar.7=Acceso Rápido 7
20 | key.hotbar.8=Acceso Rápido 8
21 | key.hotbar.9=Acceso Rápido 9
22 | key.inventory=Inventario
23 | key.jump=Saltar
24 | key.left=Caminar hacia la izquierda
25 | key.mouseButton=Botón %1$s
26 | key.pickItem=Agarrar Bloque
27 | key.playerlist=Preparado Jugadas
28 | key.right=Caminar hacia la derecha
29 | key.screenshot=Tomar una Captura de Pantalla
30 | key.smoothCamera=Cambiar a Cámara Cinemática
31 | key.sneak=Agacharse
32 | key.sprint=Correr
33 | key.togglePerspective=Cambiar Perspectiva
34 | key.use=Usar Objeto/Colocar Bloque
35 |
--------------------------------------------------------------------------------
/src/main/resources/assets/joypadmod/lang/ms_MY.lang:
--------------------------------------------------------------------------------
1 | key.attack=Menyerang/Memusnahkan
2 | key.back=Berjalan Belakang
3 | key.categories.gameplay=Permainan
4 | key.categories.inventory=Inventori
5 | key.categories.misc=Lain-lain
6 | key.categories.movement=Pergerakan
7 | key.categories.multiplayer=Berbilangan
8 | key.categories.ui=Antara muka Permainan
9 | key.chat=Membuka Ruang Perbualan
10 | key.command=Membuka Ruangan Perintah
11 | key.drop=Jatuhkan Barangan
12 | key.forward=Berjalan Hadapan
13 | key.hotbar.1=Slot pertama Hotbar
14 | key.hotbar.2=Slot ke-2 Hotbar
15 | key.hotbar.3=Slot ke-3 Hotbar
16 | key.hotbar.4=Slot ke-4 Hotbar
17 | key.hotbar.5=Slot ke-5 Hotbar
18 | key.hotbar.6=Slot ke-6 Hotbar
19 | key.hotbar.7=Slot ke-7 Hotbar
20 | key.hotbar.8=Slot ke-8 Hotbar
21 | key.hotbar.9=Slot ke-9 Hotbar
22 | key.inventory=Inventori
23 | key.jump=Lompat
24 | key.left=Bergerak Kiri
25 | key.mouseButton=Butang %1$s
26 | key.pickItem=Pilih Blok
27 | key.playerlist=Senarai Pemain
28 | key.right=Bergerak Kanan
29 | key.screenshot=Mangambil Tangkapan Skrin
30 | key.smoothCamera=Menogel Kamera Sinematik
31 | key.sneak=Selinap
32 | key.sprint=Lari
33 | key.togglePerspective=Menogel Perspektif
34 | key.use=Mengunakan Barangan/Meletakkan Blok
35 |
--------------------------------------------------------------------------------
/src/main/resources/assets/joypadmod/lang/it_IT.lang:
--------------------------------------------------------------------------------
1 | key.attack=Attaccare/Distruggere
2 | key.back=Camminare all'Indietro
3 | key.categories.gameplay=Gameplay
4 | key.categories.inventory=Inventario
5 | key.categories.misc=Varie
6 | key.categories.movement=Movimento
7 | key.categories.multiplayer=Multigiocatore
8 | key.categories.ui=Interfaccia di Gioco
9 | key.chat=Aprire la Chat
10 | key.command=Aprire Comando
11 | key.drop=Gettare Oggetto
12 | key.forward=Camminare in Avanti
13 | key.hotbar.1=Spazio Hotbar 1
14 | key.hotbar.2=Spazio Hotbar 2
15 | key.hotbar.3=Spazio Hotbar 3
16 | key.hotbar.4=Spazio Hotbar 4
17 | key.hotbar.5=Spazio Hotbar 5
18 | key.hotbar.6=Spazio Hotbar 6
19 | key.hotbar.7=Spazio Hotbar 7
20 | key.hotbar.8=Spazio Hotbar 8
21 | key.hotbar.9=Spazio Hotbar 9
22 | key.inventory=Inventario
23 | key.jump=Salta
24 | key.left=Spostamento a Sinistra
25 | key.mouseButton=Tasto %1$s
26 | key.pickItem=Seleziona Blocco
27 | key.playerlist=Elenca Giocatori
28 | key.right=Spostamento a Destra
29 | key.screenshot=Scattare uno Screenshot
30 | key.smoothCamera=Attivare Camera Cinematica
31 | key.sneak=Cammina Furtivamente
32 | key.sprint=Corsa
33 | key.togglePerspective=Attivare Prospettiva
34 | key.use=Usare Oggetto/Piazzare Blocco
35 |
--------------------------------------------------------------------------------
/src/main/resources/assets/joypadmod/lang/lv_LV.lang:
--------------------------------------------------------------------------------
1 | key.attack=Uzbrukt/iznīcināt
2 | key.back=Iet atpakaļ
3 | key.categories.gameplay=spēle
4 | key.categories.inventory=Inventārs
5 | key.categories.misc=Dažādi
6 | key.categories.movement=Kustība
7 | key.categories.multiplayer=Daudzspēlētāju režīms
8 | key.categories.ui=Spēles interfeiss
9 | key.chat=Atvērt čata logu
10 | key.command=Atvērt komandlogu
11 | key.drop=Nomest lietu
12 | key.forward=Iet uz priekšu
13 | key.hotbar.1=Ātrās pieejas slots: 1
14 | key.hotbar.2=Ātrās pieejas slots: 2
15 | key.hotbar.3=Ātrās pieejas slots: 3
16 | key.hotbar.4=Ātrās pieejas slots: 4
17 | key.hotbar.5=Ātrās pieejas slots: 5
18 | key.hotbar.6=Ātrās pieejas slots: 6
19 | key.hotbar.7=Ātrās pieejas slots: 7
20 | key.hotbar.8=Ātrās pieejas slots: 8
21 | key.hotbar.9=Ātrās pieejas slots: 9
22 | key.inventory=Soma
23 | key.jump=Lēkt
24 | key.left=Iet sāniski pa kreisi
25 | key.mouseButton=Poga %1$s
26 | key.pickItem=Paņemt bloku
27 | key.playerlist=Parādīt spēlētājus
28 | key.right=Iet sāniski pa labi
29 | key.screenshot=Veikt ekrānuzņēmumu
30 | key.smoothCamera=Ieslēgt kino skatu
31 | key.sneak=Lavīties
32 | key.sprint=Skriet
33 | key.togglePerspective=Pārslēgt skatu
34 | key.use=Izmantot lietu/novietot bloku
35 |
--------------------------------------------------------------------------------
/src/main/resources/assets/joypadmod/lang/bg_BG.lang:
--------------------------------------------------------------------------------
1 | key.attack=Атакуване/Чупене
2 | key.back=Ходене назад
3 | key.categories.gameplay=Геймплей
4 | key.categories.inventory=Инвентар
5 | key.categories.misc=Разни
6 | key.categories.movement=Движение
7 | key.categories.multiplayer=Групова игра
8 | key.categories.ui=Игрален интерфейс
9 | key.chat=Отваряне на чат
10 | key.command=Отваряне на команди
11 | key.drop=Пускане на предмет
12 | key.forward=Вървене напред
13 | key.hotbar.1=Бърза лента слот 1
14 | key.hotbar.2=Бърза лента слот 2
15 | key.hotbar.3=Бърза лента слот 3
16 | key.hotbar.4=Бърза лента слот 4
17 | key.hotbar.5=Бърза лента слот 5
18 | key.hotbar.6=Бърза лента слот 6
19 | key.hotbar.7=Бърза лента слот 7
20 | key.hotbar.8=Бърза лента слот 8
21 | key.hotbar.9=Бърза лента слот 9
22 | key.inventory=Инвентар
23 | key.jump=Скок
24 | key.left=Завиване на ляво
25 | key.mouseButton=Бутон за %1$s
26 | key.pickItem=Вземане на блокче
27 | key.playerlist=Списък с играчи
28 | key.right=Завиване на дясно
29 | key.screenshot=Правене на снимка
30 | key.smoothCamera=Превключване кинематографична камера
31 | key.sneak=Промъкване
32 | key.sprint=Бягане
33 | key.togglePerspective=Превключване перспектива
34 | key.use=Използване на предмет/Поставяне на блок
35 |
--------------------------------------------------------------------------------
/src/main/resources/assets/joypadmod/lang/pt_PT.lang:
--------------------------------------------------------------------------------
1 | key.attack=Atacar/Destruir
2 | key.back=Andar para trás
3 | key.categories.gameplay=Jogabilidade
4 | key.categories.inventory=Inventário
5 | key.categories.misc=Outros
6 | key.categories.movement=Movimento
7 | key.categories.multiplayer=Multijogador
8 | key.categories.ui=Interface do jogo
9 | key.chat=Abrir o Chat
10 | key.command=Abrir comando
11 | key.drop="Dropar" Item
12 | key.forward=Andar para a frente
13 | key.hotbar.1=1º slot da barra rápida
14 | key.hotbar.2=2º slot da barra rápida
15 | key.hotbar.3=3º slot da barra rápida
16 | key.hotbar.4=4º slot da barra rápida
17 | key.hotbar.5=5º slot da barra rápida
18 | key.hotbar.6=6º slot da barra rápida
19 | key.hotbar.7=7º slot da barra rápida
20 | key.hotbar.8=8º slot da barra rápida
21 | key.hotbar.9=9º slot da barra rápida
22 | key.inventory=Inventário
23 | key.jump=Saltar
24 | key.left=Andar para a esquerda
25 | key.mouseButton=Botão %1$s
26 | key.pickItem=Apanhar Bloco
27 | key.playerlist=Lista de Jogadores
28 | key.right=Andar para a direita
29 | key.screenshot=Tirar Foto
30 | key.smoothCamera=Câmara Cinemática
31 | key.sneak=Agachar
32 | key.sprint=Correr
33 | key.togglePerspective=Mudar Câmara
34 | key.use=Usar item/Colocar bloco
35 |
--------------------------------------------------------------------------------
/src/main/resources/assets/joypadmod/lang/ga_IE.lang:
--------------------------------------------------------------------------------
1 | key.attack=Ionsaigh/Scrios
2 | key.back=Siúil ar gCúl
3 | key.categories.gameplay=Imirt
4 | key.categories.inventory=Fardal
5 | key.categories.misc=Ilchineálach
6 | key.categories.movement=Gluaiseacht
7 | key.categories.multiplayer=Mód Ilimreora
8 | key.categories.ui=Comhéadan Cluiche
9 | key.chat=Oscail Comhrá
10 | key.command=Tabhair Ordú
11 | key.drop=Leag Earra
12 | key.forward=Siúil ar Aghaidh
13 | key.hotbar.1=Sliotán 1 an Mhearbharra
14 | key.hotbar.2=Sliotán 2 an Mhearbharra
15 | key.hotbar.3=Sliotán 3 an Mhearbharra
16 | key.hotbar.4=Sliotán 4 an Mhearbharra
17 | key.hotbar.5=Sliotán 5 an Mhearbharra
18 | key.hotbar.6=Sliotán 6 an Mhearbharra
19 | key.hotbar.7=Sliotán 7 an Mhearbharra
20 | key.hotbar.8=Sliotán 8 an Mhearbharra
21 | key.hotbar.9=Sliotán 9 an Mhearbharra
22 | key.inventory=Fardal
23 | key.jump=Léim
24 | key.left=Tabhair céim faoi Chlé
25 | key.mouseButton=Cnaipe %1$s
26 | key.pickItem=Pioc Bloc
27 | key.playerlist=Liostáil Imreoirí
28 | key.right=Tabhair céim faoi Dheis
29 | key.screenshot=Gabháil Scáileáin
30 | key.smoothCamera=Scoránaigh an Ceamara Cineamatach
31 | key.sneak=Téaltaigh
32 | key.sprint=Rith
33 | key.togglePerspective=Scoránaigh an Dearcadh
34 | key.use=Úsáid Earra/Cuir Bloc
35 |
--------------------------------------------------------------------------------
/src/main/resources/assets/joypadmod/lang/lt_LT.lang:
--------------------------------------------------------------------------------
1 | key.attack=Pulti/Sunaikinti
2 | key.back=Eiti atgal
3 | key.categories.gameplay=Žaidimas
4 | key.categories.inventory=Inventorius
5 | key.categories.misc=Įvairūs
6 | key.categories.movement=Judėjimas
7 | key.categories.multiplayer=Žaidimas tinkle
8 | key.categories.ui=Žaidimo sąsaja
9 | key.chat=Pokalbis
10 | key.command=Komanda
11 | key.drop=Išmesti daiktą
12 | key.forward=Eiti pirmyn
13 | key.hotbar.1=Reikalingiausių daiktų dėtuvė 1
14 | key.hotbar.2=Reikalingiausių daiktų dėtuvė 2
15 | key.hotbar.3=Reikalingiausių daiktų dėtuvė 3
16 | key.hotbar.4=Reikalingiausių daiktų dėtuvė 4
17 | key.hotbar.5=Reikalingiausių daiktų dėtuvė 5
18 | key.hotbar.6=Reikalingiausių daiktų dėtuvė 6
19 | key.hotbar.7=Reikalingiausių daiktų dėtuvė 7
20 | key.hotbar.8=Reikalingiausių daiktų dėtuvė 8
21 | key.hotbar.9=Reikalingiausių daiktų dėtuvė 9
22 | key.inventory=Inventorius
23 | key.jump=Pašokti
24 | key.left=Į kairę
25 | key.mouseButton=Pelytė %1$s
26 | key.pickItem=Pasirinkti bloką
27 | key.playerlist=Žaidėjų sąrašas
28 | key.right=Į dešinę
29 | key.screenshot=Ekrano nuotrauka
30 | key.smoothCamera=Kino kamera
31 | key.sneak=Sėlinti
32 | key.sprint=Bėgti
33 | key.togglePerspective=Perjungti perspektyvą
34 | key.use=Naudoti daiktą/Padėti bloką
35 |
--------------------------------------------------------------------------------
/src/main/resources/assets/joypadmod/lang/ka_GE.lang:
--------------------------------------------------------------------------------
1 | key.attack=შეტევა/დამტვრევა
2 | key.back=უკან სიარული
3 | key.categories.gameplay=სათამაშო პროცესი
4 | key.categories.inventory=ინვენტარი
5 | key.categories.misc=სხვადასხვა
6 | key.categories.movement=მოძრაობა
7 | key.categories.multiplayer=ქსელური თამაში
8 | key.categories.ui=სათამაშო ინტერფეისი
9 | key.chat=სასაუბროს გახსნა
10 | key.command=ბრძანებების გახსნა
11 | key.drop=ნივთის გადაგდება
12 | key.forward=წინ სიარული
13 | key.hotbar.1=ჩქარი გამოძახების დანაყოფი 1
14 | key.hotbar.2=ჩქარი გამოძახების დანაყოფი 2
15 | key.hotbar.3=ჩქარი გამოძახების დანაყოფი 3
16 | key.hotbar.4=ჩქარი გამოძახების დანაყოფი 4
17 | key.hotbar.5=ჩქარი გამოძახების დანაყოფი 5
18 | key.hotbar.6=ჩქარი გამოძახების დანაყოფი 6
19 | key.hotbar.7=ჩქარი გამოძახების დანაყოფი 7
20 | key.hotbar.8=ჩქარი გამოძახების დანაყოფი 8
21 | key.hotbar.9=ჩქარი გამოძახების დანაყოფი 9
22 | key.inventory=ინვენტარი
23 | key.jump=ახტომა
24 | key.left=მარცხნივ
25 | key.mouseButton=ღილაკი %1$s
26 | key.pickItem=ბლოკის არჩევა
27 | key.playerlist=მოთამაშეთა სია
28 | key.right=მარჯვნივ
29 | key.screenshot=სურათის გადაღება
30 | key.smoothCamera=სინემატიკური კამერის შეცვლა
31 | key.sneak=მიპარვა
32 | key.sprint=სირბილი
33 | key.togglePerspective=ხედის შეცვლა
34 | key.use=ნივთის გამოყენება/ბლოკის დადგმა
35 |
--------------------------------------------------------------------------------
/src/main/java/com/shiny/joypadmod/mappings/DefaultButtonMappings.java:
--------------------------------------------------------------------------------
1 | package com.shiny.joypadmod.mappings;
2 |
3 | public class DefaultButtonMappings {
4 |
5 | public int A() {
6 | return 0;
7 | }
8 |
9 | public int B() {
10 | return 1;
11 | }
12 |
13 | public int X() {
14 | return 2;
15 | }
16 |
17 | public int Y() {
18 | return 3;
19 | }
20 |
21 | public int Back() {
22 | return 4;
23 | }
24 |
25 | public int Start() {
26 | return 5;
27 | }
28 |
29 | public int LB() {
30 | return 6;
31 | }
32 |
33 | public int RB() {
34 | return 7;
35 | }
36 |
37 | public int LS() {
38 | return 8;
39 | }
40 |
41 | public int RS() {
42 | return 9;
43 | }
44 |
45 |
46 | public static class LWJGLButtonMappings extends DefaultButtonMappings {
47 | @Override
48 | public int Back() {
49 | return 6;
50 | }
51 |
52 | @Override
53 | public int LB() {
54 | return 4;
55 | }
56 |
57 | @Override
58 | public int RB() {
59 | return 5;
60 | }
61 |
62 | @Override
63 | public int Start() {
64 | return 7;
65 | }
66 |
67 | }
68 | }
69 |
70 |
--------------------------------------------------------------------------------
/src/main/resources/assets/joypadmod/lang/fr_CA.lang:
--------------------------------------------------------------------------------
1 | key.attack=Attaquer / Détruire
2 | key.back=Reculer
3 | key.categories.gameplay=Gameplay
4 | key.categories.inventory=Inventaire
5 | key.categories.misc=Divers
6 | key.categories.movement=Mouvements
7 | key.categories.multiplayer=Multijoueur
8 | key.categories.ui=Interface de jeu
9 | key.chat=Ouvrir le chat
10 | key.command=Entrer une commande
11 | key.drop=Jeter un objet
12 | key.forward=Avancer
13 | key.hotbar.1=Barre d'action emplacement 1
14 | key.hotbar.2=Barre d'action emplacement 2
15 | key.hotbar.3=Barre d'action emplacement 3
16 | key.hotbar.4=Barre d'action emplacement 4
17 | key.hotbar.5=Barre d'action emplacement 5
18 | key.hotbar.6=Barre d'action emplacement 6
19 | key.hotbar.7=Barre d'action emplacement 7
20 | key.hotbar.8=Barre d'action emplacement 8
21 | key.hotbar.9=Barre d'action emplacement 9
22 | key.inventory=Ouvrir l'inventaire
23 | key.jump=Sauter
24 | key.left=Straffer à gauche
25 | key.mouseButton=Souris %1$s
26 | key.pickItem=Choisir le bloc
27 | key.playerlist=Afficher la liste des joueurs
28 | key.right=Straffer à droite
29 | key.screenshot=Prendre un screenshot
30 | key.smoothCamera=Alterner l'effet de caméra
31 | key.sneak=Avancer prudemment
32 | key.sprint=Sprinter
33 | key.togglePerspective=Changer de perspective
34 | key.use=Utiliser un item / Placer un bloc
35 |
--------------------------------------------------------------------------------
/src/main/resources/assets/joypadmod/lang/el_GR.lang:
--------------------------------------------------------------------------------
1 | key.attack=Επίθεση/Καταστροφή
2 | key.back=Βάδισμα πίσω
3 | key.categories.gameplay=Χειρισμός
4 | key.categories.inventory=Αποθέματα
5 | key.categories.misc=Διάφορα
6 | key.categories.movement=Kίνηση
7 | key.categories.multiplayer=Παιχνίδι πολλών παικτών
8 | key.categories.ui=Διεπαφή παιχνιδιού
9 | key.chat=Άνοιγμα Συνομιλίας
10 | key.command=Άνοιγμα Εντολών
11 | key.drop=Ρίξιμο Αντικειμένου
12 | key.forward=Βάδισμα μπροστά
13 | key.hotbar.1=Θέση 1 Μπάρας Ταχείας Επιλογής
14 | key.hotbar.2=Θέση 2 Μπάρας Ταχείας Επιλογής
15 | key.hotbar.3=Θέση 3 Μπάρας Ταχείας Επιλογής
16 | key.hotbar.4=Θέση 4 Μπάρας Ταχείας Επιλογής
17 | key.hotbar.5=Θέση 5 Μπάρας Ταχείας Επιλογής
18 | key.hotbar.6=Θέση 6 Μπάρας Ταχείας Επιλογής
19 | key.hotbar.7=Θέση 7 Μπάρας Ταχείας Επιλογής
20 | key.hotbar.8=Θέση 8 Μπάρας Ταχείας Επιλογής
21 | key.hotbar.9=Θέση 9 Μπάρας Ταχείας Επιλογής
22 | key.inventory=Αποθέματα
23 | key.jump=Άλμα
24 | key.left=Ματιά Αριστερά
25 | key.mouseButton=Κουμπί %1$s
26 | key.pickItem=Επιλογή κύβου
27 | key.playerlist=Δείτε τα ονόματα όλων των παικτών
28 | key.right=Ματιά Δεξιά
29 | key.screenshot=Λήψη στιγμιότυπου οθόνης
30 | key.smoothCamera=Εναλλαγή κινηματογραφικής κάμερας
31 | key.sneak=Σκύψιμο
32 | key.sprint=Τρέξιμο
33 | key.togglePerspective=Εναλλαγή κάμερας
34 | key.use=Χρήση Αντικειμένου/Τοποθέτηση κύβου
35 |
--------------------------------------------------------------------------------
/src/main/resources/assets/joypadmod/lang/fr_FR.lang:
--------------------------------------------------------------------------------
1 | key.attack=Attaquer/détruire
2 | key.back=Reculer
3 | key.categories.gameplay=Gameplay
4 | key.categories.inventory=Inventaire
5 | key.categories.misc=Divers
6 | key.categories.movement=Mouvement
7 | key.categories.multiplayer=Multijoueur
8 | key.categories.ui=Interface de jeu
9 | key.chat=Ouvrir le tchat
10 | key.command=Entrer une commande
11 | key.drop=Jeter un objet
12 | key.forward=Avancer
13 | key.hotbar.1=1ère case de la barre d'inventaire
14 | key.hotbar.2=2ème case de la barre d'inventaire
15 | key.hotbar.3=3ème case de la barre d'inventaire
16 | key.hotbar.4=4ème case de la barre d'inventaire
17 | key.hotbar.5=5ème case de la barre d'inventaire
18 | key.hotbar.6=6ème case de la barre d'inventaire
19 | key.hotbar.7=7ème case de la barre d'inventaire
20 | key.hotbar.8=8ème case de la barre d'inventaire
21 | key.hotbar.9=9ème case de la barre d'inventaire
22 | key.inventory=Inventaire
23 | key.jump=Sauter
24 | key.left=Aller à gauche
25 | key.mouseButton=Bouton %1$s
26 | key.pickItem=Choisir le bloc
27 | key.playerlist=Afficher la liste des joueurs
28 | key.right=Aller à droite
29 | key.screenshot=Prendre une capture d'écran
30 | key.smoothCamera=Changer d'effet de caméra
31 | key.sneak=S'accroupir
32 | key.sprint=Courir
33 | key.togglePerspective=Changer de point de vue
34 | key.use=Utiliser un objet/placer un bloc
35 |
--------------------------------------------------------------------------------
/src/main/resources/assets/joypadmod/lang/zh_CN.lang:
--------------------------------------------------------------------------------
1 | calibrationMenu.auto=自动的
2 | calibrationMenu.deadzone=盲区
3 | calibrationMenu.instructionsTitle=说明
4 | calibrationMenu.instructions1=移动摇杆
5 | calibrationMenu.instructions2=按下自动找盲区
6 | calibrationMenu.save=保存
7 |
8 | controlMenu.addKey=快捷键
9 | controlMenu.advanced=先进
10 | controlMenu.axis=Axis
11 | controlMenu.buttons=键
12 | controlMenu.calibrate=校正
13 | controlMenu.controller=游戏设备
14 | controlMenu.invert=反转
15 | controlMenu.look=览
16 | controlMenu.mouse=鼠标
17 | controlMenu.scroll=滚动条
18 | controlMenu.noControllers=全无游戏设备!
19 | controlMenu.pressKey=按键...
20 | controlMenu.toggleInstructions=按空格键切换游戏设备
21 |
22 | -Global-.SharedProfile=共享设置
23 | -Global-.GrabMouse=鼠标抢
24 | -Global-.displayAllControls=显示所有控制器
25 |
26 | joy.guiRightClick=右键
27 | joy.guiLeftClick=左键
28 | joy.shiftClick=Shift 键
29 | joy.interact=相互作用
30 | joy.menu=选单
31 |
32 | controls.reset=重置
33 |
34 | key.attack=攻击/摧毁
35 | key.back=向后移动
36 | key.categories.gameplay=游戏内容
37 | key.categories.inventory=道具栏
38 | key.categories.misc=杂项
39 | key.categories.movement=移动
40 | key.categories.multiplayer=多人游戏
41 | key.categories.ui=游戏界面
42 | key.chat=打开聊天栏
43 | key.command=输入指令
44 | key.drop=丢弃物品
45 | key.forward=向前移动
46 | key.hotbar.1=快捷栏1
47 | key.hotbar.2=快捷栏2
48 | key.hotbar.3=快捷栏3
49 | key.hotbar.4=快捷栏4
50 | key.hotbar.5=快捷栏5
51 | key.hotbar.6=快捷栏6
52 | key.hotbar.7=快捷栏7
53 | key.hotbar.8=快捷栏8
54 | key.hotbar.9=快捷栏9
55 | key.inventory=道具栏
56 | key.jump=跳跃
57 | key.left=向左移动
58 | key.mouseButton=鼠标按键%1$s
59 | key.pickItem=选取方块
60 | key.playerlist=玩家列表
61 | key.right=向右移动
62 | key.screenshot=截图
63 | key.smoothCamera=切换电影视角
64 | key.sneak=潜行
65 | key.sprint=疾跑
66 | key.togglePerspective=切换视角
67 | key.use=使用物品/放置方块
68 |
--------------------------------------------------------------------------------
/src/main/resources/assets/joypadmod/lang/zh_TW.lang:
--------------------------------------------------------------------------------
1 | calibrationMenu.auto=Auto
2 | calibrationMenu.deadzone=盲區
3 | calibrationMenu.instructionsTitle=說明
4 | calibrationMenu.instructions1=移動搖桿
5 | calibrationMenu.instructions2=按Auto找盲區
6 | calibrationMenu.save=保存
7 |
8 | controlMenu.addKey=快捷鍵
9 | controlMenu.advanced=先進
10 | controlMenu.axis=Axis
11 | controlMenu.buttons=鍵
12 | controlMenu.calibrate=校正
13 | controlMenu.controller=遊戲設備
14 | controlMenu.invert=反轉
15 | controlMenu.look=覽
16 | controlMenu.mouse=鼠標
17 | controlMenu.scroll=滚动条
18 | controlMenu.noControllers=全無遊戲設備!
19 | controlMenu.pressKey=按鍵...
20 | controlMenu.toggleInstructions=按空格鍵切換控制器
21 |
22 | -Global-.SharedProfile=共享设置
23 | -Global-.GrabMouse=鼠标抢
24 | -Global-.displayAllControls=显示所有控制器
25 |
26 | joy.guiRightClick=右擊
27 | joy.guiLeftClick=左擊
28 | joy.shiftClick=Shift 擊
29 | joy.interact=相互作用
30 | joy.menu=功能表
31 |
32 | controls.reset=重置
33 |
34 | key.attack=攻擊/破壞
35 | key.back=後退
36 | key.categories.gameplay=游戲機制
37 | key.categories.inventory=物品欄
38 | key.categories.misc=其他
39 | key.categories.movement=腳色控制
40 | key.categories.multiplayer=多人遊戲
41 | key.categories.ui=遊戲介面
42 | key.chat=開啟聊天視窗
43 | key.command=開啟指令視窗
44 | key.drop=丟棄物品
45 | key.forward=往前
46 | key.hotbar.1=物品欄1
47 | key.hotbar.2=物品欄2
48 | key.hotbar.3=物品欄3
49 | key.hotbar.4=物品欄4
50 | key.hotbar.5=物品欄5
51 | key.hotbar.6=物品欄6
52 | key.hotbar.7=物品欄7
53 | key.hotbar.8=物品欄8
54 | key.hotbar.9=物品欄9
55 | key.inventory=物品欄
56 | key.jump=跳躍
57 | key.left=往左
58 | key.mouseButton=滑鼠 %1$s
59 | key.pickItem=選取方塊
60 | key.playerlist=玩家列表
61 | key.right=往右
62 | key.screenshot=截取畫面
63 | key.smoothCamera=切換視角平滑移動
64 | key.sneak=潛行
65 | key.sprint=跑步
66 | key.togglePerspective=切換視角
67 | key.use=使用物品/放置方塊
68 |
--------------------------------------------------------------------------------
/src/main/java/com/shiny/joypadmod/event/ButtonInputEvent.java:
--------------------------------------------------------------------------------
1 | package com.shiny.joypadmod.event;
2 |
3 | import com.shiny.joypadmod.ControllerSettings;
4 |
5 | public class ButtonInputEvent extends ControllerInputEvent {
6 | public ButtonInputEvent(int controllerNumber, int buttonNumber, float threshold) {
7 | super(EventType.BUTTON, controllerNumber, buttonNumber, threshold, 0);
8 | }
9 |
10 | @Override
11 | protected boolean isTargetEvent() {
12 | return ControllerSettings.JoypadModInputLibrary.isEventButton() && ControllerSettings.JoypadModInputLibrary.getEventControlIndex() == buttonNumber;
13 | }
14 |
15 | @Override
16 | public float getAnalogReading() {
17 | if (ControllerSettings.JoypadModInputLibrary.getController(controllerNumber).isButtonPressed(buttonNumber)) {
18 | return 1.0f;
19 | }
20 |
21 | return 0f;
22 | }
23 |
24 | @Override
25 | public String getName() {
26 | if (!isValid())
27 | return "NONE";
28 | return ControllerSettings.JoypadModInputLibrary.getController(controllerNumber).getButtonName(buttonNumber);
29 | }
30 |
31 | @Override
32 | public String toString() {
33 | return "Event: " + getName() + " Type: " + getEventType() +
34 | " Current value: " + getAnalogReading() + " Is pressed: " + isPressed();
35 | }
36 |
37 | @Override
38 | public String getDescription() {
39 | return getName();
40 | }
41 |
42 | @Override
43 | public boolean isValid() {
44 | return controllerNumber >= 0 && buttonNumber >= 0
45 | && buttonNumber < ControllerSettings.JoypadModInputLibrary.getController(controllerNumber).getButtonCount();
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/src/main/resources/assets/joypadmod/lang/ja_JP.lang:
--------------------------------------------------------------------------------
1 | calibrationMenu.auto=オート
2 | calibrationMenu.deadzone=デッドゾーン
3 | calibrationMenu.instructionsTitle=説明書
4 | calibrationMenu.instructions1=ジョイスティックを動かす
5 | calibrationMenu.instructions2=デッドゾーンを見つけるために、オートを押す
6 | calibrationMenu.save=保存
7 |
8 | controlMenu.addKey=新しいキーの追加
9 | controlMenu.advanced=アドバンスド
10 | controlMenu.axis=Axis
11 | controlMenu.buttons=ボタン
12 | controlMenu.calibrate=調整する
13 | controlMenu.controller=コントローラー
14 | controlMenu.invert=反転
15 | controlMenu.look=みる
16 | controlMenu.mouse=マウス
17 | controlMenu.scroll=スクロール
18 | controlMenu.noControllers=コントローラー 未発見!
19 | controlMenu.pressKey=キーを押す...
20 | controlMenu.toggleInstructions=スペースキーでコントローラーの切り替え(オン・オフ)
21 |
22 | -Global-.SharedProfile=共有設定
23 | -Global-.GrabMouse=マウスのグラブ
24 | -Global-.displayAllControls=すべてのコントローラを表示する
25 |
26 | joy.guiRightClick=マウス右ボタン
27 | joy.guiLeftClick=マウス左ボタン
28 | joy.shiftClick=Shiftキーを押しながらクリック
29 |
30 | joy.interact=アクション
31 | joy.menu=メニュー
32 |
33 | controls.reset=リセット
34 |
35 | key.attack=攻撃する/壊す
36 | key.back=後退
37 | key.categories.gameplay=ゲームプレイ
38 | key.categories.inventory=持ち物欄
39 | key.categories.misc=その他
40 | key.categories.movement=移動
41 | key.categories.multiplayer=マルチプレイ
42 | key.categories.ui=インターフェース
43 | key.chat=チャットを開く
44 | key.command=コマンドを開く
45 | key.drop=アイテムを捨てる
46 | key.forward=前進
47 | key.hotbar.1=ホットバースロット1
48 | key.hotbar.2=ホットバースロット2
49 | key.hotbar.3=ホットバースロット3
50 | key.hotbar.4=ホットバースロット4
51 | key.hotbar.5=ホットバースロット5
52 | key.hotbar.6=ホットバースロット6
53 | key.hotbar.7=ホットバースロット7
54 | key.hotbar.8=ホットバースロット8
55 | key.hotbar.9=ホットバースロット9
56 | key.inventory=持ち物欄
57 | key.jump=ジャンプ
58 | key.left=左
59 | key.mouseButton=ボタン %1$s
60 | key.pickItem=ブロック選択
61 | key.playerlist=プレイヤーリスト
62 | key.right=右
63 | key.screenshot=スクリーンショット撮影
64 | key.smoothCamera=カメラ動作の切り替え
65 | key.sneak=こっそり動く
66 | key.sprint=ダッシュ
67 | key.togglePerspective=視野の切り替え
68 | key.use=アイテムの使用/ブロックの設置
69 |
--------------------------------------------------------------------------------
/src/main/java/com/shiny/joypadmod/event/PovInputEvent.java:
--------------------------------------------------------------------------------
1 | package com.shiny.joypadmod.event;
2 |
3 | import com.shiny.joypadmod.ControllerSettings;
4 |
5 | public class PovInputEvent extends ControllerInputEvent {
6 | int povNumber;
7 |
8 | public PovInputEvent(int controllerId, int povNumber, float threshold) {
9 | // check if valid povNumber
10 | super(EventType.POV, controllerId, povNumber, threshold, 0);
11 | this.povNumber = povNumber;
12 | }
13 |
14 | @Override
15 | protected boolean isTargetEvent() {
16 | if (povNumber == 0)
17 | return ControllerSettings.JoypadModInputLibrary.isEventPovX();
18 | return ControllerSettings.JoypadModInputLibrary.isEventPovY();
19 | }
20 |
21 | @Override
22 | public float getAnalogReading() {
23 | return povNumber == 0 ? ControllerSettings.JoypadModInputLibrary.getController(controllerNumber).getPovX() : ControllerSettings.JoypadModInputLibrary.getController(
24 | controllerNumber).getPovY();
25 | }
26 |
27 | @Override
28 | public String getName() {
29 | return povNumber == 0 ? "POV X" : "POV Y";
30 | }
31 |
32 | @Override
33 | public String toString() {
34 | return "Event: " + getName() + " Type: " + getEventType() +
35 | " Max Value: " + threshold + " Current value: " + getAnalogReading() +
36 | " Is pressed: " + isPressed();
37 | }
38 |
39 | @Override
40 | public String getDescription() {
41 | return getName() + " " + getDirection(getThreshold());
42 | }
43 |
44 | private String getDirection(float reading) {
45 | if (reading == 0)
46 | return "";
47 | if (reading > 0) {
48 | return "+";
49 | }
50 | return "-";
51 | }
52 |
53 | @Override
54 | public boolean isValid() {
55 | return povNumber == 0 || povNumber == 1;
56 | }
57 |
58 | }
59 |
--------------------------------------------------------------------------------
/src/main/java/com/shiny/joypadmod/utils/JoypadMouseHelper.java:
--------------------------------------------------------------------------------
1 | package com.shiny.joypadmod.utils;
2 |
3 | import com.shiny.joypadmod.ControllerSettings;
4 |
5 | import com.shiny.joypadmod.JoypadMod;
6 | import net.minecraft.util.MouseHelper;
7 |
8 | // warning: small but non zero chance of this causing incompatibility with other mods
9 | public class JoypadMouseHelper extends MouseHelper {
10 | /**
11 | * Grabs the mouse cursor it doesn't move and isn't seen.
12 | */
13 | @Override
14 | public void grabMouseCursor() {
15 | if (ControllerSettings.isInputEnabled() && !ControllerSettings.grabMouse) {
16 | // VirtualMouse.setGrabbed(true);
17 | return;
18 | }
19 |
20 | super.grabMouseCursor();
21 | }
22 |
23 | /**
24 | * Ungrabs the mouse cursor so it can be moved and set it to the center of the screen
25 | */
26 | @Override
27 | public void ungrabMouseCursor() {
28 | if (ControllerSettings.isInputEnabled() && !ControllerSettings.grabMouse) {
29 | // VirtualMouse.setGrabbed(false);
30 | return;
31 | }
32 |
33 | super.ungrabMouseCursor();
34 | }
35 |
36 | /*
37 | * @Override public void mouseXYChange() { this.deltaX = Mouse.getDX(); this.deltaY = Mouse.getDY(); if (this.deltaX != 0 || this.deltaY != 0) { JoypadMod.logger.info("MouseHelper dx:" + deltaX + " dy:"
38 | * + deltaY); } }
39 | */
40 |
41 | @Override
42 | protected void finalize() throws Throwable {
43 | try {
44 | JoypadMod.logger.warn("JoypadMouseHelper being garbage collected. "
45 | + "If Minecraft not shutting down, this means another mod may have replaced it.");
46 | } catch (Throwable t) {
47 | throw t;
48 | } finally {
49 | super.finalize();
50 | }
51 | }
52 |
53 | // side note, I had early visions of simply Overriding the mouseXYChange() method and this mod would be
54 | // half done, but alas not all Minecraft uses this method.
55 |
56 | }
57 |
--------------------------------------------------------------------------------
/src/main/resources/assets/joypadmod/lang/ru_RU.lang:
--------------------------------------------------------------------------------
1 | calibrationMenu.auto=авто
2 | calibrationMenu.deadzone=Мертвая зона
3 | calibrationMenu.instructionsTitle=команда
4 | calibrationMenu.instructions1=Переместите джойстик
5 | calibrationMenu.instructions2=Пресс авто найти мертвую зону
6 | calibrationMenu.save=сохранять
7 |
8 | controlMenu.addKey=Добавить ключ
9 | controlMenu.advanced=дополнительные параметры
10 | controlMenu.axis=ось
11 | controlMenu.buttons=Кнопки
12 | controlMenu.calibrate=калибровать
13 | controlMenu.controller=контроллер
14 | controlMenu.invert=Отменить
15 | controlMenu.look=Посмотрите
16 | controlMenu.mouse=мышь
17 | controlMenu.scroll=Прокрутка
18 | controlMenu.noControllers=контроллеры не найдены!
19 | controlMenu.pressKey=Нажмите кнопку ...
20 | controlMenu.toggleInstructions=Нажмите пробел для переключения контроллера
21 |
22 | -Global-.SharedProfile=совместно использовать Установки
23 | -Global-.GrabMouse=извлекать мышь
24 | -Global-.displayAllControls=Показать все контроллеры
25 |
26 | joy.guiRightClick=Щелкните правой кнопкой мыши
27 | joy.guiLeftClick=Щелкните левой кнопкой мыши
28 | joy.shiftClick=Shift кнопку
29 | joy.interact=взаимодействовать
30 | joy.menu=меню
31 |
32 | controls.reset=Сброс
33 |
34 | key.attack=Атаковать/Разрушить
35 | key.back=Назад
36 | key.categories.gameplay=Игровой процесс
37 | key.categories.inventory=Инвентарь
38 | key.categories.misc=Разное
39 | key.categories.movement=Движение
40 | key.categories.multiplayer=Сетевая игра
41 | key.categories.ui=Интерфейс игры
42 | key.chat=Открыть чат
43 | key.command=Ввод команды
44 | key.drop=Выбросить предмет
45 | key.forward=Вперед
46 | key.hotbar.1=Слот 1
47 | key.hotbar.2=Слот 2
48 | key.hotbar.3=Слот 3
49 | key.hotbar.4=Слот 4
50 | key.hotbar.5=Слот 5
51 | key.hotbar.6=Слот 6
52 | key.hotbar.7=Слот 7
53 | key.hotbar.8=Слот 8
54 | key.hotbar.9=Слот 9
55 | key.inventory=Инвентарь
56 | key.jump=Прыжок
57 | key.left=Влево
58 | key.mouseButton=Кнопка %1$s
59 | key.pickItem=Выбор блока
60 | key.playerlist=Список игроков
61 | key.right=Вправо
62 | key.screenshot=Сделать снимок экрана
63 | key.smoothCamera=Переключить камеру
64 | key.sneak=Красться
65 | key.sprint=Бег
66 | key.togglePerspective=Переключить перспективу
67 | key.use=Использовать предмет/Поставить блок
68 |
--------------------------------------------------------------------------------
/src/main/resources/assets/joypadmod/lang/sr_SP.lang:
--------------------------------------------------------------------------------
1 | calibrationMenu.auto=Ауто
2 | calibrationMenu.deadzone=Мртва зона
3 | calibrationMenu.instructionsTitle=Упутства
4 | calibrationMenu.instructions1=Притискајте све дугмиће и палице
5 | calibrationMenu.instructions2=Притисните 'ауто' да се пронађу мртве зоне
6 | calibrationMenu.save=Сачувај
7 |
8 | controlMenu.addKey=Нови тастер
9 | controlMenu.advanced=Напредно
10 | controlMenu.axis=Оса
11 | controlMenu.buttons=Дугмића
12 | controlMenu.calibrate=Калибрација
13 | controlMenu.controller=Гејмпед
14 | controlMenu.invert=Инверзија
15 | controlMenu.look=Поглед
16 | controlMenu.mouse=Миш
17 | controlMenu.scroll=Точкић
18 | controlMenu.noControllers=Није пронађен ниједан гејмпед
19 | controlMenu.pressKey=Притисните тастер...
20 | controlMenu.toggleInstructions=Размак пали/гаси тренутни гејмпед
21 |
22 | -Global-.SharedProfile=Дељење подешавања
23 | -Global-.GrabMouse=Закључавање миша
24 | -Global-.displayAllControls=Прикажи све гејмпаде
25 |
26 | joy.guiRightClick=Десни клик
27 | joy.guiLeftClick=Леви клик
28 | joy.shiftClick=Шифт клик
29 | joy.interact=Интеракција
30 | joy.menu=Мени
31 |
32 | controls.reset=Ресетовање
33 |
34 | key.attack=Нападни/Уништи
35 | key.back=Ходај уназад
36 | key.categories.gameplay=Гејмплеј
37 | key.categories.inventory=Инвентар
38 | key.categories.misc=Остало
39 | key.categories.movement=Кретање
40 | key.categories.multiplayer=Онлине игра
41 | key.categories.ui=Интерфејс игре
42 | key.chat=Отвори ћаскање
43 | key.command=Отвори команде
44 | key.drop=Испусти предмет
45 | key.forward=Ходај напред
46 | key.hotbar.1=Хотбар место 1
47 | key.hotbar.2=Хотбар место 2
48 | key.hotbar.3=Хотбар место 3
49 | key.hotbar.4=Хотбар место 4
50 | key.hotbar.5=Хотбар место 5
51 | key.hotbar.6=Хотбар место 6
52 | key.hotbar.7=Хотбар место 7
53 | key.hotbar.8=Хотбар место 8
54 | key.hotbar.9=Хотбар место 9
55 | key.inventory=Инвентар
56 | key.jump=Скок
57 | key.left=Ходај лево
58 | key.mouseButton=Тастер %1$s
59 | key.pickItem=Изабери блок
60 | key.playerlist=Списак играча
61 | key.right=Ходај десно
62 | key.screenshot=Сликај
63 | key.smoothCamera=Пали/гаси синематичну камеру
64 | key.sneak=Шуњање
65 | key.sprint=Спринт
66 | key.togglePerspective=Промени перспективу
67 | key.use=Користи предмет/Постави блок
68 |
--------------------------------------------------------------------------------
/src/main/resources/assets/joypadmod/lang/nl_NL.lang:
--------------------------------------------------------------------------------
1 | key.attack=Aanvallen/vernietigen
2 | key.back=Achteruit lopen
3 | key.categories.gameplay=Gameplay
4 | key.categories.inventory=Inventaris
5 | key.categories.misc=Diversen
6 | key.categories.movement=Beweging
7 | key.categories.multiplayer=Multiplayer
8 | key.categories.ui=Spelinterface
9 | key.chat=Chat openen
10 | key.command=Opdrachtregel openen
11 | key.drop=Voorwerp laten vallen
12 | key.forward=Vooruit lopen
13 | key.hotbar.1=Hotbarslot 1
14 | key.hotbar.2=Hotbarslot 2
15 | key.hotbar.3=Hotbarslot 3
16 | key.hotbar.4=Hotbarslot 4
17 | key.hotbar.5=Hotbarslot 5
18 | key.hotbar.6=Hotbarslot 6
19 | key.hotbar.7=Hotbarslot 7
20 | key.hotbar.8=Hotbarslot 8
21 | key.hotbar.9=Hotbarslot 9
22 | key.inventory=Inventaris
23 | key.jump=Springen
24 | key.left=Zijwaarts naar links
25 | key.mouseButton=Knop %1$s
26 | key.pickItem=Blok kiezen
27 | key.playerlist=Spelerslijst
28 | key.right=Zijwaarts naar rechts
29 | key.screenshot=Schermafbeelding maken
30 | key.smoothCamera=Filmische camera omschakelen
31 | key.sneak=Sluipen
32 | key.sprint=Sprinten
33 | key.togglePerspective=Perspectief omschakelen
34 | key.use=Voorwerp gebruiken/blok plaatsen
35 |
36 | calibrationMenu.auto=Auto
37 | calibrationMenu.deadzone=Dode zone
38 | calibrationMenu.instructionsTitle=Instructies
39 | calibrationMenu.instructions1=Druk en beweeg alle joysitck knoppen
40 | calibrationMenu.instructions2=Druk op 'Auto' om de dode zone te vinden
41 | calibrationMenu.save=Opslaan
42 | controlMenu.addKey=Knop toevoegen
43 | controlMenu.advanced=Geavanceerd
44 | controlMenu.axis=As
45 | controlMenu.buttons=Knoppen
46 | controlMenu.calibrate=Kalibreren
47 | controlMenu.controller=Controller
48 | controlMenu.invert=Muis omkeren
49 | controlMenu.look=Camera
50 | controlMenu.mouse=Muis
51 | controlMenu.scroll=Scrollen
52 | controlMenu.noControllers=Geen controller gevonden
53 | controlMenu.pressKey=Druk op toets...
54 | controlMenu.toggleInstructions=Druk spatie om de controller aan en uit te zetten
55 | -Global-.SharedProfile=Instellingen delen
56 | -Global-.GrabMouse=Vastpakken met muis
57 | -Global-.displayAllControls=Alle controllers weergeven
58 | joy.guiRightClick=Rechtsklik
59 | joy.guiLeftClick=Linksklik
60 | joy.shiftClick=Shift-klik
61 | joy.interact=Interactie
62 | joy.menu=Menu
63 |
--------------------------------------------------------------------------------
/src/main/resources/assets/joypadmod/lang/de_DE.lang:
--------------------------------------------------------------------------------
1 | calibrationMenu.auto=Auto
2 | calibrationMenu.deadzone=Deadzone
3 | calibrationMenu.instructionsTitle=Anleitungen
4 | calibrationMenu.instructions1=Bewegen Sie Joystick
5 | calibrationMenu.instructions2=Drücken Sie Auto-Deadzone zu finden
6 | calibrationMenu.save=Annehmen
7 |
8 | controlMenu.addKey=Neu Taste
9 | controlMenu.advanced=Erweiterte
10 | controlMenu.axis=Achse
11 | controlMenu.buttons=Button
12 | controlMenu.calibrate=Kalibrieren
13 | controlMenu.controller=Controller
14 | controlMenu.invert=Invert
15 | controlMenu.look=Schauen
16 | controlMenu.mouse=Mauszeiger
17 | controlMenu.scroll=Blättern
18 | controlMenu.noControllers=Keine Controller gefunden!
19 | controlMenu.pressKey=Taste ... drücken
20 | controlMenu.toggleInstructions=Drücken Sie die Leertaste, um Controller wechseln
21 |
22 | -Global-.SharedProfile=Gemeinsamen Einstellungen
23 | -Global-.GrabMouse=Maus Greifen
24 | -Global-.displayAllControls=Alle Controller anzeigen
25 |
26 | joy.guiRightClick=Rechte Maustaste
27 | joy.guiLeftClick=Linke Maustaste
28 | joy.shiftClick=Shift klicken
29 | joy.interact=Interagieren
30 | joy.menu=Menu
31 |
32 | controls.reset=Standard
33 |
34 | key.attack=Angreifen/Abbauen
35 | key.back=Rückwärts gehen
36 | key.categories.gameplay=Spielmechanik
37 | key.categories.inventory=Inventar
38 | key.categories.misc=Verschiedenes
39 | key.categories.movement=Bewegung
40 | key.categories.multiplayer=Mehrspieler
41 | key.categories.ui=Spielsteuerung
42 | key.chat=Chat
43 | key.command=Befehl
44 | key.drop=Gegenstand fallenlassen
45 | key.forward=Vorwärts gehen
46 | key.hotbar.1=Schnellzugriff 1
47 | key.hotbar.2=Schnellzugriff 2
48 | key.hotbar.3=Schnellzugriff 3
49 | key.hotbar.4=Schnellzugriff 4
50 | key.hotbar.5=Schnellzugriff 5
51 | key.hotbar.6=Schnellzugriff 6
52 | key.hotbar.7=Schnellzugriff 7
53 | key.hotbar.8=Schnellzugriff 8
54 | key.hotbar.9=Schnellzugriff 9
55 | key.inventory=Inventar
56 | key.jump=Springen
57 | key.left=Links
58 | key.mouseButton=Maustaste %1$s
59 | key.pickItem=Block auswählen
60 | key.playerlist=Spieler auflisten
61 | key.right=Rechts
62 | key.screenshot=Screenshot
63 | key.smoothCamera=Kameraverhalten wechseln
64 | key.sneak=Schleichen
65 | key.sprint=Sprinten
66 | key.togglePerspective=Perspektive umschalten
67 | key.use=Benutzen/Platzieren
68 |
--------------------------------------------------------------------------------
/src/main/java/com/shiny/joypadmod/devices/LWJGLDeviceWrapper.java:
--------------------------------------------------------------------------------
1 | package com.shiny.joypadmod.devices;
2 |
3 | import org.lwjgl.input.Controllers;
4 |
5 | public class LWJGLDeviceWrapper extends InputDevice {
6 |
7 | public LWJGLDeviceWrapper(int index) {
8 | super(index);
9 | }
10 |
11 | @Override
12 | public String getName() {
13 | return Controllers.getController(myIndex).getName();
14 | }
15 |
16 | @Override
17 | public int getButtonCount() {
18 | return Controllers.getController(myIndex).getButtonCount();
19 | }
20 |
21 | @Override
22 | public int getAxisCount() {
23 | return Controllers.getController(myIndex).getAxisCount();
24 | }
25 |
26 | @Override
27 | public float getAxisValue(int axisIndex) {
28 | return Controllers.getController(myIndex).getAxisValue(axisIndex);
29 | }
30 |
31 | @Override
32 | public String getAxisName(int index) {
33 | return Controllers.getController(myIndex).getAxisName(index);
34 | }
35 |
36 | @Override
37 | public float getDeadZone(int index) {
38 | return Controllers.getController(myIndex).getDeadZone(index);
39 | }
40 |
41 | @Override
42 | public String getButtonName(int index) {
43 | return Controllers.getController(myIndex).getButtonName(index);
44 | }
45 |
46 | @Override
47 | public Boolean isButtonPressed(int index) {
48 | return Controllers.getController(myIndex).isButtonPressed(index);
49 | }
50 |
51 | @Override
52 | public Float getPovX() {
53 | return Controllers.getController(myIndex).getPovX();
54 | }
55 |
56 | @Override
57 | public Float getPovY() {
58 | return Controllers.getController(myIndex).getPovY();
59 | }
60 |
61 | @Override
62 | public void setDeadZone(int axisIndex, float value) {
63 | Controllers.getController(myIndex).setDeadZone(axisIndex, value);
64 | }
65 |
66 | public void setIndex(int index) {
67 | myIndex = index;
68 | }
69 |
70 | @Override
71 | public Boolean isConnected() {
72 | return true; // if this device ever disconnects LWJGL chokes and minecraft needs to be restarted
73 | }
74 |
75 | @Override
76 | public int getBatteryLevel() {
77 | return -1; // not supported
78 | }
79 |
80 | }
81 |
--------------------------------------------------------------------------------
/src/main/resources/assets/joypadmod/lang/hu_HU.lang:
--------------------------------------------------------------------------------
1 | calibrationMenu.auto=Autó
2 | calibrationMenu.deadzone=Holt zóna
3 | calibrationMenu.instructionsTitle=Utasítások
4 | calibrationMenu.instructions1=Nyomkodd és moygasd az összes joystick kontrollokat
5 | calibrationMenu.instructions2=Nyomd meg az auto-t hogy megtaláld a holt zónákat
6 | calibrationMenu.save=Mentsd el
7 |
8 | controlMenu.addKey=Új billentyű
9 | controlMenu.advanced=Fejlett
10 | controlMenu.axis=Tengely
11 | controlMenu.buttons=Gombok
12 | controlMenu.calibrate=Kalibráció
13 | controlMenu.controller=Játékvezérlő
14 | controlMenu.invert=Megfordít
15 | controlMenu.look=Néz/kinéz
16 | controlMenu.mouse=Egér
17 | controlMenu.scroll=Scroll
18 | controlMenu.noControllers=Egyetlen játékvezérlő sincs találva
19 | controlMenu.pressKey=Nyomd meg...
20 | controlMenu.toggleInstructions=A space kapcsolja ki/be a játékvezérlőt
21 |
22 | -Global-.SharedProfile=Oszd meg a beállításokat
23 | -Global-.GrabMouse=Fogd meg az egérrel
24 | -Global-.displayAllControls=Mútasd meg az összes játékvezérlőt
25 |
26 | joy.guiRightClick=Bal kattintás
27 | joy.guiLeftClick=Jobb kattintás
28 | joy.shiftClick=Váltás kattintás
29 | joy.interact=Egymásra hatás
30 | joy.menu=Menü
31 |
32 | key.attack=Támadás/Blokktörés
33 | key.back=Hátrálás
34 | key.categories.gameplay=Játékmenet
35 | key.categories.inventory=Felszerelés
36 | key.categories.misc=Egyéb
37 | key.categories.movement=Mozgás
38 | key.categories.multiplayer=Többjátékos
39 | key.categories.ui=Kezelőfelület
40 | key.chat=Chat megnyitása
41 | key.command=Parancssor megnyitása
42 | key.drop=Tárgy eldobása
43 | key.forward=Gyaloglás előre
44 | key.hotbar.1=Gyorstár 1-es rekesze
45 | key.hotbar.2=Gyorstár 2-es rekesze
46 | key.hotbar.3=Gyorstár 3-as rekesze
47 | key.hotbar.4=Gyorstár 4-es rekesze
48 | key.hotbar.5=Gyorstár 5-ös rekesze
49 | key.hotbar.6=Gyorstár 6-os rekesze
50 | key.hotbar.7=Gyorstár 7-es rekesze
51 | key.hotbar.8=Gyorstár 8-as rekesze
52 | key.hotbar.9=Gyorstár 9-es rekesze
53 | key.inventory=Felszerelés
54 | key.jump=Ugrás
55 | key.left=Oldalazás balra
56 | key.mouseButton=%1$s egérgomb
57 | key.pickItem=Blokk kiválasztása
58 | key.playerlist=Játékoslista
59 | key.right=Oldalazás jobbra
60 | key.screenshot=Képernyőkép készítése
61 | key.smoothCamera=Kameramozgás lágyítása
62 | key.sneak=Lopakodás
63 | key.sprint=Futás
64 | key.togglePerspective=Nézetváltás
65 | key.use=Tárgy használata/Blokk lerakása
66 |
--------------------------------------------------------------------------------
/src/main/resources/assets/joypadmod/lang/pl_PL.lang:
--------------------------------------------------------------------------------
1 | calibrationMenu.auto=Auto
2 | calibrationMenu.deadzone=Martwa strefa
3 | calibrationMenu.instructionsTitle=Instrukcje
4 | calibrationMenu.instructions1=Przycisnij wszystkie guziki i ruszaj gałkami
5 | calibrationMenu.instructions2=Guzik 'auto' znajduje martwe strefy
6 | calibrationMenu.save=Zapisz
7 |
8 | controlMenu.addKey=Nowy klawisz
9 | controlMenu.advanced=Zaawansowane
10 | controlMenu.axis=Ośi
11 | controlMenu.buttons=Przycisków
12 | controlMenu.calibrate=Kalibracija
13 | controlMenu.controller=Gamepad
14 | controlMenu.invert=Invertuj
15 | controlMenu.look=Kamera
16 | controlMenu.mouse=Myszka
17 | controlMenu.scroll=Scroll myszki
18 | controlMenu.noControllers=Nie znaleziono gamepada
19 | controlMenu.pressKey=Wciśnij dowolny klawisz...
20 | controlMenu.toggleInstructions=Spacja wł/wył gamepad
21 |
22 | -Global-.SharedProfile=Wspólne ustawienia
23 | -Global-.GrabMouse=Przechwycenie myszki
24 | -Global-.displayAllControls=Pokaż wszystkie gamepad-y
25 |
26 | joy.guiRightClick=Lewy klik
27 | joy.guiLeftClick=Prawy klik
28 | joy.shiftClick=Shift-klik
29 | joy.interact=Interakcja
30 | joy.menu=Menu
31 |
32 |
33 | controls.reset=Resetuj
34 |
35 | key.attack=Atakuj/niszcz
36 | key.back=Idź do tyłu
37 | key.categories.gameplay=Rozgrywka
38 | key.categories.inventory=Ekwipunek
39 | key.categories.misc=Różne
40 | key.categories.movement=Ruch
41 | key.categories.multiplayer=Gra wieloosobowa
42 | key.categories.ui=Interfejs gry
43 | key.chat=Otwórz czat
44 | key.command=Wpisywanie komendy
45 | key.drop=Upuść przedmiot
46 | key.forward=Idź do przodu
47 | key.hotbar.1=Slot 1 paska szybkiego wyboru
48 | key.hotbar.2=Slot 2 paska szybkiego wyboru
49 | key.hotbar.3=Slot 3 paska szybkiego wyboru
50 | key.hotbar.4=Slot 4 paska szybkiego wyboru
51 | key.hotbar.5=Slot 5 paska szybkiego wyboru
52 | key.hotbar.6=Slot 6 paska szybkiego wyboru
53 | key.hotbar.7=Slot 7 paska szybkiego wyboru
54 | key.hotbar.8=Slot 8 paska szybkiego wyboru
55 | key.hotbar.9=Slot 9 paska szybkiego wyboru
56 | key.inventory=Ekwipunek
57 | key.jump=Skok
58 | key.left=Idź w lewo
59 | key.mouseButton=Przycisk %1$s
60 | key.pickItem=Wybierz blok
61 | key.playerlist=Lista graczy
62 | key.right=Idź w prawo
63 | key.screenshot=Zrób zrzut ekranu
64 | key.smoothCamera=Przełącz tryb kamery filmowej
65 | key.sneak=Skradanie
66 | key.sprint=Sprint
67 | key.togglePerspective=Przełącz perspektywę
68 | key.use=Użyj przedmiotu/umieść blok
69 |
--------------------------------------------------------------------------------
/src/main/java/com/shiny/joypadmod/devices/LWJGLibrary.java:
--------------------------------------------------------------------------------
1 | package com.shiny.joypadmod.devices;
2 |
3 | import org.lwjgl.LWJGLException;
4 | import org.lwjgl.input.Controllers;
5 |
6 | public class LWJGLibrary extends InputLibrary {
7 |
8 | LWJGLDeviceWrapper theDevice;
9 | LWJGLDeviceWrapper tempDevice;
10 |
11 | @Override
12 | public void create() throws LWJGLException {
13 | Controllers.create();
14 | theDevice = new LWJGLDeviceWrapper(0);
15 | tempDevice = new LWJGLDeviceWrapper(0);
16 | }
17 |
18 | @Override
19 | public Boolean isCreated() {
20 | return Controllers.isCreated();
21 | }
22 |
23 | @Override
24 | public void clearEvents() {
25 | Controllers.clearEvents();
26 | }
27 |
28 | @Override
29 | public InputDevice getController(int index) {
30 | theDevice.setIndex(index);
31 | return theDevice;
32 | }
33 |
34 | @Override
35 | public int getControllerCount() {
36 | return Controllers.getControllerCount();
37 | }
38 |
39 | @Override
40 | public InputDevice getEventSource() {
41 | tempDevice.setIndex(Controllers.getEventSource().getIndex());
42 | return tempDevice;
43 | }
44 |
45 | @Override
46 | public int getEventControlIndex() {
47 | return Controllers.getEventControlIndex();
48 | }
49 |
50 | @Override
51 | public Boolean isEventButton() {
52 | return Controllers.isEventButton();
53 | }
54 |
55 | @Override
56 | public Boolean isEventAxis() {
57 | return Controllers.isEventAxis();
58 | }
59 |
60 | @Override
61 | public Boolean isEventPovX() {
62 | return Controllers.isEventPovX();
63 | }
64 |
65 | @Override
66 | public Boolean isEventPovY() {
67 | return Controllers.isEventPovY();
68 | }
69 |
70 | @Override
71 | public Boolean next() {
72 | return Controllers.next();
73 | }
74 |
75 | @Override
76 | public void poll() {
77 | // polling happens within Minecraft itself so no need to do our own
78 | }
79 |
80 | @Override
81 | public Boolean wasDisconnected() {
82 | return false; // not supported in this library
83 | }
84 |
85 | @Override
86 | public Boolean wasConnected() {
87 | return false; // not supported in this library
88 | }
89 |
90 | @Override
91 | public InputDevice getCurrentController() {
92 | return theDevice;
93 | }
94 |
95 | }
96 |
--------------------------------------------------------------------------------
/src/main/resources/assets/joypadmod/lang/en_US.lang:
--------------------------------------------------------------------------------
1 | calibrationMenu.auto=Auto
2 | calibrationMenu.deadzone=Deadzone
3 | calibrationMenu.instructionsTitle=Instructions
4 | calibrationMenu.instructions1=Press and wiggle all joystick controls
5 | calibrationMenu.instructions2=Press auto to find deadzone
6 | calibrationMenu.save=Save
7 |
8 | controlMenu.addKey=Add Key
9 | controlMenu.advanced=Advanced
10 | controlMenu.axis=Axis
11 | controlMenu.buttons=Buttons
12 | controlMenu.calibrate=Calibrate
13 | controlMenu.controller=Controller
14 | controlMenu.invert=Invert
15 | controlMenu.look=Look
16 | controlMenu.mouse=Mouse
17 | controlMenu.scroll=Scroll
18 | controlMenu.noControllers=No controllers found!
19 | controlMenu.pressKey=Press key...
20 | controlMenu.toggleInstructions=Press space to toggle controller
21 |
22 | -Global-.SharedProfile=Share settings
23 | -Global-.GrabMouse=Mouse Grab
24 | -Global-.displayAllControls=Display all controllers
25 |
26 | -User-.DisplayHints=Button hints
27 | -User-.LegacyInput=Legacy input
28 |
29 | menuHint.quickmove=Quick Move
30 | menuHint.takeall=Take All
31 | menuHint.placeall=Place All
32 | menuHint.takehalf=Take 1/2
33 | menuHint.placeone=Place 1
34 |
35 | joy.guiRightClick=Right Click
36 | joy.guiLeftClick=Left Click
37 | joy.shiftClick=Shift click
38 | joy.interact=Interact
39 | joy.menu=Menu
40 |
41 | controls.reset=Reset
42 |
43 | key.attack=Attack/Destroy
44 | key.back=Walk Backwards
45 | key.categories.gameplay=Gameplay
46 | key.categories.inventory=Inventory
47 | key.categories.misc=Miscellaneous
48 | key.categories.movement=Movement
49 | key.categories.multiplayer=Multiplayer
50 | key.categories.ui=Game Interface
51 | key.chat=Open Chat
52 | key.command=Open Command
53 | key.drop=Drop Item
54 | key.forward=Walk Forwards
55 | key.hotbar.1=Hotbar Slot 1
56 | key.hotbar.2=Hotbar Slot 2
57 | key.hotbar.3=Hotbar Slot 3
58 | key.hotbar.4=Hotbar Slot 4
59 | key.hotbar.5=Hotbar Slot 5
60 | key.hotbar.6=Hotbar Slot 6
61 | key.hotbar.7=Hotbar Slot 7
62 | key.hotbar.8=Hotbar Slot 8
63 | key.hotbar.9=Hotbar Slot 9
64 | key.inventory=Inventory
65 | key.jump=Jump
66 | key.left=Strafe Left
67 | key.mouseButton=Button %1$s
68 | key.pickItem=Pick Block
69 | key.playerlist=List Players
70 | key.right=Strafe Right
71 | key.screenshot=Take Screenshot
72 | key.smoothCamera=Toggle Cinematic Camera
73 | key.sneak=Sneak
74 | key.sprint=Sprint
75 | key.togglePerspective=Toggle Perspective
76 | key.use=Use Item/Place Block
77 |
--------------------------------------------------------------------------------
/src/main/java/com/shiny/joypadmod/gui/McGuiHelper.java:
--------------------------------------------------------------------------------
1 | package com.shiny.joypadmod.gui;
2 |
3 | import java.lang.reflect.Method;
4 |
5 | import com.shiny.joypadmod.JoypadMod;
6 | import net.minecraft.client.Minecraft;
7 | import net.minecraft.client.gui.GuiScreen;
8 | import net.minecraftforge.fml.common.ObfuscationReflectionHelper;
9 |
10 | public class McGuiHelper {
11 |
12 | private static Method mouseButtonMove = null;
13 | private static Minecraft mc = Minecraft.getMinecraft();
14 |
15 | private static boolean created = false;
16 |
17 | @SuppressWarnings("rawtypes")
18 | public static void create() throws Exception {
19 | JoypadMod.logger.info("Creating McGuiHelper");
20 | Class[] params3 = new Class[]{int.class, int.class, int.class, long.class};
21 |
22 | mouseButtonMove = tryGetMethod(GuiScreen.class, params3, new String[]{"mouseClickMove","func_146273_a"});
23 |
24 | created = true;
25 | }
26 |
27 | @SuppressWarnings("rawtypes")
28 | private static Method tryGetMethod(Class> inClass, Class[] params, String[] names) throws NoSuchMethodException,
29 | SecurityException {
30 | Method m;
31 | try {
32 | m = inClass.getDeclaredMethod(names[0], params);
33 | } catch (Exception ex) {
34 | m = inClass.getDeclaredMethod(names[1], params);
35 | }
36 |
37 | m.setAccessible(true);
38 | return m;
39 | }
40 |
41 | public static void guiMouseDrag(int rawX, int rawY) {
42 | if (!created){
43 | JoypadMod.logger.error("Unable to use McGuiHelper because it failed to initialize");
44 | return;
45 | }
46 |
47 | long lastEvent = -1;
48 | int eventButton = -1;
49 | // JoypadMod.logger.info("Calling mouseDrag");
50 |
51 | try {
52 | eventButton = ObfuscationReflectionHelper.getPrivateValue(GuiScreen.class, mc.currentScreen, "eventButton","field_146287_f");
53 | lastEvent = ObfuscationReflectionHelper.getPrivateValue(GuiScreen.class, mc.currentScreen, "lastMouseEvent","field_146288_g");
54 | } catch (Exception ex) {
55 | JoypadMod.logger.error("Failed calling ObfuscationReflectionHelper" + ex.toString());
56 | if (lastEvent == -1)
57 | lastEvent = 100;
58 | eventButton = 0;
59 | }
60 | long var3 = Minecraft.getSystemTime() - lastEvent;
61 |
62 | try {
63 | mouseButtonMove.invoke(mc.currentScreen, rawX, rawY, eventButton, var3);
64 | } catch (Exception ex) {
65 | }
66 |
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/src/main/java/com/shiny/joypadmod/event/AxisInputEvent.java:
--------------------------------------------------------------------------------
1 | package com.shiny.joypadmod.event;
2 |
3 | import com.shiny.joypadmod.ControllerSettings;
4 | import com.shiny.joypadmod.JoypadMod;
5 |
6 | public class AxisInputEvent extends ControllerInputEvent {
7 | int axisNumber;
8 |
9 | boolean pressed = false; // used for input limiting
10 |
11 | public AxisInputEvent(int controllerId, int axisNumber, float threshold, float deadzone) {
12 | // check if valid axis
13 | super(EventType.AXIS, controllerId, axisNumber, threshold, deadzone);
14 | this.axisNumber = axisNumber;
15 | if (isValid()) {
16 | this.setDeadZone(deadzone);
17 | } else {
18 | if (controllerId < 0) {
19 | JoypadMod.logger.error("Tried to create an axis with invalid controller number");
20 | } else {
21 | JoypadMod.logger.error("Attempted to create a binding with invalid axis number. Axis index requested: "
22 | + axisNumber + " axis available: " + ControllerSettings.JoypadModInputLibrary.getController(controllerNumber).getAxisCount());
23 | }
24 |
25 | JoypadMod.logger.warn("Processing will continue with invalid axis " + axisNumber
26 | + ". Binding will not respond until rebound and may cause instability in mod.");
27 | }
28 |
29 | }
30 |
31 | @Override
32 | protected boolean isTargetEvent() {
33 | return ControllerSettings.JoypadModInputLibrary.isEventAxis() && ControllerSettings.JoypadModInputLibrary.getEventControlIndex() == axisNumber;
34 | }
35 |
36 | @Override
37 | public float getAnalogReading() {
38 | if (!isValid())
39 | return 0;
40 | return ControllerUtils.getAxisValue(ControllerSettings.JoypadModInputLibrary.getController(controllerNumber), axisNumber);
41 | }
42 |
43 | @Override
44 | public float getDeadZone() {
45 | if (!isValid())
46 | return 0;
47 | return ControllerSettings.JoypadModInputLibrary.getController(controllerNumber).getDeadZone(axisNumber);
48 | }
49 |
50 | @Override
51 | public String getName() {
52 | if (!isValid())
53 | return "Not Set";
54 | return ControllerSettings.JoypadModInputLibrary.getController(controllerNumber).getAxisName(axisNumber);
55 | }
56 |
57 | @Override
58 | public String toString() {
59 | if (!isValid())
60 | return "Not Set";
61 | return "Event: " + getName() + " Type: " + getEventType() +
62 | " Threshold: " + threshold + " Current value: " + getAnalogReading() +
63 | " Is pressed: " + isPressed();
64 | }
65 |
66 | @Override
67 | public void setDeadZone(float deadzone) {
68 | if (!isValid())
69 | return;
70 | JoypadMod.logger.info("Setting deadzone on controller " + controllerNumber + " axis " + this.axisNumber + " value "
71 | + deadzone);
72 | ControllerSettings.JoypadModInputLibrary.getController(controllerNumber).setDeadZone(this.axisNumber, deadzone);
73 | this.deadzone = deadzone;
74 | }
75 |
76 | @Override
77 | public String getDescription() {
78 | if (!isValid())
79 | return "NONE";
80 |
81 | return getName() + " " + getDirection(getThreshold());
82 | }
83 |
84 | private String getDirection(float reading) {
85 | if (reading > 0) {
86 | return "+";
87 | }
88 | return "-";
89 | }
90 |
91 | @Override
92 | public boolean isValid() {
93 | return controllerNumber >= 0 && axisNumber >= 0
94 | && axisNumber < ControllerSettings.JoypadModInputLibrary.getController(controllerNumber).getAxisCount();
95 | }
96 | }
97 |
--------------------------------------------------------------------------------
/src/main/java/com/shiny/joypadmod/utils/McObfuscationHelper.java:
--------------------------------------------------------------------------------
1 | package com.shiny.joypadmod.utils;
2 |
3 | import net.minecraft.client.resources.I18n;
4 | import net.minecraft.client.settings.KeyBinding;
5 |
6 | // the point of this class is to have a central location for calls to all the
7 | // Minecraft functions that are currently obfuscated
8 | // due to Forge not being up to date with MCP or MCP not having the latest
9 | // variable name de-obfuscated
10 | // This is particularly useful in early releases of Forge and less useful as the
11 | // version stabilizes
12 | // This may help in keeping older Minecraft joypad releases up to date with the
13 | // latest additions
14 |
15 | // you will note that it is primarily only useful for the functions that are
16 | // currently obfuscated in Forge 1.7.2 but a central location
17 | // for all Minecraft calls may be a good practice going forward
18 | public class McObfuscationHelper {
19 | // format of Map
20 | // key = de-obfuscated function or field Name
21 | // values = str1=164Name, str2=1.7.2,str3=nextVersionName etc
22 |
23 | public static int keyCode(KeyBinding key) {
24 | return key.getKeyCode();
25 | }
26 |
27 | public static String getKeyDescription(KeyBinding key) {
28 | return key.getKeyDescription();
29 | }
30 |
31 | public static String getKeyCategory(KeyBinding key) {
32 | return key.getKeyCategory();
33 | }
34 |
35 | public static String lookupString(String input) {
36 | String ret = "";
37 | if (input.contains("joy.")) {
38 | if (input.contains("X-") || input.contains("prev"))
39 | ret += symGet(JSyms.lArrow);
40 | else if (input.contains("X+") || input.contains("next"))
41 | ret += symGet(JSyms.rArrow);
42 | else if (input.contains("Y-") || input.contains("Up"))
43 | ret += symGet(JSyms.uArrow);
44 | else if (input.contains("Y+") || input.contains("Down"))
45 | ret += symGet(JSyms.dArrow);
46 | if (input.equals("joy.closeInventory"))
47 | return doTranslate("key.inventory") + " " + symGet(JSyms.remove);
48 |
49 | if (!ret.equals("")) {
50 | if (input.contains("camera"))
51 | ret = doTranslate("controlMenu.look") + " " + ret;
52 | else if (input.contains("gui"))
53 | ret = doTranslate("controlMenu.mouse") + " " + ret;
54 | else if (input.contains("scroll"))
55 | ret = doTranslate("controlMenu.scroll") + " " + ret;
56 | else if (input.contains("Item"))
57 | ret = doTranslate("key.inventory") + " " + ret;
58 |
59 | return ret;
60 | }
61 | }
62 |
63 | if (input.contains("-Global-.GrabMouse")) {
64 | return symGet(JSyms.warning) + " " + doTranslate(input);
65 | }
66 |
67 | return doTranslate(input);
68 | }
69 |
70 | public enum JSyms {
71 | lArrow, rArrow, uArrow, dArrow, eCircle, fCircle, unbind, remove, warning
72 | }
73 |
74 | public static char symGet(JSyms sym) {
75 | switch (sym) {
76 | case lArrow:
77 | return 0x2B05;
78 | case rArrow:
79 | return 0x27A1;
80 | case uArrow:
81 | return 0x2B06;
82 | case dArrow:
83 | return 0x2B07;
84 | case unbind:
85 | return '-';
86 | case eCircle:
87 | return 9675;
88 | case fCircle:
89 | return 9679;
90 | case remove:
91 | return 0x2716;
92 | case warning:
93 | return 0x26A0;
94 | default:
95 | return '?';
96 |
97 | }
98 | }
99 |
100 | private static String doTranslate(String input) {
101 | String translation = I18n.format(input);
102 | if (translation.compareTo(input) == 0) {
103 | String keyString = input.replace("joy.", "key.");
104 | // translation failed so try to lookup with the key name
105 | translation = I18n.format(keyString);
106 | if (translation.compareTo(keyString) == 0)
107 | return input;
108 | }
109 |
110 | return translation;
111 | }
112 |
113 | }
114 |
--------------------------------------------------------------------------------
/src/main/java/com/shiny/joypadmod/gui/GuiSlider.java:
--------------------------------------------------------------------------------
1 | package com.shiny.joypadmod.gui;
2 |
3 | import org.lwjgl.input.Mouse;
4 | import org.lwjgl.opengl.GL11;
5 |
6 | import com.shiny.joypadmod.utils.McObfuscationHelper;
7 |
8 | import net.minecraft.client.Minecraft;
9 | import net.minecraft.client.gui.FontRenderer;
10 | import net.minecraft.client.gui.GuiButton;
11 | import net.minecraft.util.text.translation.I18n;
12 |
13 | public class GuiSlider extends GuiButton {
14 | /**
15 | * The value of this slider control.
16 | */
17 | protected float sliderValue = 1.0F;
18 | public float minValue = 0.01F;
19 | public float maxValue = 1.0F;
20 |
21 | /**
22 | * Is this slider control being dragged.
23 | */
24 | public boolean dragging;
25 |
26 | protected String baseDisplayString;
27 |
28 | public GuiSlider(int id, int posX, int posY, int width, int height, String displayString, float value) {
29 | super(id, posX, posY, width, height, displayString);
30 | this.sliderValue = value;
31 | this.baseDisplayString = displayString;
32 | }
33 |
34 | public void setValue(float value) {
35 | if (value < minValue) {
36 | value = minValue;
37 | }
38 | if (value > maxValue) {
39 | value = maxValue;
40 | }
41 | sliderValue = value;
42 | }
43 |
44 | public float getValue() {
45 | return sliderValue;
46 | }
47 |
48 | /**
49 | * Returns 0 if the button is disabled, 1 if the mouse is NOT hovering over this button and 2 if it IS hovering over this button.
50 | */
51 | @Override
52 | public int getHoverState(boolean mouseOver) {
53 | return 0;
54 | }
55 |
56 | /**
57 | * Fired when the mouse button is dragged. Equivalent of MouseListener.mouseDragged(MouseEvent e).
58 | */
59 | @Override
60 | protected void mouseDragged(Minecraft minecraft, int mouseX, int mouseY) {
61 | // something is awry with this receiving the mouse released event so check manually if button pressed
62 | if (!Mouse.isButtonDown(0))
63 | this.dragging = false;
64 |
65 | if (this.visible) {
66 | if (this.dragging) {
67 | setValue((float) (mouseX - (this.x + 4)) / (float) (this.width - 8));
68 | this.updateText();
69 | }
70 |
71 | GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
72 | this.drawTexturedModalRect(this.x + (int) (this.sliderValue * (this.width - 8)), this.y, 0,
73 | 66, 4, 20);
74 | this.drawTexturedModalRect(this.x + (int) (this.sliderValue * (this.width - 8)) + 4,
75 | this.y, 196, 66, 4, 20);
76 | }
77 | }
78 |
79 | /**
80 | * Returns true if the mouse has been pressed on this control. Equivalent of MouseListener.mousePressed(MouseEvent e).
81 | */
82 | @Override
83 | public boolean mousePressed(Minecraft minecraft, int mouseX, int mouseY) {
84 | if (super.mousePressed(minecraft, mouseX, mouseY)) {
85 | setValue((float) (mouseX - (this.x + 4)) / (float) (this.width - 8));
86 |
87 | this.dragging = true;
88 | return true;
89 | } else {
90 | return false;
91 | }
92 | }
93 |
94 | /**
95 | * Fired when the mouse button is released. Equivalent of MouseListener.mouseReleased(MouseEvent e).
96 | */
97 | @Override
98 | public void mouseReleased(int mouseX, int mouseY) {
99 | this.dragging = false;
100 | }
101 |
102 | public void updateText() {
103 | String output = "";
104 | if (this.baseDisplayString.equals("controlMenu.sensitivity.game")) {
105 | output = String.format("(%s) %s", McObfuscationHelper.lookupString("key.categories.gameplay"),
106 | McObfuscationHelper.lookupString("options.sensitivity"));
107 | } else if (this.baseDisplayString.equals("controlMenu.sensitivity.menu")) {
108 | output = String.format("(%s) %s", McObfuscationHelper.lookupString("joy.menu"),
109 | McObfuscationHelper.lookupString("options.sensitivity"));
110 | }
111 | if (output != "") {
112 | FontRenderer fr = Minecraft.getMinecraft().fontRenderer;
113 | String value = ": " + (int) (this.sliderValue * 100.0F);
114 | this.displayString = fr.trimStringToWidth(output, this.width - fr.getStringWidth(value)) + value;
115 | } else {
116 | this.displayString = I18n.translateToLocalFormatted(this.baseDisplayString,
117 | (int) (this.sliderValue * 100.0F));
118 | }
119 | }
120 | }
121 |
--------------------------------------------------------------------------------
/src/main/java/com/shiny/joypadmod/utils/Customizations.java:
--------------------------------------------------------------------------------
1 | package com.shiny.joypadmod.utils;
2 |
3 | import com.shiny.joypadmod.JoypadMod;
4 | import org.lwjgl.opengl.GL11;
5 |
6 | import com.shiny.joypadmod.ControllerSettings;
7 |
8 | import net.minecraft.client.Minecraft;
9 | import net.minecraft.client.gui.Gui;
10 | import net.minecraft.util.ResourceLocation;
11 |
12 | public class Customizations {
13 |
14 | public static class Reticle {
15 | public static int width;
16 | public static int height;
17 | public static int imageWidth;
18 | public static int imageHeight;
19 | public static int reticleColor = 0xFFFFFFFF;
20 | private static String imageLocation = null;
21 |
22 | private static ResourceLocation resource = null;
23 | private static Minecraft mc;
24 | private static boolean glBlend = true;
25 | private static boolean glDepthTest = false;
26 |
27 | public static String getLocation() {
28 | return imageLocation;
29 | }
30 |
31 | public static void setLocation(String path, int inWidth, int inHeight,
32 | int inImageWidth, int inImageHeight) {
33 | resource = new ResourceLocation(path);
34 | width = inWidth;
35 | height = inHeight;
36 | imageWidth = inImageWidth;
37 | imageHeight = inImageHeight;
38 | mc = Minecraft.getMinecraft();
39 | }
40 |
41 | public static void SetupGl() {
42 | GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
43 | if (GL11.glIsEnabled(GL11.GL_DEPTH_TEST)) { // do this to ensure that we render on top of everything
44 | glDepthTest = true;
45 | GL11.glDisable(GL11.GL_DEPTH_TEST);
46 | }
47 | if (resource != null && !GL11.glIsEnabled(GL11.GL_BLEND)) { // do this to ensure that transparency is on for our reticle texture
48 | glBlend = false;
49 | GL11.glEnable(GL11.GL_BLEND);
50 | }
51 | }
52 |
53 | public static void RestoreGl() {
54 | if (glDepthTest) {
55 | GL11.glEnable(GL11.GL_DEPTH_TEST);
56 | }
57 | if (resource != null && !glBlend) {
58 | GL11.glDisable(GL11.GL_BLEND);
59 | }
60 | }
61 |
62 | public static Boolean parseSettings(String settings) {
63 | if (settings != null) {
64 | String[] tokens = settings.split(",");
65 | if (tokens.length == 5) {
66 | try {
67 | setLocation(tokens[0], Integer.parseInt(tokens[1]),
68 | Integer.parseInt(tokens[2]),
69 | Integer.parseInt(tokens[3]),
70 | Integer.parseInt(tokens[4]));
71 | return true;
72 | } catch (Exception ex) {
73 | JoypadMod.logger.error("Failed parsing settings string for reticle: " + settings +
74 | ". " + ex.toString());
75 | }
76 | }
77 | }
78 | JoypadMod.logger.error("Unexpected settings string: " + settings);
79 | return false;
80 | }
81 |
82 | public static void Draw(int x, int y) {
83 | SetupGl();
84 | if (resource != null) {
85 | try {
86 | mc.renderEngine.bindTexture(resource);
87 |
88 | Gui.drawModalRectWithCustomSizedTexture(x - width / 2, y - height / 2, 0, 0,
89 | width, height, imageWidth, imageHeight);
90 |
91 | } catch (Exception ex) {
92 | JoypadMod.logger.error("Caught exception when rendering reticle. Defaulting to basic."
93 | + ex.getMessage());
94 | resource = null;
95 | }
96 | } else {
97 | Gui.drawRect(x - 3, y, x + 4, y + 1, reticleColor);
98 | Gui.drawRect(x, y - 3, x + 1, y + 4, reticleColor);
99 | }
100 | RestoreGl();
101 | }
102 |
103 | }
104 |
105 | public static void init() {
106 | String user = ControllerSettings.config.getDefaultCategory();
107 | String reticleSettings = ControllerSettings.config.getConfigFileSetting(user + ".CustomReticle");
108 | if (reticleSettings == "false") {
109 | reticleSettings = "joypadmod:textures/reticle.png,16,16,16,16";
110 | ControllerSettings.config.setConfigFileSetting(user + ".CustomReticle", reticleSettings);
111 | }
112 | Reticle.parseSettings(reticleSettings);
113 | }
114 |
115 | }
116 |
--------------------------------------------------------------------------------
/src/main/java/com/shiny/joypadmod/JoypadMod.java:
--------------------------------------------------------------------------------
1 | package com.shiny.joypadmod;
2 |
3 | import com.shiny.joypadmod.gui.ButtonScreenTips;
4 | import com.shiny.joypadmod.utils.Customizations;
5 | import com.shiny.joypadmod.gui.McGuiHelper;
6 | import com.shiny.joypadmod.devices.VirtualKeyboard;
7 | import com.shiny.joypadmod.devices.VirtualMouse;
8 | import com.shiny.joypadmod.utils.GameRenderHandler;
9 | import com.shiny.joypadmod.utils.JoypadMouseHelper;
10 | import net.minecraft.client.Minecraft;
11 | import net.minecraft.client.gui.ScaledResolution;
12 | import net.minecraft.crash.CrashReport;
13 | import net.minecraftforge.client.event.RenderGameOverlayEvent;
14 | import net.minecraftforge.common.MinecraftForge;
15 | import net.minecraftforge.fml.common.Mod;
16 | import net.minecraftforge.fml.common.Mod.EventHandler;
17 | import net.minecraftforge.fml.common.event.FMLInitializationEvent;
18 | import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
19 | import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
20 | import net.minecraftforge.fml.common.eventhandler.EventPriority;
21 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
22 | import net.minecraftforge.fml.common.gameevent.TickEvent;
23 | import org.apache.logging.log4j.LogManager;
24 | import org.apache.logging.log4j.Logger;
25 |
26 | @Mod(modid = JoypadMod.MODID, name = JoypadMod.NAME, version = JoypadMod.VERSION, clientSideOnly = true, acceptedMinecraftVersions = "[1.12]")
27 | public class JoypadMod {
28 | public static Logger logger = LogManager.getLogger("Joypad Mod");
29 | public static final String MODID = "joypadsplitscreenmod";
30 | public static final String NAME = "Joypad Mod";
31 | public static final String VERSION = "1.12-14.21.0.2387";
32 |
33 | private static ControllerSettings controllerSettings;
34 |
35 | @EventHandler
36 | public void preInit(FMLPreInitializationEvent event) {
37 | logger.info("preInit");
38 | controllerSettings = new ControllerSettings(event.getSuggestedConfigurationFile());
39 | }
40 |
41 | @EventHandler
42 | public void init(FMLInitializationEvent event) {
43 | logger.info("init");
44 | try {
45 | if (Minecraft.getMinecraft().mouseHelper == null) {
46 | JoypadMod.logger.warn("Replacing Mousehelper that may have already been replaced by another mod!");
47 | }
48 | Minecraft.getMinecraft().mouseHelper = new JoypadMouseHelper();
49 | JoypadMod.logger.info("Replaced mousehelper in Minecraft with JoypadMouseHelper");
50 | } catch (Exception ex) {
51 | JoypadMod.logger.warn("Unable to exchange mousehelper. Game may grab mouse from keyboard players!");
52 | }
53 | }
54 |
55 | @EventHandler
56 | public void postInit(FMLPostInitializationEvent event) {
57 | logger.info("postInit");
58 | controllerSettings.init();
59 | try {
60 | VirtualKeyboard.create();
61 | } catch (Exception ex) {
62 | logger.fatal("Unable to initialize VirtualKeyboard. Limited compatibility with some mods likely. " + ex.toString());
63 | }
64 |
65 | try {
66 | VirtualMouse.create();
67 | McGuiHelper.create();
68 | } catch (Exception e) {
69 | Minecraft.getMinecraft().crashed(new CrashReport("A fatal error occurred.", e));
70 | }
71 |
72 | MinecraftForge.EVENT_BUS.register(this);
73 |
74 | Customizations.init();
75 | }
76 |
77 | @SubscribeEvent(priority = EventPriority.HIGH)
78 | public void tickRender(TickEvent.RenderTickEvent event) {
79 | if (event.phase == TickEvent.Phase.START) {
80 | GameRenderHandler.HandlePreRender();
81 | } else if (event.phase == TickEvent.Phase.END) {
82 | GameRenderHandler.HandlePostRender();
83 | }
84 | }
85 |
86 | @SubscribeEvent(priority = EventPriority.HIGH)
87 | public void tickRenderClient(TickEvent.ClientTickEvent event) {
88 | if (event.phase == TickEvent.Phase.START) {
89 | GameRenderHandler.HandleClientStartTick();
90 | } else if (event.phase == TickEvent.Phase.END) {
91 | GameRenderHandler.HandleClientEndTick();
92 | }
93 | }
94 |
95 | @SubscribeEvent(priority = EventPriority.LOWEST)
96 | public void buttonMapDisplay(RenderGameOverlayEvent.Post event) {
97 | if (event.isCancelable() || event.getType() != RenderGameOverlayEvent.ElementType.EXPERIENCE) {
98 | return;
99 | }
100 | new ButtonScreenTips();
101 | }
102 |
103 | //TODO: Replace this (removed in 1.13+)
104 | public static ScaledResolution GetScaledResolution() {
105 | Minecraft mc = Minecraft.getMinecraft();
106 | return new ScaledResolution(mc);
107 | }
108 | }
109 |
--------------------------------------------------------------------------------
/src/main/java/com/shiny/joypadmod/devices/VirtualKeyboard.java:
--------------------------------------------------------------------------------
1 | package com.shiny.joypadmod.devices;
2 |
3 | import java.lang.reflect.Field;
4 | import java.nio.ByteBuffer;
5 |
6 | import com.shiny.joypadmod.JoypadMod;
7 | import org.lwjgl.input.Keyboard;
8 |
9 | import com.shiny.joypadmod.ControllerSettings;
10 |
11 | public class VirtualKeyboard {
12 | private static Field keyDownField;
13 | private static Field keyBufferField;
14 | private static Byte[] keyState;
15 | private static boolean created = false;
16 |
17 | /**
18 | * VirtualKeyboard cannot be constructed.
19 | */
20 | private VirtualKeyboard() {
21 | }
22 |
23 | public static void create() throws NoSuchFieldException, SecurityException {
24 | if (created)
25 | return;
26 |
27 | JoypadMod.logger.info("Creating VirtualKeyboard");
28 | keyBufferField = Keyboard.class.getDeclaredField("readBuffer");
29 | keyDownField = Keyboard.class.getDeclaredField("keyDownBuffer");
30 | keyDownField.setAccessible(true);
31 | keyBufferField.setAccessible(true);
32 | keyState = new Byte[Keyboard.KEYBOARD_SIZE];
33 | for (int i = 0; i < Keyboard.KEYBOARD_SIZE; i++)
34 | keyState[i] = 0;
35 | created = true;
36 | }
37 |
38 | public static boolean isCreated() {
39 | return created;
40 | }
41 |
42 | // send a press key event to the keyboard buffer
43 | public static void pressKey(int keycode) {
44 | if (!checkCreated()) {
45 | return;
46 | }
47 |
48 | if (keyHelper(keycode, 1)) {
49 | if (ControllerSettings.loggingLevel > 1)
50 | JoypadMod.logger.info("Pressing key " + Keyboard.getKeyName(keycode));
51 | keyState[keycode] = 1;
52 | holdKey(keycode, true);
53 | }
54 | }
55 |
56 | // send a release key event to the keyboard buffer
57 | // give option to only send the event if a pressKey event was recorded prior
58 | public static void releaseKey(int keycode, boolean onlyIfPressed) {
59 | if (!checkCreated()) {
60 | return;
61 | }
62 |
63 | if (isValidKey(keycode, true) && (!onlyIfPressed || keyState[keycode] == 1)) {
64 | if (ControllerSettings.loggingLevel > 1)
65 | JoypadMod.logger.info("Releasing key " + Keyboard.getKeyName(keycode));
66 | keyHelper(keycode, 0);
67 | keyState[keycode] = 0;
68 | holdKey(keycode, false);
69 | }
70 | }
71 |
72 | public static void holdKey(int keycode, boolean down) {
73 | if (!checkCreated()) {
74 | return;
75 | }
76 |
77 | if (!isValidKey(keycode, true)) {
78 | return;
79 | }
80 |
81 | if (ControllerSettings.loggingLevel > 2)
82 | JoypadMod.logger.info("Holding key " + Keyboard.getKeyName(keycode));
83 | if (keyDownField != null) {
84 | try {
85 | byte b = (byte) (down ? 1 : 0);
86 | ((ByteBuffer) keyDownField.get(null)).put(keycode, b);
87 | } catch (Exception ex) {
88 | JoypadMod.logger.error("Failed putting value in key buffer" + ex.toString());
89 | }
90 | }
91 | }
92 |
93 | private static boolean checkCreated() {
94 | if (!created) {
95 | JoypadMod.logger.error("Virtual Keyboard has not been created or failed to initialize and cannot be used");
96 | return false;
97 | }
98 | return true;
99 | }
100 |
101 | private static boolean isValidKey(int keycode, boolean logError) {
102 | if (keycode < 0 || keycode > Keyboard.KEYBOARD_SIZE) {
103 | if (logError) {
104 | JoypadMod.logger.error("Invalid keyboard keycode requested: " + keycode);
105 | }
106 | return false;
107 | }
108 |
109 | return true;
110 | }
111 |
112 | private static boolean keyHelper(int keycode, int state) {
113 | if (!checkCreated()) {
114 | return false;
115 | }
116 | if (!isValidKey(keycode, true)) {
117 | return false;
118 | }
119 |
120 | if (keyBufferField != null) {
121 | if (ControllerSettings.loggingLevel > 1)
122 | JoypadMod.logger.info("Hacking key " + Keyboard.getKeyName(keycode) + " state: " + state);
123 | try {
124 | ((ByteBuffer) keyBufferField.get(null)).compact();
125 | ((ByteBuffer) keyBufferField.get(null)).putInt(keycode); // key
126 | ((ByteBuffer) keyBufferField.get(null)).put((byte) state); // state
127 | ((ByteBuffer) keyBufferField.get(null)).putInt(keycode); // character
128 | ((ByteBuffer) keyBufferField.get(null)).putLong(500); // nanos
129 | ((ByteBuffer) keyBufferField.get(null)).put((byte) 0); // repeat
130 | ((ByteBuffer) keyBufferField.get(null)).flip();
131 | return true;
132 |
133 | } catch (Exception ex) {
134 | JoypadMod.logger.error("Failed putting value in keyBufferField " + ex.toString());
135 | }
136 | }
137 | return false;
138 | }
139 | }
140 |
--------------------------------------------------------------------------------
/src/main/java/com/shiny/joypadmod/event/ControllerInputEvent.java:
--------------------------------------------------------------------------------
1 | package com.shiny.joypadmod.event;
2 |
3 | import com.shiny.joypadmod.ControllerSettings;
4 | import com.shiny.joypadmod.JoypadMod;
5 |
6 | /**
7 | * Input event that encapsulates the button press, pov and axis movement
8 | *
9 | * @author shiny
10 | */
11 | public abstract class ControllerInputEvent {
12 | protected final EventType type;
13 | protected final int controllerNumber;
14 | protected final int buttonNumber;
15 | protected float threshold;
16 | protected float deadzone;
17 | protected boolean isActive;
18 | protected boolean wasReleased;
19 | // switch whether this has ever been pressed in its lifetime
20 | protected boolean pressedOnce;
21 |
22 | public enum EventType {
23 | BUTTON, AXIS, POV
24 | }
25 |
26 | public ControllerInputEvent(EventType type, int controllerNumber, int buttonNumber, float threshold, float deadzone) {
27 | JoypadMod.logger.info("ControllerInputEvent constructor params:( type: " + type + ", controllerNumber: "
28 | + controllerNumber + ", buttonNumber: " + buttonNumber + ", threshhold: " + threshold + ", deadzone: "
29 | + deadzone + ")");
30 | this.type = type;
31 | this.controllerNumber = controllerNumber;
32 | this.buttonNumber = buttonNumber;
33 | this.threshold = threshold;
34 | this.deadzone = deadzone;
35 | isActive = false;
36 | wasReleased = false;
37 | pressedOnce = false;
38 | }
39 |
40 | // subclasses will check the controller event to see if it matches their subclass type
41 | protected abstract boolean isTargetEvent();
42 |
43 | // check if axis or button number is valid
44 | public abstract boolean isValid();
45 |
46 | public abstract float getAnalogReading();
47 |
48 | public abstract String getName();
49 |
50 | public abstract String getDescription();
51 |
52 | public EventType getEventType() {
53 | return type;
54 | }
55 |
56 | public boolean isActive() {
57 | return isActive;
58 | }
59 |
60 | public boolean pressedOnce() {
61 | return pressedOnce;
62 | }
63 |
64 | public boolean isPressed() {
65 | if (!isActive || !isValid())
66 | return false;
67 |
68 | boolean ret = meetsThreshold();
69 |
70 | if (!ret) {
71 | wasReleased = true;
72 | isActive = false;
73 | }
74 |
75 | return ret;
76 | }
77 |
78 | // this should only be called when a Controllers.next call has returned true
79 | public boolean wasPressed() {
80 | if (!isValid())
81 | return false;
82 |
83 | boolean bRet = wasPressedRaw() && meetsThreshold();
84 |
85 | if (bRet) {
86 | isActive = true;
87 | }
88 |
89 | if (isActive && wasReleased) {
90 | JoypadMod.logger.warn("wasPressed returning true prior to the wasReleased being consumed");
91 | wasReleased = false;
92 | }
93 |
94 | return bRet;
95 | }
96 |
97 | // just checks the event to see if it matches, not using threshold values
98 | public boolean wasPressedRaw() {
99 | if (!isValid())
100 | return false;
101 |
102 | if (ControllerSettings.JoypadModInputLibrary.getEventSource().getIndex() == controllerNumber && isTargetEvent()) {
103 | pressedOnce = true;
104 | return true;
105 | }
106 |
107 | return false;
108 | }
109 |
110 | // signify to the caller that this was just released and needs a release event to be sent
111 | public boolean wasReleased() {
112 | boolean bRet = false;
113 | if (wasReleased) {
114 | if (ControllerSettings.loggingLevel > 1)
115 | JoypadMod.logger.debug("wasReleased returning true for " + getName());
116 | bRet = true;
117 | wasReleased = false;
118 | }
119 | return bRet;
120 | }
121 |
122 | protected boolean meetsThreshold() {
123 | return threshold > 0 ? getAnalogReading() >= threshold : getAnalogReading() <= threshold;
124 | }
125 |
126 | public int getControllerIndex() {
127 | return controllerNumber;
128 | }
129 |
130 | public int getEventIndex() {
131 | return buttonNumber;
132 | }
133 |
134 | public float getThreshold() {
135 | return threshold;
136 | }
137 |
138 | public void setThreshold(float f) {
139 | threshold = f;
140 | }
141 |
142 | public float getDeadZone() {
143 | return deadzone;
144 | }
145 |
146 | public void setDeadZone(float f) {
147 | }
148 |
149 | public String toConfigFileString() {
150 | return getEventType().toString() + "," + getEventIndex() + "," + getThreshold() + "," + getDeadZone();
151 | }
152 |
153 | @Override
154 | public boolean equals(Object obj) {
155 | if (obj == this) {
156 | return true;
157 | }
158 | if (obj == null || obj.getClass() != this.getClass()) {
159 | return false;
160 | }
161 | ControllerInputEvent inputEvent = (ControllerInputEvent) obj;
162 | return inputEvent.type == this.type && inputEvent.buttonNumber == this.buttonNumber
163 | && inputEvent.threshold == this.threshold;
164 | }
165 | }
166 |
--------------------------------------------------------------------------------
/src/main/java/com/shiny/joypadmod/devices/XInputDeviceWrapper.java:
--------------------------------------------------------------------------------
1 | package com.shiny.joypadmod.devices;
2 |
3 | import com.github.strikerx3.jxinput.XInputBatteryInformation;
4 | import com.github.strikerx3.jxinput.XInputButtons;
5 | import com.github.strikerx3.jxinput.XInputDevice;
6 | import com.github.strikerx3.jxinput.XInputDevice14;
7 | import com.github.strikerx3.jxinput.enums.XInputAxis;
8 | import com.github.strikerx3.jxinput.enums.XInputBatteryDeviceType;
9 | import com.github.strikerx3.jxinput.enums.XInputButton;
10 | import com.github.strikerx3.jxinput.exceptions.XInputNotLoadedException;
11 | import com.shiny.joypadmod.JoypadMod;
12 |
13 | public class XInputDeviceWrapper extends InputDevice {
14 |
15 | public XInputDevice theDevice;
16 | public Boolean xInput14 = false;
17 |
18 | float[] deadZones = new float[]{0.15f, 0.15f, 0.15f, 0.15f, 0.15f, 0.15f};
19 |
20 | public XInputDeviceWrapper(int index) {
21 | super(index);
22 |
23 | }
24 |
25 | @Override
26 | public String getName() {
27 | return "XInput Device";
28 | }
29 |
30 | @Override
31 | public int getButtonCount() {
32 | return 15;
33 | }
34 |
35 | @Override
36 | public int getAxisCount() {
37 | return 6;
38 | }
39 |
40 | @Override
41 | public float getAxisValue(int axisIndex) {
42 | float value = theDevice.getComponents().getAxes().get(XInputAxis.values()[axisIndex]);
43 |
44 | if (Math.abs(value) > deadZones[axisIndex]) {
45 | XInputAxis axis = XInputAxis.values()[axisIndex];
46 | if (axis == XInputAxis.LEFT_THUMBSTICK_Y || axis == XInputAxis.RIGHT_THUMBSTICK_Y)
47 | value *= -1;
48 |
49 | return value;
50 | }
51 |
52 | return 0;
53 | }
54 |
55 | @Override
56 | public String getAxisName(int index) {
57 |
58 | String name = XInputAxis.values()[index].toString();
59 | String ret;
60 | if (name.length() > 11) {
61 | ret = String.format("%s %s", name.substring(0, 9), name.charAt(name.length() - 1));
62 | } else
63 | ret = name;
64 | return ret;
65 | }
66 |
67 | @Override
68 | public float getDeadZone(int index) {
69 | return deadZones[index];
70 | }
71 |
72 | @Override
73 | public String getButtonName(int index) {
74 | return XInputButton.values()[index].toString();
75 | }
76 |
77 | @Override
78 | public Boolean isButtonPressed(int index) {
79 |
80 | return isPressed(XInputButton.values()[index], theDevice.getComponents().getButtons());
81 | }
82 |
83 | @Override
84 | public Float getPovX() {
85 |
86 | if (theDevice.getDelta().getButtons().isPressed(XInputButton.DPAD_LEFT))
87 | return -1.0f;
88 | if (theDevice.getDelta().getButtons().isPressed(XInputButton.DPAD_RIGHT))
89 | return 1.0f;
90 | return 0f;
91 | }
92 |
93 | @Override
94 | public Float getPovY() {
95 | if (theDevice.getDelta().getButtons().isPressed(XInputButton.DPAD_UP))
96 | return 1.0f;
97 | if (theDevice.getDelta().getButtons().isPressed(XInputButton.DPAD_DOWN))
98 | return -1.0f;
99 | return 0f;
100 | }
101 |
102 | @Override
103 | public void setDeadZone(int axisIndex, float value) {
104 | deadZones[axisIndex] = value;
105 | }
106 |
107 | protected void setIndex(int index, Boolean useXInput14) {
108 | try {
109 |
110 | if (useXInput14) {
111 | xInput14 = true;
112 | theDevice = XInputDevice14.getDeviceFor(index);
113 | } else
114 | theDevice = XInputDevice.getDeviceFor(index);
115 | myIndex = index;
116 | theDevice.poll();
117 | } catch (XInputNotLoadedException e) {
118 | JoypadMod.logger.fatal("Failed calling setIndex on XInputDevice: " + e.toString());
119 | }
120 | }
121 |
122 | @Override
123 | public Boolean isConnected() {
124 | return theDevice.isConnected();
125 | }
126 |
127 | @Override
128 | public int getBatteryLevel() {
129 | try {
130 | XInputBatteryInformation gamepadBattInfo = ((XInputDevice14) theDevice).getBatteryInformation(XInputBatteryDeviceType.GAMEPAD);
131 |
132 | return gamepadBattInfo.getLevel().ordinal();
133 | } catch (Exception ex) {
134 | return -1;
135 | }
136 | }
137 |
138 |
139 | public Boolean isPressed(XInputButton buttonToCheck, XInputButtons buttons) {
140 | switch (buttonToCheck) {
141 | case A:
142 | return buttons.a;
143 | case B:
144 | return buttons.b;
145 | case X:
146 | return buttons.x;
147 | case Y:
148 | return buttons.y;
149 | case BACK:
150 | return buttons.back;
151 | case START:
152 | return buttons.start;
153 | case LEFT_SHOULDER:
154 | return buttons.lShoulder;
155 | case RIGHT_SHOULDER:
156 | return buttons.rShoulder;
157 | case LEFT_THUMBSTICK:
158 | return buttons.lThumb;
159 | case RIGHT_THUMBSTICK:
160 | return buttons.rThumb;
161 | case DPAD_UP:
162 | return buttons.up;
163 | case DPAD_DOWN:
164 | return buttons.down;
165 | case DPAD_LEFT:
166 | return buttons.left;
167 | case DPAD_RIGHT:
168 | return buttons.right;
169 | case GUIDE_BUTTON:
170 | return buttons.guide;
171 |
172 | default:
173 | return false;
174 |
175 | }
176 | }
177 | }
178 |
--------------------------------------------------------------------------------
/src/main/java/com/shiny/joypadmod/gui/joypad/JoypadAdvancedMenu.java:
--------------------------------------------------------------------------------
1 | package com.shiny.joypadmod.gui.joypad;
2 |
3 | import com.shiny.joypadmod.ControllerSettings;
4 | import com.shiny.joypadmod.JoypadMod;
5 | import com.shiny.joypadmod.utils.McObfuscationHelper;
6 |
7 | import net.minecraft.client.gui.GuiButton;
8 | import net.minecraft.client.gui.GuiScreen;
9 |
10 | public class JoypadAdvancedMenu extends GuiScreen {
11 |
12 | private int buttonWidth = 150;
13 | private int buttonsPerRow = 2;
14 | private int buttonYSpacing = 25;
15 | private int buttonXSpacing = 5;
16 | private int buttonXStart_top;
17 | private int buttonYStart_top;
18 |
19 | private int joyIndex;
20 | private JoypadConfigMenu parent;
21 |
22 | private String[] otherButtons = {"controlMenu.calibrate", "controlMenu.invert"};
23 | private String[] gameOptions = {"-Global-.SharedProfile", "-Global-.displayAllControls", "-Global-.GrabMouse", "-User-.DisplayHints", "-User-.LegacyInput"};
24 |
25 | public JoypadAdvancedMenu(JoypadConfigMenu parent, int joyIndex) {
26 | super();
27 | this.parent = parent;
28 | this.joyIndex = joyIndex;
29 | }
30 |
31 | @Override
32 | public void initGui() {
33 | buttonWidth = findMaxButtonWidth() + 10;
34 | buttonXStart_top = (this.width - buttonWidth * buttonsPerRow - buttonXSpacing * buttonsPerRow) / 2;
35 | buttonYStart_top = 50;
36 |
37 | int buttonNum = 0;
38 |
39 | addButton(buttonNum++, 100, "controlMenu.calibrate", false);
40 | addButton(buttonNum++, 200, "controlMenu.invert", true, ControllerSettings.getInvertYAxis());
41 |
42 | for (int i = 0; i < gameOptions.length; i++) {
43 | addButton(buttonNum++, 300 + i, gameOptions[i], true);
44 | }
45 |
46 | buttonList.add(new GuiButton(500, width / 2 - parent.bottomButtonWidth / 2, height - 20,
47 | parent.bottomButtonWidth, 20, parent.sGet("gui.done")));
48 | }
49 |
50 | private int findMaxButtonWidth() {
51 | int maxWidth = 0;
52 |
53 | for (String otherButton : otherButtons) {
54 | String buttonString = createToggleString(otherButton, true);
55 | int width = mc.fontRenderer.getStringWidth(buttonString);
56 | maxWidth = Math.max(width, maxWidth);
57 | }
58 |
59 | for (String gameOption : gameOptions) {
60 | String buttonString = createToggleString(gameOption, true);
61 | int width = mc.fontRenderer.getStringWidth(buttonString);
62 | maxWidth = Math.max(width, maxWidth);
63 | }
64 |
65 | return maxWidth;
66 | }
67 |
68 | @Override
69 | protected void actionPerformed(GuiButton guiButton) {
70 | JoypadMod.logger.info("Action performed on " + guiButton.displayString);
71 | switch (guiButton.id) {
72 | case 100: // calibrate
73 | mc.displayGuiScreen(new JoypadCalibrationMenu(this, joyIndex));
74 | break;
75 | case 200: // invert
76 | ControllerSettings.setInvertYAxis(!ControllerSettings.getInvertYAxis());
77 | toggleOnOffButton(ControllerSettings.getInvertYAxis(), guiButton);
78 | break;
79 | case 500: // Done
80 | mc.displayGuiScreen(this.parent);
81 | break;
82 | default:
83 | int id = guiButton.id - 300;
84 | if (id >= 0 && id < gameOptions.length) {
85 | boolean currentSetting = ControllerSettings.getGameOption(gameOptions[id]).equals("true");
86 | ControllerSettings.setGameOption(gameOptions[id], "" + !currentSetting);
87 | toggleOnOffButton(!currentSetting, guiButton);
88 | }
89 | }
90 |
91 | }
92 |
93 | @Override
94 | public void drawScreen(int par1, int par2, float par3) {
95 | drawDefaultBackground();
96 |
97 | int labelYStart = 5;
98 |
99 | String titleText = String.format("Joypad Mod - %s", parent.sGet("controlMenu.advanced"));
100 | this.drawCenteredString(parent.getFontRenderer(), titleText, width / 2, labelYStart, -1);
101 |
102 | super.drawScreen(par1, par2, par3);
103 | }
104 |
105 | private void addButton(int buttonNum, int id, String code, boolean isToggle) {
106 | boolean toggleValue = isToggle && ControllerSettings.getGameOption(code).equals("true");
107 | addButton(buttonNum, id, code, isToggle, toggleValue);
108 | }
109 |
110 | private void addButton(int buttonNum, int id, String code, boolean isToggle, boolean toggleValue) {
111 | int buttonBase = buttonNum % buttonsPerRow;
112 | String buttonString = isToggle ? createToggleString(code, toggleValue) : McObfuscationHelper.lookupString(code);
113 | buttonList.add(new GuiButton(id, buttonXStart_top + buttonWidth * buttonBase + buttonXSpacing * buttonBase,
114 | buttonYStart_top + (buttonNum / buttonsPerRow) * buttonYSpacing, buttonWidth, 20, buttonString));
115 | }
116 |
117 | private String createToggleString(String code, boolean on) {
118 | String toggleString = on ? "options.on" : "options.off";
119 | return String.format("%s: %s", McObfuscationHelper.lookupString(code),
120 | McObfuscationHelper.lookupString(toggleString));
121 | }
122 |
123 | private void toggleOnOffButton(boolean b, GuiButton button) {
124 | String s1 = b ? McObfuscationHelper.lookupString("options.off")
125 | : McObfuscationHelper.lookupString("options.on");
126 | String s2 = b ? McObfuscationHelper.lookupString("options.on")
127 | : McObfuscationHelper.lookupString("options.off");
128 | button.displayString = button.displayString.replace(s1, s2);
129 | }
130 |
131 | }
132 |
--------------------------------------------------------------------------------
/src/main/java/com/shiny/joypadmod/devices/XInputLibrary.java:
--------------------------------------------------------------------------------
1 | package com.shiny.joypadmod.devices;
2 |
3 | import java.util.LinkedList;
4 |
5 | import com.github.strikerx3.jxinput.XInputDevice;
6 | import com.github.strikerx3.jxinput.XInputDevice14;
7 | import com.github.strikerx3.jxinput.XInputLibraryVersion;
8 | import com.github.strikerx3.jxinput.enums.XInputButton;
9 | import com.github.strikerx3.jxinput.listener.SimpleXInputDeviceListener;
10 | import com.github.strikerx3.jxinput.listener.XInputDeviceListener;
11 | import com.github.strikerx3.jxinput.natives.XInputNatives;
12 | import com.shiny.joypadmod.JoypadMod;
13 |
14 | public class XInputLibrary extends InputLibrary {
15 |
16 | private Boolean created = false;
17 | float axisSignalThreshold = 0.5f; // the point at which we will trigger an axis event if it meets the threshold
18 | protected Boolean xInput14 = false;
19 |
20 | public Boolean recentlyDisconnected = false;
21 | public Boolean recentlyConnected = false;
22 |
23 | XInputDeviceWrapper theDevice;
24 |
25 | static LinkedList events = new LinkedList();
26 |
27 | // used for event notification for polling
28 | int lastEvent = -1;
29 | int lastEventControlIndex = -1;
30 |
31 | public static class InputEvent {
32 | int eventType = -1; // 0 = axis event 1 = button press
33 | int eventControlIndex = -1; // button or axis number
34 |
35 | public InputEvent(int event, int controlIndex) {
36 | eventType = event;
37 | eventControlIndex = controlIndex;
38 | }
39 | }
40 |
41 | @Override
42 | public void create() throws Exception {
43 | if (XInputDevice14.isAvailable())
44 | xInput14 = true;
45 | else if (!XInputDevice.isAvailable()) {
46 | if (!XInputNatives.isLoaded()) {
47 | JoypadMod.logger.error("XInput native libraries failed to load with error: " + XInputNatives.getLoadError().toString());
48 | } else {
49 | JoypadMod.logger.error("XInputNatives were loaded but XInputDevice reports it is not available");
50 | }
51 |
52 | throw new Exception("XInput is not available on system.");
53 | }
54 |
55 | theDevice = new XInputDeviceWrapper(0);
56 | theDevice.setIndex(0, xInput14);
57 | created = true;
58 | JoypadMod.logger.info("XInput is available on system. Using version: " + XInputLibraryVersion.values()[XInputNatives.getLoadedLibVersion()].toString());
59 | }
60 |
61 | @Override
62 | public Boolean isCreated() {
63 | return created;
64 | }
65 |
66 |
67 | @Override
68 | public void clearEvents() {
69 | events.clear();
70 | }
71 |
72 | @Override
73 | public InputDevice getController(int index) {
74 | if (index != theDevice.theDevice.getPlayerNum()) {
75 | theDevice.theDevice.removeListener(listener);
76 | theDevice.setIndex(index, xInput14);
77 | theDevice.theDevice.addListener(listener);
78 | }
79 | return theDevice;
80 | }
81 |
82 | @Override
83 | public int getControllerCount() {
84 | return 4;
85 | }
86 |
87 | @Override
88 | public InputDevice getEventSource() {
89 | return theDevice;
90 | }
91 |
92 | @Override
93 | public int getEventControlIndex() {
94 | return lastEventControlIndex;
95 | }
96 |
97 | @Override
98 | public Boolean isEventButton() {
99 | return lastEvent == 0;
100 | }
101 |
102 | @Override
103 | public Boolean isEventAxis() {
104 | return lastEvent == 1;
105 | }
106 |
107 | @Override
108 | public Boolean isEventPovX() {
109 | return false;
110 | }
111 |
112 | @Override
113 | public Boolean isEventPovY() {
114 | return false;
115 | }
116 |
117 | @Override
118 | public Boolean next() {
119 |
120 | if (events.isEmpty())
121 | return false;
122 | InputEvent event = (InputEvent) events.removeFirst();
123 | lastEvent = event.eventType;
124 | lastEventControlIndex = event.eventControlIndex;
125 | return true;
126 | }
127 |
128 |
129 | @Override
130 | public void poll() {
131 | theDevice.theDevice.poll();
132 |
133 | for (int i = 0; i < 6; i++) {
134 | if (Math.abs(theDevice.getAxisValue(i)) > axisSignalThreshold) {
135 | events.add(new InputEvent(1, i));
136 | }
137 | }
138 |
139 | }
140 |
141 | XInputDeviceListener listener = new SimpleXInputDeviceListener() {
142 | @Override
143 | public void connected() {
144 | JoypadMod.logger.info("Connection message received");
145 | recentlyConnected = true;
146 | }
147 |
148 | @Override
149 | public void disconnected() {
150 | JoypadMod.logger.info("Disconnection message received");
151 | recentlyDisconnected = true;
152 | }
153 |
154 | @Override
155 | public void buttonChanged(final XInputButton button, final boolean pressed) {
156 | events.add(new InputEvent(0, button.ordinal()));
157 | JoypadMod.logger.info(button.name() + (pressed ? " pressed" : " released"));
158 | // the given button was just pressed (if pressed == true) or released (pressed == false)
159 | }
160 | };
161 |
162 | @Override
163 | public Boolean wasDisconnected() {
164 | if (recentlyDisconnected) {
165 | recentlyDisconnected = false;
166 | return true;
167 | }
168 | return false;
169 | }
170 |
171 | @Override
172 | public Boolean wasConnected() {
173 | if (recentlyConnected) {
174 | recentlyConnected = false;
175 | return true;
176 | }
177 | return false;
178 | }
179 |
180 | @Override
181 | public InputDevice getCurrentController() {
182 |
183 | return theDevice;
184 | }
185 |
186 | }
187 |
--------------------------------------------------------------------------------
/src/main/java/com/shiny/joypadmod/gui/ButtonScreenTips.java:
--------------------------------------------------------------------------------
1 | package com.shiny.joypadmod.gui;
2 |
3 | import com.shiny.joypadmod.ControllerSettings;
4 | import com.shiny.joypadmod.JoypadMod;
5 | import com.shiny.joypadmod.utils.McObfuscationHelper;
6 | import com.shiny.joypadmod.event.ControllerBinding;
7 |
8 | import net.minecraft.client.Minecraft;
9 | import net.minecraft.client.gui.FontRenderer;
10 | import net.minecraft.client.gui.Gui;
11 | import net.minecraft.client.gui.ScaledResolution;
12 | import net.minecraft.client.gui.inventory.GuiContainer;
13 |
14 | public class ButtonScreenTips extends Gui {
15 |
16 | public static class HintString {
17 |
18 | public String bindingString;
19 | public String hintHolding;
20 | public String hintNormal;
21 | public Boolean isValid;
22 | private String hintOverride;
23 | private String hintOverrideHolding;
24 |
25 | public HintString(String bindString, String menuHintOverride, String menuHintOverrideHolding) {
26 | JoypadMod.logger.info(String.format("HintString Constructor called with " +
27 | "binding: %s. MenuOverride: %s. menuHintOverrideHolding: %s",
28 | bindString, menuHintOverride, menuHintOverrideHolding));
29 | bindingString = bindString;
30 | hintOverride = menuHintOverride;
31 | hintOverrideHolding = menuHintOverrideHolding;
32 | UpdateHintString();
33 | }
34 |
35 | public HintString(String a) {
36 | this(a, null, null);
37 | }
38 |
39 | public void UpdateHintString() {
40 | try {
41 | ControllerBinding b = ControllerSettings.get(bindingString);
42 | isValid = b != null && b.inputEvent != null && b.inputEvent.isValid();
43 | if (isValid) {
44 | hintNormal = b.getInputName() + " - ";
45 | if (hintOverride == null)
46 | hintNormal += b.getMenuItemName();
47 | else
48 | hintNormal += McObfuscationHelper.lookupString(hintOverride);
49 | if (hintOverrideHolding == null)
50 | hintHolding = null;
51 | else
52 | hintHolding = b.getInputName() + " - " +
53 | McObfuscationHelper.lookupString(hintOverrideHolding);
54 | }
55 | JoypadMod.logger.info(String.format("HintString: %s, HintStringHolding: %s",
56 | hintNormal, hintHolding));
57 | } catch (Exception ex) {
58 | isValid = false;
59 | JoypadMod.logger.error("Error updating HintString " + bindingString + " " + ex.getLocalizedMessage());
60 | }
61 | }
62 | }
63 |
64 | public static HintString[] blTipsGame = {new HintString("joy.inventory"), new HintString("joy.jump")};
65 | public static HintString[] brTipsGame = {new HintString("joy.attack"), new HintString("joy.use")};
66 | public static HintString[] blTipsMenu = {new HintString("joy.closeInventory"),
67 | new HintString("joy.shiftClick", "menuHint.quickmove", null) /* quick move */};
68 | public static HintString[] brTipsMenu = {new HintString("joy.guiLeftClick", "menuHint.takeall", "menuHint.placeall"),
69 | new HintString("joy.interact", "menuHint.takehalf", "menuHint.placeone") /* take half stack / drop 1 item */};
70 |
71 | Minecraft mc = Minecraft.getMinecraft();
72 | FontRenderer fr = mc.fontRenderer;
73 | int currentX = 5;
74 | int currentY = 20;
75 |
76 | public ButtonScreenTips() {
77 | if (ControllerSettings.isSuspended()
78 | || !ControllerSettings.isInputEnabled()
79 | || !ControllerSettings.displayHints)
80 | return;
81 |
82 | displayTips();
83 | }
84 |
85 | public static void UpdateHintString() {
86 | for (HintString hs : blTipsGame)
87 | hs.UpdateHintString();
88 | for (HintString hs : brTipsGame)
89 | hs.UpdateHintString();
90 | for (HintString hs : blTipsMenu)
91 | hs.UpdateHintString();
92 | for (HintString hs : brTipsMenu)
93 | hs.UpdateHintString();
94 | }
95 |
96 | private int findMaxStringLength(HintString[] hintStrings, boolean inMenu, boolean isHolding) {
97 | int max = 0;
98 | for (HintString hs : hintStrings) {
99 | if (hs.isValid) {
100 | String checkString;
101 | if (isHolding && hs.hintHolding != null)
102 | checkString = hs.hintHolding;
103 | else
104 | checkString = hs.hintNormal;
105 | int len = fr.getStringWidth(checkString);
106 | if (len > max)
107 | max = len;
108 | }
109 | }
110 | return max;
111 | }
112 |
113 | private void displayTips() {
114 | ScaledResolution scaled = JoypadMod.GetScaledResolution();
115 | int width = scaled.getScaledWidth();
116 | int height = scaled.getScaledHeight();
117 |
118 | if (mc.currentScreen instanceof GuiContainer) {
119 | boolean isHolding = mc.player != null &&
120 | mc.player.inventory != null &&
121 | mc.player.inventory.getItemStack() != null;
122 | int maxLen = findMaxStringLength(blTipsMenu, true, isHolding);
123 | currentX = width / 2 - 100 - maxLen;
124 | currentY = height - ((fr.FONT_HEIGHT * blTipsMenu.length) + (blTipsMenu.length * 5));
125 | for (HintString hs : blTipsMenu) {
126 | if (hs.isValid) {
127 | String outString = isHolding && hs.hintHolding != null ? hs.hintHolding : hs.hintNormal;
128 | drawTip(outString, 0xFFFFFF);
129 | }
130 | }
131 | currentX = width / 2 + 100;
132 | currentY = height - ((fr.FONT_HEIGHT * brTipsMenu.length) + (brTipsMenu.length * 5));
133 | for (HintString hs : brTipsMenu) {
134 | if (hs.isValid) {
135 | String outString = isHolding && hs.hintHolding != null ? hs.hintHolding : hs.hintNormal;
136 | drawTip(outString, 0xFFFFFF);
137 | }
138 | }
139 | } else if (mc.inGameHasFocus) {
140 | boolean isHolding = false;
141 | int maxLen = findMaxStringLength(blTipsGame, false, isHolding);
142 | currentX = width / 2 - 95 - maxLen;
143 | currentY = height - ((fr.FONT_HEIGHT * blTipsGame.length) + (blTipsGame.length * 5));
144 | for (HintString hs : blTipsGame) {
145 | if (hs.isValid) {
146 | String outString = isHolding && hs.hintHolding != null ? hs.hintHolding : hs.hintNormal;
147 | drawTip(outString, 0xFFFFFF);
148 | }
149 | }
150 | currentX = width / 2 + 95;
151 | currentY = height - ((fr.FONT_HEIGHT * brTipsGame.length) + (brTipsGame.length * 5));
152 | for (HintString hs : brTipsGame) {
153 | if (hs.isValid) {
154 | String outString = isHolding && hs.hintHolding != null ? hs.hintHolding : hs.hintNormal;
155 | drawTip(outString, 0xFFFFFF);
156 | }
157 | }
158 | }
159 | }
160 |
161 | private void drawTip(String text, int color) {
162 | this.drawString(fr, text, currentX, currentY, color);
163 | //fr.drawStringWithShadow(text, currentX, currentY, color);
164 | currentY += fr.FONT_HEIGHT + 5;
165 | }
166 | }
167 |
--------------------------------------------------------------------------------
/src/main/java/com/shiny/joypadmod/devices/VirtualMouse.java:
--------------------------------------------------------------------------------
1 | package com.shiny.joypadmod.devices;
2 |
3 | import java.lang.reflect.Field;
4 | import java.nio.ByteBuffer;
5 |
6 | import com.shiny.joypadmod.JoypadMod;
7 | import org.lwjgl.input.Mouse;
8 |
9 | import com.shiny.joypadmod.ControllerSettings;
10 |
11 | public class VirtualMouse {
12 |
13 | private static Field xField;
14 | private static Field yField;
15 | private static Field dxField;
16 | private static Field dyField;
17 | // private static Field eventXField;
18 | // private static Field eventYField;
19 | private static Field buttonField;
20 | private static Field mouseReadBuffer;
21 | private static Field isGrabbedField;
22 | private static int[] buttonsDown = {0, 0, 0};
23 | private static final int buttonsSupported = 3;
24 |
25 | private static int lastX = 0;
26 | private static int lastY = 0;
27 |
28 | private static boolean created = false;
29 |
30 | private VirtualMouse() {
31 | }
32 |
33 | public static void create() throws NoSuchFieldException, SecurityException {
34 | if (created)
35 | return;
36 |
37 | JoypadMod.logger.info("Creating VirtualMouse");
38 | xField = getSetField("x");
39 | yField = getSetField("y");
40 | dxField = getSetField("dx");
41 | dyField = getSetField("dy");
42 | // eventXField = getSetField("event_x");
43 | // eventYField = getSetField("event_y");
44 | buttonField = getSetField("buttons");
45 | mouseReadBuffer = getSetField("readBuffer");
46 | isGrabbedField = getSetField("isGrabbed");
47 |
48 | created = true;
49 | }
50 |
51 | private static Field getSetField(String fieldName) throws NoSuchFieldException, SecurityException {
52 | Field f = Mouse.class.getDeclaredField(fieldName);
53 | f.setAccessible(true);
54 | return f;
55 | }
56 |
57 | public static boolean isCreated() {
58 | return created;
59 | }
60 |
61 | public static void unpressAllButtons() {
62 | for (int i = 0; i < buttonsSupported; i++) {
63 | releaseMouseButton(i, true);
64 | }
65 | }
66 |
67 | // note a Mouse.poll is used indirectly by Minecraft when it calls Display.update
68 | // Mouse.poll will set the dx/dy values based on what it reads from the mouse
69 | // therefore, we have to send the dx/dy values in addition to setting the
70 | // dx/dy variables directly
71 | // this function doesn't really work properly right now
72 | public static boolean moveMouse(int dx, int dy) {
73 | if (!checkCreated())
74 | return false;
75 |
76 | if (ControllerSettings.loggingLevel > 1)
77 | JoypadMod.logger.info("Moving mouse: dx:" + dx + " dy:" + dy);
78 | addMouseEvent((byte) -1, (byte) 0, dx, dy, 0, 1000);
79 | try {
80 | dxField.setInt(null, dx);
81 | dyField.setInt(null, dy);
82 | } catch (Exception ex) {
83 | JoypadMod.logger.error("Failed setting dx/dy value of mouse. " + ex.toString());
84 | }
85 |
86 | return true;
87 | }
88 |
89 | public static boolean holdMouseButton(int button, boolean onlyIfNotHeld) {
90 | if (!checkCreated() || !checkButtonSupported(button))
91 | return false;
92 |
93 | if (onlyIfNotHeld && buttonsDown[button] != 0) {
94 | if (ControllerSettings.loggingLevel > 1)
95 | JoypadMod.logger.info("rejecting mouse button press as its already indicated as held");
96 | return true;
97 | }
98 |
99 | if (ControllerSettings.loggingLevel > 1)
100 | JoypadMod.logger.info("Holding mouse button: " + button);
101 | setMouseButton(button, true);
102 | addMouseEvent((byte) button, (byte) 1, lastX, lastY, 0, 1000);
103 | buttonsDown[button] = 1;
104 | return true;
105 | }
106 |
107 | public static boolean releaseMouseButton(int button, boolean onlyIfHeld) {
108 | if (!checkCreated() || !checkButtonSupported(button))
109 | return false;
110 |
111 | if (onlyIfHeld && buttonsDown[button] != 1)
112 | return true;
113 |
114 | if (ControllerSettings.loggingLevel > 1)
115 | JoypadMod.logger.info("Releasing mouse button: " + button);
116 | setMouseButton(button, false);
117 | addMouseEvent((byte) button, (byte) 0, lastX, lastY, 0, 1000);
118 | buttonsDown[button] = 0;
119 | return true;
120 | }
121 |
122 | public static boolean isButtonDown(int button) {
123 | return buttonsDown[button] == 1;
124 | }
125 |
126 | public static boolean scrollWheel(int event_dwheel) {
127 | if (!checkCreated())
128 | return false;
129 |
130 | if (ControllerSettings.loggingLevel > 1)
131 | JoypadMod.logger.info("Setting scroll wheel: " + event_dwheel);
132 | addMouseEvent((byte) -1, (byte) 0, 0, 0, event_dwheel, 10000);
133 | return true;
134 | }
135 |
136 | public static boolean setXY(int x, int y) {
137 | if (!checkCreated())
138 | return false;
139 |
140 | if (ControllerSettings.loggingLevel > 3 && (lastX != x || lastY != y))
141 | JoypadMod.logger.info("Setting mouse position to x:" + x + " y:" + y);
142 |
143 | try {
144 | xField.setInt(null, x);
145 | yField.setInt(null, y);
146 | // eventXField.setInt(null, x);
147 | // eventYField.setInt(null, y);
148 | lastX = x;
149 | lastY = y;
150 | return true;
151 | } catch (Exception ex) {
152 | JoypadMod.logger.error("Failed setting x/y value of mouse. " + ex.toString());
153 | }
154 | return false;
155 | }
156 |
157 | public static boolean setMouseButton(int button, boolean down) {
158 | if (ControllerSettings.loggingLevel > 3)
159 | JoypadMod.logger.info("Hacking mouse button: " + button);
160 | try {
161 | ((ByteBuffer) buttonField.get(null)).put(button, (byte) (down ? 1 : 0));
162 | } catch (Exception ex) {
163 | JoypadMod.logger.error("Failed setting mouse button field: " + ex.toString());
164 | return false;
165 | }
166 |
167 | return true;
168 | }
169 |
170 | private static boolean addMouseEvent(byte eventButton, byte eventState, int event_dx, int event_dy,
171 | int event_dwheel, long event_nanos) {
172 | if (!checkCreated())
173 | return false;
174 |
175 | if (ControllerSettings.loggingLevel > 1)
176 | JoypadMod.logger.info("AddMouseEvent: eventButton: " + eventButton + " eventState: " + eventState + " event_dx: "
177 | + event_dx + " event_dy: " + event_dy + " event_dwheel: " + event_dwheel);
178 |
179 | try {
180 | ((ByteBuffer) mouseReadBuffer.get(null)).compact();
181 | ((ByteBuffer) mouseReadBuffer.get(null)).put(eventButton); // eventButton
182 | ((ByteBuffer) mouseReadBuffer.get(null)).put(eventState); // eventState
183 | ((ByteBuffer) mouseReadBuffer.get(null)).putInt(event_dx); // event_dx
184 | ((ByteBuffer) mouseReadBuffer.get(null)).putInt(event_dy); // event_dy
185 | ((ByteBuffer) mouseReadBuffer.get(null)).putInt(event_dwheel); // event_dwheel
186 | ((ByteBuffer) mouseReadBuffer.get(null)).putLong(event_nanos); // event_nanos
187 | ((ByteBuffer) mouseReadBuffer.get(null)).flip();
188 | } catch (Exception ex) {
189 | JoypadMod.logger.error("Failed putting value in mouseReadBuffer " + ex.toString());
190 | return false;
191 | }
192 |
193 | return true;
194 | }
195 |
196 | public static void setGrabbed(boolean grabbed) {
197 | if (ControllerSettings.loggingLevel > 3)
198 | JoypadMod.logger.info("Setting Mouse.isGrabbed to return: " + grabbed);
199 | try {
200 | isGrabbedField.setBoolean(null, grabbed);
201 | } catch (Exception ex) {
202 | JoypadMod.logger.error("Failed trying to set Mouse.isGrabbed. " + ex.toString());
203 | }
204 | }
205 |
206 | private static boolean checkButtonSupported(int button) {
207 | if (button < 0 || button >= buttonsSupported) {
208 | JoypadMod.logger.error("Button number is not supported. Max button index is " + (buttonsSupported - 1));
209 | return false;
210 | }
211 | return true;
212 | }
213 |
214 | private static boolean checkCreated() {
215 | if (!created) {
216 | JoypadMod.logger.error("Virtual mouse has not been created or failed to initialize and cannot be used");
217 | return false;
218 | }
219 | return true;
220 | }
221 |
222 | }
223 |
--------------------------------------------------------------------------------
/src/main/java/com/shiny/joypadmod/gui/joypad/JoypadCalibrationList.java:
--------------------------------------------------------------------------------
1 | package com.shiny.joypadmod.gui.joypad;
2 |
3 | import java.text.DecimalFormat;
4 | import java.util.ArrayList;
5 | import java.util.List;
6 |
7 | import com.shiny.joypadmod.JoypadMod;
8 | import org.lwjgl.input.Mouse;
9 |
10 | import com.shiny.joypadmod.ControllerSettings;
11 | import com.shiny.joypadmod.devices.InputDevice;
12 | import com.shiny.joypadmod.utils.McObfuscationHelper;
13 | import com.shiny.joypadmod.event.ControllerUtils;
14 |
15 | import net.minecraft.client.Minecraft;
16 | import net.minecraft.client.gui.GuiButton;
17 | import net.minecraft.client.gui.ScaledResolution;
18 | import net.minecraft.client.renderer.Tessellator;
19 | import net.minecraftforge.fml.client.GuiScrollingList;
20 |
21 | public class JoypadCalibrationList extends GuiScrollingList {
22 | private Minecraft mc;
23 | private int width;
24 | private int entryHeight;
25 | private int joypadIndex;
26 | private JoypadCalibrationMenu parent;
27 |
28 | public JoypadCalibrationList(Minecraft client, int width, int height, int top, int bottom, int left,
29 | int entryHeight, int joypadIndex, JoypadCalibrationMenu parent) {
30 | super(client, width, height, top, bottom, left, entryHeight);
31 | mc = Minecraft.getMinecraft();
32 | this.width = width;
33 | this.entryHeight = entryHeight;
34 | this.joypadIndex = joypadIndex;
35 | this.parent = parent;
36 | }
37 |
38 | @Override
39 | protected int getSize() {
40 | int ret = ControllerSettings.JoypadModInputLibrary.getController(joypadIndex).getAxisCount();
41 | if (ret > 0) {
42 | int theHeight = this.bottom - this.top;
43 | // make sure all items will appear at the top
44 | if (ret * entryHeight < theHeight)
45 | ret = (int) Math.floor(theHeight / entryHeight);
46 | }
47 |
48 | return Math.max(ControllerSettings.JoypadModInputLibrary.getController(joypadIndex).getAxisCount(), ret);
49 | }
50 |
51 | @Override
52 | protected void elementClicked(int index, boolean doubleClick) {
53 | }
54 |
55 | @Override
56 | protected boolean isSelected(int index) {
57 | return false;
58 | }
59 |
60 | @Override
61 | protected void drawBackground() {
62 | // TODO Auto-generated method stub
63 |
64 | }
65 |
66 | public void actionPerformed(GuiButton guiButton) {
67 | int axisId = guiButton.id;
68 | JoypadMod.logger.info("Action performed on buttonID " + axisId);
69 | InputDevice controller = this.joypadIndex != -1 ? ControllerSettings.JoypadModInputLibrary.getController(this.joypadIndex) : null;
70 |
71 | if (guiButton.id < 100) {
72 | // auto set this deadzone
73 | ControllerUtils.autoCalibrateAxis(this.joypadIndex, axisId);
74 | } else if (guiButton.id >= 100 && guiButton.id < 200) {
75 | // request to lower the deadzone of this axis
76 | axisId -= 100;
77 | controller.setDeadZone(axisId, controller.getDeadZone(axisId) - 0.01f);
78 | } else if (guiButton.id >= 200 && guiButton.id < 300) {
79 | // clear deadzone of this axis
80 | axisId -= 200;
81 | controller.setDeadZone(axisId, 0.0f);
82 | } else if (guiButton.id >= 300 && guiButton.id < 400) {
83 | // request to raise the deadzone of this axis
84 | axisId -= 300;
85 | controller.setDeadZone(axisId, controller.getDeadZone(axisId) + 0.01f);
86 | } else if (guiButton.id >= 400 && guiButton.id < 500) {
87 | // toggle the single direction property of the axis
88 | axisId -= 400;
89 | ControllerSettings.toggleSingleDirectionAxis(joypadIndex, axisId);
90 | char toggleSign = McObfuscationHelper.symGet(McObfuscationHelper.JSyms.eCircle);
91 | if (ControllerSettings.isSingleDirectionAxis(joypadIndex, axisId)) {
92 | toggleSign = McObfuscationHelper.symGet(McObfuscationHelper.JSyms.fCircle);
93 | }
94 | guiButton.displayString = "" + toggleSign;
95 | }
96 | }
97 |
98 | public List buttonList = new ArrayList<>();
99 |
100 | @Override
101 | protected void drawSlot(int var1, int var2, int var3, int var4, Tessellator var5) {
102 | final ScaledResolution scaledResolution = JoypadMod.GetScaledResolution();
103 |
104 | final int k = Mouse.getX() * scaledResolution.getScaledWidth() / mc.displayWidth;
105 | final int i1 = scaledResolution.getScaledHeight() - Mouse.getY() * scaledResolution.getScaledHeight()
106 | / mc.displayHeight - 1;
107 |
108 | if (var1 < ControllerSettings.JoypadModInputLibrary.getController(joypadIndex).getAxisCount()) {
109 | int totalWidth = parent.axisBoxWidth;
110 | drawAxis(var1, this.width / 2 - totalWidth / 2, var3 + 2, 21, k, i1, totalWidth);
111 |
112 | for (int i = 5 * var1; i < 5 * var1 + 5; i++) {
113 | if (buttonList.size() > i) {
114 | buttonList.get(i).y = var3 + 5;
115 | buttonList.get(i).drawButton(Minecraft.getMinecraft(), k, i1, 0);
116 | }
117 | }
118 | }
119 | }
120 |
121 | private int[] drawAxis(int axisNum, int xStart, int yStart, int ySpace, int par1, int par2, int totalWidth) {
122 | InputDevice controller = ControllerSettings.JoypadModInputLibrary.getController(joypadIndex);
123 | int yPos = yStart;
124 | DecimalFormat df = new DecimalFormat("#0.00");
125 | int autoButtonWidth = mc.fontRenderer.getStringWidth(McObfuscationHelper.lookupString("calibrationMenu.auto")) + 10;
126 | int resetButtonWidth = mc.fontRenderer.getStringWidth(McObfuscationHelper.lookupString("controls.reset")) + 10;
127 | int directionButWidth = 15;
128 |
129 | int maxSize = parent.fr.getStringWidth("X Axis:");
130 | String title = parent.fr.trimStringToWidth(controller.getAxisName(axisNum), maxSize);
131 |
132 | parent.drawBoxWithText(xStart, yPos, xStart + totalWidth, yPos + 25, title, 0xAA0000, 0x0000AA);
133 | yPos += 10;
134 | int xPos = xStart + 5;
135 |
136 | String output = title + ": " + df.format(ControllerUtils.getAxisValue(controller, axisNum));
137 | parent.write(xPos, yPos, output);
138 | xPos += maxSize + parent.fr.getStringWidth(" -1.00") + 4;
139 | output = McObfuscationHelper.lookupString("calibrationMenu.deadzone") + ": "
140 | + df.format(controller.getDeadZone(axisNum));
141 | parent.write(xPos, yPos, output);
142 | xPos += parent.fr.getStringWidth(output) + 5;
143 |
144 | int xPos2 = xStart + totalWidth - directionButWidth;
145 |
146 | int yOffset = -7;
147 | int xOffset = 2;
148 | if (this.buttonList.size() <= 5 * axisNum) {
149 | // Single direction axis toggle button
150 | char toggleSign = McObfuscationHelper.symGet(McObfuscationHelper.JSyms.eCircle);
151 | if (ControllerSettings.isSingleDirectionAxis(joypadIndex, axisNum)) {
152 | toggleSign = McObfuscationHelper.symGet(McObfuscationHelper.JSyms.fCircle);
153 | }
154 | buttonList.add(new GuiButton(axisNum + 400, xPos2, yPos + yOffset, directionButWidth, 20, "" + toggleSign));
155 | xPos2 -= directionButWidth - xOffset;
156 |
157 | buttonList.add(new GuiButton(axisNum + 300, xPos2, yPos + yOffset, directionButWidth, 20, ">"));
158 | xPos2 -= resetButtonWidth - xOffset;
159 | buttonList.add(new GuiButton(axisNum + 200, xPos2, yPos + yOffset, resetButtonWidth, 20,
160 | McObfuscationHelper.lookupString("controls.reset")));
161 | xPos2 -= directionButWidth - xOffset;
162 | buttonList.add(new GuiButton(axisNum + 100, xPos2, yPos + yOffset, directionButWidth, 20, "<"));
163 | xPos2 -= autoButtonWidth - xOffset;
164 | buttonList.add(new GuiButton(axisNum, xPos2, yPos + yOffset, autoButtonWidth, 20,
165 | McObfuscationHelper.lookupString("calibrationMenu.auto")));
166 |
167 | /*
168 | * buttonList.add(new GuiButton(axisNum, xPos, yPos + yOffset, autoButtonWidth, 20, McObfuscationHelper.lookupString("calibrationMenu.auto"))); buttonList.add(new GuiButton(axisNum + 100,
169 | * xPos + autoButtonWidth + xOffset, yPos + yOffset, directionButWidth, 20, "<")); buttonList.add(new GuiButton(axisNum + 200, xPos + autoButtonWidth + directionButWidth + xOffset * 2,
170 | * yPos + yOffset, resetButtonWidth, 20, McObfuscationHelper.lookupString("controls.reset"))); buttonList.add(new GuiButton(axisNum + 300, xPos + autoButtonWidth + resetButtonWidth +
171 | * directionButWidth + xOffset * 3, yPos + yOffset, directionButWidth, 20, ">"));
172 | */
173 | }
174 |
175 | return new int[]{xStart + totalWidth, yPos};
176 | }
177 | }
178 |
--------------------------------------------------------------------------------
/src/main/java/com/shiny/joypadmod/devices/JoypadMouse.java:
--------------------------------------------------------------------------------
1 | package com.shiny.joypadmod.devices;
2 |
3 | import com.shiny.joypadmod.ControllerSettings;
4 | import com.shiny.joypadmod.JoypadMod;
5 | import net.minecraft.client.Minecraft;
6 | import net.minecraft.client.gui.ScaledResolution;
7 |
8 | import com.shiny.joypadmod.event.ControllerInputEvent.EventType;
9 |
10 | public class JoypadMouse {
11 | public static int getX() {
12 | return AxisReader.x;
13 | }
14 |
15 | public static int getY() {
16 | return AxisReader.y;
17 | }
18 |
19 | public static int getmcX() {
20 | return AxisReader.mcX;
21 | }
22 |
23 | public static int getmcY() {
24 | return AxisReader.mcY;
25 | }
26 |
27 | public static void pollAxis() {
28 | AxisReader.pollAxis();
29 | }
30 |
31 | public static boolean pollAxis(boolean inGui) {
32 | AxisReader.pollAxis(inGui);
33 | return AxisReader.deltaX != 0 || AxisReader.deltaY != 0;
34 | }
35 |
36 | public static void updateXY() {
37 | AxisReader.updateXY();
38 | }
39 |
40 | public static void leftButtonDown() {
41 | if (!VirtualMouse.isButtonDown(0)) {
42 | VirtualMouse.setXY(AxisReader.mcX, AxisReader.mcY);
43 | VirtualMouse.holdMouseButton(0, true);
44 | }
45 | }
46 |
47 | public static void leftButtonUp() {
48 | if (VirtualMouse.isButtonDown(0)) {
49 | VirtualMouse.releaseMouseButton(0, true);
50 | }
51 | }
52 |
53 | public static boolean isLeftButtonDown() {
54 | return VirtualMouse.isButtonDown(0);
55 | }
56 |
57 | public static void rightButtonDown() {
58 | if (!VirtualMouse.isButtonDown(1)) {
59 | VirtualMouse.setXY(AxisReader.mcX, AxisReader.mcY);
60 | VirtualMouse.holdMouseButton(1, true);
61 | }
62 | }
63 |
64 | public static void rightButtonUp() {
65 | if (VirtualMouse.isButtonDown(1)) {
66 | VirtualMouse.releaseMouseButton(1, true);
67 | }
68 | }
69 |
70 | public static boolean isRightButtonDown() {
71 | return VirtualMouse.isButtonDown(1);
72 | }
73 |
74 | public static void UnpressButtons() {
75 | for (int i = 0; i < 2; i++) {
76 | if (VirtualMouse.isButtonDown(i))
77 | VirtualMouse.releaseMouseButton(i, true);
78 | }
79 | }
80 |
81 | public static class AxisReader {
82 | private static Minecraft mc = Minecraft.getMinecraft();
83 |
84 | // last delta movement of axis
85 | public static float deltaX;
86 | public static float deltaY;
87 |
88 | // last virtual mouse position
89 | public static int x = 0;
90 | public static int y = 0;
91 |
92 | // values that Minecraft expects when reading the actual mouse
93 | public static int mcX = 0;
94 | public static int mcY = 0;
95 |
96 | private static long lastAxisReading = 0;
97 | private static long guiPollTimeout = 30;
98 | private static long gamePollTimeout = 10;
99 | public static long last0Reading = 0;
100 | public static long lastNon0Reading = 0;
101 |
102 | public static void pollAxis() {
103 | pollAxis(mc.currentScreen != null);
104 | }
105 |
106 | // pollAxis()
107 | // this is the equivalent of moving the mouse around on your joypad
108 | // the current algorithm as of 4/6/2014
109 | // 1) get reading of axis (will be between -1.0 && 1.0)
110 | // 2) if reading of both axis == 0 exit ( note: a 0 reading will be partly determined by the deadzones )
111 | // 3) sensitivityValue = current menu/game sensitivity value (set by user)
112 | // 4) if axisReading > axisThreshold, delta = axisReading * sensitivityValue
113 | // 5) if in game && axisReading < axisThreshold / 2, delta = axisReading * sensitivityValue * 0.3
114 | // 6) if axisReading < axisThreshold, delta = axisReading * sensitivityValue * 0.5
115 | // a second modifier will apply if the axisReading > axisThreshold and is currently within the first 500ms of being pressed
116 | // this will start by halving the sensitivityValue and over the course of 500ms add an additional 10% until it is sending the full sensitivity value
117 | public static void pollAxis(boolean inGui) {
118 | if (!pollNeeded(inGui))
119 | return;
120 |
121 | float xPlus = getReading(inGui ? "joy.guiX+" : "joy.cameraX+");
122 | float xMinus = getReading(inGui ? "joy.guiX-" : "joy.cameraX-");
123 | float horizontalMovement;
124 | float horizontalThreshold;
125 | if (Math.abs(xPlus) > Math.abs(xMinus)) {
126 | horizontalMovement = xPlus;
127 | horizontalThreshold = ControllerSettings.get(inGui ? "joy.guiX+" : "joy.cameraX+").inputEvent.getThreshold();
128 | } else {
129 | horizontalMovement = xMinus;
130 | horizontalThreshold = ControllerSettings.get(inGui ? "joy.guiX-" : "joy.cameraX-").inputEvent.getThreshold();
131 | }
132 |
133 | float yPlus = getReading(inGui ? "joy.guiY+" : "joy.cameraY+");
134 | float yMinus = getReading(inGui ? "joy.guiY-" : "joy.cameraY-");
135 | float verticalMovement;
136 | float verticalThreshold;
137 | if (Math.abs(yPlus) > Math.abs(yMinus)) {
138 | verticalMovement = yPlus;
139 | verticalThreshold = ControllerSettings.get(inGui ? "joy.guiY+" : "joy.cameraY+").inputEvent.getThreshold();
140 | } else {
141 | verticalMovement = yMinus;
142 | verticalThreshold = ControllerSettings.get(inGui ? "joy.guiY-" : "joy.cameraY-").inputEvent.getThreshold();
143 | }
144 |
145 | deltaX = horizontalMovement;
146 | deltaY = verticalMovement;
147 |
148 | if (deltaX == 0 && deltaY == 0) {
149 | last0Reading = Minecraft.getSystemTime();
150 | return;
151 | }
152 | lastNon0Reading = Minecraft.getSystemTime();
153 |
154 | deltaX = calculateFinalDelta(inGui, deltaX, horizontalThreshold);
155 | deltaY = calculateFinalDelta(inGui, deltaY, verticalThreshold);
156 | if (ControllerSettings.loggingLevel > 2)
157 | JoypadMod.logger.info("Camera deltaX: " + deltaX + " Camera deltaY: " + deltaY);
158 | lastAxisReading = Minecraft.getSystemTime();
159 | }
160 |
161 | public static void updateXY() {
162 | if (!pollNeeded(mc.currentScreen != null))
163 | return;
164 |
165 | int lastReportedX = x;
166 | int lastReportedY = y;
167 |
168 | final ScaledResolution scaledResolution = JoypadMod.GetScaledResolution();
169 |
170 | pollAxis();
171 |
172 | if (mc.currentScreen != null) {
173 | x += (int) deltaX;
174 | y += (int) deltaY;
175 |
176 | if (x < 0)
177 | x = 0;
178 | if (y < 0)
179 | y = 0;
180 | if (x > scaledResolution.getScaledWidth())
181 | x = scaledResolution.getScaledWidth() - 5;
182 | if (y > scaledResolution.getScaledHeight())
183 | y = scaledResolution.getScaledHeight() - 5;
184 |
185 | if (ControllerSettings.loggingLevel > 2 &&
186 | (lastReportedX != x || lastReportedY != y))
187 | JoypadMod.logger.debug("Virtual Mouse x: " + x + " y: " + y);
188 |
189 | mcY = mc.displayHeight - (y * scaledResolution.getScaleFactor());
190 | mcX = x * scaledResolution.getScaleFactor();
191 | deltaX = 0;
192 | deltaY = 0;
193 | }
194 | }
195 |
196 | public static void centerCrosshairs() {
197 | final ScaledResolution scaledResolution = JoypadMod.GetScaledResolution();
198 |
199 | x = scaledResolution.getScaledWidth() / 2;
200 | y = scaledResolution.getScaledHeight() / 2;
201 |
202 | mcY = mc.displayHeight - (y * scaledResolution.getScaleFactor());
203 | mcX = x * scaledResolution.getScaleFactor();
204 | }
205 |
206 | public static boolean pollNeeded(boolean inGui) {
207 | return Minecraft.getSystemTime() - lastAxisReading >= (inGui ? guiPollTimeout : gamePollTimeout);
208 | }
209 |
210 | public static void setXY(int x, int y) {
211 | final ScaledResolution scaledResolution = JoypadMod.GetScaledResolution();
212 |
213 | AxisReader.x = x;
214 | AxisReader.y = y;
215 | AxisReader.mcX = x * scaledResolution.getScaleFactor();
216 | AxisReader.mcY = mc.displayHeight - (y * scaledResolution.getScaleFactor());
217 | }
218 |
219 | private static float getReading(String bindKey) {
220 | boolean isButton = ControllerSettings.get(bindKey).inputEvent.getEventType() == EventType.BUTTON;
221 |
222 | if (isButton || ControllerSettings.get(bindKey).inputEvent.pressedOnce()) {
223 | float f = ControllerSettings.get(bindKey).getAnalogReading();
224 | if (isButton && bindKey.contains("-"))
225 | f *= -1;
226 | return f;
227 | }
228 |
229 | return 0;
230 | }
231 |
232 | private static float lastReportedMultiplier = 0;
233 |
234 | private static float getModifiedMultiplier(float currentMultiplier) {
235 | long elapsed = Minecraft.getSystemTime() - last0Reading;
236 | if (elapsed < 500) {
237 | float base = currentMultiplier * 0.5f;
238 |
239 | // increase the multiplier by 10% every 100 ms
240 | currentMultiplier = base + (base * elapsed) / 500;
241 | if (ControllerSettings.loggingLevel > 2 &&
242 | lastReportedMultiplier != currentMultiplier) {
243 | JoypadMod.logger.info("CameraMultiplier " + currentMultiplier);
244 | lastReportedMultiplier = currentMultiplier;
245 | }
246 | }
247 |
248 | return currentMultiplier;
249 | }
250 |
251 | private static float calculateFinalDelta(boolean inGui, float currentDelta, float currentThreshold) {
252 | if (Math.abs(currentDelta) < 0.01)
253 | return 0;
254 |
255 | if (Math.abs(currentDelta) < Math.abs(currentThreshold / 3)) {
256 | return (currentDelta < 0 ? -1 : 1);
257 | }
258 |
259 | float cameraMultiplier = (inGui ? ControllerSettings.inMenuSensitivity
260 | : ControllerSettings.inGameSensitivity);
261 |
262 | if (!inGui && Math.abs(currentDelta) < Math.abs(currentThreshold / 2))
263 | cameraMultiplier *= 0.3;
264 | else if (Math.abs(currentDelta) < Math.abs(currentThreshold))
265 | cameraMultiplier *= 0.5;
266 | else
267 | cameraMultiplier = getModifiedMultiplier(cameraMultiplier);
268 |
269 | float finalDelta = currentDelta * cameraMultiplier;
270 |
271 | // return at minimum a 1 or -1
272 | if (finalDelta < 1.0 && finalDelta > 0.0)
273 | finalDelta = 1.0f;
274 | else if (finalDelta < 0 && finalDelta > -1.0)
275 | finalDelta = -1.0f;
276 |
277 | return finalDelta;
278 | }
279 | }
280 |
281 | }
282 |
--------------------------------------------------------------------------------
/src/main/java/com/shiny/joypadmod/event/ControllerUtils.java:
--------------------------------------------------------------------------------
1 | package com.shiny.joypadmod.event;
2 |
3 | import java.util.HashMap;
4 | import java.util.Map;
5 |
6 | import com.shiny.joypadmod.ControllerSettings;
7 | import com.shiny.joypadmod.JoypadMod;
8 | import com.shiny.joypadmod.devices.InputDevice;
9 | import com.shiny.joypadmod.devices.XInputDeviceWrapper;
10 |
11 | public class ControllerUtils {
12 | private static Map joypadNameMap;
13 | private int mappedControllerIndex;
14 |
15 | public ControllerUtils() {
16 | joypadNameMap = new HashMap<>();
17 | mappedControllerIndex = -1;
18 | }
19 |
20 | public void printDeadZones(InputDevice joystick2) {
21 | if (joystick2 != null) {
22 | for (int axisNo = 0; axisNo < joystick2.getAxisCount(); axisNo++) {
23 | JoypadMod.logger.info("Axis " + axisNo + " deadzone: " + joystick2.getDeadZone(axisNo));
24 | }
25 | }
26 | }
27 |
28 | public void printAxisNames(InputDevice joystick2) {
29 | for (int axisNo = 0; axisNo < joystick2.getAxisCount(); axisNo++) {
30 | JoypadMod.logger.info("Axis " + axisNo + ", " + joystick2.getAxisName(axisNo));
31 | }
32 | }
33 |
34 | public void printButtonNames(InputDevice joystick2) {
35 | for (int buttonNo = 0; buttonNo < joystick2.getButtonCount(); buttonNo++) {
36 | JoypadMod.logger.info("Button " + buttonNo + ", " + joystick2.getButtonName(buttonNo));
37 | }
38 | }
39 |
40 | public boolean checkJoypadRequirements(InputDevice controller, int requiredButtonCount, int requiredMinButtonCount,
41 | int requiredAxisCount) {
42 | boolean meetsRequirements = meetsInputRequirements(controller, requiredButtonCount, requiredMinButtonCount,
43 | requiredAxisCount);
44 | StringBuilder msg = new StringBuilder();
45 |
46 | if (!meetsRequirements) {
47 | msg.append("Selected controller ").append(controller.getName()).append(
48 | " has less than required number of axes or buttons \n").append("Buttons required - ").append(
49 | requiredButtonCount).append(" , detected - ").append(controller.getButtonCount()).append("\n").append(
50 | "Axes required - ").append(requiredAxisCount).append(" , detected - ").append(
51 | controller.getAxisCount()).append("\n").append(
52 | "Check settings file named 'options.txt' for the correct value of 'joyNo' parameter\n").append(
53 | "Total number of controllers detected: ").append(ControllerSettings.JoypadModInputLibrary.getControllerCount());
54 | JoypadMod.logger.info(msg.toString());
55 | }
56 | return meetsRequirements;
57 | }
58 |
59 | public boolean meetsInputRequirements(InputDevice controller, int requiredButtonCount, int requiredMinButtonCount,
60 | int requiredAxisCount) {
61 | boolean meetsRequirements = true;
62 | if ((controller.getButtonCount() < requiredMinButtonCount)
63 | || (controller.getButtonCount() < requiredButtonCount && controller.getAxisCount() < requiredAxisCount)) {
64 | meetsRequirements = false;
65 | }
66 | return meetsRequirements;
67 | }
68 |
69 | public ControllerInputEvent getLastEvent(InputDevice inputDevice, int eventIndex) {
70 | if (ControllerSettings.JoypadModInputLibrary.isEventAxis()) {
71 | if (Math.abs(ControllerUtils.getAxisValue(inputDevice, eventIndex)) > 0.75f) {
72 | return new AxisInputEvent(inputDevice.getIndex(), eventIndex, ControllerUtils.getAxisValue(inputDevice, eventIndex),
73 | inputDevice.getDeadZone(eventIndex));
74 | }
75 | } else if (ControllerSettings.JoypadModInputLibrary.isEventButton()) {
76 | int id = ControllerSettings.JoypadModInputLibrary.getEventControlIndex();
77 | if (inputDevice.isButtonPressed(id)) {
78 | return new ButtonInputEvent(inputDevice.getIndex(), id, 1);
79 | }
80 | } else if (ControllerSettings.JoypadModInputLibrary.isEventPovX()) {
81 | if (Math.abs(inputDevice.getPovX()) > 0.5f) {
82 | return new PovInputEvent(inputDevice.getIndex(), 0, inputDevice.getPovX() / 2);
83 | }
84 | } else if (ControllerSettings.JoypadModInputLibrary.isEventPovY()) {
85 | if (Math.abs(inputDevice.getPovY()) > 0.5f) {
86 | return new PovInputEvent(inputDevice.getIndex(), 1, inputDevice.getPovY() / 2);
87 | }
88 | }
89 | return null;
90 | }
91 |
92 | public String getHumanReadableInputName(InputDevice inputDevice, ControllerInputEvent inputEvent) {
93 | if (inputDevice == null || inputEvent == null) {
94 | return "NONE";
95 | }
96 | String result = null;
97 |
98 | try {
99 | setJoypadNameMap(inputDevice);
100 | result = joypadNameMap.get(inputEvent.getDescription());
101 | if (result == null && inputEvent.getDescription() != "NONE")
102 | joypadNameMap.put(inputEvent.getDescription(), inputEvent.getDescription());
103 | } catch (Exception ex) {
104 | JoypadMod.logger.error("Error in getHumanReadableInputName: " + ex.toString());
105 | }
106 |
107 | return result == null ? inputEvent.getDescription() : result;
108 | }
109 |
110 | /**
111 | * Returns true if any two controller axes read "-1" at the same time. Used to work around the issue with LWJGL which initializes axes at -1 until the axes are moved by the player.
112 | */
113 | public boolean isDeadlocked(InputDevice controller) {
114 | int numberOfNegativeAxes = 0;
115 | if (controller.getAxisCount() < 1) {
116 | return false;
117 | }
118 | for (int i = 0; i < controller.getAxisCount(); i++) {
119 | if (ControllerUtils.getAxisValue(controller, i) == -1) {
120 | numberOfNegativeAxes++;
121 | }
122 | }
123 | return numberOfNegativeAxes > 1;
124 | }
125 |
126 | public static void autoCalibrateAxis(int joyId, int axisId) {
127 | InputDevice controller = ControllerSettings.JoypadModInputLibrary.getController(joyId);
128 | controller.setDeadZone(axisId, 0);
129 | float currentValue = Math.abs(getAxisValue(controller, axisId));
130 | JoypadMod.logger.info("Axis: " + axisId + " currently has a value of: " + currentValue);
131 | float newValue = currentValue + 0.15f;
132 | controller.setDeadZone(axisId, newValue);
133 | JoypadMod.logger.info("Auto set axis " + axisId + " deadzone to " + newValue);
134 | }
135 |
136 | public static float getAxisValue(InputDevice inputDevice, int axisNum) {
137 | float rawValue = inputDevice.getAxisValue(axisNum);
138 | if (ControllerSettings.isSingleDirectionAxis(inputDevice.getIndex(), axisNum)) {
139 | return (rawValue + 1f) / 2f;
140 | }
141 | return rawValue;
142 | }
143 |
144 | public static int findYAxisIndex(int joyId) {
145 | InputDevice controller = ControllerSettings.JoypadModInputLibrary.getController(joyId);
146 | if (controller.getClass() == XInputDeviceWrapper.class)
147 | return 1;
148 | for (int i = 0; i < controller.getAxisCount(); i++) {
149 | String axisName = controller.getAxisName(i);
150 | if (axisName.equals("y") || axisName.contains("Y Axis"))
151 | return i;
152 | }
153 |
154 | return 0;
155 | }
156 |
157 | public static int findXAxisIndex(int joyId) {
158 | InputDevice controller = ControllerSettings.JoypadModInputLibrary.getController(joyId);
159 | if (controller.getClass() == XInputDeviceWrapper.class)
160 | return 0;
161 | for (int i = 0; i < controller.getAxisCount(); i++) {
162 | String axisName = controller.getAxisName(i);
163 | if (axisName.equals("x") || axisName.contains("X Axis"))
164 | return i;
165 | }
166 |
167 | return 1;
168 | }
169 |
170 | private Map buildDefaultMap(InputDevice controller) {
171 | Map retMap = new HashMap<>();
172 | if (controller.getName().toLowerCase().contains("xinput")
173 | || controller.getName().toLowerCase().contains("xusb")
174 | || controller.getName().toLowerCase().contains("xbox")) {
175 | retMap = new HashMap<>();
176 | retMap.put("Button 0", "A");
177 | retMap.put("Button 1", "B");
178 | retMap.put("Button 2", "X");
179 | retMap.put("Button 3", "Y");
180 | retMap.put("Button 4", "LB");
181 | retMap.put("Button 5", "RB");
182 | retMap.put("Button 6", "BACK");
183 | retMap.put("Button 7", "START");
184 | retMap.put("Button 8", "LS");
185 | retMap.put("Button 9", "RS");
186 | retMap.put("X Axis +", "LS Right");
187 | retMap.put("X Axis -", "LS Left");
188 | retMap.put("Y Axis +", "LS Down");
189 | retMap.put("Y Axis -", "LS Up");
190 | retMap.put("X Rotation +", "RS right");
191 | retMap.put("X Rotation -", "RS left");
192 | retMap.put("Y Rotation +", "RS down");
193 | retMap.put("Y Rotation -", "RS up");
194 | retMap.put("POV X +", "Dpad right");
195 | retMap.put("POV X -", "Dpad left");
196 | retMap.put("POV Y +", "Dpad down");
197 | retMap.put("POV Y -", "Dpad up");
198 | retMap.put("X Axis", "Left stick horizontal");
199 | retMap.put("Y Axis", "Left stick vertical");
200 | retMap.put("X Rotation", "Right stick horizontal");
201 | retMap.put("Y Rotation", "Right stick vertical");
202 | retMap.put("Z Axis", "Triggers");
203 | retMap.put("POV X", "Dpad horizontal");
204 | retMap.put("POV Y", "Dpad vertical");
205 | if (ControllerSettings.xbox6Axis.contains(controller.getIndex())) {
206 | retMap.put("Z Axis -", "LT");
207 | retMap.put("Z Axis +", "LT");
208 | retMap.put("Z Rotation -", "RT");
209 | retMap.put("Z Rotation +", "RT");
210 | } else {
211 | retMap.put("Z Axis -", "RT");
212 | retMap.put("Z Axis +", "LT");
213 | }
214 |
215 | //double check all axis / buttons in case an OS reports these differently
216 | for (int iTemp = 0; iTemp < controller.getAxisCount()
217 | + controller.getButtonCount(); iTemp++) {
218 | int i = iTemp >= controller.getAxisCount() ?
219 | iTemp - controller.getAxisCount() : iTemp;
220 | String key = iTemp < controller.getAxisCount() ?
221 | controller.getAxisName(i) : controller.getButtonName(i);
222 | if (!retMap.containsKey(key))
223 | retMap.put(key, key);
224 | }
225 | } else // unknown joystick, so create a default map
226 | {
227 | for (int iTemp = 0; iTemp < controller.getAxisCount()
228 | + controller.getButtonCount(); iTemp++) {
229 | int i = iTemp >= controller.getAxisCount() ?
230 | iTemp - controller.getAxisCount() : iTemp;
231 | String key = iTemp < controller.getAxisCount() ?
232 | controller.getAxisName(i) : controller.getButtonName(i);
233 | retMap.put(key, key);
234 | }
235 | }
236 | return retMap;
237 | }
238 |
239 | private void setJoypadNameMap(InputDevice controller) {
240 | if (controller.getIndex() != mappedControllerIndex) {
241 | joypadNameMap.clear();
242 | // check if config file has map
243 | Map newMap = ControllerSettings.config.buildStringMapFromConfig
244 | ("-ControllerNameMap-", controller.getName());
245 | if (newMap == null) {
246 | joypadNameMap = buildDefaultMap(controller);
247 | } else {
248 | joypadNameMap = newMap;
249 | }
250 | mappedControllerIndex = controller.getIndex();
251 | }
252 | }
253 |
254 | public void updateCurrentJoypadMap(String key, String value) {
255 | if (joypadNameMap != null) {
256 | // save if the key is new
257 | if (value != joypadNameMap.put(key, value))
258 | saveCurrentJoypadMap();
259 | }
260 | }
261 |
262 | public boolean saveCurrentJoypadMap() {
263 | if (mappedControllerIndex >= 0) {
264 | try {
265 | ControllerSettings.config.saveStringMap
266 | ("-ControllerNameMap-", ControllerSettings.JoypadModInputLibrary.getController(mappedControllerIndex).getName(),
267 | joypadNameMap, "Map the controller button/axis to human readable names");
268 | return true;
269 | } catch (Exception ex) {
270 | JoypadMod.logger.error("Failed trying to save joypadMap" + ex.toString());
271 | }
272 | }
273 | return false;
274 | }
275 |
276 | }
277 |
--------------------------------------------------------------------------------
/src/main/java/com/shiny/joypadmod/gui/joypad/JoypadCalibrationMenu.java:
--------------------------------------------------------------------------------
1 | package com.shiny.joypadmod.gui.joypad;
2 |
3 | import java.util.ArrayList;
4 | import java.util.List;
5 |
6 | import com.shiny.joypadmod.ControllerSettings;
7 | import com.shiny.joypadmod.JoypadMod;
8 | import com.shiny.joypadmod.devices.InputDevice;
9 | import com.shiny.joypadmod.utils.McObfuscationHelper;
10 |
11 | import net.minecraft.client.Minecraft;
12 | import net.minecraft.client.gui.FontRenderer;
13 | import net.minecraft.client.gui.GuiButton;
14 | import net.minecraft.client.gui.GuiScreen;
15 |
16 | public class JoypadCalibrationMenu extends GuiScreen {
17 | public GuiScreen parent;
18 |
19 | // bottom button parameters
20 | private int buttonYStart_bottom;
21 | private int bottomButtonWidth = 70;
22 |
23 | private int joypadIndex;
24 | private int yStart = 5;
25 | private int buttonBoxWidth = 132;
26 | public int axisBoxWidth = 300;
27 | private int povBoxWidth;
28 | private int instructionBoxWidth;
29 |
30 | private int boxSpacing = 5;
31 | private String lastControllerEvent = "";
32 |
33 | private JoypadCalibrationList calibrationList = null;
34 | private List singleDirectionAxisSaved = null;
35 |
36 | FontRenderer fr = Minecraft.getMinecraft().fontRenderer;
37 |
38 | String[] instructions = new String[]{"calibrationMenu.instructions1", "calibrationMenu.instructions2",
39 | "calibrationMenu.save"};
40 |
41 | public JoypadCalibrationMenu(GuiScreen parent, int joypadIndex) {
42 | super();
43 | this.joypadIndex = joypadIndex;
44 | this.parent = parent;
45 | // create a copy of the currently saved SDA to compare when exiting
46 | singleDirectionAxisSaved = new ArrayList<>(ControllerSettings.getSingleDirectionAxis(joypadIndex));
47 | }
48 |
49 | @Override
50 | public void onGuiClosed() {
51 | ControllerSettings.applySavedDeadZones(joypadIndex);
52 | super.onGuiClosed();
53 | }
54 |
55 | @Override
56 | public void initGui() {
57 |
58 | povBoxWidth = fr.getStringWidth("PovX: -10.00");
59 | instructionBoxWidth = 0;
60 | for (String instruction : instructions) {
61 | int newWidth = fr.getStringWidth(McObfuscationHelper.lookupString(instruction));
62 | if (newWidth > instructionBoxWidth)
63 | instructionBoxWidth = newWidth;
64 | }
65 | instructionBoxWidth += fr.getStringWidth("1: ") + 10;
66 |
67 | Math.max(5, width / 2 - ((axisBoxWidth + instructionBoxWidth + boxSpacing) / 2));
68 |
69 | buttonYStart_bottom = height - 20;
70 |
71 | int xPos = width / 2 - bottomButtonWidth / 2;
72 |
73 | GuiButton doneButton = new GuiButton(500, xPos, buttonYStart_bottom, bottomButtonWidth, 20, McObfuscationHelper.lookupString("gui.cancel"));
74 |
75 | // these buttons will be moved if we display axis values
76 | if (joypadIndex != -1 && ControllerSettings.JoypadModInputLibrary.getController(joypadIndex).getAxisCount() > 0) {
77 | int listStartY = (instructions.length + 3) * fr.FONT_HEIGHT + 20;
78 | int entryHeight = 32;
79 |
80 | calibrationList = new JoypadCalibrationList(Minecraft.getMinecraft(), width, height, listStartY,
81 | height - 25, 0, entryHeight, joypadIndex, this);
82 |
83 | xPos -= bottomButtonWidth / 2;
84 | buttonList.add(new GuiButton(400, xPos, buttonYStart_bottom, bottomButtonWidth, 20,
85 | McObfuscationHelper.lookupString("calibrationMenu.save")));
86 | xPos += bottomButtonWidth;
87 | doneButton.x += bottomButtonWidth / 2;
88 | doneButton.displayString = McObfuscationHelper.lookupString("gui.cancel");
89 | }
90 |
91 | buttonList.add(doneButton);
92 |
93 | }
94 |
95 | @Override
96 | protected void mouseClicked(int par1, int par2, int par3) {
97 | try {
98 | super.mouseClicked(par1, par2, par3);
99 | } catch (java.io.IOException e) {
100 | }
101 | if (calibrationList == null)
102 | return;
103 |
104 | for (GuiButton guiButton : calibrationList.buttonList) {
105 | if (guiButton.mousePressed(Minecraft.getMinecraft(), par1, par2)) {
106 | calibrationList.actionPerformed(guiButton);
107 | break;
108 | }
109 | }
110 | }
111 |
112 | @Override
113 | protected void actionPerformed(GuiButton guiButton) {
114 | JoypadMod.logger.info("Action performed on buttonID " + guiButton.id);
115 |
116 | switch (guiButton.id) {
117 | case 400: // Save
118 | singleDirectionAxisSaved = new ArrayList<>(ControllerSettings.getSingleDirectionAxis(joypadIndex));
119 | InputDevice controller = ControllerSettings.JoypadModInputLibrary.getController(joypadIndex);
120 | ControllerSettings.saveDeadZones(controller);
121 | ControllerSettings.saveSingleDirectionAxis(controller);
122 | buttonList.get(1).displayString = McObfuscationHelper.lookupString("gui.done");
123 | break;
124 | case 500: // Done
125 | if (joypadIndex >= 0) {
126 | List singleDirectionAxisExit = ControllerSettings.getSingleDirectionAxis(joypadIndex);
127 | // revert singleDirectionAxis toggles if it wasn't saved
128 | for (int i = 0; i < ControllerSettings.JoypadModInputLibrary.getController(joypadIndex).getAxisCount(); i++) {
129 | if (singleDirectionAxisSaved.contains(i) != singleDirectionAxisExit.contains(i))
130 | ControllerSettings.toggleSingleDirectionAxis(joypadIndex, i);
131 | }
132 | }
133 |
134 | mc.displayGuiScreen(this.parent);
135 | break;
136 | }
137 | }
138 |
139 | @Override
140 | public void drawScreen(int par1, int par2, float par3) {
141 | drawDefaultBackground();
142 |
143 | if (calibrationList != null)
144 | calibrationList.drawScreen(par1, par2, par3);
145 |
146 | int ySpace = fr.FONT_HEIGHT;
147 | String title = McObfuscationHelper.lookupString("controlMenu.calibrate");
148 | InputDevice controller = null;
149 | if (joypadIndex != -1) {
150 | controller = ControllerSettings.JoypadModInputLibrary.getController(joypadIndex);
151 | title += " - " + controller.getName();
152 | }
153 |
154 | write(yStart, fr.trimStringToWidth(title, width - 2));
155 |
156 | if (joypadIndex == -1) {
157 | write(yStart + ySpace * 2, McObfuscationHelper.lookupString("controlMenu.noControllers"));
158 | } else if (ControllerSettings.JoypadModInputLibrary.getController(joypadIndex).getAxisCount() <= 0) {
159 | write(yStart + ySpace * 2, McObfuscationHelper.lookupString("controlMenu.axis") + "# 0!");
160 | } else {
161 | // readLastControllerEvent();
162 | // write(yStart + (int) (ySpace * 1.5), "Last Controller Event: " + lastControllerEvent, 0xAAAAAA);
163 |
164 | int yPos = yStart + ySpace * 2 + 2;
165 | drawInstructions(width / 2 - instructionBoxWidth / 2, yPos, ySpace, instructionBoxWidth);
166 |
167 | // int xyEndLeftDown[] = drawButtons(xStart, xyEndLeft[1] + boxSpacing + 2, ySpace);
168 |
169 | }
170 |
171 | super.drawScreen(par1, par2, par3);
172 | }
173 |
174 | public void drawBoxWithText(int xStart, int yStart, int xEnd, int yEnd, String title, int boxColor, int textColor) {
175 | boxColor = -1; // can't seem to get any boxes other than white
176 | textColor = 0xFFAA00;
177 | int stringWidth = fr.getStringWidth(title);
178 | int xPos = xStart + ((xEnd - xStart) / 2) - (stringWidth / 2);
179 |
180 | this.drawHorizontalLine(xStart, xPos, yStart, boxColor);
181 | int yTitleOffset = (fr.FONT_HEIGHT / 2) + (fr.getUnicodeFlag() ? 1 : -1);
182 | this.write(xPos + 2, yStart - yTitleOffset, title, textColor);
183 | xPos += stringWidth + 2;
184 | this.drawHorizontalLine(xPos, xEnd, yStart, boxColor);
185 | this.drawVerticalLine(xStart, yStart, yEnd, boxColor);
186 | this.drawHorizontalLine(xStart, xEnd, yEnd, boxColor);
187 | this.drawVerticalLine(xEnd, yStart, yEnd, boxColor);
188 | }
189 |
190 | private int[] drawInstructions(int xStart, int yStart, int ySpace, int totalWidth) {
191 | int yPos = yStart;
192 |
193 | String title = McObfuscationHelper.lookupString("calibrationMenu.instructionsTitle");
194 | int yEnd = yStart + ((instructions.length + 1) * ySpace);
195 | drawBoxWithText(xStart, yStart, xStart + totalWidth, yEnd, title, 0xAA0000, 0x0000AA);
196 |
197 | yPos += 7;
198 | xStart += 5;
199 |
200 | for (int i = 0; i < instructions.length; i++, yPos += ySpace) {
201 | String text = String.format("%s: %s", i + 1, McObfuscationHelper.lookupString(instructions[i]));
202 | int strWidth = fr.getStringWidth(text);
203 | write((totalWidth - 5) / 2 + xStart - strWidth / 2, yPos, text);
204 | }
205 |
206 | return new int[]{xStart + totalWidth, yEnd};
207 | }
208 |
209 | private void write(int yPos, String text) {
210 | write(yPos, text, -1);
211 | }
212 |
213 | private void write(int yPos, String text, int fontColor) {
214 | this.drawCenteredString(fr, text, width / 2, yPos, fontColor);
215 | }
216 |
217 | public void write(int xPos, int yPos, String text) {
218 | write(xPos, yPos, text, -1);
219 | }
220 |
221 | public void write(int xPos, int yPos, String text, int fontColor) {
222 | this.drawString(fr, text, xPos, yPos, fontColor);
223 | }
224 |
225 | public void drawHorizontalLine(int par1, int par2, int par3, int par4) {
226 | super.drawHorizontalLine(par1, par2, par3, par4);
227 | }
228 |
229 | public void drawVerticalLine(int par1, int par2, int par3, int par4) {
230 | super.drawVerticalLine(par1, par2, par3, par4);
231 | }
232 |
233 | private void readLastControllerEvent() {
234 | try {
235 | InputDevice controller = ControllerSettings.JoypadModInputLibrary.getController(this.joypadIndex);
236 | while (ControllerSettings.JoypadModInputLibrary.next() && ControllerSettings.JoypadModInputLibrary.getEventSource() == controller) {
237 | if (ControllerSettings.JoypadModInputLibrary.isEventAxis()) {
238 | lastControllerEvent = controller.getAxisName(ControllerSettings.JoypadModInputLibrary.getEventControlIndex());
239 | } else if (ControllerSettings.JoypadModInputLibrary.isEventButton()) {
240 | lastControllerEvent = controller.getButtonName(ControllerSettings.JoypadModInputLibrary.getEventControlIndex());
241 | } else if (ControllerSettings.JoypadModInputLibrary.isEventPovX()) {
242 | lastControllerEvent = "PovX";
243 | } else if (ControllerSettings.JoypadModInputLibrary.isEventPovY()) {
244 | lastControllerEvent = "PovY";
245 | } else {
246 | lastControllerEvent = "Unknown controller event with index: " + ControllerSettings.JoypadModInputLibrary.getEventControlIndex();
247 | }
248 | }
249 | } catch (Exception ex) {
250 | lastControllerEvent = ex.toString();
251 | }
252 | }
253 |
254 | private int[] drawButtons(int xStart, int yStart, int ySpace) {
255 | InputDevice controller = ControllerSettings.JoypadModInputLibrary.getController(joypadIndex);
256 | int yPos = yStart;
257 | int maxButtons = 13;
258 | int butWidth = buttonBoxWidth;
259 | int numStrings = Math.min(controller.getButtonCount(), maxButtons);
260 |
261 | String title = "Buttons";
262 | int yEnd = yStart + ((numStrings + 3) * ySpace);
263 | drawBoxWithText(xStart, yStart, xStart + butWidth, yEnd, title, 0xAA0000, 0x0000AA);
264 | yPos += 7;
265 | xStart += 7;
266 |
267 | for (int i = 0; i < numStrings; i++, yPos += ySpace) {
268 | int maxSize = fr.getStringWidth(title + " 10");
269 | String stringOut = fr.trimStringToWidth(controller.getButtonName(i), maxSize);
270 | String output = stringOut + ": " + (controller.isButtonPressed(i) ? "Pressed" : "Not pressed");
271 | write(xStart, yPos, output);
272 | }
273 | drawPov(xStart, yPos, ySpace);
274 | return new int[]{xStart + butWidth, yEnd};
275 | }
276 |
277 | private int[] drawPov(int xStart, int yStart, int ySpace) {
278 | InputDevice controller = ControllerSettings.JoypadModInputLibrary.getController(joypadIndex);
279 | int yPos = yStart;
280 | int butWidth = povBoxWidth;
281 | int numStrings = 2;
282 | // String title = "Pov";
283 | int yEnd = yStart + ((numStrings + 1) * ySpace);
284 | // drawBoxWithText(xStart, yStart, xStart + butWidth, yEnd, title, 0xAA0000, 0x0000AA);
285 | // yPos += 7;
286 | // xStart += 7;
287 |
288 | for (int i = 0; i < numStrings; i++, yPos += ySpace) {
289 | String output = i == 0 ? "PovX: " + controller.getPovX() : "PovY: " + controller.getPovY();
290 | write(xStart, yPos, output);
291 | }
292 |
293 | return new int[]{xStart + butWidth, yEnd};
294 | }
295 | }
296 |
--------------------------------------------------------------------------------