-
-
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
3 changed files
with
80 additions
and
80 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
This file was deleted.
Oops, something went wrong.
28 changes: 28 additions & 0 deletions
28
patches/server/1069-Create-LimitedSet-for-entity-scoreboard-tags.patch
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
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 | ||
|
||
|
||
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 | ||
--- 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.pistonDeltas = new double[]{0.0D, 0.0D, 0.0D}; | ||
this.mainSupportingBlockPos = Optional.empty(); | ||
this.onGroundNoBlocks = false; | ||
@@ -654,7 +654,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess | ||
} | ||
|
||
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 | ||
} | ||
|
||
public boolean removeTag(String tag) { |