0
0
mirror of https://hub.spigotmc.org/stash/scm/spigot/craftbukkit.git synced 2024-11-24 06:26:14 +00:00
craftbukkit/nms-patches/net/minecraft/stats/ServerStatisticManager.patch
2023-03-15 03:30:00 +11:00

27 lines
1.1 KiB
Diff

--- 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) {