Skip to content

Commit

Permalink
Missing paper comment
Browse files Browse the repository at this point in the history
  • Loading branch information
lynxplay committed Oct 21, 2024
1 parent 364181d commit 90c9f98
Showing 1 changed file with 4 additions and 4 deletions.
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;
Expand All @@ -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) {

0 comments on commit 90c9f98

Please sign in to comment.