Skip to content

Commit e8de674

Browse files
committed
fix npe
1 parent 83d589e commit e8de674

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/main/java/ca/spottedleaf/moonrise/mixin/block_counting/LevelChunkSectionMixin.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,14 +124,13 @@ private void updateBlockCallback(final int x, final int y, final int z, final Bl
124124
final boolean oldTicking = oldState.isRandomlyTicking();
125125
final boolean newTicking = newState.isRandomlyTicking();
126126
if (oldTicking != newTicking) {
127+
this.createTickingBlocks();
127128
final ShortList tickingBlocks = this.tickingBlocks;
128129
final short position = (short)(x | (z << 4) | (y << (4+4)));
129130

130131
if (oldTicking) {
131-
this.createTickingBlocks();
132132
tickingBlocks.remove(position);
133133
} else {
134-
this.createTickingBlocks();
135134
tickingBlocks.add(position);
136135
}
137136
}
@@ -199,7 +198,8 @@ public void recalcBlockCounts() {
199198
this.tickingBlockCount += (short)paletteCount;
200199
final short[] raw = coordinates.elements();
201200
final int rawLen = raw.length;
202-
201+
202+
this.createTickingBlocks();
203203
final ShortList tickingBlocks = this.tickingBlocks;
204204

205205
tickingBlocks.setMinCapacity(Math.min((rawLen + tickingBlocks.size()) * 3 / 2, 16*16*16));

0 commit comments

Comments
 (0)