aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/og/net/minecraft/stats/ServerStatisticManager.patch
blob: ac3c4fffdf11927f12719756ec63ed01d712d0b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
--- a/net/minecraft/stats/ServerStatisticManager.java
+++ b/net/minecraft/stats/ServerStatisticManager.java
@@ -1,3 +1,4 @@
+// mc-dev import
 package net.minecraft.stats;
 
 import com.google.common.collect.Maps;
@@ -158,13 +159,12 @@
     }
 
     private <T> Optional<Statistic<T>> getStat(StatisticWrapper<T> statisticwrapper, String s) {
-        Optional optional = Optional.ofNullable(MinecraftKey.tryParse(s));
-        IRegistry iregistry = statisticwrapper.getRegistry();
+        // CraftBukkit - decompile error start
+        Optional<MinecraftKey> optional = Optional.ofNullable(MinecraftKey.tryParse(s));
+        IRegistry<T> iregistry = statisticwrapper.getRegistry();
 
-        Objects.requireNonNull(iregistry);
-        optional = optional.flatMap(iregistry::getOptional);
-        Objects.requireNonNull(statisticwrapper);
-        return optional.map(statisticwrapper::get);
+        return optional.flatMap(iregistry::getOptional).map(statisticwrapper::get);
+        // CraftBukkit - decompile error end
     }
 
     private static NBTTagCompound fromJson(JsonObject jsonobject) {