From 747725fa16dbe2163a9d785e91f50cb49583452f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nelson=20Gra=C3=A7a?= Date: Thu, 17 Sep 2026 16:07:32 +0100 Subject: [PATCH] Adding 26.3 support --- gradle/wrapper/gradle-wrapper.properties | 2 +- settings.gradle.kts | 2 +- .../mixin/modules/sign/FormatSignMixin.java | 19 +++++++++++++++++++ .../experiments/commands/RocketCommand.java | 3 +++ .../miscellaneous/commands/NudgeCommand.java | 4 +++- .../solstice/modules/sign/SignModule.java | 12 ++++++++++-- .../formatters/AdvancementFormatter.java | 18 +++++++++++++----- .../modules/sudo/commands/DoAsCommand.java | 2 ++ .../modules/sudo/commands/SudoCommand.java | 8 +++++--- stonecutter.properties.toml | 18 ++++++++++++++++-- 10 files changed, 73 insertions(+), 15 deletions(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 5dd3c012..c42672d9 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.7.1-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/settings.gradle.kts b/settings.gradle.kts index 0f0835fa..6a6ff3d8 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -20,7 +20,7 @@ plugins { stonecutter { create(rootProject) { - versions("1.21.1", "1.21.4", "1.21.11", "26.2") + versions("1.21.1", "1.21.4", "1.21.11", "26.2", "26.3") vcsVersion = "1.21.1" } } diff --git a/src/main/java/me/alexdevs/solstice/mixin/modules/sign/FormatSignMixin.java b/src/main/java/me/alexdevs/solstice/mixin/modules/sign/FormatSignMixin.java index 98f78377..fafe99bf 100644 --- a/src/main/java/me/alexdevs/solstice/mixin/modules/sign/FormatSignMixin.java +++ b/src/main/java/me/alexdevs/solstice/mixin/modules/sign/FormatSignMixin.java @@ -10,6 +10,7 @@ import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; import java.util.List; @@ -17,6 +18,22 @@ @Mixin(SignBlockEntity.class) public abstract class FormatSignMixin { + //? if >= 26.3 { + /*@Inject(method = "updateSignText", at = @At("TAIL")) + private void solstice$formatSignText(Player player, net.minecraft.world.level.block.entity.SignTextSlot slot, List lines, CallbackInfo ci) { + if (ModuleProvider.SIGN.canFormatSign(player)) { + try { + var self = (SignBlockEntity) (Object) this; + var current = self.getText(slot); + var formatted = SignModule.formatSign(lines, current); + self.setText(formatted, slot); + } catch (Exception e) { + Solstice.LOGGER.error("Something went wrong while formatting a sign!", e); + } + } + } + *///? } else { + @Inject(method = "setMessages", at = @At("HEAD"), cancellable = true) private void solstice$formatSignText(Player player, List messages, SignText text, CallbackInfoReturnable cir) { if (ModuleProvider.SIGN.canFormatSign(player)) { @@ -28,4 +45,6 @@ public abstract class FormatSignMixin { } } } + //? } + } diff --git a/src/main/java/me/alexdevs/solstice/modules/experiments/commands/RocketCommand.java b/src/main/java/me/alexdevs/solstice/modules/experiments/commands/RocketCommand.java index 77522c63..65a3b94c 100644 --- a/src/main/java/me/alexdevs/solstice/modules/experiments/commands/RocketCommand.java +++ b/src/main/java/me/alexdevs/solstice/modules/experiments/commands/RocketCommand.java @@ -69,6 +69,9 @@ private int execute(CommandContext context, String flags) th } player.push(0, power, 0); + //? >= 26.3 + //player.syncVelocity = true; + //? < 26.3 player.hurtMarked = true; } diff --git a/src/main/java/me/alexdevs/solstice/modules/miscellaneous/commands/NudgeCommand.java b/src/main/java/me/alexdevs/solstice/modules/miscellaneous/commands/NudgeCommand.java index 66aa76e6..e7bef486 100644 --- a/src/main/java/me/alexdevs/solstice/modules/miscellaneous/commands/NudgeCommand.java +++ b/src/main/java/me/alexdevs/solstice/modules/miscellaneous/commands/NudgeCommand.java @@ -13,7 +13,6 @@ import net.minecraft.commands.arguments.EntityArgument; import net.minecraft.server.level.ServerPlayer; import net.minecraft.sounds.SoundEvents; -import net.minecraft.sounds.SoundSource; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.phys.Vec3; @@ -56,6 +55,9 @@ private int execute(CommandContext context, float power, boo var vec = new Vec3(x, 0, z).normalize().scale(power); living.setDeltaMovement(vec); + //? >= 26.3 + //living.syncVelocity = true; + //? < 26.3 living.hurtMarked = true; if (!quiet) { if (entity instanceof ServerPlayer player) { diff --git a/src/main/java/me/alexdevs/solstice/modules/sign/SignModule.java b/src/main/java/me/alexdevs/solstice/modules/sign/SignModule.java index 6eeefc13..56c453ce 100644 --- a/src/main/java/me/alexdevs/solstice/modules/sign/SignModule.java +++ b/src/main/java/me/alexdevs/solstice/modules/sign/SignModule.java @@ -20,14 +20,22 @@ public void init() { } public static SignText formatSign(List messages, SignText text) { + //? if >= 26.3 + //SignText.Mutable mutableText = text.asMutable(); + for (var i = 0; i < messages.size(); i++) { var message = messages.get(i); var line = message.raw(); - //? if >= 26.1 + //? if >= 26.3 + //mutableText.setLine(i,LegacyFormattingParser.ALL.parseNode(line).toComponent()); + //? if = 26.2 //text = text.setMessage(i, LegacyFormattingParser.ALL.parseNode(line).toComponent()); - //? if < 26.1 + //? if < 26.2 text = text.setMessage(i, LegacyFormattingParser.ALL.parseNode(line).toText()); } + //? if >= 26.3 + //return mutableText.asImmutable(); + //? if < 26.3 return text; } diff --git a/src/main/java/me/alexdevs/solstice/modules/styling/formatters/AdvancementFormatter.java b/src/main/java/me/alexdevs/solstice/modules/styling/formatters/AdvancementFormatter.java index 65a70925..18654c4c 100644 --- a/src/main/java/me/alexdevs/solstice/modules/styling/formatters/AdvancementFormatter.java +++ b/src/main/java/me/alexdevs/solstice/modules/styling/formatters/AdvancementFormatter.java @@ -3,19 +3,27 @@ import eu.pb4.placeholders.api.PlaceholderContext; import me.alexdevs.solstice.api.text.Format; import me.alexdevs.solstice.modules.ModuleProvider; +import net.minecraft.advancements.AdvancementHolder; +import net.minecraft.advancements.AdvancementType; import net.minecraft.network.chat.Component; import net.minecraft.server.level.ServerPlayer; import java.util.Map; -import net.minecraft.advancements.AdvancementHolder; -import net.minecraft.advancements.AdvancementType; - public class AdvancementFormatter { public static Component getText(ServerPlayer player, AdvancementHolder entry, AdvancementType frame) { - var title = entry.value().display().get().getTitle(); - var description = entry.value().display().get().getDescription(); + var title = entry.value().display().get() + //? >= 26.3 + //.title(); + //? < 26.3 + .getTitle(); + var description = entry.value().display().get() + //? >= 26.3 + //.description(); + //? < 26.3 + .getDescription(); + var config = ModuleProvider.STYLING.getConfig(); diff --git a/src/main/java/me/alexdevs/solstice/modules/sudo/commands/DoAsCommand.java b/src/main/java/me/alexdevs/solstice/modules/sudo/commands/DoAsCommand.java index b0549ab0..999f27cc 100644 --- a/src/main/java/me/alexdevs/solstice/modules/sudo/commands/DoAsCommand.java +++ b/src/main/java/me/alexdevs/solstice/modules/sudo/commands/DoAsCommand.java @@ -64,8 +64,10 @@ public static CommandSourceStack buildPlayerSource(CommandSource commandOutput, player.getRotationVector(), PlayerUtils.getLevel(player), opLevel, + //? if < 26.3 { player.getScoreboardName(), player.getDisplayName(), + //? } server, player ); diff --git a/src/main/java/me/alexdevs/solstice/modules/sudo/commands/SudoCommand.java b/src/main/java/me/alexdevs/solstice/modules/sudo/commands/SudoCommand.java index 135c49c8..56567961 100644 --- a/src/main/java/me/alexdevs/solstice/modules/sudo/commands/SudoCommand.java +++ b/src/main/java/me/alexdevs/solstice/modules/sudo/commands/SudoCommand.java @@ -65,7 +65,7 @@ public LiteralArgumentBuilder command(String name) { public CommandSourceStack buildServerSource(CommandSource commandOutput, MinecraftServer server) { return new CommandSourceStack( commandOutput, - //? if >= 26.1 { + //? if >= 26.2 { /*net.minecraft.world.phys.Vec3.atCenterOf(server.overworld().getRespawnData().pos()), *///? } elif >= 1.21.11 { /*server.overworld().getRespawnData().pos().getCenter(), @@ -78,10 +78,12 @@ public CommandSourceStack buildServerSource(CommandSource commandOutput, Minecra //net.minecraft.server.permissions.PermissionSet.ALL_PERMISSIONS, //? < 1.21.11 4, + //? <= 26.2 "Server", Component.nullToEmpty("Server"), - server, - null + server + //? <= 26.2 + ,null ); } } diff --git a/stonecutter.properties.toml b/stonecutter.properties.toml index 475d3e12..897879da 100644 --- a/stonecutter.properties.toml +++ b/stonecutter.properties.toml @@ -2,9 +2,9 @@ mod.id = "solstice" mod.name = "Solstice Essentials" mod.group = "me.alexdevs" -mod.version = "1.9.6" +mod.version = "1.9.7-alpha" -loomx.loom_version = "1.17-SNAPSHOT" +loomx.loom_version = "1.18.1" deps.luckperms = "5.4" @@ -73,3 +73,17 @@ deps.sgui = "2.1.0+26.2" deps.commoneconomy = "2.0.0" deps.trinkets = "4.1.0-beta.2+26.2" deps.vanish = "1.6.15+26.2" + +["26.3"] +mod.mc_compat = "~26.3" + +deps.fabric_loader = "0.19.5" +deps.fabric_api = "0.160.7+26.3" + +deps.configurate = "4.1.2" +deps.permissions_api = "0.7.0" +deps.placeholderapi = "3.2.0+26.3" +deps.sgui = "2.2.0+26.3" +deps.commoneconomy = "2.0.0" +deps.trinkets = "4.2.0+26.3" +deps.vanish = "1.6.15+26.3"