Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-6570

Missing InventoryType: COMPOSTER

    XMLWordPrintable

Details

    • This server is running CraftBukkit version 3114-Spigot-66f9d3c-6fdecf2 (MC: 1.17) (Implementing API version 1.17-R0.1-SNAPSHOT)
    • Yes

    Description

      Currently there exists no Composter InventoryType.

      This becomes an issue when using code to filter out non-chest InventoryMoveItemEvents.

      The below code works fine for chest-related hopper inventory siphoning.

      	public void onHopperMoveItem(InventoryMoveItemEvent event) {
      		if (!event.getSource().getType().equals(InventoryType.CHEST))
      			return;
      
      		Location loc = event.getSource().getLocation();
      	}
      

      However if the Hopper-Composter-Hopper auto-composter shown in the supplied image is built it will pass the above code's if statement. This is because Composters report a Chest InventoryType.

      The above code will also throw an NPE when loc is set, as the getSource().getLocation() is null (probably related to the missing InventoryType somehow.)

      Attachments

        Activity

          People

            Unassigned Unassigned
            LlmDl Llm Dl
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: