Jannyboy11 / InvSee-plus-plus

A bukkit plugin for manipulating player inventories
Other
84 stars 12 forks source link

Release as a Multi-Release JAR file with true ADTs #93

Open Jannyboy11 opened 5 months ago

Jannyboy11 commented 5 months ago

Since Java 21 it's possible to use pattern matching for records. For API users it would be nice if they could use this feature to destructure SpectateResponse and OpenResponse.

We can make publicly visible records (Open, Closed, Fail, Succeed) that implement the sealed interfaces OpenResponse and SpectateResponse in a Java-21 specific package. Implementations of NotOpenedReason and NotCreatedReason can also become records. These interfaces will not become sealed as to allow for more error reasons in the future.

Jannyboy11 commented 5 months ago

Now labeling this as 'good first issue' since InvSee++ is already released as a Multi-Release JAR file since version 0.26.0 (Java 8 support).