mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-12-28 03:29:06 +00:00
HELP ME
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
package com.volmit.iris.engine.data.cache;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.util.function.NastySupplier;
|
||||
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
@@ -50,6 +51,21 @@ public class AtomicCache<T> {
|
||||
}
|
||||
}
|
||||
|
||||
public T aquireNasty(NastySupplier<T> t)
|
||||
{
|
||||
return aquire(() -> {
|
||||
try
|
||||
{
|
||||
return t.get();
|
||||
}
|
||||
|
||||
catch(Throwable e)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public T aquire(Supplier<T> t) {
|
||||
if (this.t.get() != null) {
|
||||
return this.t.get();
|
||||
|
||||
Reference in New Issue
Block a user