diff --git a/worldedit-core/src/main/java/com/boydti/fawe/FaweCache.kt b/worldedit-core/src/main/java/com/boydti/fawe/FaweCache.kt index 7c7d788ad..073314c67 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/FaweCache.kt +++ b/worldedit-core/src/main/java/com/boydti/fawe/FaweCache.kt @@ -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(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() } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/CuboidRegionSelector.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/CuboidRegionSelector.java index 1a4cecc71..63ba9a430 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/CuboidRegionSelector.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/CuboidRegionSelector.java @@ -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; }