@@ -236,7 +236,7 @@ private CompoundBinaryTag readCustomData(CompoundBinaryTag tag, Set<String> tags
236236 }
237237 }
238238
239- private <T > T [] readRegionFiles (File regionDir , IntFunction <T []> generator , Function <CompoundBinaryTag , T > function ) throws IOException {
239+ private <T > T [] readRegionFiles (File regionDir , IntFunction <T []> generator , Function <CompoundBinaryTag , @ Nullable T > function ) throws IOException {
240240 File [] files = regionDir .listFiles ((dir , name ) -> name .endsWith (MCA ));
241241 if (files == null || files .length == 0 ) {
242242 return generator .apply (0 );
@@ -252,7 +252,7 @@ private <T> T[] readRegionFiles(File regionDir, IntFunction<T[]> generator, Func
252252 );
253253 }
254254
255- private <T > T [] readRegionFile (File regionFile , IntFunction <T []> generator , Function <CompoundBinaryTag , T > function ) throws IOException {
255+ private <T > T [] readRegionFile (File regionFile , IntFunction <T []> generator , Function <CompoundBinaryTag , @ Nullable T > function ) throws IOException {
256256 byte [] bytes ;
257257 try (FileInputStream is = new FileInputStream (regionFile )) {
258258 bytes = is .readAllBytes ();
@@ -287,7 +287,6 @@ private <T> T[] readRegionFile(File regionFile, IntFunction<T[]> generator, Func
287287
288288 CompoundBinaryTag tag = BinaryTagIO .reader ().read (decompressorStream );
289289 T element = function .apply (tag );
290- //noinspection ConstantValue
291290 if (element != null ) {
292291 data .add (element );
293292 }
0 commit comments