Closed mattmess1221 closed 1 year ago
with delete, file, and uri implementations.
This is cleaner than using a switch and a nullable skin attribute. It's better to omit the field all together. As a benefit, we can make the FileUpload accept a Path directly instead of converting it from a URI manually.
skin
FileUpload
Path
URI
Once Minecraft uses a Java version that has functional pattern matching as non-preview, we can use that via
switch (upload) { case SkinUpload.Delete -> ...; case SkinUpload.FileUpload fileUpload -> ...; case SkinUpload.UriUpload uriUpload -> ...; default -> throw new IllegalArgumentException(); }
with delete, file, and uri implementations.
This is cleaner than using a switch and a nullable
skin
attribute. It's better to omit the field all together. As a benefit, we can make theFileUpload
accept aPath
directly instead of converting it from aURI
manually.Once Minecraft uses a Java version that has functional pattern matching as non-preview, we can use that via