mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 23:38:25 +01:00
Add initial size cap to component map
This commit is contained in:
parent
ec006b59bb
commit
f97bdb1894
1 changed files with 13 additions and 0 deletions
|
@ -4,6 +4,19 @@ Date: Mon, 11 Sep 2023 12:01:57 +1000
|
||||||
Subject: [PATCH] Add slot sanity checks in container clicks
|
Subject: [PATCH] Add slot sanity checks in container clicks
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/core/component/DataComponentPatch.java b/src/main/java/net/minecraft/core/component/DataComponentPatch.java
|
||||||
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
|
--- a/src/main/java/net/minecraft/core/component/DataComponentPatch.java
|
||||||
|
+++ b/src/main/java/net/minecraft/core/component/DataComponentPatch.java
|
||||||
|
@@ -0,0 +0,0 @@ public final class DataComponentPatch {
|
||||||
|
if (i == 0 && j == 0) {
|
||||||
|
return DataComponentPatch.EMPTY;
|
||||||
|
} else {
|
||||||
|
- Reference2ObjectMap<DataComponentType<?>, Optional<?>> reference2objectmap = new Reference2ObjectArrayMap(i + j);
|
||||||
|
+ Reference2ObjectMap<DataComponentType<?>, Optional<?>> reference2objectmap = new Reference2ObjectArrayMap(Math.min(i + j, 256)); // Paper - sensible initial size limit
|
||||||
|
|
||||||
|
DataComponentType datacomponenttype;
|
||||||
|
int k;
|
||||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
|
|
Loading…
Reference in a new issue