Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

LIMachi

Members
  • Joined

  • Last visited

Everything posted by LIMachi

  1. Thanks, I will try to do a PR tomorrow then
  2. Because this is not a "bug" in itself, but might cause bugs in mods that assume that the index is correct (when using it to replace an item with Inventory#setItem for example). And so Mojang as no reason to "fix" this since it doesn't affect any Vanilla items (only compass and map items use the tick method in vanilla), but Forge might be interested in tweaking this behavior to ensure that mods using the tick method work as intended.
  3. In Inventory#tick, the function iterate on all slots in the player inventory to tick them, passing their index as the 3rd parameter and if they are selected as the 4th parameter, but those are not valid for armor or offhand, since the variable 'i' is reset per inventory compartment, resulting in index 0 for offhand and boots, and 1,2,3 for leggings, chest and helmet. public void tick() { for(NonNullList<ItemStack> nonnulllist : this.compartments) { for(int i = 0; i < nonnulllist.size(); ++i) { if (!nonnulllist.get(i).isEmpty()) { nonnulllist.get(i).inventoryTick(this.player.level, this.player, i, this.selected == i); } } } armor.forEach(e -> e.onArmorTick(player.level, player)); } I think a simple tweak would be enough to fix this since 'compartments' are initialized in order: public void tick() { int index = 0; for(NonNullList<ItemStack> nonnulllist : this.compartments) { for(int i = 0; i < nonnulllist.size(); ++i) { if (!nonnulllist.get(i).isEmpty()) { nonnulllist.get(i).inventoryTick(this.player.level, this.player, index, this.selected == index); ++index; } } } armor.forEach(e -> e.onArmorTick(player.level, player)); }

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.