mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-29 15:49:00 +01:00
Report errors correctly from FutureTasks
Anything that posts something to main thread was not correctly reporting their errors to the logger, passing the ExecutionExcetion instead of the cause. This resolves that, as well as patches some simple cases of System.nanoTime where mojang had used a LongSupplier to use a different method on client.
This commit is contained in:
parent
41e3db6b65
commit
c4cbda699b
1 changed files with 47 additions and 0 deletions
|
@ -796,4 +796,51 @@ index a21006290c..6c6f006f3a 100644
|
|||
public int a() {
|
||||
return this.b.size();
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/SystemUtils.java b/src/main/java/net/minecraft/server/SystemUtils.java
|
||||
index 1f1cb6a1b2..ced573d7fb 100644
|
||||
--- a/src/main/java/net/minecraft/server/SystemUtils.java
|
||||
+++ b/src/main/java/net/minecraft/server/SystemUtils.java
|
||||
@@ -0,0 +0,0 @@ public class SystemUtils {
|
||||
return Collectors.toMap(Entry::getKey, Entry::getValue);
|
||||
}
|
||||
|
||||
- public static <T extends Comparable<T>> String a(IBlockState<T> iblockstate, Object object) {
|
||||
- return iblockstate.a((Comparable)object);
|
||||
+ public static <T extends Comparable<T>> String a(IBlockState<T> iblockstate, T object) { // Paper - decompile fix
|
||||
+ return iblockstate.a(object); // Paper - decompile fix
|
||||
}
|
||||
|
||||
public static String a(String s, @Nullable MinecraftKey minecraftkey) {
|
||||
@@ -0,0 +0,0 @@ public class SystemUtils {
|
||||
}
|
||||
|
||||
public static long b() {
|
||||
- return c() / 1000000L;
|
||||
+ return System.nanoTime() / 1000000L; // Paper
|
||||
}
|
||||
|
||||
public static long c() {
|
||||
- return a.getAsLong();
|
||||
+ return System.nanoTime(); // Paper
|
||||
}
|
||||
|
||||
public static long d() {
|
||||
@@ -0,0 +0,0 @@ public class SystemUtils {
|
||||
futuretask.run();
|
||||
return (V)futuretask.get();
|
||||
} catch (ExecutionException executionexception) {
|
||||
- logger.fatal("Error executing task", executionexception);
|
||||
+ logger.fatal("Error executing task", executionexception.getCause() != null ? executionexception.getCause() : executionexception); // Paper
|
||||
} catch (InterruptedException interruptedexception) {
|
||||
logger.fatal("Error executing task", interruptedexception);
|
||||
}
|
||||
@@ -0,0 +0,0 @@ public class SystemUtils {
|
||||
}
|
||||
|
||||
public static <K> Strategy<K> g() {
|
||||
- return SystemUtils.IdentityHashingStrategy.INSTANCE;
|
||||
+ return (Strategy<K>) IdentityHashingStrategy.INSTANCE; // Paper - decompile fix
|
||||
}
|
||||
|
||||
static enum IdentityHashingStrategy implements Strategy<Object> {
|
||||
--
|
Loading…
Reference in a new issue