2020-04-21 22:06:30 +00:00
|
|
|
From 744f80a2c7cee1fd31f773eecbb4d34b3987c370 Mon Sep 17 00:00:00 2001
|
2020-04-12 22:31:14 +00:00
|
|
|
From: Spottedleaf <spottedleaf@spottedleaf.dev>
|
|
|
|
Date: Mon, 6 Apr 2020 18:06:24 -0700
|
|
|
|
Subject: [PATCH] Remove streams from MinecraftKey
|
|
|
|
|
|
|
|
They produce a lot of garbage.
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/MinecraftKey.java b/src/main/java/net/minecraft/server/MinecraftKey.java
|
2020-04-21 22:06:30 +00:00
|
|
|
index 2b271d3e..b1beebf0 100644
|
2020-04-12 22:31:14 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/MinecraftKey.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/MinecraftKey.java
|
|
|
|
@@ -125,15 +125,29 @@ public class MinecraftKey implements Comparable<MinecraftKey> {
|
|
|
|
}
|
|
|
|
|
|
|
|
private static boolean c(String s) {
|
|
|
|
- return s.chars().allMatch((i) -> {
|
|
|
|
- return i == 95 || i == 45 || i >= 97 && i <= 122 || i >= 48 && i <= 57 || i == 47 || i == 46;
|
|
|
|
- });
|
|
|
|
+ // Paper start - remove streams
|
|
|
|
+ for (int index = 0, len = s.length(); index < len; ++index) {
|
|
|
|
+ int i = (int)s.charAt(index);
|
|
|
|
+ boolean condition = i == 95 || i == 45 || i >= 97 && i <= 122 || i >= 48 && i <= 57 || i == 47 || i == 46; // this is copied from the replaced code.
|
|
|
|
+ if (!condition) {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return true;
|
|
|
|
+ // Paper end - remove streams
|
|
|
|
}
|
|
|
|
|
|
|
|
private static boolean d(String s) {
|
|
|
|
- return s.chars().allMatch((i) -> {
|
|
|
|
- return i == 95 || i == 45 || i >= 97 && i <= 122 || i >= 48 && i <= 57 || i == 46;
|
|
|
|
- });
|
|
|
|
+ // Paper start - remove streams
|
|
|
|
+ for (int index = 0, len = s.length(); index < len; ++index) {
|
|
|
|
+ int i = (int)s.charAt(index);
|
|
|
|
+ boolean condition = i == 95 || i == 45 || i >= 97 && i <= 122 || i >= 48 && i <= 57 || i == 46; // this is copied from the replaced code.
|
|
|
|
+ if (!condition) {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return true;
|
|
|
|
+ // Paper end - remove streams
|
|
|
|
}
|
|
|
|
|
|
|
|
public static class a implements JsonDeserializer<MinecraftKey>, JsonSerializer<MinecraftKey> {
|
|
|
|
--
|
2020-04-21 22:06:30 +00:00
|
|
|
2.25.1.windows.1
|
2020-04-12 22:31:14 +00:00
|
|
|
|