mirror of
https://github.com/GeyserMC/Floodgate.git
synced 2025-12-19 14:59:20 +00:00
Implemented a way to close forms from floodgate (#566)
* feat: added #closeForm method to FloodgateApi * feat: implementation of the closeForm method * Update Floodgate API version --------- Co-authored-by: Roch Blonndiaux <contact@roch-blondiaux.com> Co-authored-by: onebeastchris <github@onechris.mozmail.com>
This commit is contained in:
@@ -125,6 +125,11 @@ public class SimpleFloodgateApi implements FloodgateApi {
|
||||
return sendForm(uuid, formBuilder.build());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean closeForm(UUID uuid) {
|
||||
return pluginMessageManager.getChannel(FormChannel.class).closeForm(uuid);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean sendForm(UUID uuid, org.geysermc.cumulus.Form<?> form) {
|
||||
return sendForm(uuid, form.newForm());
|
||||
|
||||
@@ -93,6 +93,10 @@ public class FormChannel implements PluginMessageChannel {
|
||||
return Result.handled();
|
||||
}
|
||||
|
||||
public boolean closeForm(UUID player) {
|
||||
return pluginMessageUtils.sendMessage(player, getIdentifier(), new byte[0]);
|
||||
}
|
||||
|
||||
public boolean sendForm(UUID player, Form form) {
|
||||
byte[] formData = createFormData(form);
|
||||
return pluginMessageUtils.sendMessage(player, getIdentifier(), formData);
|
||||
|
||||
Reference in New Issue
Block a user