mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-10 06:48:34 +00:00
Fixlighting now also calculates heightmaps
Fixes #386 and #438 seems fixed, but that might be something else that fixed?
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
package com.boydti.fawe.`object`.clipboard
|
||||
|
||||
import com.boydti.fawe.beta.implementation.lighting.HeightMapType
|
||||
import com.sk89q.jnbt.CompoundTag
|
||||
import com.sk89q.worldedit.WorldEditException
|
||||
import com.sk89q.worldedit.entity.Entity
|
||||
@ -49,6 +50,10 @@ object EmptyClipboard : Clipboard {
|
||||
return null
|
||||
}
|
||||
|
||||
override fun getHeightMap(type: HeightMapType?): IntArray {
|
||||
return IntArray(256)
|
||||
}
|
||||
|
||||
@Throws(WorldEditException::class)
|
||||
override fun <T : BlockStateHolder<T>?> setBlock(position: BlockVector3, block: T): Boolean {
|
||||
return false
|
||||
|
@ -11,13 +11,13 @@ public final class BitArrayUnstretched {
|
||||
private final long mask;
|
||||
private final int longLen;
|
||||
|
||||
public BitArrayUnstretched(int bitsPerEntry, long[] buffer) {
|
||||
public BitArrayUnstretched(int bitsPerEntry, int arraySize, long[] buffer) {
|
||||
this.bitsPerEntry = bitsPerEntry;
|
||||
this.mask = (1L << bitsPerEntry) - 1L;
|
||||
this.emptyBitCount = 64 % bitsPerEntry;
|
||||
this.maxSeqLocIndex = 64 - (bitsPerEntry + emptyBitCount);
|
||||
final int blocksPerLong = MathMan.floorZero((double) 64 / bitsPerEntry);
|
||||
this.longLen = MathMan.ceilZero((float) 4096 / blocksPerLong);
|
||||
this.longLen = MathMan.ceilZero((float) arraySize / blocksPerLong);
|
||||
if (buffer.length < longLen) {
|
||||
this.data = new long[longLen];
|
||||
} else {
|
||||
@ -25,6 +25,16 @@ public final class BitArrayUnstretched {
|
||||
}
|
||||
}
|
||||
|
||||
public BitArrayUnstretched(int bitsPerEntry, int arraySize) {
|
||||
this.bitsPerEntry = bitsPerEntry;
|
||||
this.mask = (1L << bitsPerEntry) - 1L;
|
||||
this.emptyBitCount = 64 % bitsPerEntry;
|
||||
this.maxSeqLocIndex = 64 - bitsPerEntry;
|
||||
final int blocksPerLong = MathMan.floorZero((double) 64 / bitsPerEntry);
|
||||
this.longLen = MathMan.ceilZero((float) arraySize / blocksPerLong);
|
||||
this.data = new long[longLen];
|
||||
}
|
||||
|
||||
public long[] getData() {
|
||||
return data;
|
||||
}
|
||||
@ -61,7 +71,7 @@ public final class BitArrayUnstretched {
|
||||
long l = 0;
|
||||
for (int i = 0; i < longLen; i++) {
|
||||
int lastVal;
|
||||
for (; localStart <= maxSeqLocIndex && arrI < 4096; localStart += bitsPerEntry) {
|
||||
for (; localStart <= maxSeqLocIndex && arrI < arr.length; localStart += bitsPerEntry) {
|
||||
lastVal = arr[arrI++];
|
||||
l |= ((long) lastVal << localStart);
|
||||
}
|
||||
@ -85,7 +95,7 @@ public final class BitArrayUnstretched {
|
||||
for (int i = 0; i < longLen; i++) {
|
||||
long l = data[i];
|
||||
char lastVal;
|
||||
for (; localStart <= maxSeqLocIndex && arrI < 4096; localStart += bitsPerEntry) {
|
||||
for (; localStart <= maxSeqLocIndex && arrI < buffer.length; localStart += bitsPerEntry) {
|
||||
lastVal = (char) (l >>> localStart & this.mask);
|
||||
buffer[arrI++] = lastVal;
|
||||
}
|
||||
@ -104,7 +114,7 @@ public final class BitArrayUnstretched {
|
||||
for (int i = 0; i < longLen; i++) {
|
||||
long l = data[i];
|
||||
char lastVal;
|
||||
for (; localStart <= maxSeqLocIndex && arrI < 4096; localStart += bitsPerEntry) {
|
||||
for (; localStart <= maxSeqLocIndex && arrI < buffer.length; localStart += bitsPerEntry) {
|
||||
lastVal = (char) (l >>> localStart & this.mask);
|
||||
buffer[arrI++] = lastVal;
|
||||
}
|
||||
|
Reference in New Issue
Block a user