mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-01 02:46:41 +00:00
@ -19,13 +19,12 @@
|
||||
|
||||
package com.sk89q.worldedit.util.formatting.component;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.google.common.base.Function;
|
||||
import com.google.common.collect.Collections2;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.sk89q.worldedit.history.changeset.ChangeSet;
|
||||
import com.sk89q.worldedit.util.formatting.text.Component;
|
||||
import com.sk89q.worldedit.util.formatting.text.TextComponent;
|
||||
import com.sk89q.worldedit.util.formatting.text.TranslatableComponent;
|
||||
import com.sk89q.worldedit.util.formatting.text.event.ClickEvent;
|
||||
import com.sk89q.worldedit.util.formatting.text.event.HoverEvent;
|
||||
import com.sk89q.worldedit.util.formatting.text.format.TextColor;
|
||||
@ -33,7 +32,6 @@ import com.sk89q.worldedit.util.formatting.text.format.TextColor;
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.function.Supplier;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public abstract class PaginationBox extends MessageBox {
|
||||
@ -95,7 +93,7 @@ public abstract class PaginationBox extends MessageBox {
|
||||
}
|
||||
int pageCount = (int) Math.ceil(getComponentsSize() / (double) componentsPerPage);
|
||||
if (page < 1 || page > pageCount) {
|
||||
throw new InvalidComponentException(TranslatableComponent.of("worldedit.error.invalid-page"));
|
||||
throw new InvalidComponentException(Caption.of("worldedit.error.invalid-page"));
|
||||
}
|
||||
currentPage = page;
|
||||
final int lastComp = Math.min(page * componentsPerPage, getComponentsSize());
|
||||
|
@ -19,12 +19,12 @@
|
||||
|
||||
package com.sk89q.worldedit.util.formatting.component;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.util.SideEffect;
|
||||
import com.sk89q.worldedit.util.SideEffectSet;
|
||||
import com.sk89q.worldedit.util.formatting.text.Component;
|
||||
import com.sk89q.worldedit.util.formatting.text.TextComponent;
|
||||
import com.sk89q.worldedit.util.formatting.text.TranslatableComponent;
|
||||
import com.sk89q.worldedit.util.formatting.text.event.ClickEvent;
|
||||
import com.sk89q.worldedit.util.formatting.text.event.HoverEvent;
|
||||
import com.sk89q.worldedit.util.formatting.text.format.TextColor;
|
||||
@ -65,15 +65,15 @@ public class SideEffectBox extends PaginationBox {
|
||||
SideEffect.State state = this.sideEffectSet.getState(effect);
|
||||
|
||||
TextComponent.Builder builder = TextComponent.builder();
|
||||
builder = builder.append(TranslatableComponent.of(effect.getDisplayName(), TextColor.YELLOW)
|
||||
.hoverEvent(HoverEvent.of(HoverEvent.Action.SHOW_TEXT, TranslatableComponent.of(effect.getDescription()))));
|
||||
builder = builder.append(Caption.of(effect.getDisplayName(), TextColor.YELLOW)
|
||||
.hoverEvent(HoverEvent.of(HoverEvent.Action.SHOW_TEXT, Caption.of(effect.getDescription()))));
|
||||
for (SideEffect.State uiState : SHOWN_VALUES) {
|
||||
builder = builder.append(TextComponent.space());
|
||||
builder = builder.append(TranslatableComponent.of(uiState.getDisplayName(), uiState == state ? TextColor.WHITE : TextColor.GRAY)
|
||||
builder = builder.append(Caption.of(uiState.getDisplayName(), uiState == state ? TextColor.WHITE : TextColor.GRAY)
|
||||
.clickEvent(ClickEvent.runCommand("//perf -h " + effect.name().toLowerCase(Locale.US) + " " + uiState.name().toLowerCase(Locale.US)))
|
||||
.hoverEvent(HoverEvent.showText(uiState == state
|
||||
? TranslatableComponent.of("worldedit.sideeffect.box.current")
|
||||
: TranslatableComponent.of("worldedit.sideeffect.box.change-to", TranslatableComponent.of(uiState.getDisplayName()))
|
||||
? Caption.of("worldedit.sideeffect.box.current")
|
||||
: Caption.of("worldedit.sideeffect.box.change-to", Caption.of(uiState.getDisplayName()))
|
||||
))
|
||||
);
|
||||
}
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package com.sk89q.worldedit.util.paste;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.sk89q.worldedit.command.util.AsyncCommandBuilder;
|
||||
import com.sk89q.worldedit.extension.platform.Actor;
|
||||
import com.sk89q.worldedit.util.formatting.text.TextComponent;
|
||||
@ -71,7 +72,7 @@ public final class ActorCallbackPaste {
|
||||
|
||||
AsyncCommandBuilder.wrap(task, sender)
|
||||
.registerWithSupervisor(supervisor, "Submitting content to a pastebin service.")
|
||||
.sendMessageAfterDelay(TranslatableComponent.of("worldedit.pastebin.uploading"))
|
||||
.sendMessageAfterDelay(Caption.of("worldedit.pastebin.uploading"))
|
||||
.onSuccess((String) null, url -> sender.printInfo(successMessage.args(TextComponent.of(url.toString())).build()))
|
||||
.onFailure("Failed to submit paste", null)
|
||||
.buildAndExec(Pasters.getExecutor());
|
||||
|
Reference in New Issue
Block a user