Python Plugin Loader

PythonLoader 0.3.4

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).

Downloads:

Documentation
The Readme on github contains an introduction to creating plugins in python
Also make sure to check out @zaph34r's tutorial series

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

You must login to post a comment. Don't have an account? Register to get one!

  • Avatar of cyberlis cyberlis Aug 12, 2014 at 07:14 UTC - 0 likes

    I forked Python Plugin Loader and changed it a lot. I removed decorator api. Now it is only Class API. To write a plugin with this api is almost identical to writing one in java, so much so that you can safely use the documentation on how to write a java plugin; simply translate it into python. One of the new feature is to [re]load/unload plugins without server restarting

    Just take a look http://dev.bukkit.org/bukkit-plugins/pploader/ Soon i will give some nice plugins (fishing plugin, chat plugin, time rangs) writte in python

  • Avatar of Intangir Intangir Jul 08, 2014 at 20:21 UTC - 0 likes

    gdude claims to have fixed it

    i haven't tested it yet https://github.com/gdude2002/Python-Plugin-Loader

    im thinking of migrating away from python scripts anyway though.. i mean it seemed like a good idea but i just end up having to debug twice as long because i don't get any of the compile time error checks

    also it seems to frequently send the wrong events to the wrong handlers

    Last edited Jul 08, 2014 by Intangir
  • Avatar of noobkackboon noobkackboon Mar 16, 2014 at 01:03 UTC - 2 likes

    The latest bukkit version breaks this plugin! (see https://github.com/masteroftime/Python-Plugin-Loader/issues/15)

  • Avatar of Intangir Intangir Feb 08, 2014 at 05:47 UTC - 0 likes

    how can you save persistent data across sessions? like in a config.yml doc or something

    im using the decorator version of the scripts

    __plugin_name__ = "Tweak_Test"
    __plugin_version__ = "1.0"
    
    @hook.enable
    def onEnable():
        log.prefix = "[%s] " % __plugin_name__;
        log.info("Enabling %s v%s" % (__plugin_name__, __plugin_version__));
    
    @hook.disable
    def onDisable():
        log.info("Disabling %s v%s" % (__plugin_name__, __plugin_version__));
    
    Last edited Feb 08, 2014 by Intangir
  • Avatar of RedSeamonster RedSeamonster Jan 31, 2014 at 02:37 UTC - 0 likes

    @sat481: Go

    See this: https://forums.bukkit.org/threads/placing-iron-doors-via-plugin.118520/. If it doesn't work, try consulting the forums or the IRC channel, it sounds like more of a general Bukkit issue versus solely PythonLoader.

    Last edited Jan 31, 2014 by RedSeamonster

    BFAK:RedSeamonster,90747771,7e5d229bb31f16a524cd6b3e4ecc9984bb4b7a50270b23acb4f3fd814a22d511

  • Avatar of sat481 sat481 Jan 27, 2014 at 18:22 UTC - 0 likes

    This is driving me mad now. I am trying to place a door in a house that is built with the command /buildhouse. The house builds fine, with a gap for the door, but when I try and place a door in the gap I only get the bottom half. I have tried adding another WOODEN_DOOR block to the top, but then I get two door items. He is a snippet of my code that places the actual door relative to the player:

    block = blocks.getRelative(3,0,0)

    block.setType(bukkit.Material.WOODEN_DOOR)

    I have the same problem with beds also, I know it is something to do with the them been multiblock items but nothing I have tried has worked, so any help much appreciated.

    Sat

    Last edited Jan 27, 2014 by sat481
  • Avatar of gdude2002 gdude2002 Jan 05, 2014 at 16:55 UTC - 0 likes

    @HungryBehr: Go

    I've raised this issue on GitHub, maybe if you could also weigh in there things could be done faster.

    https://github.com/masteroftime/Python-Plugin-Loader/issues/14

    EDIT: I fixed this, here (there's no plugin DL there, as is the bukkitdev rules). I don't feel like it's a very ideal fix, so I didn't submit a pull request, and won't be releasing a public version of my fix - but if you want a copy of it despite your better judgement, PM me.

    Last edited Jan 05, 2014 by gdude2002

    My plugins: Painter | WordWarning

    Owner of The Archives

  • Avatar of RedSeamonster RedSeamonster Dec 20, 2013 at 03:33 UTC - 0 likes

    @Brixishuge: Go

    Can confirm, it's a pretty irritating issue.

    I have been downgrading to older versions of CB to troubleshoot (as a work around), but hopefully someone will come up with a way to fix the loader.

    Last edited Dec 20, 2013 by RedSeamonster
  • Avatar of Brixishuge Brixishuge Dec 08, 2013 at 18:41 UTC - 0 likes

    Since 1.7.2, errors are messed up and don't say anything useful...

    PYTHON

  • Avatar of HungryBehr HungryBehr Nov 23, 2013 at 05:43 UTC - 0 likes

    Hello, I'm having some issues with trying to use configuration files with Python/Bukkit. I put the following files into a pyp zip file (called configtest.pyp, if that matters):

    ----- config.yml
    # default config.yml
    message: Hello World and Welcome! :)
    rules:
      - Play Nice
      - Respect others
      - Have Fun
    
    ----- plugin.yml
    name: ConfigTest
    version: 0.1
    main: ConfigClass
    
    ----- main.py
    class ConfigClass(PythonPlugin):
    
        def onEnable(self):
            self.saveDefaultConfig()
    
        def onDisable(self):
            pass
    

    When I try and load the plugin and have it save the default configuration file, I get:

    09:15:01 [SEVERE] Error occurred while enabling ConfigTest v0.1 (Is it up to date?): zip file closed java.lang.IllegalStateException: zip file closed at java.util.zip.ZipFile.ensureOpen(ZipFile.java:632) at java.util.zip.ZipFile.getEntry(ZipFile.java:303) at net.lahwran.bukkit.jython.PluginPythonZip.getStream(PluginPythonZip.java:43) at net.lahwran.bukkit.jython.PythonPlugin.getResource(PythonPlugin.java:331) at net.lahwran.bukkit.jython.PythonPlugin.saveResource(PythonPlugin.java:346) at net.lahwran.bukkit.jython.PythonPlugin.saveDefaultConfig(PythonPlugin.java:397) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.python.core.PyReflectedFunction.call(PyReflectedFunction.java:186) 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 org.python.pycode._pyx68.onEnable$2(<iostream>:7) at org.python.pycode._pyx68.call_function(<iostream>) 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.main$ConfigClass$4.onEnable(Unknown Source) at net.lahwran.bukkit.jython.PythonPlugin.setEnabled(PythonPlugin.java:163) at org.python.proxies.main$ConfigClass$4.setEnabled(Unknown Source) at net.lahwran.bukkit.jython.PythonPluginLoader.enablePlugin(PythonPluginLoader.java:388) at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:381) at org.bukkit.craftbukkit.v1_6_R3.CraftServer.loadPlugin(CraftServer.java:284) at org.bukkit.craftbukkit.v1_6_R3.CraftServer.enablePlugins(CraftServer.java:266) at net.minecraft.server.v1_6_R3.MinecraftServer.l(MinecraftServer.java:315) at net.minecraft.server.v1_6_R3.MinecraftServer.f(MinecraftServer.java:292) at net.minecraft.server.v1_6_R3.MinecraftServer.a(MinecraftServer.java:252) at net.minecraft.server.v1_6_R3.DedicatedServer.init(DedicatedServer.java:152) at net.minecraft.server.v1_6_R3.MinecraftServer.run(MinecraftServer.java:393) at net.minecraft.server.v1_6_R3.ThreadServerApplication.run(SourceFile:583)

    Any ideas?

    And thanks to masteroftime for a fantastic plugin!

    Tim

Table of contents

  1. 1 PythonLoader 0.3.4

Facts

Date created
Aug 27, 2011
Category
Last update
May 14, 2013
Development stage
Release
License
GNU General Public License version 3 (GPLv3)
Curse link
Python Plugin Loader
Downloads
10,223
Recent files

Authors