[ci skip] Add more patch identifying comments, merge related patches

This commit is contained in:
Nassim Jahnke
2024-01-14 16:31:39 +01:00
parent 0cb53bb7af
commit 44f3ecd436
42 changed files with 460 additions and 584 deletions

View File

@@ -13,7 +13,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
if (this.level.paperConfig().maps.itemFrameCursorUpdateInterval > 0 && this.tickCount % this.level.paperConfig().maps.itemFrameCursorUpdateInterval == 0 && itemstack.getItem() instanceof MapItem) { // CraftBukkit - Moved this.tickCounter % 10 logic here so item frames do not enter the other blocks // Paper - Make item frame map cursor update interval configurable
- Integer integer = MapItem.getMapId(itemstack);
+ Integer integer = entityitemframe.cachedMapId; // Paper
+ Integer integer = entityitemframe.cachedMapId; // Paper - Perf: Cache map ids on item frames
MapItemSavedData worldmap = MapItem.getSavedData(integer, this.level);
if (worldmap != null) {
@@ -25,7 +25,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public static final int NUM_ROTATIONS = 8;
public float dropChance;
public boolean fixed;
+ public Integer cachedMapId; // Paper
+ public Integer cachedMapId; // Paper - Perf: Cache map ids on item frames
public ItemFrame(EntityType<? extends ItemFrame> type, Level world) {
super(type, world);
@@ -33,7 +33,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
private void onItemChanged(ItemStack stack) {
+ this.cachedMapId = MapItem.getMapId(stack); // Paper
+ this.cachedMapId = MapItem.getMapId(stack); // Paper - Perf: Cache map ids on item frames
if (!stack.isEmpty() && stack.getFrame() != this) {
stack.setEntityRepresentation(this);
}