Skip to content

Commit 3dce8f6

Browse files
committed
[Port] Update to 1.21.10 (v2.7.0)
1 parent 0007cb1 commit 3dce8f6

File tree

9 files changed

+34
-28
lines changed

9 files changed

+34
-28
lines changed

common/src/main/java/com/gitlab/cdagaming/craftpresence/config/gui/MainGui.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import com.gitlab.cdagaming.unilib.utils.gui.widgets.ScrollableTextWidget;
3535
import io.github.cdagaming.unicore.utils.StringUtils;
3636
import net.minecraft.client.gui.screens.Screen;
37+
import net.minecraft.client.input.KeyEvent;
3738

3839
public class MainGui extends ConfigurationGui<Config> {
3940
private final Config INSTANCE, DEFAULTS;
@@ -232,11 +233,11 @@ calc2, getButtonY(currentY),
232233
}
233234

234235
@Override
235-
public boolean keyPressed(int keyCode, int mouseX, int mouseY) {
236-
if (isEscapeKey(keyCode) && getCurrentData().hasChanged()) {
236+
public boolean keyPressed(KeyEvent keyEvent) {
237+
if (isEscapeKey(keyEvent.input()) && getCurrentData().hasChanged()) {
237238
syncData();
238239
}
239-
return super.keyPressed(keyCode, mouseX, mouseY);
240+
return super.keyPressed(keyEvent);
240241
}
241242

242243
@Override

common/src/main/java/com/gitlab/cdagaming/craftpresence/utils/CommandUtils.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
import com.gitlab.cdagaming.unilib.impl.TranslationManager;
4747
import com.gitlab.cdagaming.unilib.utils.GameUtils;
4848
import com.gitlab.cdagaming.unilib.utils.KeyUtils;
49+
import com.gitlab.cdagaming.unilib.utils.ResourceUtils;
4950
import com.gitlab.cdagaming.unilib.utils.gui.RenderUtils;
5051
import com.gitlab.cdagaming.unilib.utils.gui.integrations.ExtendedScreen;
5152
import com.jagrosh.discordipc.entities.DiscordBuild;
@@ -479,7 +480,7 @@ public static void registerKeybinds() {
479480
"configKeyCode",
480481
"key.craftpresence.config_keycode.name",
481482
Constants.TRANSLATOR::translate,
482-
"key.category.craftpresence.controls",
483+
ResourceUtils.getResource(Constants.MOD_ID, "controls"),
483484
Constants.TRANSLATOR::translate,
484485
CraftPresence.CONFIG.accessibilitySettings.getDefaults().configKeyCode,
485486
CraftPresence.CONFIG.accessibilitySettings.configKeyCode,

common/src/main/java/com/gitlab/cdagaming/craftpresence/utils/entity/EntityUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,13 +280,13 @@ public void getInternalData() {
280280
if (CraftPresence.SERVER.isEnabled()) {
281281
for (PlayerInfo playerInfo : CraftPresence.SERVER.currentPlayerList) {
282282
if (playerInfo != null) {
283-
final String uuidString = playerInfo.getProfile().getId().toString();
283+
final String uuidString = playerInfo.getProfile().id().toString();
284284
if (!StringUtils.isNullOrEmpty(uuidString)) {
285285
if (!ENTITY_NAMES.contains(uuidString)) {
286286
ENTITY_NAMES.add(uuidString);
287287
}
288288
if (!PLAYER_BINDINGS.containsKey(uuidString)) {
289-
PLAYER_BINDINGS.put(uuidString, playerInfo.getProfile().getName());
289+
PLAYER_BINDINGS.put(uuidString, playerInfo.getProfile().name());
290290
}
291291
}
292292
}

common/src/main/java/com/gitlab/cdagaming/craftpresence/utils/gui/impl/CommandsGui.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
import com.gitlab.cdagaming.unilib.utils.gui.widgets.TextDisplayWidget;
3939
import io.github.cdagaming.unicore.utils.FileUtils;
4040
import io.github.cdagaming.unicore.utils.StringUtils;
41+
import net.minecraft.client.input.KeyEvent;
4142

4243
import java.io.BufferedWriter;
4344
import java.io.File;
@@ -488,14 +489,14 @@ private void checkCommands() {
488489
}
489490

490491
@Override
491-
public boolean keyPressed(int keyCode, int mouseX, int mouseY) {
492+
public boolean keyPressed(KeyEvent keyEvent) {
492493
if (!blockInteractions) {
493494
if (commandInput.isControlFocused()) {
494-
if (isEscapeKey(keyCode)) {
495+
if (isEscapeKey(keyEvent.input())) {
495496
commandInput.setControlFocused(false);
496497
} else {
497498
if (canAcceptCommand()) {
498-
if (keyCode == getKeyByVersion(15, 258) && !tabCompletions.isEmpty()) { // Tab Key Event
499+
if (keyEvent.input() == getKeyByVersion(15, 258) && !tabCompletions.isEmpty()) { // Tab Key Event
499500
if (commandArgs.length > 1 && (filteredCommandArgs[filteredCommandArgs.length - 1].length() > 1 ||
500501
filteredCommandArgs[filteredCommandArgs.length - 1].equalsIgnoreCase("?")
501502
)) {
@@ -504,14 +505,14 @@ public boolean keyPressed(int keyCode, int mouseX, int mouseY) {
504505
);
505506
commandInput.setControlMessage(commandString);
506507
}
507-
} else if (keyCode == getKeyByVersion(28, 257) || keyCode == getKeyByVersion(156, 335)) { // Enter Key Event
508+
} else if (keyEvent.input() == getKeyByVersion(28, 257) || keyEvent.input() == getKeyByVersion(156, 335)) { // Enter Key Event
508509
acceptCommand();
509510
}
510511
}
511-
return commandInput.keyPressed(keyCode, mouseX, mouseY);
512+
return commandInput.keyPressed(keyEvent);
512513
}
513514
}
514-
return super.keyPressed(keyCode, mouseX, mouseY);
515+
return super.keyPressed(keyEvent);
515516
}
516517
return false;
517518
}
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"pack": {
33
"description": "${mod_name} Resources",
4-
"pack_format": 64
4+
"min_format": [65, 0],
5+
"max_format": [69, 0]
56
}
67
}
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"pack": {
33
"description": "${mod_name} Resources",
4-
"pack_format": 64
4+
"min_format": [65, 0],
5+
"max_format": [69, 0]
56
}
67
}

gradle.properties

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,29 +13,29 @@ isJarMod=false
1313
# Mapping Info
1414
mc_mappings=
1515
mc_mappings_type=mojmap
16-
mc_version=1.21.8
17-
mc_protocol=772
16+
mc_version=1.21.10
17+
mc_protocol=773
1818
display_version=
1919
# Fabric Info
20-
fabric_api_version=0.134.0+1.21.8
21-
fabric_game_version_range=>=1.21.7 <1.21.9
20+
fabric_api_version=0.134.1+1.21.10
21+
fabric_game_version_range=>=1.21.9 <1.21.11
2222
fabric_loader_version_range=>=0.12.0
2323
additional_fabric_loaders=quilt
2424
# Forge Info
25-
forge_version=58.1.0
26-
fml_version_range=[57,)
27-
forge_game_version_range=[1.21.7, 1.21.9)
28-
forge_loader_version_range=[57.0.0,)
25+
forge_version=60.0.0
26+
fml_version_range=[59,)
27+
forge_game_version_range=[1.21.9, 1.21.11)
28+
forge_loader_version_range=[59.0.0,)
2929
# NeoForge Info
30-
neoforge_version=47
30+
neoforge_version=0-beta
3131
neo_fml_version_range=[1.0,)
32-
neoforge_game_version_range=[1.21.7, 1.21.9)
33-
neoforge_loader_version_range=[21.7.0-beta,)
32+
neoforge_game_version_range=[1.21.9, 1.21.11)
33+
neoforge_loader_version_range=[21.9.0-beta,)
3434
# Deployment Info
3535
versionId=2.7.0
3636
deploymentType=Release
3737
versionLabel=Release
38-
additional_mc_versions=1.21.7
38+
additional_mc_versions=1.21.9
3939
# Integration Info
4040
source_java_version=21
4141
build_java_version=21

neoforge/src/main/java/com/gitlab/cdagaming/craftpresence/neoforge/CraftPresenceNeoForge.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public CraftPresenceNeoForge() {
4646
throw new UnsupportedOperationException("Incompatible JVM!!! @MOD_NAME@ requires Java 8 or above to work properly!");
4747
}
4848

49-
if (FMLEnvironment.dist.isClient()) {
49+
if (FMLEnvironment.getDist().isClient()) {
5050
ClientExtensions.Setup();
5151
new CraftPresence(this::setupIntegrations);
5252
} else {
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"pack": {
33
"description": "${mod_name} Resources",
4-
"pack_format": 64
4+
"min_format": [65, 0],
5+
"max_format": [69, 0]
56
}
67
}

0 commit comments

Comments
 (0)