Open buglord opened 5 years ago
https://lsimons.wordpress.com/2009/07/20/instanceof-vs-classcastexception-performance-which-is-faster/ notes that speed is equivilant for casting exceptions and instanceof but makes no mention of memory usage. but also includes casting after instanceof which is not relevant for simply checking type.
botania terra axe already functions similarly but registers as an axe even when removed from whitelist due to https://github.com/ondrejduchon/TreeChopper/blob/e9f32846d1e7887f2cca0bdd107a5b927ca77721/src/main/java/treechopper/proxy/CommonProxy.java#L152-L157 preventing normal function of the tool. having a blacklist in addition to the whitelist would solve problem.
sidenote (possible performance enhancement); throwing exceptions for every non-axe item is a bit messy, could check instanceof instead.