[DEV] jxpl - javax.script Plugin Loader r12, r14 [1597 (1.0.1-R1), 1.1]

Discussion in 'Inactive/Unsupported Plugins' started by angelsl, Oct 27, 2011.

  1. Offline

    angelsl

  2. Offline

    angelsl

    jxpl r11 released
    • Fix jxpl's javascript breaking
      • Rhino is now included in the jar, avoiding differences in Java 6/7 API
    • Fix jxpl completely breaking if one script fails to load
    • More log message rewording
    Try Event.Type.ENTITY_DAMAGE...
     
  3. Thanks. I just want to take few examples.

    Code:
    function onEnable() {
        helper.log(Level.INFO, "Testplugin loaded!");
        helper.registerEvent(Event.Type.PLAYER_JOIN, Event.Priority.Lowest, "onPlayerJoin");
        helper.registerEvent(Event.Type.BLOCK_DAMAGE, Event.Priority.Highest, "OnBlockDamage");
    }
    function OnBlockDamage(p, block, iteminhand, false) {  p.sendMessage(ChatColor.YELLOW + "Block : " + block); }
    org.angelsl.bukkit.jxpl.rhino.util.ExtendedScriptException: org.mozilla.javascript.EvaluatorException: missing formal parameter (<Unknown source>#29) in <Unknown source> at line number 29
     
  4. Offline

    angelsl

    All event handlers in jxpl have two arguments: type and eventArgs.
    Code:
    function onEnable() {
        helper.log(Level.INFO, "Testplugin loaded!");
        helper.registerEvent(Event.Type.PLAYER_JOIN, Event.Priority.Lowest, "onPlayerJoin");
        helper.registerEvent(Event.Type.BLOCK_DAMAGE, Event.Priority.Highest, "onBlockDamage");
    }
    function onBlockDamage(type, args) {  args.getPlayer().sendMessage(ChatColor.YELLOW + "Block : " + args.getBlock().getType()); }
    
     
  5. How can i disable damage done by entity to any player ? I found http://jd.bukkit.org/apidocs/org/bukkit/event/entity/EntityDamageEvent.html but can't image how to get "getPlayer()".
     
  6. Offline

    nacs

    Code:
    00:49:50 [INFO] [jxpl] Initialising jxpl r12 on server version "git-Bukkit-1.0.1-R1-1-g1e6a083-b1602jnks (MC: 1.0.1)", Bukkit version "1.0.1-R2-SNAPSHOT"
    00:49:50 [INFO] [jxpl] Not using script engine "Mozilla Rhino 1.6 release 2", factory "com.sun.script.javascript.RhinoScriptEngineFactory"; blacklisted
    00:49:50 [INFO] [jxpl] Not using script engine "AppleScriptEngine 1.1", factory "apple.applescript.AppleScriptEngineFactory"; blacklisted
    00:49:50 [INFO] [jxpl] File extension ".js" will be handled by script engine "Mozilla Rhino 1.7R3".
    00:49:50 [INFO] [jxpl] Loaded script "jxpl.command.js" ([jxpl.command] version [2] by [])
    00:49:50 [INFO] [jxpl] Loaded script "spawn.js" ([SpawnMob] version [1] by [])
    Works great! Thanks for handling this so quickly @angelsl.


    That is a general Bukkit development question, not plugin specific. Stop spamming this thread, wasting his time and expecting him to write the whole script for you.
     
    angelsl likes this.
  7. Offline

    angelsl

    Seems like I forgot to do this..
    jxpl r12 released
    • Make it show the script filename instead of <Unknown source> in stacktraces.
    Thank you for reporting it in the first place :)

    I have that feeling many people (on Java 6) tried jxpl and gave up because the example scripts failed. D:

    The following builds are for builds with the new event registration mechanism only (1.1 dev builds).
    jxpl r13 released
    • I'm now moving completely to BukkitDev. Changelogs will no longer be posted here; new version posts will continue.
    jxpl r14 released
     
  8. Offline

    angelsl

    jxpl 15 released
     
  9. Offline

    md_5

    Long time no see angelsl. You will notice that this thread has now been placed into the Inactive Plugin subforum.
    If you wish to revive this plugin, please ensure that you update and test compatibility with the latest recommended Bukkit build before reporting your original post, asking for it to be moved back to the release forum.

    Thanks for your time.
    md_5
     

Share This Page