04-21-2013, 06:14 AM
Bad idea: comparing to a number, instead of a named constant. If you come back to this code in a month, you won't know that 9 is "water"
Even worse: You're checking only one value used for water, you need to check two: E_BLOCK_WATER and E_BLOCK_STATIONARY_WATER. Now, how about lava? Obsidian? Bedrock?
Before you start writing a huge IF condition, let me suggest writing a switch block instead, with the block destroying in its default branch
Even worse: You're checking only one value used for water, you need to check two: E_BLOCK_WATER and E_BLOCK_STATIONARY_WATER. Now, how about lava? Obsidian? Bedrock?
Before you start writing a huge IF condition, let me suggest writing a switch block instead, with the block destroying in its default branch
