Limit item frame cursors on maps

This commit is contained in:
Yive 2021-05-26 15:09:33 -07:00
parent cd9caecbde
commit e8cb0ac761

View file

@ -140,16 +140,30 @@
nbt.putInt("xCenter", this.centerX);
nbt.putInt("zCenter", this.centerZ);
nbt.putByte("scale", this.scale);
@@ -443,7 +522,7 @@
@@ -247,8 +326,10 @@
if (!this.isTrackedCountOverLimit(256)) {
MapFrame worldmapframe1 = new MapFrame(blockposition, entityitemframe.getDirection().get2DDataValue() * 90, entityitemframe.getId());
+ if (this.decorations.size() < player.level().paperConfig().maps.itemFrameCursorLimit) { // Paper - Limit item frame cursors on maps
this.addDecoration(MapDecorationTypes.FRAME, player.level(), MapItemSavedData.getFrameKey(entityitemframe.getId()), (double) blockposition.getX(), (double) blockposition.getZ(), (double) (entityitemframe.getDirection().get2DDataValue() * 90), (Component) null);
this.frameMarkers.put(worldmapframe1.getId(), worldmapframe1);
+ } // Paper - Limit item frame cursors on maps
}
MapDecorations mapdecorations = (MapDecorations) stack.getOrDefault(DataComponents.MAP_DECORATIONS, MapDecorations.EMPTY);
@@ -441,9 +522,9 @@
return true;
}
- if (!this.isTrackedCountOverLimit(256)) {
+ if (!this.isTrackedCountOverLimit(((Level) world).paperConfig().maps.itemFrameCursorLimit)) { // Paper - Limit item frame cursors on maps
this.bannerMarkers.put(mapiconbanner.getId(), mapiconbanner);
- this.addDecoration(mapiconbanner.getDecoration(), world, mapiconbanner.getId(), d0, d1, 180.0D, (Component) mapiconbanner.name().orElse((Object) null));
+ this.addDecoration(mapiconbanner.getDecoration(), world, mapiconbanner.getId(), d0, d1, 180.0D, (Component) mapiconbanner.name().orElse(null)); // CraftBukkit - decompile error
return true;
}
}
@@ -554,7 +633,7 @@
@@ -554,7 +635,7 @@
this.player = entityhuman;
}
@ -158,7 +172,7 @@
int i = this.minDirtyX;
int j = this.minDirtyY;
int k = this.maxDirtyX + 1 - this.minDirtyX;
@@ -563,7 +642,7 @@
@@ -563,7 +644,7 @@
for (int i1 = 0; i1 < k; ++i1) {
for (int j1 = 0; j1 < l; ++j1) {
@ -167,7 +181,7 @@
}
}
@@ -573,19 +652,29 @@
@@ -573,19 +654,29 @@
@Nullable
Packet<?> nextUpdatePacket(MapId mapId) {
MapItemSavedData.MapPatch worldmap_c;