Update example-7-hello-events.js

This commit is contained in:
Walter Higgins 2014-11-08 06:17:57 +00:00
parent 2f391fb4b4
commit 67d46db748

View file

@ -93,11 +93,17 @@ Update: Since version 2.0.8 the above code can be replaced by the more succinct:
});
***/
// wph 20140927 - event handler differs depending on framework.
// wph 20140927 - event handler registration differs depending on framework.
var onJoin = __plugin.canary ? events.connection : events.playerJoin;
onJoin( function( event ) {
function onJoin( event ) {
if ( isOp(event.player) ) {
echo( event.player, 'Welcome to ' + __plugin );
}
});
}
if (__plugin.canary){
// canarymod
events.connection( onJoin );
} else {
// bukkit
events.playerJoin( onJoin );
}