Supposing that we want to exit from a cancelled event function by us, we need to do:
Being that we could do:
This case gets more sense with a true comparison case:
Also, this will be biutifier than:
Or
What do you think?
Java:
e.setCancelled(true);
if(e.isCancelled())
return;
Being that we could do:
Java:
if(e.setCancelled(true))
return;
This case gets more sense with a true comparison case:
Java:
ItemStack theResult = e.getSlot(23);
if(e.setCancelled(theResult != null)) /* If the item is not null, cancel the event and exit quickly */
return;
Also, this will be biutifier than:
Java:
ItemStack theResult = e.getSlot(23);
if(theResult != null)
{
e.setCancelled(true);
return;
}
Or
Java:
ItemStack theResult = e.getSlot(23);
e.setCancelled(theResult != null);
if(e.isCancelled())
return;
What do you think?