am so stupid
This commit is contained in:
@@ -138,19 +138,32 @@ public class SectionUpdateRouter implements ISectionWatcher {
|
|||||||
var lock = this.locks[idx];
|
var lock = this.locks[idx];
|
||||||
|
|
||||||
long stamp = lock.readLock();
|
long stamp = lock.readLock();
|
||||||
byte types = set.getOrDefault(position, (byte) 0);
|
byte types = (byte) (set.getOrDefault(position, (byte) 0)&type);
|
||||||
lock.unlockRead(stamp);
|
lock.unlockRead(stamp);
|
||||||
|
|
||||||
if (types!=0) {
|
if (types!=0) {
|
||||||
if ((type&WorldEngine.UPDATE_TYPE_CHILD_EXISTENCE_BIT)!=0) {
|
if ((types&WorldEngine.UPDATE_TYPE_CHILD_EXISTENCE_BIT)!=0) {
|
||||||
this.childUpdateCallback.accept(section);
|
this.childUpdateCallback.accept(section);
|
||||||
}
|
}
|
||||||
if ((type&UPDATE_TYPE_BLOCK_BIT)!=0) {
|
if ((types&UPDATE_TYPE_BLOCK_BIT)!=0) {
|
||||||
this.renderMeshGen.accept(section.key);
|
this.renderMeshGen.accept(section.key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void triggerRemesh(long position) {
|
||||||
|
int idx = getSliceIndex(position);
|
||||||
|
var set = this.slices[idx];
|
||||||
|
var lock = this.locks[idx];
|
||||||
|
|
||||||
|
long stamp = lock.readLock();
|
||||||
|
byte types = set.getOrDefault(position, (byte) 0);
|
||||||
|
lock.unlockRead(stamp);
|
||||||
|
if ((types&UPDATE_TYPE_BLOCK_BIT)!=0) {
|
||||||
|
this.renderMeshGen.accept(position);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private static int getSliceIndex(long value) {
|
private static int getSliceIndex(long value) {
|
||||||
value = (value ^ value >>> 30) * -4658895280553007687L;
|
value = (value ^ value >>> 30) * -4658895280553007687L;
|
||||||
value = (value ^ value >>> 27) * -7723592293110705685L;
|
value = (value ^ value >>> 27) * -7723592293110705685L;
|
||||||
|
|||||||
Reference in New Issue
Block a user