File tree Expand file tree Collapse file tree 2 files changed +13
-5
lines changed
src/main/java/net/querz/mca Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -191,7 +191,7 @@ public static int chunkToBlock(int chunk) {
191191
192192 private static final Pattern mcaFilePattern = Pattern .compile ("^.*r\\ .(?<regionX>-?\\ d+)\\ .(?<regionZ>-?\\ d+)\\ .mca$" );
193193
194- private static MCAFile newMCAFile (File file ) {
194+ public static MCAFile newMCAFile (File file ) {
195195 Matcher m = mcaFilePattern .matcher (file .getName ());
196196 if (m .find ()) {
197197 return new MCAFile (Integer .parseInt (m .group ("regionX" )), Integer .parseInt (m .group ("regionZ" )));
Original file line number Diff line number Diff line change @@ -371,10 +371,18 @@ public static Section newSection() {
371371 */
372372 public CompoundTag updateHandle (int y ) {
373373 data .putByte ("Y" , (byte ) y );
374- data .put ("Palette" , palette );
375- if (blockLight != null ) data .putByteArray ("BlockLight" , blockLight );
376- data .putLongArray ("BlockStates" , blockStates );
377- if (skyLight != null ) data .putByteArray ("SkyLight" , skyLight );
374+ if (palette != null ) {
375+ data .put ("Palette" , palette );
376+ }
377+ if (blockLight != null ) {
378+ data .putByteArray ("BlockLight" , blockLight );
379+ }
380+ if (blockStates != null ) {
381+ data .putLongArray ("BlockStates" , blockStates );
382+ }
383+ if (skyLight != null ) {
384+ data .putByteArray ("SkyLight" , skyLight );
385+ }
378386 return data ;
379387 }
380388}
You can’t perform that action at this time.
0 commit comments