Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented a way to close forms from floodgate #566

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ static FloodgateApi getInstance() {

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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,11 @@ public boolean sendForm(UUID uuid, FormBuilder<?, ?, ?> formBuilder) {
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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ public Result handleServerCall(byte[] data, UUID playerUuid, String playerUserna
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);
Expand Down
Loading