[SPIGOT-6570] Missing InventoryType: COMPOSTER Created: 16/Jun/21 Updated: 16/Jun/21 Resolved: 16/Jun/21 |
|
| Status: | Resolved |
| Project: | Spigot |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor |
| Reporter: | Llm Dl | Assignee: | Unassigned |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | InventoryMoveItemEvent, InventoryType | ||
| Environment: |
Java 16, Windows. Not applicable to issue. |
||
| Attachments: |
|
| Version: | This server is running CraftBukkit version 3114-Spigot-66f9d3c-6fdecf2 (MC: 1.17) (Implementing API version 1.17-R0.1-SNAPSHOT) |
| Guidelines Read: | 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.) |
| Comments |
| Comment by Llm Dl [ 16/Jun/21 ] |
|
Very nice work md5! |