mirror of
https://github.com/DiscordSRV/Ascension.git
synced 2024-11-22 11:55:54 +01:00
enhancedBuilder -> textBuilder
This commit is contained in:
parent
37248aac56
commit
d4975f833a
@ -63,7 +63,7 @@ public class DiscordSRVCommand implements GameCommandExecutor {
|
||||
@Override
|
||||
public void execute(ICommandSender sender, GameCommandArguments arguments) {
|
||||
MinecraftComponent component = discordSRV.componentFactory()
|
||||
.enhancedBuilder(discordSRV.config().command.discordFormat)
|
||||
.textBuilder(discordSRV.config().command.discordFormat)
|
||||
.addContext(sender)
|
||||
.applyPlaceholderService()
|
||||
.build();
|
||||
|
@ -196,7 +196,7 @@ public abstract class BroadcastCommand implements GameCommandExecutor, GameComma
|
||||
@Override
|
||||
public String getContent(String content) {
|
||||
MinecraftComponent component = discordSRV.componentFactory()
|
||||
.enhancedBuilder(content)
|
||||
.textBuilder(content)
|
||||
.applyPlaceholderService()
|
||||
.build();
|
||||
|
||||
|
@ -83,7 +83,7 @@ public class DiscordSRVMinecraftRenderer extends DefaultMinecraftRenderer {
|
||||
|
||||
return component.append(ComponentUtil.fromAPI(
|
||||
discordSRV.componentFactory()
|
||||
.enhancedBuilder(guildChannel != null ? format.format : format.unknownFormat)
|
||||
.textBuilder(guildChannel != null ? format.format : format.unknownFormat)
|
||||
.addReplacement("%channel_name%", guildChannel != null ? guildChannel.getName() : null)
|
||||
.applyPlaceholderService()
|
||||
.build()
|
||||
@ -109,7 +109,7 @@ public class DiscordSRVMinecraftRenderer extends DefaultMinecraftRenderer {
|
||||
DiscordGuildMember member = guild.getMemberById(userId).orElse(null);
|
||||
|
||||
GameTextBuilder builder = discordSRV.componentFactory()
|
||||
.enhancedBuilder(user != null ? format.format : format.unknownFormat);
|
||||
.textBuilder(user != null ? format.format : format.unknownFormat);
|
||||
|
||||
if (user != null) {
|
||||
builder.addContext(user);
|
||||
@ -136,7 +136,7 @@ public class DiscordSRVMinecraftRenderer extends DefaultMinecraftRenderer {
|
||||
DiscordRole role = discordSRV.discordAPI().getRoleById(roleId).orElse(null);
|
||||
|
||||
GameTextBuilder builder = discordSRV.componentFactory()
|
||||
.enhancedBuilder(role != null ? format.format : format.unknownFormat);
|
||||
.textBuilder(role != null ? format.format : format.unknownFormat);
|
||||
|
||||
if (role != null) {
|
||||
builder.addContext(role);
|
||||
|
@ -332,7 +332,7 @@ public class ReceivedDiscordMessageImpl extends SendableDiscordMessageImpl imple
|
||||
List<Component> components = new ArrayList<>();
|
||||
for (Attachment attachment : attachments) {
|
||||
components.add(ComponentUtil.fromAPI(
|
||||
discordSRV.componentFactory().enhancedBuilder(attachmentFormat)
|
||||
discordSRV.componentFactory().textBuilder(attachmentFormat)
|
||||
.addReplacement("%file_name%", attachment.fileName())
|
||||
.addReplacement("%file_url%", attachment.url())
|
||||
.build()
|
||||
|
@ -108,7 +108,7 @@ public class DiscordChatMessageModule extends AbstractModule<DiscordSRV> {
|
||||
discordSRV.componentFactory().minecraftSerializer().serialize(message.toString()));
|
||||
|
||||
GameTextBuilder componentBuilder = discordSRV.componentFactory()
|
||||
.enhancedBuilder(format)
|
||||
.textBuilder(format)
|
||||
.addContext(discordMessage, author, channel, channelConfig)
|
||||
.addReplacement("%message%", messageComponent);
|
||||
if (member != null) {
|
||||
|
@ -73,6 +73,6 @@ public final class PermissionUtil {
|
||||
}
|
||||
|
||||
private static Component translate(DiscordSRV discordSRV, String data) {
|
||||
return data != null ? ComponentUtil.fromAPI(discordSRV.componentFactory().enhancedBuilder(data).build()) : null;
|
||||
return data != null ? ComponentUtil.fromAPI(discordSRV.componentFactory().textBuilder(data).build()) : null;
|
||||
}
|
||||
}
|
||||
|
@ -33,6 +33,6 @@ public class GlobalTextHandlingContext {
|
||||
|
||||
@Placeholder("text_")
|
||||
public MinecraftComponent text(@PlaceholderRemainder String text) {
|
||||
return discordSRV.componentFactory().enhancedBuilder(text).build();
|
||||
return discordSRV.componentFactory().textBuilder(text).build();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user