-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
4 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: Intybyte <[email protected]> | ||
Date: Mon, 21 Oct 2024 01:41:04 +0200 | ||
Subject: [PATCH] Create LimitedSet for entity scoreboard tags | ||
Subject: [PATCH] Expand scoreboard tag count validation to API set | ||
|
||
|
||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java | ||
index 4b54d0ea31062972e68ee8fafe3cfaf68f65a5cd..2711cd3b13686efdb3227cf681ddcf98ee82fd06 100644 | ||
index 4b54d0ea31062972e68ee8fafe3cfaf68f65a5cd..d9ae35015c8d6023c6b1053e3b1a528dd31b0673 100644 | ||
--- a/src/main/java/net/minecraft/world/entity/Entity.java | ||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java | ||
@@ -566,7 +566,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess | ||
this.packetPositionCodec = new VecDeltaCodec(); | ||
this.uuid = Mth.createInsecureUUID(this.random); | ||
this.stringUUID = this.uuid.toString(); | ||
- this.tags = Sets.newHashSet(); | ||
+ this.tags = new io.papermc.paper.util.SizeLimitedSet<>(new it.unimi.dsi.fastutil.objects.ObjectOpenHashSet<>(), MAX_ENTITY_TAG_COUNT); | ||
+ this.tags = new io.papermc.paper.util.SizeLimitedSet<>(new it.unimi.dsi.fastutil.objects.ObjectOpenHashSet<>(), MAX_ENTITY_TAG_COUNT); // Paper - fully limit tag size - replace set impl | ||
this.pistonDeltas = new double[]{0.0D, 0.0D, 0.0D}; | ||
this.mainSupportingBlockPos = Optional.empty(); | ||
this.onGroundNoBlocks = false; | ||
|
@@ -22,7 +22,7 @@ index 4b54d0ea31062972e68ee8fafe3cfaf68f65a5cd..2711cd3b13686efdb3227cf681ddcf98 | |
|
||
public boolean addTag(String tag) { | ||
- return this.tags.size() >= 1024 ? false : this.tags.add(tag); | ||
+ return this.tags.add(tag); // Paper - Create Limited set for Entity | ||
+ return this.tags.add(tag); // Paper - fully limit tag size - replace set impl | ||
} | ||
|
||
public boolean removeTag(String tag) { |