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:
@@ -97,6 +97,8 @@ public interface FloodgateApi {
|
||||
|
||||
boolean sendForm(UUID uuid, FormBuilder<?, ?, ?> formBuilder);
|
||||
|
||||
boolean closeForm(UUID uuid);
|
||||
|
||||
/**
|
||||
* @deprecated since Cumulus 1.1 and will be removed when Cumulus 2.0 releases. Please use the
|
||||
* new form classes instead.
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -2,4 +2,4 @@ org.gradle.configureondemand=true
|
||||
org.gradle.caching=true
|
||||
org.gradle.parallel=true
|
||||
|
||||
version=2.2.3-SNAPSHOT
|
||||
version=2.2.4-SNAPSHOT
|
||||
Reference in New Issue
Block a user