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