This commit is contained in:
cyberpwn
2021-08-24 22:28:33 -04:00
parent 432e95e4ec
commit 8df789ae34
84 changed files with 404 additions and 786 deletions

View File

@@ -45,49 +45,35 @@ public class AtomicCache<T> {
public void reset() {
t.set(null);
if(nullSupport)
{
if (nullSupport) {
set.set(false);
}
}
public T aquire(Supplier<T> t) {
if(this.t.get() != null)
{
if (this.t.get() != null) {
return this.t.get();
}
else if(nullSupport && set.get())
{
} else if (nullSupport && set.get()) {
return null;
}
lock.lock();
if(this.t.get() != null)
{
if (this.t.get() != null) {
lock.unlock();
return this.t.get();
}
else if(nullSupport && set.get())
{
} else if (nullSupport && set.get()) {
lock.unlock();
return null;
}
try
{
try {
this.t.set(t.get());
if(nullSupport)
{
if (nullSupport) {
set.set(true);
}
}
catch(Throwable e)
{
} catch (Throwable e) {
Iris.error("Atomic cache failure!");
e.printStackTrace();
}

View File

@@ -92,8 +92,7 @@ public class MCATerrainChunk implements TerrainChunk {
return;
}
if(blockData == null)
{
if (blockData == null) {
Iris.error("NULL BD");
}