Paper/nms-patches/DataConverterRegistry.patch

36 lines
1.7 KiB
Diff
Raw Normal View History

2018-10-15 10:21:35 +02:00
--- a/net/minecraft/server/DataConverterRegistry.java
+++ b/net/minecraft/server/DataConverterRegistry.java
2018-12-25 22:00:00 +01:00
@@ -20,7 +20,12 @@
DataFixerBuilder datafixerbuilder = new DataFixerBuilder(1631);
a(datafixerbuilder);
- return datafixerbuilder.build(ForkJoinPool.commonPool());
+ // CraftBukkit start
+ ForkJoinPool pool = new ForkJoinPool(Integer.getInteger("net.minecraft.server.DataConverterRegistry.bootstrapThreads", Math.min(Runtime.getRuntime().availableProcessors(), 2)));
+ DataFixer fixer = datafixerbuilder.build(pool);
+ pool.shutdown();
+ return fixer;
+ // CraftBukkit end
}
public static DataFixer a() {
2018-12-25 22:00:00 +01:00
@@ -184,6 +189,18 @@
2018-10-15 10:21:35 +02:00
datafixerbuilder.addFixer(new DataConverterItemFrame(schema46, false));
2018-10-22 21:00:00 +02:00
Schema schema47 = datafixerbuilder.addSchema(1458, DataConverterRegistry.b);
2018-10-15 10:21:35 +02:00
+ // CraftBukkit start
+ datafixerbuilder.addFixer(new com.mojang.datafixers.DataFix(schema47, false) {
+ @Override
+ protected com.mojang.datafixers.TypeRewriteRule makeRule() {
2018-12-06 00:00:00 +01:00
+ return this.fixTypeEverywhereTyped("Player CustomName", this.getInputSchema().getType(DataConverterTypes.PLAYER), (typed) -> {
2018-10-15 10:21:35 +02:00
+ return typed.update(DSL.remainderFinder(), (dynamic) -> {
+ return DataConverterCustomNameEntity.a(dynamic);
+ });
+ });
+ }
+ });
+ // CraftBukkit end
datafixerbuilder.addFixer(new DataConverterCustomNameEntity(schema47, false));
datafixerbuilder.addFixer(new DataConverterCustomNameItem(schema47, false));
datafixerbuilder.addFixer(new DataConverterCustomNameTile(schema47, false));