81 lines
6.0 KiB
Diff
81 lines
6.0 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: IPECTER <ipectert@gmail.com>
|
|
Date: Tue, 30 May 2023 12:12:29 +0900
|
|
Subject: [PATCH] MC Dev fixes
|
|
|
|
|
|
diff --git a/src/main/java/com/destroystokyo/paper/Metrics.java b/src/main/java/com/destroystokyo/paper/Metrics.java
|
|
index b0b2cbd8d9db1772d43a285eca9060f3879acab0..8cde30544e14f8fc2dac32966ae3c21f8cf3a551 100644
|
|
--- a/src/main/java/com/destroystokyo/paper/Metrics.java
|
|
+++ b/src/main/java/com/destroystokyo/paper/Metrics.java
|
|
@@ -604,15 +604,6 @@ public class Metrics {
|
|
metrics.addCustomChart(new Metrics.SingleLineChart("players", () -> Bukkit.getOnlinePlayers().size()));
|
|
metrics.addCustomChart(new Metrics.SimplePie("online_mode", () -> Bukkit.getOnlineMode() ? "online" : (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode() ? "bungee" : "offline"))); // Purpur
|
|
metrics.addCustomChart(new Metrics.SimplePie("purpur_version", () -> (org.bukkit.craftbukkit.Main.class.getPackage().getImplementationVersion() != null) ? org.bukkit.craftbukkit.Main.class.getPackage().getImplementationVersion() : "unknown")); // Purpur
|
|
- final String paperVersion;
|
|
- final String implVersion = org.bukkit.craftbukkit.Main.class.getPackage().getImplementationVersion();
|
|
- if (implVersion != null) {
|
|
- final String buildOrHash = implVersion.substring(implVersion.lastIndexOf('-') + 1);
|
|
- paperVersion = "git-Pufferfish-%s-%s".formatted(Bukkit.getServer().getMinecraftVersion(), buildOrHash); // Pufferfish
|
|
- } else {
|
|
- paperVersion = "unknown";
|
|
- }
|
|
- metrics.addCustomChart(new Metrics.SimplePie("pufferfish_version", () -> paperVersion)); // Pufferfish
|
|
|
|
metrics.addCustomChart(new Metrics.DrilldownPie("java_version", () -> {
|
|
Map<String, Map<String, Integer>> map = new HashMap<>();
|
|
diff --git a/src/main/java/net/minecraft/util/datafix/fixes/LeavesFix.java b/src/main/java/net/minecraft/util/datafix/fixes/LeavesFix.java
|
|
index 733134401fcba393053c7a2dfa1d0d44f8f79ff5..17d931ef47846b59e28dc0c5b5ae91396a1d3e7d 100644
|
|
--- a/src/main/java/net/minecraft/util/datafix/fixes/LeavesFix.java
|
|
+++ b/src/main/java/net/minecraft/util/datafix/fixes/LeavesFix.java
|
|
@@ -71,14 +71,14 @@ public class LeavesFix extends DataFix {
|
|
return this.fixTypeEverywhereTyped("Leaves fix", type, (typed) -> {
|
|
return typed.updateTyped(opticFinder, (typedx) -> {
|
|
int[] is = new int[]{0};
|
|
- Typed<?> typed2 = typedx.updateTyped(opticFinder2, (typed) -> {
|
|
- Int2ObjectMap<LeavesFix.LeavesSection> int2ObjectMap = new Int2ObjectOpenHashMap<>(typed.getAllTyped(opticFinder3).stream().map((typedx) -> {
|
|
- return new LeavesFix.LeavesSection(typedx, this.getInputSchema());
|
|
+ Typed<?> typed2 = typedx.updateTyped(opticFinder2, (typed2x) -> { // Plazma - decompile fix
|
|
+ Int2ObjectMap<LeavesFix.LeavesSection> int2ObjectMap = new Int2ObjectOpenHashMap<>(typed2x.getAllTyped(opticFinder3).stream().map((typedx2) -> { // Plazma - decompile fix
|
|
+ return new LeavesFix.LeavesSection(typedx2, this.getInputSchema()); // Plazma - decompile fix
|
|
}).collect(Collectors.toMap(LeavesFix.Section::getIndex, (leavesSection) -> {
|
|
return leavesSection;
|
|
})));
|
|
if (int2ObjectMap.values().stream().allMatch(LeavesFix.Section::isSkippable)) {
|
|
- return typed;
|
|
+ return typed2x; // Plazma - decompile fix
|
|
} else {
|
|
List<IntSet> list = Lists.newArrayList();
|
|
|
|
@@ -134,8 +134,8 @@ public class LeavesFix extends DataFix {
|
|
}
|
|
}
|
|
|
|
- return typed.updateTyped(opticFinder3, (typedx) -> {
|
|
- return int2ObjectMap.get(typedx.get(DSL.remainderFinder()).get("Y").asInt(0)).write(typedx);
|
|
+ return typed.updateTyped(opticFinder3, (typedx2) -> { // Plazma - decompile fix
|
|
+ return int2ObjectMap.get(typedx2.get(DSL.remainderFinder()).get("Y").asInt(0)).write(typedx2); // Plazma - decompile fix
|
|
});
|
|
}
|
|
});
|
|
@@ -298,8 +298,8 @@ public class LeavesFix extends DataFix {
|
|
throw new IllegalStateException("Block state type is not what was expected.");
|
|
} else {
|
|
Optional<List<Pair<String, Dynamic<?>>>> optional = typed.getOptional(this.paletteFinder);
|
|
- this.palette = optional.map((list) -> {
|
|
- return list.stream().map(Pair::getSecond).collect(Collectors.toList());
|
|
+ this.palette = (List) optional.map((list) -> { // Plazma - decompile fix
|
|
+ return (List) list.stream().map(Pair::getSecond).collect(Collectors.toList()); // Plazma - decompile fix
|
|
}).orElse(ImmutableList.of());
|
|
Dynamic<?> dynamic = typed.get(DSL.remainderFinder());
|
|
this.index = dynamic.get("Y").asInt(0);
|
|
@@ -321,7 +321,7 @@ public class LeavesFix extends DataFix {
|
|
public Typed<?> write(Typed<?> typed) {
|
|
return this.isSkippable() ? typed : typed.update(DSL.remainderFinder(), (dynamic) -> {
|
|
return dynamic.set("BlockStates", dynamic.createLongList(Arrays.stream(this.storage.getRaw())));
|
|
- }).set(this.paletteFinder, this.palette.stream().map((dynamic) -> {
|
|
+ }).set(this.paletteFinder, (List) this.palette.stream().map((dynamic) -> { // Plazma - decompile fix
|
|
return Pair.of(References.BLOCK_STATE.typeName(), dynamic);
|
|
}).collect(Collectors.toList()));
|
|
}
|