geforkt von Mirrors/FastAsyncWorldEdit
Removed some redundant code
Dieser Commit ist enthalten in:
Ursprung
5d5ee7e61e
Commit
995e1261e5
@ -422,19 +422,6 @@ object FaweCache : Trimable {
|
||||
return null
|
||||
} else {
|
||||
val clazz = value.javaClass
|
||||
if (clazz.name.startsWith("com.intellectualcrafters.jnbt")) {
|
||||
try {
|
||||
if (clazz.name == "com.intellectualcrafters.jnbt.EndTag") {
|
||||
return EndTag()
|
||||
}
|
||||
val field = clazz.getDeclaredField("value")
|
||||
field.isAccessible = true
|
||||
return asTag(field.get(value))
|
||||
} catch (e: Throwable) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
|
||||
}
|
||||
println("Invalid nbt: $value")
|
||||
return null
|
||||
}
|
||||
@ -477,12 +464,11 @@ object FaweCache : Trimable {
|
||||
val nThreads = Settings.IMP.QUEUE.PARALLEL_THREADS
|
||||
val queue = ArrayBlockingQueue<Runnable>(nThreads)
|
||||
return object : ThreadPoolExecutor(nThreads, nThreads,
|
||||
0L, TimeUnit.MILLISECONDS, queue, Executors.defaultThreadFactory(),
|
||||
ThreadPoolExecutor.CallerRunsPolicy()) {
|
||||
0L, TimeUnit.MILLISECONDS, queue, Executors.defaultThreadFactory(), CallerRunsPolicy()) {
|
||||
override fun afterExecute(r: Runnable?, t: Throwable?) {
|
||||
var t = t
|
||||
var throwable = t
|
||||
try {
|
||||
super.afterExecute(r, t)
|
||||
super.afterExecute(r, throwable)
|
||||
if (t == null && r is Future<*>) {
|
||||
try {
|
||||
val future = r as Future<*>?
|
||||
@ -490,15 +476,15 @@ object FaweCache : Trimable {
|
||||
future.get()
|
||||
}
|
||||
} catch (ce: CancellationException) {
|
||||
t = ce
|
||||
throwable = ce
|
||||
} catch (ee: ExecutionException) {
|
||||
t = ee.cause
|
||||
throwable = ee.cause
|
||||
} catch (ie: InterruptedException) {
|
||||
Thread.currentThread().interrupt()
|
||||
}
|
||||
|
||||
}
|
||||
t?.printStackTrace()
|
||||
throwable?.printStackTrace()
|
||||
} catch (e: Throwable) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
|
@ -129,7 +129,7 @@ public class CuboidRegionSelector implements RegionSelector, CUIRegion {
|
||||
public boolean selectPrimary(BlockVector3 position, SelectorLimits limits) {
|
||||
checkNotNull(position);
|
||||
|
||||
if (position1 != null && position.equals(position1)) {
|
||||
if (position.equals(position1)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -142,7 +142,7 @@ public class CuboidRegionSelector implements RegionSelector, CUIRegion {
|
||||
public boolean selectSecondary(BlockVector3 position, SelectorLimits limits) {
|
||||
checkNotNull(position);
|
||||
|
||||
if (position2 != null && position.equals(position2)) {
|
||||
if (position.equals(position2)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren