{"action":"closed","issue":{"url":"https://api.github.com/repos/CanaryModTeam/CanaryMod/issues/197","labels_url":"https://api.github.com/repos/CanaryModTeam/CanaryMod/issues/197/labels{/name}","comments_url":"https://api.github.com/repos/CanaryModTeam/CanaryMod/issues/197/comments","events_url":"https://api.github.com/repos/CanaryModTeam/CanaryMod/issues/197/events","html_url":"https://github.com/CanaryModTeam/CanaryMod/issues/197","id":58036440,"number":197,"title":"HangingEntityDestroyHook is not being canceled when set to do so","user":{"login":"clucky","id":1021793,"avatar_url":"https://avatars.githubusercontent.com/u/1021793?v=3","gravatar_id":"","url":"https://api.github.com/users/clucky","html_url":"https://github.com/clucky","followers_url":"https://api.github.com/users/clucky/followers","following_url":"https://api.github.com/users/clucky/following{/other_user}","gists_url":"https://api.github.com/users/clucky/gists{/gist_id}","starred_url":"https://api.github.com/users/clucky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clucky/subscriptions","organizations_url":"https://api.github.com/users/clucky/orgs","repos_url":"https://api.github.com/users/clucky/repos","events_url":"https://api.github.com/users/clucky/events{/privacy}","received_events_url":"https://api.github.com/users/clucky/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-02-18T07:37:32Z","updated_at":"2015-02-18T07:38:54Z","closed_at":"2015-02-18T07:38:54Z","body":"As you can see by my code, the hook should be canceled properly, resulting in the item frame remaining in the same state; however, in-game, the item frames are still destroyed (though no item is dropped).\r\n\r\n````\r\n\t@HookHandler\r\n\tpublic void onHangingEntityDestroy(HangingEntityDestroyHook hook) {\r\n\t\tPlayer player = hook.getPlayer();\r\n\t\tif (player != null) {\r\n\t\t\tMember member = Member.getMemberByPlayer(player);\r\n\t\t\tColony colony = Colony.getColonyByChunk(ChunkVector.getChunkOfPosition(hook.getPainting().getPosition()), hook.getPainting().getWorld());\r\n\t\t\tif (colony != null) {\r\n\t\t\t\tif (hook.getPainting().getEntityType() == EntityType.ITEMFRAME) {\r\n\t\t\t\t\tif (!colony.memberHasFlagHere(Flag.BREAK, member, hook.getPainting().getLocation())) {\r\n\t\t\t\t\t\thook.setCanceled();\r\n\t\t\t\t\t\thook.getPlayer().message(ChatFormat.RED + \"You do not have the required flags to destroy item frames here.\");\r\n\t\t\t\t\t}\r\n\t\t\t\t} else if (hook.getPainting().getEntityType() == EntityType.PAINTING) {\r\n\t\t\t\t\tif (!colony.memberHasFlagHere(Flag.BREAK, member, hook.getPainting().getLocation())) {\r\n\t\t\t\t\t\thook.setCanceled();\r\n\t\t\t\t\t\thook.getPlayer().message(ChatFormat.RED + \"You do not have the required flags to destroy paintings here.\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else if (hook.getDamageSource().getDamageDealer().getEntityType() == EntityType.ARROW) {\r\n\t\t\tColonyCraft.logger.debug(\"An arrow was shot at an item frame.\");\r\n\t\t}\r\n\t}\r\n````"}}