mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-04 23:47:59 +01:00
Use the block value to find the current block
This commit is contained in:
parent
ca25cc0470
commit
ef51a3765b
@ -92,11 +92,14 @@ public class Section implements PublicCloneable<Section> {
|
|||||||
{
|
{
|
||||||
final long clear = MAGIC_MASKS[bitsPerEntry];
|
final long clear = MAGIC_MASKS[bitsPerEntry];
|
||||||
|
|
||||||
|
final long value = block >> bitIndex & clear;
|
||||||
|
final boolean isCurrentAir = Block.fromStateId(
|
||||||
|
hasPalette ? paletteBlockMap.get((short) value) : (short) value).isAir();
|
||||||
|
|
||||||
block |= clear << bitIndex;
|
block |= clear << bitIndex;
|
||||||
block ^= clear << bitIndex;
|
block ^= clear << bitIndex;
|
||||||
block |= (long) blockId << bitIndex;
|
block |= (long) blockId << bitIndex;
|
||||||
|
|
||||||
final boolean isCurrentAir = Block.fromStateId(getBlockAt(x, y, z)).isAir();
|
|
||||||
if (!isCurrentAir && isAir) { // The old block isn't air & the new block is.
|
if (!isCurrentAir && isAir) { // The old block isn't air & the new block is.
|
||||||
this.blockCount--;
|
this.blockCount--;
|
||||||
} else if (isCurrentAir && !isAir) { // The old block is air & the new block isn't.
|
} else if (isCurrentAir && !isAir) { // The old block is air & the new block isn't.
|
||||||
|
Loading…
Reference in New Issue
Block a user