Skip to content
Closed
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 @@ -4,6 +4,7 @@
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Contract;
import org.jspecify.annotations.Nullable;
import java.util.Collection;

/**
* A view for a possible response to a dialog.
Expand Down Expand Up @@ -49,4 +50,12 @@ public interface DialogResponseView {
*/
@Contract(pure = true)
@Nullable Float getFloat(String key);

/**
* Gets all keys in the response.
*
* @return a collection of keys
*/
@Contract(pure = true)
Collection<String> keys();
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import net.kyori.adventure.nbt.api.BinaryTagHolder;
import net.minecraft.nbt.CompoundTag;
import org.jspecify.annotations.Nullable;
import java.util.Collection;

public class PaperDialogResponseView implements DialogResponseView {

Expand Down Expand Up @@ -45,4 +46,9 @@ public BinaryTagHolder payload() {
}
return this.payload.getFloat(key).orElse(null);
}

@Override
public Collection<String> keys() {
return this.payload.keySet();
}
}