HxCKDMS / HxCEnchants

Adds many new enchantments to minecraft.
GNU General Public License v3.0
1 stars 0 forks source link

EnchantHandlers.java weird logic #32

Closed adamsonich closed 8 years ago

adamsonich commented 8 years ago

"!(entity instanceof EntityPlayer)) && entity != player" (entity is not any player) and (entity is not owner-player) will always give false on any player

adamsonich commented 8 years ago

small but still speed up

DrZed commented 8 years ago

You didn't read the whole line did you? "(Configurations.PlayerAuraDeadly || !(entity instanceof EntityPlayer)) && entity != player" IF PlayerAuraDeadly is enabled then the statement will be read in the code as.. "true && victim != EnchantedPlayer" If it's not enabled "entity != EntityPlayer && victim != enchantedPlayer"

DrZed commented 8 years ago

If enabled the enchant can damage players, but I don't want it damaging the user of the enchant

DrZed commented 8 years ago

I use IntelliJ IDEA AKA (Intelligent Java Integrated Development Environment Advanced) It would've told me that the statement was useless, if it was.