Explosions and TNT block and entity
#13
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 Smile
Reply
Thanks given by:


Messages In This Thread
Explosions and TNT block and entity - by keyboard - 04-18-2013, 12:54 PM
RE: Explosions and TNT block and entity - by xoft - 04-18-2013, 05:45 PM
RE: Explosions and TNT block and entity - by xoft - 04-18-2013, 11:32 PM
RE: Explosions and TNT block and entity - by xoft - 04-19-2013, 06:28 PM
RE: Explosions and TNT block and entity - by xoft - 04-21-2013, 05:49 AM
RE: Explosions and TNT block and entity - by xoft - 04-21-2013, 06:14 AM
RE: Explosions and TNT block and entity - by xoft - 04-21-2013, 06:46 AM
RE: Explosions and TNT block and entity - by xoft - 03-09-2014, 04:03 AM
RE: Explosions and TNT block and entity - by xoft - 03-09-2014, 06:27 AM



Users browsing this thread: 1 Guest(s)