Skip to content

Commit

Permalink
Rename FormattableSigns module to Sign
Browse files Browse the repository at this point in the history
  • Loading branch information
Ale32bit committed Dec 24, 2024
1 parent 432784f commit e822ba1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package me.alexdevs.solstice.mixin;

import me.alexdevs.solstice.Solstice;
import me.alexdevs.solstice.modules.formattableSigns.FormattableSignsModule;
import me.alexdevs.solstice.modules.sign.SignModule;
import net.minecraft.block.entity.SignBlockEntity;
import net.minecraft.block.entity.SignText;
import net.minecraft.entity.player.PlayerEntity;
Expand All @@ -18,10 +18,10 @@ public abstract class SignBlockEntityMixin {

@Inject(method = "getTextWithMessages", at = @At("HEAD"), cancellable = true)
private void getTextWithMessages(PlayerEntity player, List<FilteredMessage> messages, SignText text, CallbackInfoReturnable<SignText> cir) {
var formattableSignsModule = Solstice.modules.getModule(FormattableSignsModule.class);
var formattableSignsModule = Solstice.modules.getModule(SignModule.class);
if (formattableSignsModule.canFormatSign(player)) {
try {
text = FormattableSignsModule.formatSign(messages, text);
text = SignModule.formatSign(messages, text);
cir.setReturnValue(text);
} catch (Exception e) {
Solstice.LOGGER.error("Something went wrong while formatting a sign!", e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import me.alexdevs.solstice.modules.extinguish.ExtinguishModule;
import me.alexdevs.solstice.modules.feed.FeedModule;
import me.alexdevs.solstice.modules.fly.FlyModule;
import me.alexdevs.solstice.modules.formattableSigns.FormattableSignsModule;
import me.alexdevs.solstice.modules.sign.SignModule;
import me.alexdevs.solstice.modules.god.GodModule;
import me.alexdevs.solstice.modules.hat.HatModule;
import me.alexdevs.solstice.modules.heal.HealModule;
Expand Down Expand Up @@ -66,7 +66,7 @@ public class ModuleProvider {
new ExtinguishModule(),
new FeedModule(),
new FlyModule(),
new FormattableSignsModule(),
new SignModule(),
new GodModule(),
new HatModule(),
new HealModule(),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package me.alexdevs.solstice.modules.formattableSigns;
package me.alexdevs.solstice.modules.sign;

import eu.pb4.placeholders.api.parsers.LegacyFormattingParser;
import me.alexdevs.solstice.api.module.ModuleBase;
Expand All @@ -9,10 +9,10 @@

import java.util.List;

public class FormattableSignsModule extends ModuleBase {
public static final String ID = "formattablesigns";
public class SignModule extends ModuleBase {
public static final String ID = "sign";

public FormattableSignsModule() {
public SignModule() {
super(ID);
}

Expand All @@ -26,6 +26,6 @@ public static SignText formatSign(List<FilteredMessage> messages, SignText text)
}

public boolean canFormatSign(PlayerEntity player) {
return Permissions.check(player, getPermissionNode("base"), 2);
return Permissions.check(player, getPermissionNode("format"), 2);
}
}

0 comments on commit e822ba1

Please sign in to comment.