I'm jython/python bukkit plugin developer and I'm stuck here. I was always using == in cases like this one, and everything worked perfect. What's the problem? Here's the code:
lastslot = event.getNewSlot()
iteminslot = event.getPlayer().getInventory().getItem(lastslot).getType()
print "Iteminslot: %s "%iteminslot
print "CurrentKey: %s"%currentKey
if clickable1 == "false":
log.info("clickable1 ok")
if iteminslot == currentKey:
log.info("iteminslot ok")
event.getPlayer().addPotionEffect(potion_effect)
When I run code, I get code process to the "clickable1 ok" logger, so it stops checking if iteminslot == currentKey... But when I print out Iteminslot and Currentkey, they are same!
20:41:00 [INFO] Iteminslot: DIAMOND_SWORD
20:41:00 [INFO] CurrentKey: DIAMOND_SWORD
20:41:01 [INFO] clickable1 ok
Where am I making mistakes? Thanks for reading/answering! :)