Paper/Spigot-Server-Patches/0471-Remove-streams-from-MinecraftKey.patch
Aikar ce270e1412
Updated Upstream (Bukkit/CraftBukkit/Spigot)
Upstream has released updates that appears to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
b2f1908c SPIGOT-5783: Add helpful info to UnknownDependencyException
e4f46260 SPIGOT-2623: Add EntityEquipment methods to get/set ItemStacks by slot.
529a9a69 SPIGOT-5751: Clarify behaviour of block drop-related API methods

CraftBukkit Changes:
8ea9b138 Remove outdated build delay.
ffc2b251 Revert "#675: Fix redirected CommandNodes sometimes not being properly redirected"
cb701f6b #675: Fix redirected CommandNodes sometimes not being properly redirected
c9d7c16b SPIGOT-2623: Add EntityEquipment methods to get/set ItemStacks by slot.
fad2494a #673: Fix Craftworld#isChunkLoaded
8637ec00 SPIGOT-5751: Made breakNaturally and getDrops returns the correct item if no argument is given

Spigot Changes:
a99063f7 Rebuild patches

Fixes #3602
2020-06-23 04:40:03 -04:00

48 lines
2.1 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
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
index 2b271d3e509a5450c9136dced3ad4dc4d65af45a..b1beebf0ed5737c04875bf9138624fb2bd5dff27 100644
--- 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> {