Inactive [DEV] PythonLoader v0.3.1 - Load Plugins written in Python [1.1-R6]

Discussion in 'Inactive/Unsupported Plugins' started by masteroftime, Aug 8, 2011.

  1. Offline

    masteroftime

    PythonLoader 0.3
    This plugin allows developers to code bukkit plugins in the python programming language. The plugins in python can either use a thin wrapper to the standard Bukkit API, or the newer decorator API. For more detailed instructions for installing this plugin and how to code plugins, take a look into the Readme on Github.

    Features:
    • Load bukkit plugins written in python.
    Installation:
    Put PythonLoader.jar into plugins directory and jython.jar into lib directory (within bukkit folder not plugins folder).

    PythonLoader
    Jython (By downloading and using Jython you accept the Jython License)
    Source Code

    I have to give special credits to @lahwran who created the whole decorator API and corrected many of my mistakes. :)

    Changelog: Version 0.3.1

    Version 0.3.1
    • Updated to CB 1.1-R6
    Version 0.3
    • Updated to CB 1.1-R1
    • Changed to new EventHandling System
    Version 0.2
    • Added decorator API
    • Invalid plugin exceptions are thrown when an invalid python plugin is loaded
    • Seperate Python Interpreter for each plugin
    • JavaPlugin's event executor creation is now directly used
    Version 0.1.1
    • Changed plugin.yaml to plugin.yml
    • Removed some debug output
    Version 0.1
    • First official release.
     
  2. Offline

    NickFaro

    Wouldn't a more appropriate extension for the plugins be "Plugin.egg"?
     
  3. @NickFaro No, the python is expands, "py". right away you can see what iswritten in a plugin
     
  4. Offline

    MalcolmLC

    why .egg ?
     
  5. Offline

    NickFaro

    That's the generic python package file extension. It says in wikipedia that python eggs are the basic equivalent of java jars.
     
  6. Offline

    Redyugi

    The only time I have seen eggs while using Python is when I am installing 3rd party modules... so I don't believe they are the equivalent. And I do believe the extension @masteroftime is using is just a zip file renamed for the plugin.

    None of those errors show anything with this plugin.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 18, 2016
  7. Offline

    MalcolmLC

    @Redyugi
    Im when are you going to upload somthing to the github , I have been watching it like a hawk 0_O.
     
  8. Offline

    Redyugi

    Oops.. I knew I was forgetting something... lol. Umm.. probably tomorrow. XD Going to be right now so...
     
  9. Offline

    MalcolmLC

    Lol its ok , Im not trying to rush you .
     
  10. @Redyugi
    When I do not have pythonloader I do not have bugs. When it is added at once in every plugin I get errors.
     
  11. Offline

    MalcolmLC

    Did you put the jython jar in your server root directory .
     
  12. @MalcolmLC
    Yes, I put, but it does not help
     
  13. Offline

    Redyugi

    Give me the errors that actually have something to do with this plugin, or we can't help at all.
     
    MalcolmLC likes this.
  14. Offline

    DragonSoulSong

    Actually, believe it or not, that's only two errors. Both of which seem to be caused by Java being unable to access certain classes it needs. (I'm no expert at reading these, but that's what I see.)
     
  15. Offline

    masteroftime

    To be true I have never heard of .egg files before and as far as I found out they are installers for python. I chose pyp as an abbreviation for PYthon Plugin. And I won't change it because I think more users will associate pyp with python than egg, and even if you have python interpreter installed it doesn't register egg files.

    try to exchange the PythonLoader.jar with this and then tell me if it worked. If not tell me what plugins you have installed.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 18, 2016
  16. No, it does not work. I have error in 2 plugins:
    my plugins:
     
  17. Offline

    zklapow

    How do you create your zip files? For some reason when I create a zip on my mac it give me this error.

    Code:
    java.lang.NullPointerException: Missing plugin.yml
        at org.bukkit.plugin.python.PythonPluginLoader.loadPlugin(PythonPluginLoader.java:149)
        at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:207)
        at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:130)
        at com.master.bukkit.python.PythonLoader.onEnable(PythonLoader.java:44)
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:126)
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:878)
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:272)
        at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:162)
        at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:146)
        at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:284)
        at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:271)
        at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:148)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:335)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    But I have a plugin.yml. Also if I unzip and then rezip the sample plugin it does not work, but the original works just fine.

    Thanks
     
  18. Offline

    masteroftime

    @zklapow maybe you have inlcuded the folder while zipping the files. They have to be on root level in the zip file. If thats not the case send me a zip file so that I can take a look at it.

    @Q.from.the.continuum I couldn't recreate your problem so it will take more time to find the error, but I didn't forget you!

    @Q.from.the.continuum add this file to your plugins directory and then type in the bukkit console:

    Code:
    classinfo com.bukkit.Milton.SignReadMore.SignReadMore
    classinfo com.bukkit.Milton.SignReadMore.SignReadMoreCommand
    and then gimme the output
     

    Attached Files:

    Last edited by a moderator: May 18, 2016
  19. Offline

    MalcolmLC

    Did you mean to upload that as a .txt file ?
     
  20. Offline

    masteroftime

    Didn't let me upload as a jar :p It's not a virus anyway.
     
  21. Offline

    MalcolmLC

    Oh I thought you made a mistake , you wouldn't give us a virus I trust you, you smart person youu :D
     
  22. yes!!! I was about experiment with Bukkit and Jython when I found this. You just saved me a bunch of time, and made it so much easier and nicer than I would have xD.
     
  23.  
  24. Offline

    zklapow

    So I got my plugin working but whenever I try to call player.getName() i get this error
    Code:
    java.lang.IllegalAccessError: tried to access class org.python.core.PyUnicode$Plane from class org.python.core.PyUnicode
        at org.python.core.PyUnicode.<init>(PyUnicode.java:27)
        at org.python.core.PyUnicode.<init>(PyUnicode.java:37)
        at org.python.core.adapter.ClassicPyObjectAdapter$4.adapt(ClassicPyObjectAdapter.java:62)
        at org.python.core.adapter.ExtensiblePyObjectAdapter.adapt(ExtensiblePyObjectAdapter.java:44)
        at org.python.core.adapter.ClassicPyObjectAdapter.adapt(ClassicPyObjectAdapter.java:120)
        at org.python.core.Py.java2py(Py.java:1549)
        at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:190)
        at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:204)
        at org.python.core.PyObject.__call__(PyObject.java:387)
        at org.python.core.PyObject.__call__(PyObject.java:391)
        at org.python.core.PyMethod.__call__(PyMethod.java:109)
        at blockey$py.onPlayerLogin$2(/Users/zklapow/Desktop/bukkit/plugins/Blockey.pyp/blockey.py:6)
        at blockey$py.call_function(/Users/zklapow/Desktop/bukkit/plugins/Blockey.pyp/blockey.py)
        at org.python.core.PyTableCode.call(PyTableCode.java:165)
        at org.python.core.PyBaseCode.call(PyBaseCode.java:301)
        at org.python.core.PyBaseCode.call(PyBaseCode.java:194)
        at org.python.core.PyFunction.__call__(PyFunction.java:387)
        at org.python.core.PyMethod.instancemethod___call__(PyMethod.java:220)
        at org.python.core.PyMethod.__call__(PyMethod.java:211)
        at org.python.core.PyMethod.__call__(PyMethod.java:201)
        at org.python.core.PyMethod.__call__(PyMethod.java:196)
        at org.python.core.PyObject._jcallexc(PyObject.java:3502)
        at org.python.core.PyObject._jcall(PyObject.java:3534)
        at org.python.proxies.blockey$Blockey$0.onPlayerLogin(Unknown Source)
        at org.bukkit.plugin.python.PythonPluginLoader$12.execute(PythonPluginLoader.java:394)
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:332)
        at net.minecraft.server.ServerConfigurationManager.a(ServerConfigurationManager.java:184)
        at net.minecraft.server.NetLoginHandler.b(NetLoginHandler.java:82)
        at net.minecraft.server.NetLoginHandler.a(NetLoginHandler.java:33)
        at net.minecraft.server.NetworkListenThread.a(SourceFile:91)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:451)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:361)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    I can't call getName on antyhing(commands etc.) or the same error is displayed. Any Ideas?
     
  25. Offline

    mibshidobu

    I get the same kind of errors, for example I get that RuneCraft can't call like onPlayerInteract I think it was or something. Heres my auth script that I'm working on and one of the errors(others appear just same thing but different events). Python plugins work(have tested/made mutiple yet) just all the other Java plugins don't.
     

    Attached Files:

  26. Offline

    EvHub

    Also getting same kinds of errors as mibshidobu and Q.from.the.continuum. Gives errors with Spout, NoCheat, Redstone Chips, Runecraft, and more (some errors I'm not even sure what plugin they belong to). The errors almost always have to do with fetching methods and classes, and the errors occur even without me putting in any of my own python plugins, just with the basic PythonLoader. I would really appreciate if this could be fixed, as I would love to be able to write plugins in Python, but I also need to use my other plugins as well. I know you are on top of it, but I just thought I would throw in me piece too. :)
     
  27. Offline

    MalcolmLC

    Thats weird , I wonder what plugin isnt working with python loader , I use nocheat also and it seems to work for me .
     
  28. Offline

    mibshidobu

    Well all Java plugins I've tested don't work aslong as PythonLoader is loaded.....
     
  29. Offline

    Glycan

    Hello! This is a wonderful thing, I've been looking for something like this for a while, I even manually built jython2.2 for it's jythonc so that I could make class files with python. It's not what I wanted, of course. This is. I give you lots of praise. I know python more or less well, I'd be glad to help.

    Also, please work on making a proper doc and install and whatnot.
     
    MalcolmLC likes this.
  30. Offline

    Glycan

    How do you schedule a task? What is a runnable?
     
  31. Offline

    masteroftime

    Please, this thread is about my python loader plugin and not about the bukkit scheduler
     

Share This Page