13
0
geforkt von Mirrors/Paper
Paper/paper-server/patches/sources/net/minecraft/stats/ServerStatsCounter.java.patch
CraftBukkit/Spigot 30e4583dbe Remap CraftBukkit to Mojang+Yarn Mappings
By: Initial Source <noreply+automated@papermc.io>
2024-12-11 22:26:55 +01:00

27 Zeilen
1018 B
Diff

--- a/net/minecraft/stats/ServerStatsCounter.java
+++ b/net/minecraft/stats/ServerStatsCounter.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<Stat<T>> getStat(StatType<T> type, String id) {
- Optional optional = Optional.ofNullable(ResourceLocation.tryParse(id));
- Registry iregistry = type.getRegistry();
+ // CraftBukkit - decompile error start
+ Optional<ResourceLocation> optional = Optional.ofNullable(ResourceLocation.tryParse(id));
+ Registry<T> iregistry = type.getRegistry();
- Objects.requireNonNull(iregistry);
- optional = optional.flatMap(iregistry::getOptional);
- Objects.requireNonNull(type);
- return optional.map(type::get);
+ return optional.flatMap(iregistry::getOptional).map(type::get);
+ // CraftBukkit - decompile error end
}
private static CompoundTag fromJson(JsonObject json) {