mirror of
https://github.com/rockyhawk64/CommandPanels.git
synced 2025-11-18 07:14:17 +01:00
add label for floodgate, fix dependencies, fix vault tag error, fix range always true
This commit is contained in:
parent
ebebdf7fcf
commit
075b07f73a
@ -8,24 +8,18 @@ folia-supported: false
|
||||
|
||||
dependencies:
|
||||
server:
|
||||
PlaceholderAPI:
|
||||
load: AFTER
|
||||
required: false
|
||||
Vault:
|
||||
load: AFTER
|
||||
required: false
|
||||
ItemsAdder:
|
||||
load: AFTER
|
||||
required: false
|
||||
Nexo:
|
||||
load: AFTER
|
||||
required: false
|
||||
HeadDatabase:
|
||||
load: AFTER
|
||||
required: false
|
||||
MMOItems:
|
||||
load: AFTER
|
||||
required: false
|
||||
floodgate:
|
||||
load: AFTER
|
||||
required: false
|
||||
PlaceholderAPI:
|
||||
required: false
|
||||
MMOItems:
|
||||
required: false
|
||||
Vault:
|
||||
required: false
|
||||
@ -56,10 +56,10 @@ public class ActionBuilder implements Listener {
|
||||
// Use the first non-null value
|
||||
if (text != null) {
|
||||
ctx.session.getPlayerSession((Player) audience).setData(id, text);
|
||||
} else if (bool != null) {
|
||||
ctx.session.getPlayerSession((Player) audience).setData(id, String.valueOf(bool));
|
||||
} else if (number != null) {
|
||||
ctx.session.getPlayerSession((Player) audience).setData(id, String.valueOf(number));
|
||||
} else if (bool != null) {
|
||||
ctx.session.getPlayerSession((Player) audience).setData(id, String.valueOf(bool));
|
||||
}
|
||||
}
|
||||
|
||||
@ -76,11 +76,13 @@ public class ActionBuilder implements Listener {
|
||||
// Bottom of the list is prioritised over the top
|
||||
if (!button.getClipboard().isEmpty()) {
|
||||
action = DialogAction.staticAction(
|
||||
ClickEvent.copyToClipboard(button.getClipboard()));
|
||||
ClickEvent.copyToClipboard(
|
||||
ctx.text.parseTextToString(player, button.getClipboard())));
|
||||
}
|
||||
if (!button.getUrl().isEmpty()) {
|
||||
action = DialogAction.staticAction(
|
||||
ClickEvent.openUrl(button.getUrl()));
|
||||
ClickEvent.openUrl(
|
||||
ctx.text.parseTextToString(player, button.getUrl())));
|
||||
}
|
||||
|
||||
return ActionButton.builder(name)
|
||||
|
||||
@ -9,6 +9,7 @@ import me.rockyhawk.commandpanels.session.floodgate.FloodgateComponent;
|
||||
import me.rockyhawk.commandpanels.session.floodgate.FloodgatePanel;
|
||||
import me.rockyhawk.commandpanels.session.floodgate.components.*;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.geysermc.cumulus.component.LabelComponent;
|
||||
import org.geysermc.cumulus.response.CustomFormResponse;
|
||||
import org.geysermc.floodgate.api.FloodgateApi;
|
||||
|
||||
@ -53,6 +54,12 @@ public class CustomForm {
|
||||
|
||||
// Create the component
|
||||
switch (comp) {
|
||||
case FloodgateLabel input -> {
|
||||
form.label(
|
||||
parseText(input.getName().replaceAll("\\\\n", "\n"))
|
||||
);
|
||||
inputOrder.add(input);
|
||||
}
|
||||
case FloodgateInput input -> {
|
||||
form.input(
|
||||
parseText(input.getName()),
|
||||
@ -143,7 +150,7 @@ public class CustomForm {
|
||||
}
|
||||
});
|
||||
|
||||
FloodgateApi.getInstance().sendForm(player.getUniqueId(), form);
|
||||
FloodgateApi.getInstance().sendForm(player.getUniqueId(), form.build());
|
||||
}
|
||||
|
||||
// Placeholder key will be the ID of the component and make session data from result string
|
||||
|
||||
@ -21,10 +21,6 @@ public class VaultTag implements RequirementTagResolver {
|
||||
.getServicesManager()
|
||||
.getRegistration(Economy.class);
|
||||
this.economy = (rsp != null) ? rsp.getProvider() : null;
|
||||
|
||||
if (economy == null) {
|
||||
Bukkit.getConsoleSender().sendMessage("[CommandPanels] VaultTag failed to load Economy.");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -24,6 +24,7 @@ public abstract class FloodgateComponent {
|
||||
|
||||
return switch (type.toLowerCase()) {
|
||||
case "button" -> new FloodgateButton(id, section);
|
||||
case "label" -> new FloodgateLabel(id, section);
|
||||
case "dropdown" -> new FloodgateDropdown(id, section);
|
||||
case "input" -> new FloodgateInput(id, section);
|
||||
case "slider" -> new FloodgateSlider(id, section);
|
||||
|
||||
@ -0,0 +1,11 @@
|
||||
package me.rockyhawk.commandpanels.session.floodgate.components;
|
||||
|
||||
import me.rockyhawk.commandpanels.session.floodgate.FloodgateComponent;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
|
||||
public class FloodgateLabel extends FloodgateComponent {
|
||||
|
||||
public FloodgateLabel(String id, ConfigurationSection section) {
|
||||
super(id, section);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user