Skip to content

Conversation

@InspectorBoat
Copy link
Contributor

May have conflicts with #1961

@LifeIsAParadox LifeIsAParadox added the reviews needed This PR needs reviews label Dec 25, 2025
InventorySearch.refreshSlot(slot);
}
ItemPickupWidget.getInstance().onItemPickup(slot, stack);
((ItemStackUpdateDurability) (Object) stack).skyblocker$getAndCacheDurability();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don’t you need this to be called on component update as well? We already have a mixin for that somewhere as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you referring to the code for cancelComponentUpdateAnimation? That occurs in renderer code: ItemInHandRendererMixin.
There is also DataComponentHolderMixin, but that method doesn't seem to have a relevant update function.
Also, I don't believe the server even has a way to partially update an inventory stack's components: the only relevant packet seems to be ClientboundContainerSetSlotPacket, which always goes through setItem.

Copy link
Contributor Author

@InspectorBoat InspectorBoat Dec 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I also did verify that the durability bar correctly updates while mining.)

@InspectorBoat InspectorBoat marked this pull request as draft December 25, 2025 23:43
@LifeIsAParadox LifeIsAParadox added wip This PR is a work in progress and removed reviews needed This PR needs reviews labels Dec 25, 2025
@InspectorBoat InspectorBoat marked this pull request as ready for review December 26, 2025 00:20
@LifeIsAParadox LifeIsAParadox added reviews needed This PR needs reviews and removed wip This PR is a work in progress labels Dec 26, 2025
@InspectorBoat InspectorBoat marked this pull request as draft December 26, 2025 03:17
@LifeIsAParadox LifeIsAParadox added wip This PR is a work in progress and removed reviews needed This PR needs reviews labels Dec 26, 2025
@InspectorBoat
Copy link
Contributor Author

InspectorBoat commented Dec 26, 2025

Okay, it turns out the major source of lag was not from updating every item in the inventory every tick, but rather updating on ItemStack creation: in some areas (like the hub, or a private island) thousands of items are created per tick:
[22:35:52] [Render thread/INFO] (Minecraft) [STDOUT]: Items created: 2072. So this patch does nothing for that.

@InspectorBoat InspectorBoat marked this pull request as ready for review December 26, 2025 04:39
@LifeIsAParadox LifeIsAParadox added reviews needed This PR needs reviews and removed wip This PR is a work in progress labels Dec 26, 2025
* Updates the durability of this item stack every tick when in the inventory.
*/
@Inject(method = "inventoryTick", at = @At("TAIL"))
private void skyblocker$updateDamage(CallbackInfo ci) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do need it to update every tick for #1961

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for ticking cooldowns?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

reviews needed This PR needs reviews

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants