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
          }
      }
  }

Activity

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

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