CardinalPGM
CardinalPGM copied to clipboard
Wrongtool does not work on blockdrops
As example, an Iron Block can only be destroyed using a Pickaxe or TNT, but if you break it with the hand, the items are dropped what should not happen.
Cardinal version: http://gyazo.com/f5f9f157780c85e41af85581057ec797
It depends on what the xml specifies, some maps allow you to break it with anything and still get it, other only allow you to use the tool that is needed to break that item
<wrongtool>
In cos(tnt) the player isnt allowed to break it with the hand (already tested), but cannot find the <wrongtool>
module in the XML.
it will default to off iirc
Uh, in the cos(tnt) of OCN you cant, but in Cardinal the player is allowed. Same XML.
Ok, we need a way to either check if the block would have dropped items (if it would not have, then it was broken with the wrong tool) or a way to check if the item used to break the block was the required tool, without having giant lists of the block and their associated tool
any ideas @twizmwazin @iEli2tyree011?
@CaptainElliott I would use block break event, get the tool and check it with a map.
What do you mean check it with the map?
I need to know if the tool used is the right tool for the block
@CaptainElliott A HashMap, sorry for being unclear.
@CaptainElliott I'm thinking of block.getDrops() > 0 then drop, else no
aka check if it would have dropped something. The only issue is if glass was broken and supposed to have a drop.
as twiz said, i also thought about testing if it drops something, but that won't work with glass, and maybe others you can either make "get drops with exeption of glass" or you can make it test the tool that has been used by the player