Cartography Table inventory not returned for InventoryClickEvent.getClickedInventory on result slot

    • Type: Bug
    • Resolution: Fixed
    • Priority: Minor
    • None
    • Affects Version/s: None
    • This server is running CraftBukkit version git-Spigot-1eece4f-d5c2e3c (MC: 1.14) (Implementing API version 1.14-R0.1-SNAPSHOT)
    • Yes

      I'm writing on a map plugin, to deny copyright protected maps. The maps have a lore and if the lore is on the map, it couldn't be copied.

       

      This works fine with the Player-Crafting Inventory and the Workbench Inventory. On click onto the map in the Result slot, I can cancel the event. But this doesn't works with the Cartography Table.

      If I check every Slot of the Cartography Table and first put the filled map in and then the empty map, the event will be canceled. If I put first an empty map in and then the filled map, the event wouldn't be canceled and I can click on the Result Slot and get the maps copied.

       

      if(e.getClickedInventory().getItem(0) != null) {
      	if(e.getClickedInventory().getItem(0).hasItemMeta()) {
      		ItemMeta iMeta = e.getClickedInventory().getItem(0).getItemMeta();
      		if(iMeta.hasLore()) {
      			List<String> iLore = e.getClickedInventory().getItem(0).getItemMeta().getLore();
      			String str = ChatColor.stripColor(String.valueOf(iLore));
      			String original = "Original";
      			String copy = "Copy";
      							
      			if(str.contains(original) || str.contains(copy)) {
      				e.setCancelled(true);
      				p.closeInventory();
      				p.sendMessage("Can not be copied");
      				return;
      			}
      		}
      	}
      }
      

            Assignee:
            Unassigned
            Reporter:
            Christopher Borchert
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: