Skip to content

Not really a issue. Feedback #31

Description

@MisterAndyDandy

I used this code for my backpack when I was looking for light values and it works fine.

instead of you patching. You can do this. <3

private void OnLevelFinalize()
  {
      try
      {
          BackPack = Capi?.World?.Player?.InventoryManager.GetOwnInventory(GlobalConstants.backpackInvClassName);
    
          BackPack?.SlotModified += BackPack_SlotModified;
      }
      catch
      {
          // just keep on
      }
  }

  public void BackPack_SlotModified(int slotid)
  {
      var itemstack = BackPack?[slotid]?.Itemstack;

      if (itemstack != null) 
      {
          if (itemstack.Collectible is ItemEGlider || itemstack.Collectible is ItemGlider)
          {
              //Do something here
          }
      }
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions