资源图标

插件 FormAPI 2.1-SNAPSHOT

请先注册登录后下载
版权类型
转载
版权链接
https://cloudburstmc.org
资源语言
  1. 英语
适配版本
  1. 1.13
  2. 1.14
  3. 1.20.6
  4. 1.21
这是一个简易的库,用于简单的创建Form
以下是常见Form的创建:

SimpleForm:​

Java:
SimpleForm form = new SimpleForm("Test simple form")
    .setContent("Sample text")
    .addButton("Just a button")
    .addButton("Button with diamond", ImageType.PATH, "textures/items/diamond");

form.send(player, (targetPlayer, targetForm, data) -> {
    if(data == -1) return;
  
    targetPlayer.sendMessage(data.toString());
});

CustomForm:​

Java:
CustomForm form = new CustomForm()
    .addLabel("Sample text")
    .addDropDown("Sample dropdown", Arrays.asList("Line 1", "Line 2", "Line 3"))
    .addInput("Text area")
    .addSlider("Slider", 1, 100)
    .addStepSlider("Step slider", Arrays.asList("Step 1", "Step 2", "Step 3"))
    .addToggle("Just a toggle", false);

form.send(player, (targetPlayer, targetForm, data) -> {
    if(data == null) return;
  
    targetPlayer.sendMessage(data.toString());
});

ModalForm:​

Java:
ModalForm form = new ModalForm("It`s a title", "Sample text", "Positive button", "Negative button");

form.send(player, (targetPlayer, targetForm, data) -> {
    if(data == -1) return;
  
    targetPlayer.sendMessage(data.toString());
});
作者
眠悠子Mzyness
下载
0
查看
37
首次发布
最后更新

评论

0.00 星 0 星

来自眠悠子Mzyness的更多资源

后退
顶部 底部