diff --git a/gradle.properties b/gradle.properties index 83a3b37..f734825 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,9 +1,9 @@ org.gradle.jvmargs=-Xmx1G org.gradle.parallel=true -minecraft_version=1.19.4 -yarn_mappings=1.19.4+build.2 -loader_version=0.14.19 +minecraft_version=1.20 +yarn_mappings=1.20+build.1 +loader_version=0.14.21 mod_version=1.2.0 maven_group=party._2a03.mc archives_base_name=minecraft-tweaks-2a03 -fabric_version=0.79.0+1.19.4 +fabric_version=0.83.0+1.20 diff --git a/src/main/java/party/_2a03/mc/command/ConfigCommand.java b/src/main/java/party/_2a03/mc/command/ConfigCommand.java index 200248c..5a110ef 100644 --- a/src/main/java/party/_2a03/mc/command/ConfigCommand.java +++ b/src/main/java/party/_2a03/mc/command/ConfigCommand.java @@ -17,9 +17,9 @@ public class ConfigCommand { ServerCommandSource source = ctx.getSource(); try { Config.loadConfig(); - source.sendFeedback(Text.of("Reloaded the configuration"), true); + source.sendFeedback(() -> Text.of("Reloaded the configuration"), true); } catch(Exception e) { - source.sendFeedback(Text.of("Failed to reload the configuration"), true); + source.sendFeedback(() -> Text.of("Failed to reload the configuration"), true); } return 1; })); diff --git a/src/main/java/party/_2a03/mc/command/FlyCommand.java b/src/main/java/party/_2a03/mc/command/FlyCommand.java index def8ea5..2ed8f21 100644 --- a/src/main/java/party/_2a03/mc/command/FlyCommand.java +++ b/src/main/java/party/_2a03/mc/command/FlyCommand.java @@ -13,7 +13,7 @@ public class FlyCommand { dispatcher.register(CommandManager.literal("fly").executes(ctx -> { ServerCommandSource source = ctx.getSource(); if (Config.getBool("disableFlyCommand")) { - source.sendFeedback(Text.of("The /fly command is disabled"), true); + source.sendFeedback(() -> Text.of("The /fly command is disabled"), true); return 0; } ServerPlayerEntity sender = source.getPlayer(); @@ -21,9 +21,9 @@ public class FlyCommand { boolean flight = abilities.allowFlying; abilities.allowFlying = !flight; if (!flight) - source.sendFeedback(Text.of("I wanna fly like an eagle... to the sea!"), true); + source.sendFeedback(() -> Text.of("I wanna fly like an eagle... to the sea!"), true); else { - source.sendFeedback(Text.of("Flight disabled"), true); + source.sendFeedback(() -> Text.of("Flight disabled"), true); abilities.flying = false; } sender.sendAbilitiesUpdate(); diff --git a/src/main/java/party/_2a03/mc/command/HatCommand.java b/src/main/java/party/_2a03/mc/command/HatCommand.java index c3ff6ac..e2a3a2c 100644 --- a/src/main/java/party/_2a03/mc/command/HatCommand.java +++ b/src/main/java/party/_2a03/mc/command/HatCommand.java @@ -17,7 +17,7 @@ public class HatCommand { ItemStack head = sender.getEquippedStack(EquipmentSlot.HEAD); sender.equipStack(EquipmentSlot.MAINHAND, head); sender.equipStack(EquipmentSlot.HEAD, mainhand); - source.sendFeedback(Text.of("Swapped items between main hand and head"), false); + source.sendFeedback(() -> Text.of("Swapped items between main hand and head"), false); return 1; })); } diff --git a/src/main/java/party/_2a03/mc/command/HeadCommand.java b/src/main/java/party/_2a03/mc/command/HeadCommand.java index 3447e0a..e94590f 100644 --- a/src/main/java/party/_2a03/mc/command/HeadCommand.java +++ b/src/main/java/party/_2a03/mc/command/HeadCommand.java @@ -29,7 +29,7 @@ public class HeadCommand { ItemEntity itementity = sender.dropItem(itemstack, false); itementity.resetPickupDelay(); itementity.setOwner(sender.getUuid()); - source.sendFeedback(Text.of("Player head has been given"), false); + source.sendFeedback(() -> Text.of("Player head has been given"), false); return 1; } } diff --git a/src/main/java/party/_2a03/mc/command/HomeCommand.java b/src/main/java/party/_2a03/mc/command/HomeCommand.java index a23e631..d49d3d5 100644 --- a/src/main/java/party/_2a03/mc/command/HomeCommand.java +++ b/src/main/java/party/_2a03/mc/command/HomeCommand.java @@ -21,11 +21,11 @@ public class HomeCommand { ServerPlayerEntity sender = source.getPlayer(); PlayerPosition position = Database.getPlayer(sender.getUuid().toString()).getHome(); if (position.registrykey == null) { - source.sendFeedback(Text.of("Home not found, do /home set"), false); + source.sendFeedback(() -> Text.of("Home not found, do /home set"), false); return -1; } sender.teleport(sender.getServer().getWorld(position.registrykey), position.x, position.y, position.z, position.yaw, position.pitch); - source.sendFeedback(Text.of("Teleported to home"), true); + source.sendFeedback(() -> Text.of("Teleported to home"), true); return 1; }); @@ -41,7 +41,7 @@ public class HomeCommand { RegistryKey registrykey = sender.getWorld().getRegistryKey(); PlayerPosition location = new PlayerPosition(x, y, z, yaw, pitch, registrykey); playerdata.setHome(location); - source.sendFeedback(Text.of("Your home has been updated"), true); + source.sendFeedback(() -> Text.of("Your home has been updated"), true); return 1; })); @@ -60,7 +60,7 @@ public class HomeCommand { RegistryKey registrykey = sender.getWorld().getRegistryKey(); PlayerPosition location = new PlayerPosition(x, y, z, yaw, pitch, registrykey); playerdata.setHome(location); - source.sendFeedback(Text.of("User's home has been updated (" + uuid.toString() + ")"), true); + source.sendFeedback(() -> Text.of("User's home has been updated (" + uuid.toString() + ")"), true); return 1; }))); diff --git a/src/main/java/party/_2a03/mc/command/NameCommand.java b/src/main/java/party/_2a03/mc/command/NameCommand.java index 0e7613c..41def3f 100644 --- a/src/main/java/party/_2a03/mc/command/NameCommand.java +++ b/src/main/java/party/_2a03/mc/command/NameCommand.java @@ -25,7 +25,7 @@ public class NameCommand { ServerPlayerEntity sender = source.getPlayer(); PlayerData playerdata = Database.getPlayer(uuid); playerdata.setName(StringArgumentType.getString(ctx, "name")); - source.sendFeedback(Text.of("User's name has been updated (" + uuid.toString() + ")"), true); + source.sendFeedback(() -> Text.of("User's name has been updated (" + uuid.toString() + ")"), true); return 1; }))))); } diff --git a/src/main/java/party/_2a03/mc/command/SkinCommand.java b/src/main/java/party/_2a03/mc/command/SkinCommand.java index 6d2d047..331ce25 100644 --- a/src/main/java/party/_2a03/mc/command/SkinCommand.java +++ b/src/main/java/party/_2a03/mc/command/SkinCommand.java @@ -34,16 +34,16 @@ public class SkinCommand { skinsig = read.readLine(); read.close(); } catch (IOException e) { - source.sendFeedback(Text.of("Failed to access skin"), false); + source.sendFeedback(() -> Text.of("Failed to access skin"), false); return 1; } if (!magic.equals("SKIN:1") || skinval == null || skinsig == null) { - source.sendFeedback(Text.of("Invalid skin"), false); + source.sendFeedback(() -> Text.of("Invalid skin"), false); return 1; } UUID uuid = UUID.fromString(StringArgumentType.getString(ctx, "UUID")); Database.getPlayer(uuid).setTextures(skinval, skinsig); - source.sendFeedback(Text.of("User's skin has been updated (" + uuid.toString() + ")"), true); + source.sendFeedback(() -> Text.of("User's skin has been updated (" + uuid.toString() + ")"), true); return 1; })))); diff --git a/src/main/java/party/_2a03/mc/command/SpawnCommand.java b/src/main/java/party/_2a03/mc/command/SpawnCommand.java index 3de3ea3..ff39c42 100644 --- a/src/main/java/party/_2a03/mc/command/SpawnCommand.java +++ b/src/main/java/party/_2a03/mc/command/SpawnCommand.java @@ -18,14 +18,14 @@ public class SpawnCommand { PlayerPosition position = new PlayerPosition(Config.getData("spawn")); if (position.registrykey == null) { if (source.hasPermissionLevel(2)) { - source.sendFeedback(Text.of("Spawn not found, do /spawn set"), false); + source.sendFeedback(() -> Text.of("Spawn not found, do /spawn set"), false); } else { - source.sendFeedback(Text.of("Spawn not found, ask an admin to set it"), false); + source.sendFeedback(() -> Text.of("Spawn not found, ask an admin to set it"), false); } return -1; } sender.teleport(sender.getServer().getWorld(position.registrykey), position.x, position.y, position.z, position.yaw, position.pitch); - source.sendFeedback(Text.of("Teleported to the spawn point"), true); + source.sendFeedback(() -> Text.of("Teleported to the spawn point"), true); return 1; }); @@ -42,7 +42,7 @@ public class SpawnCommand { RegistryKey registrykey = sender.getWorld().getRegistryKey(); PlayerPosition location = new PlayerPosition(x, y, z, yaw, pitch, registrykey); Config.setData("spawn", location.getJSON()); - source.sendFeedback(Text.of("Spawn has been set"), true); + source.sendFeedback(() -> Text.of("Spawn has been set"), true); return 1; })); diff --git a/src/main/java/party/_2a03/mc/mixin/MixinGameModeCommand.java b/src/main/java/party/_2a03/mc/mixin/MixinGameModeCommand.java index e59a55c..a8bf9d2 100644 --- a/src/main/java/party/_2a03/mc/mixin/MixinGameModeCommand.java +++ b/src/main/java/party/_2a03/mc/mixin/MixinGameModeCommand.java @@ -17,7 +17,7 @@ public class MixinGameModeCommand { @Inject(method = "execute", at = @At("HEAD")) private static void OnExecute(CommandContext context, Collection targets, GameMode gameMode, CallbackInfoReturnable cir) { if (gameMode == GameMode.CREATIVE) { - context.getSource().sendFeedback(Text.of(" Creative mode? What are you, a cheater?"), false); + context.getSource().sendFeedback(() -> Text.of(" Creative mode? What are you, a cheater?"), false); } return; } diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index f5efa1e..4278b47 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -23,9 +23,9 @@ "minecraft-tweaks-2a03.mixins.json" ], "depends": { - "fabricloader": ">=0.14.19", + "fabricloader": ">=0.14.21", "fabric-api": "*", - "minecraft": "1.19.4", + "minecraft": "~1.20", "java": ">=17" } }