Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,30 @@
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;

@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<FilteredText> 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<FilteredText> messages, SignText text, CallbackInfoReturnable<SignText> cir) {
if (ModuleProvider.SIGN.canFormatSign(player)) {
Expand All @@ -28,4 +45,6 @@ public abstract class FormatSignMixin {
}
}
}
//? }

}
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ private int execute(CommandContext<CommandSourceStack> context, String flags) th
}

player.push(0, power, 0);
//? >= 26.3
//player.syncVelocity = true;
//? < 26.3
player.hurtMarked = true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -56,6 +55,9 @@ private int execute(CommandContext<CommandSourceStack> 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) {
Expand Down
12 changes: 10 additions & 2 deletions src/main/java/me/alexdevs/solstice/modules/sign/SignModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,22 @@ public void init() {
}

public static SignText formatSign(List<FilteredText> 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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public LiteralArgumentBuilder<CommandSourceStack> 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(),
Expand All @@ -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
);
}
}
18 changes: 16 additions & 2 deletions stonecutter.properties.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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"
Loading