CardinalPGM icon indicating copy to clipboard operation
CardinalPGM copied to clipboard

Wrongtool does not work on blockdrops

Open ghost opened this issue 9 years ago • 10 comments

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

ghost avatar Mar 14 '15 20:03 ghost

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>

ElliottWhyman avatar Mar 14 '15 21:03 ElliottWhyman

In cos(tnt) the player isnt allowed to break it with the hand (already tested), but cannot find the <wrongtool> module in the XML.

ghost avatar Mar 14 '15 21:03 ghost

it will default to off iirc

ElliottWhyman avatar Mar 14 '15 21:03 ElliottWhyman

Uh, in the cos(tnt) of OCN you cant, but in Cardinal the player is allowed. Same XML.

ghost avatar Mar 14 '15 21:03 ghost

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?

ElliottWhyman avatar Mar 15 '15 09:03 ElliottWhyman

@CaptainElliott I would use block break event, get the tool and check it with a map.

dentmaged avatar Mar 15 '15 11:03 dentmaged

What do you mean check it with the map?

I need to know if the tool used is the right tool for the block

ElliottWhyman avatar Mar 15 '15 11:03 ElliottWhyman

@CaptainElliott A HashMap, sorry for being unclear.

dentmaged avatar Mar 15 '15 21:03 dentmaged

@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.

twizmwazin avatar Mar 16 '15 22:03 twizmwazin

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

Pablete1234 avatar Jun 09 '15 14:06 Pablete1234