Code Monkey home page Code Monkey logo

purugin's Introduction

Purugin - Ruby Plugins for Minecraft + Bukkit

Purugin is a plugin framework which sites on top of Bukkit that allows you to write plugins in a Ruby syntax.

Once you copy Purugin.jar into your plugins directory you only need to drop .rb files into your plugins directory. If they contain code which includes Purugin::Plugin, then they will load and get registered as Bukkit plugins.

Example

Here is a plugin which gets registered as a plugin in Bukkit which tells every use in the players world when a player joins or quits the world:

#--------- examples/player_joined_full_class.rb ----------
class PlayerJoinedPlugin
  include Purugin::Plugin, Purugin::Colors
  description 'PlayerJoined', 0.1
  
  def on_enable
    # Tell everyone in players world that they have joined
    event(:player_join) do |e|
      e.player.world.players.each do |p| 
        p.msg red("Player #{e.player.name} has joined")
      end
    end

    # Tell everyone in players world that they have quit
    event(:player_quit) do |e|
      e.player.world.players.each do |p| 
        p.msg red("Player #{e.player.name} has quit")
      end
    end
  end
end

Plugin Dependencies

Plugins can depend on other plugins. There are multiple ways of accessing dependent plugins. The first is to declare your plugin dependencies at the top of your Purugin:

    class PortsPlugin
      include Purugin::Plugin, Purugin::Colors
      description 'Ports', 0.3
      required :LocsPlus, :include => :CoordinateEncoding
      #...
    end

This example shows that the 'Ports' plugin requires (via 'required' method) the 'LocsPlus' plugin and that it should include the 'CoordinateEncoding' module from the 'LocsPlus' plugin.

You can specify optional dependencies via the optional declaration:

    optional :Permissions

As a side-effect both required and optional will define a method by the same name as plugin being referenced (Note: This may change since plugin names may not conform to sane Ruby-naming and some people don't like methods like 'Permissions()').

A second way to get a live reference to a plugin is to ask the plugin manager:

    plugin_manager['Permissions']

This has the advantage that a plugin can be named anything and you will still be able to reference it.

Running

https://www.spigotmc.org/wiki/buildtools/ https://www.spigotmc.org/wiki/spigot-installation/

To run Purugin, you just copy Purugin.jar into your plugins directory like any other minecraft plugin. Once running you can write Purugins and copy those .rb files into your plugins directory. Simple!

bin/run.sh and bin/run.bat are provided with defaults that I use and it also sets a local GEM_HOME:

GEM_HOME=./gems java -Xms1024M -Xmx1024M -jar craftbukkit.jar

Building Purugin locally

  1. Install maven 3
  2. Invoke: mvn clean package

Other Novelties

Purogo - A 3D Logo implementation in Purugin.

Contributors

git shortlog -s -n

199  Thomas E. Enebo
 14  Thomas E Enebo
 10  Eric Anderson
  7  Marv Cool
  6  Thomas Dervan
  4  Humza
  3  aumgn
  2  mml
  1  Tom Dervan
  1  chase4926

purugin's People

Contributors

aumgn avatar chase4926 avatar cyberarm avatar enebo avatar ericanderson avatar mlooney avatar nigelthorne avatar saucecoder avatar szimano avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

purugin's Issues

How do you load gems?

I want a plugin to use 'parslet'.

I have something like this...

class AutoBuildPlugin
  include Purugin::Plugin, Purugin::Colors
  description 'AutoBuild', 0.1
  gem "parslet"


  def on_enable
    require 'parslet'
    #...
  end
end

I get the following error on the server...

[16:41:38 INFO]: [AutoBuild] version 0.1 DISABLED
[16:41:38 INFO]: unable to load gem: parslet
[16:41:38 ERROR]: Error occurred (in the plugin loader) while enabling AutoBuild v0.1 (Is it up to date?)
org.jruby.exceptions.RaiseException: (LoadError) Could not find 'parslet' (>= 0) among 5 total gem(s)
Checked in 'GEM_PATH=/root/.gem/jruby/1.9:file:/ssd/var/stipedata/servers/nigel%20mct%201/stipe_user_9665513/plugins/purugin-0.8.0-bukkit-1.7.9-R0.2.jar!/META-INF/jruby.home/lib/
ruby/gems/shared:plugins/PuruginPlugin/gems', execute `gem env` for more information
at RUBY.to_specs(/ssd/var/stipedata/servers/nigel mct 1/stipe_user_9665513/plugins/purugin-0.8.0-bukkit-1.7.9-R0.2.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/dependency.rb
:315) ~[?:?]
at RUBY.to_spec(/ssd/var/stipedata/servers/nigel mct 1/stipe_user_9665513/plugins/purugin-0.8.0-bukkit-1.7.9-R0.2.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/dependency.rb:
324) ~[?:?]
at RUBY.gem(/ssd/var/stipedata/servers/nigel mct 1/stipe_user_9665513/plugins/purugin-0.8.0-bukkit-1.7.9-R0.2.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/core_ext/kernel_ge
m.rb:64) ~[?:?]
at RUBY.process_gems(file:/ssd/var/stipedata/servers/nigel mct 1/stipe_user_9665513/plugins/purugin-0.8.0-bukkit-1.7.9-R0.2.jar!/purugin/plugin.rb:204) ~[?:?]
at org.jruby.RubyHash.each(org/jruby/RubyHash.java:1341) ~[purugin-0.8.0-bukkit-1.7.9-R0.2.jar:?]
at RUBY.process_gems(file:/ssd/var/stipedata/servers/nigel mct 1/stipe_user_9665513/plugins/purugin-0.8.0-bukkit-1.7.9-R0.2.jar!/purugin/plugin.rb:196) ~[?:?]
at RUBY.onEnable(file:/ssd/var/stipedata/servers/nigel mct 1/stipe_user_9665513/plugins/purugin-0.8.0-bukkit-1.7.9-R0.2.jar!/purugin/plugin.rb:139) ~[?:?]
at AutoBuildPlugin_582808228.onEnable(AutoBuildPlugin_582808228.gen:13) ~[?:?]
at RUBY.enable_plugin(file:/ssd/var/stipedata/servers/nigel mct 1/stipe_user_9665513/plugins/purugin-0.8.0-bukkit-1.7.9-R0.2.jar!/purugin/change_listener.rb:55) ~[?:?]
at RUBY.restart_plugin(file:/ssd/var/stipedata/servers/nigel mct 1/stipe_user_9665513/plugins/purugin-0.8.0-bukkit-1.7.9-R0.2.jar!/purugin/change_listener.rb:65) ~[?:?]

The failed load reports having plugins/PuruginPlugin/gems in the GEM_HOME path.
I tried uploading the parslet gem to that folder... creating:

/plugins/PuruginPlugin/gems/parslet-1.8.0

This didn't help.

I tried adding ENV["GEM_HOME"] = "./gems" to the plugin before the require... no effect.

Support

Hey @enebo!

I just found this plugin!

I was wondering if you are going to provide support for newer versions of minecraft?

1.12 support?

Please can you add a wiki page to describe how to upgrade the minecraft version we are linking against.

LoadError bukkit, solved

I tried to follow all instructions but I kept getting this error:

09:32:38 [SEVERE] LoadError: no such file to load -- bukkit
  require at org/jruby/RubyKernel.java:1038
   (root) at /purugin.rb:5

09:32:38 [SEVERE] (LoadError) no such file to load -- bukkit initializing PuruginPlugin v0.1 (Is it up to date?)
org.jruby.embed.EvalFailedException: (LoadError) no such file to load -- bukkit
        at org.jruby.embed.internal.EmbedEvalUnitImpl.run(EmbedEvalUnitImpl.java:127)
        at org.jruby.embed.ScriptingContainer.runUnit(ScriptingContainer.java:1231)
        at org.jruby.embed.ScriptingContainer.runScriptlet(ScriptingContainer.java:1262)
        at org.purugin.PuruginPlugin.executeScript(PuruginPlugin.java:45)
        at org.purugin.PuruginPlugin.onLoad(PuruginPlugin.java:37)
        at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:141)
        at org.bukkit.craftbukkit.CraftServer.<init>(CraftServer.java:103)
        at net.minecraft.server.ServerConfigurationManager.<init>(ServerConfigurationManager.java:52)
        at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:136)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:348)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:417)

I fixed it by adding the Purugin,jar file to the classpath like so:

java -Xms1024M -Xmx1024M -cp jruby-complete.jar:craftbukkit.jar:plugins/purugin.jar org.bukkit.craftbukkit.Main

Maybe I did something wrong but now the plugin works and the .rb files in the plugin directory are functioning.

not all block types are representable anymore

I get this error when trying to use the cube command, taken (almost verbatim) from the examples:

[22:38:20 INFO]: iconoclast issued server command: /cube 1 andesite
[22:38:20 ERROR]: null
org.bukkit.command.CommandException: Unhandled exception executing 'cube 1 andesite' in org.jruby.proxy.org.bukkit.command.Command$Proxy1(cube)
    at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:144) ~[craftbukkit-1.8.8.jar:git-Bukkit-07c3001]
    at org.bukkit.craftbukkit.v1_8_R3.CraftServer.dispatchCommand(CraftServer.java:620) ~[craftbukkit-1.8.8.jar:git-Bukkit-07c3001]
    at net.minecraft.server.v1_8_R3.PlayerConnection.handleCommand(PlayerConnection.java:1106) [craftbukkit-1.8.8.jar:git-Bukkit-07c3001]
    at net.minecraft.server.v1_8_R3.PlayerConnection.a(PlayerConnection.java:966) [craftbukkit-1.8.8.jar:git-Bukkit-07c3001]
    at net.minecraft.server.v1_8_R3.PacketPlayInChat.a(SourceFile:37) [craftbukkit-1.8.8.jar:git-Bukkit-07c3001]
    at net.minecraft.server.v1_8_R3.PacketPlayInChat.a(SourceFile:9) [craftbukkit-1.8.8.jar:git-Bukkit-07c3001]
    at net.minecraft.server.v1_8_R3.PlayerConnectionUtils$1.run(SourceFile:13) [craftbukkit-1.8.8.jar:git-Bukkit-07c3001]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_65]
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_65]
    at net.minecraft.server.v1_8_R3.SystemUtils.a(SourceFile:44) [craftbukkit-1.8.8.jar:git-Bukkit-07c3001]
    at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:673) [craftbukkit-1.8.8.jar:git-Bukkit-07c3001]
    at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:335) [craftbukkit-1.8.8.jar:git-Bukkit-07c3001]
    at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:629) [craftbukkit-1.8.8.jar:git-Bukkit-07c3001]
    at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:537) [craftbukkit-1.8.8.jar:git-Bukkit-07c3001]
    at java.lang.Thread.run(Thread.java:745) [?:1.8.0_65]
Caused by: org.jruby.exceptions.RaiseException: (NameError) no method 'setType' for arguments (org.jruby.RubySymbol) on Java::OrgBukkitCraftbukkitV1_8_R3Block::CraftBlock
    at RUBY.change_type(file:/Users/brandon/Code/Spigot/plugins/Purugin.jar!/bukkit/block/block.rb:118) ~[?:?]
    at RUBY.on_enable(/Users/brandon/Code/Spigot/plugins/builder.rb:24) ~[?:?]
    at org.jruby.RubyFixnum.times(org/jruby/RubyFixnum.java:275) ~[?:?]
    at RUBY.on_enable(/Users/brandon/Code/Spigot/plugins/builder.rb:23) ~[?:?]
    at org.jruby.RubyFixnum.times(org/jruby/RubyFixnum.java:275) ~[?:?]
    at RUBY.on_enable(/Users/brandon/Code/Spigot/plugins/builder.rb:21) ~[?:?]
    at org.jruby.RubyFixnum.times(org/jruby/RubyFixnum.java:275) ~[?:?]
    at RUBY.on_enable(/Users/brandon/Code/Spigot/plugins/builder.rb:19) ~[?:?]
    at org.jruby.RubyProc.call(org/jruby/RubyProc.java:271) ~[?:?]
    at RUBY.execute(file:/Users/brandon/Code/Spigot/plugins/Purugin.jar!/purugin/command.rb:45) ~[?:?]
    at net.minecraft.server.v1_8_R3.PacketPlayInChat.a(SourceFile:37) ~[craftbukkit-1.8.8.jar:git-Bukkit-07c3001]
    at net.minecraft.server.v1_8_R3.PacketPlayInChat.a(SourceFile:9) ~[craftbukkit-1.8.8.jar:git-Bukkit-07c3001]
    at net.minecraft.server.v1_8_R3.PlayerConnectionUtils$1.run(SourceFile:13) ~[craftbukkit-1.8.8.jar:git-Bukkit-07c3001]
    at net.minecraft.server.v1_8_R3.SystemUtils.a(SourceFile:44) ~[craftbukkit-1.8.8.jar:git-Bukkit-07c3001]

visitors_log.rb

I tried to write a plugin in a file called visitors_log.rb (it could have been visitor_log.rb ) and a plugin called VisitorsLogPlugin. For some reason I couldn't get this to work in any way... finally I ended up removing all content and it still failed to load.
In the end I named it something different and it works fine. same code. different name

What are the limitations on names you can call your plugins?

Cheers
Nigel

Craftbukkit 1.3.1 support

Purugin doesn't work with Craftbukkit 1.3.1; it fails with a java.lang.SecurityException. Here's the whole output:

$ ./start_server
195 recipes
27 achievements
Aug 14, 2012 12:06:57 PM net.minecraft.server.MinecraftServer main
SEVERE: Failed to start the minecraft server
java.lang.SecurityException: sealing violation: package jline is sealed
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:234)
    at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    at jline.console.ConsoleReader.<init>(ConsoleReader.java:140)
    at jline.console.ConsoleReader.<init>(ConsoleReader.java:126)
    at net.minecraft.server.MinecraftServer.<init>(MinecraftServer.java:102)
    at net.minecraft.server.DedicatedServer.<init>(DedicatedServer.java:33)
    at net.minecraft.server.MinecraftServer.main(MinecraftServer.java:657)
    at org.bukkit.craftbukkit.Main.main(Main.java:143)```

Creating a "help" plugin fails

I created a plugin and got this

13:17:39 [SEVERE] NameError: uninitialized constant Purugin::Colors
const_missing at org/jruby/RubyModule.java:2569
HelpPlugin at /Volumes/HD-II/humza/MinecraftServer/plugins/help.rb:2
(root) at /Volumes/HD-II/humza/MinecraftServer/plugins/help.rb:1
on_load at /purugin.rb:21
onLoad at /purugin/base.rb:44

13:17:39 [SEVERE] NativeException: org.jruby.embed.EvalFailedException: (NameError) uninitialized constant Purugin::Colors
on_load at /purugin.rb:21
onLoad at /purugin/base.rb:44

13:17:39 [SEVERE] Native Exception: 'class org.jruby.embed.EvalFailedException'; Message: (NameError) uninitialized constant Purugin::Colors; StackTrace: org.jruby.embed.EvalFailedException: (NameError) uninitialized constant Purugin::Colors
at org.jruby.embed.internal.EmbedEvalUnitImpl.run(EmbedEvalUnitImpl.java:127)
at org.jruby.embed.ScriptingContainer.runUnit(ScriptingContainer.java:1231)
at org.jruby.embed.ScriptingContainer.runScriptlet(ScriptingContainer.java:1262)
at org.purugin.PuruginPlugin.executeScript(PuruginPlugin.java:45)
at org.purugin.PuruginPlugin.executeScriptAt(PuruginPlugin.java:53)
at org.purugin.RubyPluginLoader.loadPlugin(RubyPluginLoader.java:33)
at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:213)
at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:136)
Caused by: org.jruby.exceptions.RaiseException: (NameError) uninitialized constant Purugin::Colors
initializing PuruginPlugin v0.1 (Is it up to date?)
org.jruby.embed.InvokeFailedException: Native Exception: 'class org.jruby.embed.EvalFailedException'; Message: (NameError) uninitialized constant Purugin::Colors; StackTrace: org.jruby.embed.EvalFailedException: (NameError) uninitialized constant Purugin::Colors
at org.jruby.embed.internal.EmbedEvalUnitImpl.run(EmbedEvalUnitImpl.java:127)
at org.jruby.embed.ScriptingContainer.runUnit(ScriptingContainer.java:1231)
at org.jruby.embed.ScriptingContainer.runScriptlet(ScriptingContainer.java:1262)
at org.purugin.PuruginPlugin.executeScript(PuruginPlugin.java:45)
at org.purugin.PuruginPlugin.executeScriptAt(PuruginPlugin.java:53)
at org.purugin.RubyPluginLoader.loadPlugin(RubyPluginLoader.java:33)
at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:213)
at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:136)
Caused by: org.jruby.exceptions.RaiseException: (NameError) uninitialized constant Purugin::Colors

at org.jruby.embed.internal.EmbedRubyObjectAdapterImpl.call(EmbedRubyObjectAdapterImpl.java:406)
at org.jruby.embed.internal.EmbedRubyObjectAdapterImpl.callMethod(EmbedRubyObjectAdapterImpl.java:331)
at org.jruby.embed.ScriptingContainer.callMethod(ScriptingContainer.java:1334)
at org.purugin.PuruginPlugin.onLoad(PuruginPlugin.java:40)
at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:146)
at org.bukkit.craftbukkit.CraftServer.<init>(CraftServer.java:110)
at net.minecraft.server.ServerConfigurationManager.<init>(ServerConfigurationManager.java:51)
at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:133)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:337)
at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)

Caused by: org.jruby.exceptions.RaiseException: Native Exception: 'class org.jruby.embed.EvalFailedException'; Message: (NameError) uninitialized constant Purugin::Colors; StackTrace: org.jruby.embed.EvalFailedException: (NameError) uninitialized constant Purugin::Colors
at org.jruby.embed.internal.EmbedEvalUnitImpl.run(EmbedEvalUnitImpl.java:127)
at org.jruby.embed.ScriptingContainer.runUnit(ScriptingContainer.java:1231)
at org.jruby.embed.ScriptingContainer.runScriptlet(ScriptingContainer.java:1262)
at org.purugin.PuruginPlugin.executeScript(PuruginPlugin.java:45)
at org.purugin.PuruginPlugin.executeScriptAt(PuruginPlugin.java:53)
at org.purugin.RubyPluginLoader.loadPlugin(RubyPluginLoader.java:33)
at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:213)
at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:136)
Caused by: org.jruby.exceptions.RaiseException: (NameError) uninitialized constant Purugin::Colors

Caused by: org.jruby.embed.EvalFailedException: (NameError) uninitialized constant Purugin::Colors
at org.jruby.embed.internal.EmbedEvalUnitImpl.run(EmbedEvalUnitImpl.java:127)
at org.jruby.embed.ScriptingContainer.runUnit(ScriptingContainer.java:1231)
at org.jruby.embed.ScriptingContainer.runScriptlet(ScriptingContainer.java:1262)
at org.purugin.PuruginPlugin.executeScript(PuruginPlugin.java:45)
at org.purugin.PuruginPlugin.executeScriptAt(PuruginPlugin.java:53)
at org.purugin.RubyPluginLoader.loadPlugin(RubyPluginLoader.java:33)
at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:213)
at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:136)
Caused by: org.jruby.exceptions.RaiseException: (NameError) uninitialized constant Purugin::Colors

Can't build Purugin - many "not supported in -source 1.3" errors

I'm trying to build Purugin from source, and it's failing to compile with the following errors:

[INFO] Scanning for projects...
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for org.purugin:purugin:jar:0.1
-bukkit-1.4.2-R0.1-SNAPSHOT                                                                               
[WARNING] 'version' contains an expression but should be a constant. @ org.purugin:purugin:0.1-bukkit-${buk
kit.version}-SNAPSHOT, /home/duncan/Purugin/pom.xml, line 7, column 12                                    
[WARNING] 
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] 
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING] 
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building Purugin 0.1-bukkit-1.4.2-R0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.3:clean (default-clean) @ purugin ---
[INFO] Deleting file set: /home/duncan/Purugin/target (included: [**], excluded: [])
[INFO] 
[INFO] --- maven-resources-plugin:2.3:resources (default-resources) @ purugin ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 42 resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.0.2:compile (default-compile) @ purugin ---
[INFO] Compiling 2 source files to /home/duncan/Purugin/target/classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.280s
[INFO] Finished at: Sun Dec 02 19:55:56 EST 2012
[INFO] Final Memory: 6M/117M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile (default-compil
e) on project purugin: Compilation failure: Compilation failure:                                          
[ERROR] /home/duncan/Purugin/src/main/java/org/purugin/RubyPluginLoader.java:[31,5] error: annotations are 
not supported in -source 1.3                                                                              
[ERROR] 
[ERROR] (use -source 5 or higher to enable annotations)
[ERROR] /home/duncan/Purugin/src/main/java/org/purugin/RubyPluginLoader.java:[65,14] error: generics are no
t supported in -source 1.3                                                                                
[ERROR] 
[ERROR] (use -source 5 or higher to enable generics)
[ERROR] /home/duncan/Purugin/src/main/java/org/purugin/PuruginPlugin.java:[23,5] error: annotations are not
 supported in -source 1.3                                                                                 
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

My system is as follows:

OS

Linux Mint 13 Maya, 64 bit (running on a Lenovo L-520)

Java

OpenJDK Runtime Environment (IcedTea7 2.3.3) (7u9-2.3.3-0ubuntu1~12.04.1)
OpenJDK 64-Bit Server VM (build 23.2-b09, mixed mode)

Maven

Apache Maven 3.0.4
Maven home: /usr/share/maven
Java version: 1.7.0_05, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-oracle-1.7.0.5/jre
Default locale: en_AU, platform encoding: UTF-8
OS name: "linux", version: "3.2.0-23-generic", arch: "amd64", family: "unix"

Unable to connect

Attempting to get this running so I can teach my son some Ruby. We are both pretty excited to use this. However, I continue to run in to the following problem:

Craftbukkit is the latest version

[23:04:05 INFO]: This server is running CraftBukkit version git-Bukkit-1.7.2-R0.3-2-g85f5776-b3022jnks (MC: 1.7.2) (Implementing API version 1.7.2-R0.4-SNAPSHOT)

I have installed Purugin. I also have one test plugin (written in Java) that is in the folder as well. Other than that it's a blank slate.

The server starts up fine and all looks good, however, every time I attempt to connect I get the following:

[23:06:46 WARN]: Exception in thread "User Authenticator #1" 
[23:06:46 WARN]: java.lang.OutOfMemoryError: PermGen space
[23:06:46 WARN]:    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.initHandshaker(SSLSocketImpl.java:1140)
[23:06:46 WARN]:    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.doneConnect(SSLSocketImpl.java:597)
[23:06:46 WARN]:    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:571)
[23:06:46 WARN]:    at sun.net.NetworkClient.doConnect(NetworkClient.java:158)
[23:06:46 WARN]:    at sun.net.www.http.HttpClient.openServer(HttpClient.java:424)
[23:06:46 WARN]:    at sun.net.www.http.HttpClient.openServer(HttpClient.java:538)
[23:06:46 WARN]:    at sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:276)
[23:06:46 WARN]:    at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:367)
[23:06:46 WARN]:    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:172)
[23:06:46 WARN]:    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:966)
[23:06:46 WARN]:    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:158)
[23:06:46 WARN]:    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1195)
[23:06:46 WARN]:    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:234)
[23:06:46 WARN]:    at net.minecraft.util.com.mojang.authlib.HttpAuthenticationService.performGetRequest(HttpAuthenticationService.java:126)
[23:06:46 WARN]:    at net.minecraft.util.com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService.makeRequest(YggdrasilAuthenticationService.java:41)
[23:06:46 WARN]:    at net.minecraft.util.com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService.hasJoinedServer(YggdrasilMinecraftSessionService.java:45)
[23:06:46 WARN]:    at net.minecraft.server.v1_7_R1.ThreadPlayerLookupUUID.run(ThreadPlayerLookupUUID.java:27)

So it seems something is running out of memory somewhere?

If I remove the Purugin plugin I am able to then connect with no problems.

I have tried removing everything except Purugin but that results in the same thing.

Any thoughts as to what might be happening here?

Thanks.

Execute system command causes Error

With this plugin...

class TranslatePlugin
   include Purugin::Plugin
   description( 'Translate', 0.3 )

   def on_enable
     event(:async_player_chat) do |e|
      translate =   "rtranslate  \"#{e.message}\" -f en -t fr -k xxxxxxxxxxxx"
      translated = %x{translate}
       e.message = "#{e.message} :\n #{translated}"
     end
   end
 end

I get

23:13:34 [SEVERE] Could not pass event AsyncPlayerChatEvent to Translate v0.3
org.bukkit.event.EventException
    at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:341)
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62)
    at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:477)
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:459)
    at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:829)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:806)
    at net.minecraft.server.Packet3Chat.handle(Packet3Chat.java:44)
    at net.minecraft.server.NetworkManager.i(NetworkManager.java:211)
    at net.minecraft.server.NetworkManager.c(NetworkManager.java:332)
    at net.minecraft.server.NetworkReaderThread.run(SourceFile:101)
Caused by: org.jruby.exceptions.RaiseException: (Errno::EBADF) Bad file descriptor
    at org.jruby.RubyIO.read(org/jruby/RubyIO.java:2904)
    at RUBY.`(file:/home/nigel/projects/4giggles/minecraftserver/plugins/purugin-0.1-bukkit-1.3.2-R2.0-SNAPSHOT.jar!/jruby/kernel/jruby/process_manager.rb:35)
    at RUBY.`(file:/home/nigel/projects/4giggles/minecraftserver/plugins/purugin-0.1-bukkit-1.3.2-R2.0-SNAPSHOT.jar!/jruby/kernel/jruby/process_manager.rb:49)
    at RUBY.on_enable(/home/nigel/projects/4giggles/minecraftserver/plugins/translateplugin.rb:31)
    at org.jruby.RubyProc.call(org/jruby/RubyProc.java:249)
    at RUBY.on_event(/home/nigel/projects/4giggles/minecraftserver/plugins/translateplugin.rb:14)
    ... 1 more

What's the correct way to trigger a system call and get the result back in JRuby in Purugin ?

Thanks
Nigel

1.4 Support?

I'm really enjoying this project. I've already made a couple of plugins. However, while the plugins loads, have you done any official 1.4 support? Regarding your versioning on the wiki page the last supported version was 1.2.5.

I also see this in the log when I start minecraft:

22:32:50 [INFO] [PuruginPlugin] Loading PuruginPlugin v1.2.5-0.1
22:32:53 [SEVERE] jar:file:/Users/admin/Minecraft/Server/plugins/Purugin.jar!/purugin/predicate.rb:46 warning: singleton on non-persistent Java type Java::OrgBukkitBlock::Biome (http://wiki.jruby.org/Persistence)

purogo directory as an absolute path prevent moving the server directory

Hello,

The purogo plugin saves its directory via Purugin::Config as an absolute path.
If the server directory is moved, purogo won't find the shape files anymore.

One solution would be to save the path as relative to cwd or some element of the server hierarchy (the plugins/ dir, purugin.jar, the server directory), if within that directory.
Another would be to accept multiple paths, and always consider the File.join(File.dirname(__FILE__), "purogo") one.
And a last one which would only temporally solves it is to not persist default values. But I guess it's intended as it's more practical to customize if the default config is already there.

What do you think?

Can't get TagAPI to load

My plugin https://gist.github.com/3847484 tries to hook into the TagAPI plugins events... but I get errors.

19:02:18 [SEVERE] NameError: cannot load Java class org.kitteh.tag.TagAPI
for_name at org/jruby/javasupport/JavaClass.java:1206
get_proxy_class at org/jruby/javasupport/JavaUtilities.java:34
java_import at jar:file:/home/nigel/projects/4giggles/minecraftserver/plugins/purugin-0.1-bukkit-1.3.1-R1.0-SNAPSHOT.jar!/jruby/java/core_ext/object.rb:45
map at org/jruby/RubyArray.java:2350
java_import at jar:file:/home/nigel/projects/4giggles/minecraftserver/plugins/purugin-0.1-bukkit-1.3.1-R1.0-SNAPSHOT.jar!/jruby/java/core_ext/object.rb:41
import at jar:file:/home/nigel/projects/4giggles/minecraftserver/plugins/purugin-0.1-bukkit-1.3.1-R1.0-SNAPSHOT.jar!/jruby/java/core_ext/module.rb:53
Event at /home/nigel/projects/4giggles/minecraftserver/plugins/PurpleOpPlugin.rb:11
Purugin at /home/nigel/projects/4giggles/minecraftserver/plugins/PurpleOpPlugin.rb:5
(root) at /home/nigel/projects/4giggles/minecraftserver/plugins/PurpleOpPlugin.rb:4
load_plugin at jar:file:/home/nigel/projects/4giggles/minecraftserver/plugins/purugin-0.1-bukkit-1.3.1-R1.0-SNAPSHOT.jar!/purugin/change_listener.rb:33
start_plugin at jar:file:/home/nigel/projects/4giggles/minecraftserver/plugins/purugin-0.1-bukkit-1.3.1-R1.0-SNAPSHOT.jar!/purugin/change_listener.rb:77

19:02:18 [INFO] [MyChunk] Enabling MyChunk v1.2.2
19:02:18 [SEVERE] Exception in thread "RubyThread-20: jar:file:/home/nigel/projects/4giggles/minecraftserver/plugins/purugin-0.1-bukkit-1.3.1-R1.0-SNAPSHOT.jar!/purugin/change_listener.rb:75"
19:02:18 [SEVERE] org.jruby.embed.EvalFailedException: (NameError) cannot load Java class org.kitteh.tag.TagAPI
19:02:18 [SEVERE] at org.jruby.embed.internal.EmbedEvalUnitImpl.run(EmbedEvalUnitImpl.java:132)
19:02:18 [SEVERE] at org.jruby.embed.ScriptingContainer.runUnit(ScriptingContainer.java:1264)
19:02:18 [SEVERE] at org.jruby.embed.ScriptingContainer.runScriptlet(ScriptingContainer.java:1295)
19:02:18 [SEVERE] at org.purugin.PuruginPlugin.executeScript(PuruginPlugin.java:47)
19:02:18 [SEVERE] at org.purugin.PuruginPlugin.executeScriptAt(PuruginPlugin.java:55)
19:02:18 [SEVERE] at org.purugin.RubyPluginLoader.loadPlugin(RubyPluginLoader.java:36)
19:02:18 [SEVERE] at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:305)
19:02:18 [SEVERE] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
19:02:18 [SEVERE] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
19:02:18 [SEVERE] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
19:02:18 [SEVERE] at java.lang.reflect.Method.invoke(Method.java:616)
19:02:18 [SEVERE] at org.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(JavaMethod.java:455)
19:02:18 [SEVERE] at org.jruby.javasupport.JavaMethod.invokeDirect(JavaMethod.java:316)
19:02:18 [SEVERE] at org.jruby.java.invokers.InstanceMethodInvoker.call(InstanceMethodInvoker.java:59)
19:02:18 [SEVERE] at org.jruby.internal.runtime.methods.AliasMethod.call(AliasMethod.java:61)
19:02:18 [SEVERE] at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:312)
19:02:18 [SEVERE] at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:169)
19:02:18 [SEVERE] at org.jruby.ast.CallOneArgNode.interpret(CallOneArgNode.java:57)
19:02:18 [SEVERE] at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
19:02:18 [SEVERE] at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
19:02:18 [SEVERE] at org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:75)
19:02:18 [SEVERE] at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:190)
19:02:18 [SEVERE] at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:312)
19:02:18 [SEVERE] at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:169)
19:02:18 [SEVERE] at org.jruby.ast.FCallOneArgNode.interpret(FCallOneArgNode.java:36)
19:02:18 [SEVERE] at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
19:02:18 [SEVERE] at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
19:02:18 [SEVERE] at org.jruby.ast.RescueNode.executeBody(RescueNode.java:226)
19:02:18 [SEVERE] at org.jruby.ast.RescueNode.interpretWithJavaExceptions(RescueNode.java:123)
19:02:18 [SEVERE] at org.jruby.ast.RescueNode.interpret(RescueNode.java:113)
19:02:18 [SEVERE] at org.jruby.ast.BeginNode.interpret(BeginNode.java:83)
19:02:18 [SEVERE] at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
19:02:18 [SEVERE] at org.jruby.evaluator.ASTInterpreter.INTERPRET_BLOCK(ASTInterpreter.java:112)
19:02:18 [SEVERE] at org.jruby.runtime.Interpreted19Block.evalBlockBody(Interpreted19Block.java:209)
19:02:18 [SEVERE] at org.jruby.runtime.Interpreted19Block.yield(Interpreted19Block.java:197)
19:02:18 [SEVERE] at org.jruby.runtime.Interpreted19Block.call(Interpreted19Block.java:128)
19:02:18 [SEVERE] at org.jruby.runtime.Block.call(Block.java:89)
19:02:18 [SEVERE] at org.jruby.RubyProc.call(RubyProc.java:269)
19:02:18 [SEVERE] at org.jruby.RubyProc.call(RubyProc.java:223)
19:02:18 [SEVERE] at org.jruby.internal.runtime.RubyRunnable.run(RubyRunnable.java:101)
19:02:18 [SEVERE] at java.lang.Thread.run(Thread.java:679)
19:02:18 [SEVERE] Caused by: org.jruby.exceptions.RaiseException: (NameError) cannot load Java class org.kitteh.tag.TagAPI
19:02:18 [SEVERE] at org.jruby.javasupport.JavaClass.for_name(org/jruby/javasupport/JavaClass.java:1206)
19:02:18 [SEVERE] at org.jruby.javasupport.JavaUtilities.get_proxy_class(org/jruby/javasupport/JavaUtilities.java:34)
19:02:18 [SEVERE] at RUBY.java_import(jar:file:/home/nigel/projects/4giggles/minecraftserver/plugins/purugin-0.1-bukkit-1.3.1-R1.0-SNAPSHOT.jar!/jruby/java/core_ext/object.rb:45)
19:02:18 [SEVERE] at org.jruby.RubyArray.map(org/jruby/RubyArray.java:2350)
19:02:18 [SEVERE] at RUBY.java_import(jar:file:/home/nigel/projects/4giggles/minecraftserver/plugins/purugin-0.1-bukkit-1.3.1-R1.0-SNAPSHOT.jar!/jruby/java/core_ext/object.rb:41)
19:02:18 [SEVERE] at RUBY.import(jar:file:/home/nigel/projects/4giggles/minecraftserver/plugins/purugin-0.1-bukkit-1.3.1-R1.0-SNAPSHOT.jar!/jruby/java/core_ext/module.rb:53)
19:02:18 [SEVERE] at RUBY.Event(/home/nigel/projects/4giggles/minecraftserver/plugins/PurpleOpPlugin.rb:11)
19:02:18 [SEVERE] at RUBY.Purugin(/home/nigel/projects/4giggles/minecraftserver/plugins/PurpleOpPlugin.rb:5)
19:02:18 [SEVERE] at RUBY.(root)(/home/nigel/projects/4giggles/minecraftserver/plugins/PurpleOpPlugin.rb:4)
19:02:18 [SEVERE] at RUBY.load_plugin(jar:file:/home/nigel/projects/4giggles/minecraftserver/plugins/purugin-0.1-bukkit-1.3.1-R1.0-SNAPSHOT.jar!/purugin/change_listener.rb:33)
19:02:18 [SEVERE] at RUBY.start_plugin(jar:file:/home/nigel/projects/4giggles/minecraftserver/plugins/purugin-0.1-bukkit-1.3.1-R1.0-SNAPSHOT.jar!/purugin/change_listener.rb:77)

event priority support

I write a script myself, but it is not very good==

require 'java'
require 'purugin/util'
module Purugin
    module EventDefiner
        include Purugin::StringUtils
        def define_event_listener(name, package)
            event_name = camelcase_to(name.sub(/Event$/, ''), '_').downcase
            Purugin::Event::EVENT_NAME_TO_LISTENER[event_name.to_sym] = {}
            ['lowest','low','normal','high','highest','monitor'].each do |priority|
                self.module_eval <<-EOS
                    class #{priority.capitalize}#{name}Listener
                        include org.bukkit.event.Listener
                        def initialize(&code); @code = code; end
                        def on_event(event); @code.call(event); end
                        add_method_signature 'on_event', [java.lang.Void::TYPE, #{package}.#{name}]
                        add_method_annotation 'on_event', org.bukkit.event.EventHandler => {'priority' => org.bukkit.event.EventPriority::#{priority.upcase}}
                        become_java!
                    end
                    Purugin::Event::EVENT_NAME_TO_LISTENER[:#{event_name}][:#{priority}] = #{priority.capitalize}#{name}Listener
                EOS
            end
        end
    end

    module Event
        # FIXME: This only handles normal priority. Real fix is to generate these on demand versus up
        # front. We can reify what we need. This will also fix custom event types.

        require 'jruby/core_ext'

        extend Purugin::EventDefiner

        ##
        # symbol -> listener class map populated by calls to define_event_listener
        EVENT_NAME_TO_LISTENER = {}

        # These listeners and the map below come from auto-generation via generate_ruby_listeners_hack
        define_event_listener('AsyncPlayerChatEvent', 'org.bukkit.event.player')
        define_event_listener('AsyncPlayerPreLoginEvent', 'org.bukkit.event.player')
        define_event_listener('BlockBreakEvent', 'org.bukkit.event.block')
        define_event_listener('BlockBurnEvent', 'org.bukkit.event.block')
        define_event_listener('BlockCanBuildEvent', 'org.bukkit.event.block')
        define_event_listener('BlockDamageEvent', 'org.bukkit.event.block')
        define_event_listener('BlockDispenseEvent', 'org.bukkit.event.block')
        define_event_listener('BlockEvent', 'org.bukkit.event.block')
        define_event_listener('BlockExpEvent', 'org.bukkit.event.block')
        define_event_listener('BlockFadeEvent', 'org.bukkit.event.block')
        define_event_listener('BlockFormEvent', 'org.bukkit.event.block')
        define_event_listener('BlockFromToEvent', 'org.bukkit.event.block')
        define_event_listener('BlockGrowEvent', 'org.bukkit.event.block')
        define_event_listener('BlockIgniteEvent', 'org.bukkit.event.block')
        define_event_listener('BlockPhysicsEvent', 'org.bukkit.event.block')
        define_event_listener('BlockPistonEvent', 'org.bukkit.event.block')
        define_event_listener('BlockPistonExtendEvent', 'org.bukkit.event.block')
        define_event_listener('BlockPistonRetractEvent', 'org.bukkit.event.block')
        define_event_listener('BlockPlaceEvent', 'org.bukkit.event.block')
        define_event_listener('BlockRedstoneEvent', 'org.bukkit.event.block')
        define_event_listener('BlockSpreadEvent', 'org.bukkit.event.block')
        define_event_listener('BrewEvent', 'org.bukkit.event.inventory')
        define_event_listener('ChunkEvent', 'org.bukkit.event.world')
        define_event_listener('ChunkLoadEvent', 'org.bukkit.event.world')
        define_event_listener('ChunkPopulateEvent', 'org.bukkit.event.world')
        define_event_listener('ChunkUnloadEvent', 'org.bukkit.event.world')
        define_event_listener('ConversationAbandonedEvent', 'org.bukkit.conversations')
        define_event_listener('CraftItemEvent', 'org.bukkit.event.inventory')
        define_event_listener('CreatureSpawnEvent', 'org.bukkit.event.entity')
        define_event_listener('CreeperPowerEvent', 'org.bukkit.event.entity')
        define_event_listener('EnchantItemEvent', 'org.bukkit.event.enchantment')
        define_event_listener('EntityBlockFormEvent', 'org.bukkit.event.block')
        define_event_listener('EntityBreakDoorEvent', 'org.bukkit.event.entity')
        define_event_listener('EntityChangeBlockEvent', 'org.bukkit.event.entity')
        define_event_listener('EntityCombustByBlockEvent', 'org.bukkit.event.entity')
        define_event_listener('EntityCombustByEntityEvent', 'org.bukkit.event.entity')
        define_event_listener('EntityCombustEvent', 'org.bukkit.event.entity')
        define_event_listener('EntityCreatePortalEvent', 'org.bukkit.event.entity')
        define_event_listener('EntityDamageByBlockEvent', 'org.bukkit.event.entity')
        define_event_listener('EntityDamageByEntityEvent', 'org.bukkit.event.entity')
        define_event_listener('EntityDamageEvent', 'org.bukkit.event.entity')
        define_event_listener('EntityDeathEvent', 'org.bukkit.event.entity')
        define_event_listener('EntityEvent', 'org.bukkit.event.entity')
        define_event_listener('EntityExplodeEvent', 'org.bukkit.event.entity')
        define_event_listener('EntityInteractEvent', 'org.bukkit.event.entity')
        define_event_listener('EntityPortalEnterEvent', 'org.bukkit.event.entity')
        define_event_listener('EntityPortalEvent', 'org.bukkit.event.entity')
        define_event_listener('EntityPortalExitEvent', 'org.bukkit.event.entity')
        define_event_listener('EntityRegainHealthEvent', 'org.bukkit.event.entity')
        define_event_listener('EntityShootBowEvent', 'org.bukkit.event.entity')
        define_event_listener('EntityTameEvent', 'org.bukkit.event.entity')
        define_event_listener('EntityTargetEvent', 'org.bukkit.event.entity')
        define_event_listener('EntityTargetLivingEntityEvent', 'org.bukkit.event.entity')
        define_event_listener('EntityTeleportEvent', 'org.bukkit.event.entity')
        define_event_listener('ExpBottleEvent', 'org.bukkit.event.entity')
        define_event_listener('ExplosionPrimeEvent', 'org.bukkit.event.entity')
        define_event_listener('FoodLevelChangeEvent', 'org.bukkit.event.entity')
        define_event_listener('FurnaceBurnEvent', 'org.bukkit.event.inventory')
        define_event_listener('FurnaceExtractEvent', 'org.bukkit.event.inventory')
        define_event_listener('FurnaceSmeltEvent', 'org.bukkit.event.inventory')
        define_event_listener('HangingBreakByEntityEvent', 'org.bukkit.event.hanging')
        define_event_listener('HangingBreakEvent', 'org.bukkit.event.hanging')
        define_event_listener('HangingEvent', 'org.bukkit.event.hanging')
        define_event_listener('HangingPlaceEvent', 'org.bukkit.event.hanging')
        define_event_listener('InventoryClickEvent', 'org.bukkit.event.inventory')
        define_event_listener('InventoryCloseEvent', 'org.bukkit.event.inventory')
        define_event_listener('InventoryCreativeEvent', 'org.bukkit.event.inventory')
        define_event_listener('InventoryDragEvent', 'org.bukkit.event.inventory')
        define_event_listener('InventoryEvent', 'org.bukkit.event.inventory')
        define_event_listener('InventoryInteractEvent', 'org.bukkit.event.inventory')
        define_event_listener('InventoryMoveItemEvent', 'org.bukkit.event.inventory')
        define_event_listener('InventoryOpenEvent', 'org.bukkit.event.inventory')
        define_event_listener('InventoryPickupItemEvent', 'org.bukkit.event.inventory')
        define_event_listener('ItemDespawnEvent', 'org.bukkit.event.entity')
        define_event_listener('ItemSpawnEvent', 'org.bukkit.event.entity')
        define_event_listener('LeavesDecayEvent', 'org.bukkit.event.block')
        define_event_listener('LightningStrikeEvent', 'org.bukkit.event.weather')
        define_event_listener('MapInitializeEvent', 'org.bukkit.event.server')
        define_event_listener('NotePlayEvent', 'org.bukkit.event.block')
        define_event_listener('PaintingBreakByEntityEvent', 'org.bukkit.event.painting')
        define_event_listener('PaintingBreakEvent', 'org.bukkit.event.painting')
        define_event_listener('PaintingEvent', 'org.bukkit.event.painting')
        define_event_listener('PaintingPlaceEvent', 'org.bukkit.event.painting')
        define_event_listener('PigZapEvent', 'org.bukkit.event.entity')
        define_event_listener('PlayerAnimationEvent', 'org.bukkit.event.player')
        define_event_listener('PlayerBedEnterEvent', 'org.bukkit.event.player')
        define_event_listener('PlayerBedLeaveEvent', 'org.bukkit.event.player')
        define_event_listener('PlayerBucketEmptyEvent', 'org.bukkit.event.player')
        define_event_listener('PlayerBucketEvent', 'org.bukkit.event.player')
        define_event_listener('PlayerBucketFillEvent', 'org.bukkit.event.player')
        define_event_listener('PlayerChangedWorldEvent', 'org.bukkit.event.player')
        define_event_listener('PlayerChannelEvent', 'org.bukkit.event.player')
        define_event_listener('PlayerChatEvent', 'org.bukkit.event.player')
        define_event_listener('PlayerChatTabCompleteEvent', 'org.bukkit.event.player')
        define_event_listener('PlayerCommandPreprocessEvent', 'org.bukkit.event.player')
        define_event_listener('PlayerDeathEvent', 'org.bukkit.event.entity')
        define_event_listener('PlayerDropItemEvent', 'org.bukkit.event.player')
        define_event_listener('PlayerEditBookEvent', 'org.bukkit.event.player')
        define_event_listener('PlayerEggThrowEvent', 'org.bukkit.event.player')
        define_event_listener('PlayerEvent', 'org.bukkit.event.player')
        define_event_listener('PlayerExpChangeEvent', 'org.bukkit.event.player')
        define_event_listener('PlayerFishEvent', 'org.bukkit.event.player')
        define_event_listener('PlayerGameModeChangeEvent', 'org.bukkit.event.player')
        define_event_listener('PlayerInteractEntityEvent', 'org.bukkit.event.player')
        define_event_listener('PlayerInteractEvent', 'org.bukkit.event.player')
        define_event_listener('PlayerInventoryEvent', 'org.bukkit.event.player')
        define_event_listener('PlayerItemBreakEvent', 'org.bukkit.event.player')
        define_event_listener('PlayerItemConsumeEvent', 'org.bukkit.event.player')
        define_event_listener('PlayerItemHeldEvent', 'org.bukkit.event.player')
        define_event_listener('PlayerJoinEvent', 'org.bukkit.event.player')
        define_event_listener('PlayerKickEvent', 'org.bukkit.event.player')
        define_event_listener('PlayerLevelChangeEvent', 'org.bukkit.event.player')
        define_event_listener('PlayerLoginEvent', 'org.bukkit.event.player')
        define_event_listener('PlayerMoveEvent', 'org.bukkit.event.player')
        define_event_listener('PlayerPickupItemEvent', 'org.bukkit.event.player')
        define_event_listener('PlayerPortalEvent', 'org.bukkit.event.player')
        define_event_listener('PlayerPreLoginEvent', 'org.bukkit.event.player')
        define_event_listener('PlayerQuitEvent', 'org.bukkit.event.player')
        define_event_listener('PlayerRegisterChannelEvent', 'org.bukkit.event.player')
        define_event_listener('PlayerRespawnEvent', 'org.bukkit.event.player')
        define_event_listener('PlayerShearEntityEvent', 'org.bukkit.event.player')
        define_event_listener('PlayerTeleportEvent', 'org.bukkit.event.player')
        define_event_listener('PlayerToggleFlightEvent', 'org.bukkit.event.player')
        define_event_listener('PlayerToggleSneakEvent', 'org.bukkit.event.player')
        define_event_listener('PlayerToggleSprintEvent', 'org.bukkit.event.player')
        define_event_listener('PlayerUnregisterChannelEvent', 'org.bukkit.event.player')
        define_event_listener('PlayerVelocityEvent', 'org.bukkit.event.player')
        define_event_listener('PluginDisableEvent', 'org.bukkit.event.server')
        define_event_listener('PluginEnableEvent', 'org.bukkit.event.server')
        define_event_listener('PluginEvent', 'org.bukkit.event.server')
        define_event_listener('PortalCreateEvent', 'org.bukkit.event.world')
        define_event_listener('PotionSplashEvent', 'org.bukkit.event.entity')
        define_event_listener('PrepareItemCraftEvent', 'org.bukkit.event.inventory')
        define_event_listener('PrepareItemEnchantEvent', 'org.bukkit.event.enchantment')
        define_event_listener('ProjectileHitEvent', 'org.bukkit.event.entity')
        define_event_listener('ProjectileLaunchEvent', 'org.bukkit.event.entity')
        define_event_listener('RemoteServerCommandEvent', 'org.bukkit.event.server')
        define_event_listener('ServerCommandEvent', 'org.bukkit.event.server')
        define_event_listener('ServerEvent', 'org.bukkit.event.server')
        define_event_listener('ServerListPingEvent', 'org.bukkit.event.server')
        define_event_listener('ServiceEvent', 'org.bukkit.event.server')
        define_event_listener('ServiceRegisterEvent', 'org.bukkit.event.server')
        define_event_listener('ServiceUnregisterEvent', 'org.bukkit.event.server')
        define_event_listener('SheepDyeWoolEvent', 'org.bukkit.event.entity')
        define_event_listener('SheepRegrowWoolEvent', 'org.bukkit.event.entity')
        define_event_listener('SignChangeEvent', 'org.bukkit.event.block')
        define_event_listener('SlimeSplitEvent', 'org.bukkit.event.entity')
        define_event_listener('SpawnChangeEvent', 'org.bukkit.event.world')
        define_event_listener('StructureGrowEvent', 'org.bukkit.event.world')
        define_event_listener('ThunderChangeEvent', 'org.bukkit.event.weather')
        define_event_listener('VehicleBlockCollisionEvent', 'org.bukkit.event.vehicle')
        define_event_listener('VehicleCollisionEvent', 'org.bukkit.event.vehicle')
        define_event_listener('VehicleCreateEvent', 'org.bukkit.event.vehicle')
        define_event_listener('VehicleDamageEvent', 'org.bukkit.event.vehicle')
        define_event_listener('VehicleDestroyEvent', 'org.bukkit.event.vehicle')
        define_event_listener('VehicleEnterEvent', 'org.bukkit.event.vehicle')
        define_event_listener('VehicleEntityCollisionEvent', 'org.bukkit.event.vehicle')
        define_event_listener('VehicleEvent', 'org.bukkit.event.vehicle')
        define_event_listener('VehicleExitEvent', 'org.bukkit.event.vehicle')
        define_event_listener('VehicleMoveEvent', 'org.bukkit.event.vehicle')
        define_event_listener('VehicleUpdateEvent', 'org.bukkit.event.vehicle')
        define_event_listener('WeatherChangeEvent', 'org.bukkit.event.weather')
        define_event_listener('WeatherEvent', 'org.bukkit.event.weather')
        define_event_listener('WorldEvent', 'org.bukkit.event.world')
        define_event_listener('WorldInitEvent', 'org.bukkit.event.world')
        define_event_listener('WorldLoadEvent', 'org.bukkit.event.world')
        define_event_listener('WorldSaveEvent', 'org.bukkit.event.world')
        define_event_listener('WorldUnloadEvent', 'org.bukkit.event.world')

        def event(event_name, priority=:normal, &code)
            type = EVENT_NAME_TO_LISTENER[event_name.to_sym]

            raise ArgumentError.new "No suck event #{event_name}" unless type
            raise ArgumentError.new "The priority is not supported!" unless [:lowest,:low,:normal,:high,:highest,:monitor].include?(priority.to_sym)

            plugin_manager.register_events(type[priority.to_sym].new(&code), self)
        end
        alias on event
    end
end

Purugin fails to start

run.bat

set GEM_HOME=gems
java -cp jruby-complete-1.6.4.jar;craftbukkit.jar org.bukkit.craftbukkit.Main
plause

server log

15:37:37 [SEVERE] LoadError: no such file to load -- bukkit
  require at org/jruby/RubyKernel.java:1038
   (root) at jar:file:/C:/Documents%20and%20Settings/human/My%20Documents/minecraft/mod%20serv
er/plugins/Purugin.jar!/purugin.rb:8

15:37:37 [SEVERE] (LoadError) no such file to load -- bukkit initializing PuruginPlugin v0.1 (Is it
up to date?)
org.jruby.embed.EvalFailedException: (LoadError) no such file to load -- bukkit
        at org.jruby.embed.internal.EmbedEvalUnitImpl.run(EmbedEvalUnitImpl.java:127)
        at org.jruby.embed.ScriptingContainer.runUnit(ScriptingContainer.java:1231)
        at org.jruby.embed.ScriptingContainer.runScriptlet(ScriptingContainer.java:1262)
        at org.purugin.PuruginPlugin.executeScript(PuruginPlugin.java:47)
        at org.purugin.PuruginPlugin.onLoad(PuruginPlugin.java:35)
        at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:141)
        at org.bukkit.craftbukkit.CraftServer.<init>(CraftServer.java:103)
        at net.minecraft.server.ServerConfigurationManager.<init>(ServerConfigurationManager.java:52
)
        at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:136)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:348)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:417)
Caused by: org.jruby.exceptions.RaiseException: (LoadError) no such file to load -- bukkit
15:37:37 [INFO] Preparing level "world"
15:37:37 [INFO] Default game type: 0
15:37:38 [INFO] Preparing start region for level 0 (Seed: -4528252128809497368)
15:37:39 [INFO] Preparing spawn area: 40%
15:37:40 [INFO] Preparing start region for level 1 (Seed: -4528252128809497368)
15:37:40 [INFO] Preparing spawn area: 0%
15:37:41 [INFO] Preparing spawn area: 24%
15:37:42 [INFO] Preparing spawn area: 32%
15:37:43 [INFO] Preparing spawn area: 40%
15:37:44 [INFO] Preparing spawn area: 52%
15:37:45 [INFO] Preparing spawn area: 56%
15:37:46 [INFO] Preparing spawn area: 61%
15:37:47 [INFO] Preparing spawn area: 69%
15:37:48 [INFO] Preparing spawn area: 77%
15:37:49 [INFO] Preparing spawn area: 81%
15:37:50 [INFO] Preparing spawn area: 85%
15:37:51 [INFO] Preparing spawn area: 93%
15:37:52 [INFO] Preparing spawn area: 97%
15:37:53 [SEVERE] NoMethodError: undefined method `onEnable' for main:Object

15:37:53 [SEVERE] Error occurred while enabling PuruginPlugin v0.1 (Is it up to date?): (NoMethodErr
or) undefined method `onEnable' for main:Object
org.jruby.embed.InvokeFailedException: (NoMethodError) undefined method `onEnable' for main:Object
        at org.jruby.embed.internal.EmbedRubyObjectAdapterImpl.call(EmbedRubyObjectAdapterImpl.java:
406)
        at org.jruby.embed.internal.EmbedRubyObjectAdapterImpl.callMethod(EmbedRubyObjectAdapterImpl
.java:331)
        at org.jruby.embed.ScriptingContainer.callMethod(ScriptingContainer.java:1334)
        at org.purugin.PuruginPlugin.onEnable(PuruginPlugin.java:27)
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:126)
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:920)
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:278)
        at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:173)
        at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:156)
        at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:297)
        at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:284)
        at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:152)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:348)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:417)
Caused by: org.jruby.exceptions.RaiseException: (NoMethodError) undefined method `onEnable' for main
:Object
15:37:53 [INFO] Server permissions file permissions.yml is empty, ignoring it
15:37:53 [INFO] Done (1.553s)! For help, type "help" or "?"

New build refuses to load.

[10:33:45] [Server thread/ERROR]: Could not load 'plugins/purugin-0.7.1-bukkit-1.7.2-R0.2.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: java.lang.NoClassDefFoundError: org/jruby/embed/ScriptingContainer
        at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:137) ~[spigot-1.7.2-R0.3-SNAPSHOT.jar:git-Spigot-1278]
        at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:309) ~[spigot-1.7.2-R0.3-SNAPSHOT.jar:git-Spigot-1278]
        at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:231) [spigot-1.7.2-R0.3-SNAPSHOT.jar:git-Spigot-1278]
        at org.bukkit.craftbukkit.v1_7_R1.CraftServer.loadPlugins(CraftServer.java:261) [spigot-1.7.2-R0.3-SNAPSHOT.jar:git-Spigot-1278]
        at net.minecraft.server.v1_7_R1.DedicatedServer.init(DedicatedServer.java:135) [spigot-1.7.2-R0.3-SNAPSHOT.jar:git-Spigot-1278]
        at net.minecraft.server.v1_7_R1.MinecraftServer.run(MinecraftServer.java:436) [spigot-1.7.2-R0.3-SNAPSHOT.jar:git-Spigot-1278]
        at net.minecraft.server.v1_7_R1.ThreadServerApplication.run(SourceFile:617) [spigot-1.7.2-R0.3-SNAPSHOT.jar:git-Spigot-1278]
Caused by: java.lang.NoClassDefFoundError: org/jruby/embed/ScriptingContainer
        at org.purugin.PuruginPlugin.<init>(PuruginPlugin.java:16) ~[?:?]
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.7.0_51]
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) ~[?:1.7.0_51]
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.7.0_51]
        at java.lang.reflect.Constructor.newInstance(Constructor.java:526) ~[?:1.7.0_51]
        at java.lang.Class.newInstance(Class.java:374) ~[?:1.7.0_51]
        at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:52) ~[spigot-1.7.2-R0.3-SNAPSHOT.jar:git-Spigot-1278]
        at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:133) ~[spigot-1.7.2-R0.3-SNAPSHOT.jar:git-Spigot-1278]
        ... 6 more
Caused by: java.lang.ClassNotFoundException: org.jruby.embed.ScriptingContainer
        at java.net.URLClassLoader$1.run(URLClassLoader.java:366) ~[?:1.7.0_51]
        at java.net.URLClassLoader$1.run(URLClassLoader.java:355) ~[?:1.7.0_51]
        at java.security.AccessController.doPrivileged(Native Method) ~[?:1.7.0_51]
        at java.net.URLClassLoader.findClass(URLClassLoader.java:354) ~[?:1.7.0_51]
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:77) ~[spigot-1.7.2-R0.3-SNAPSHOT.jar:git-Spigot-1278]
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:62) ~[spigot-1.7.2-R0.3-SNAPSHOT.jar:git-Spigot-1278]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:425) ~[?:1.7.0_51]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:358) ~[?:1.7.0_51]
        at org.purugin.PuruginPlugin.<init>(PuruginPlugin.java:16) ~[?:?]
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.7.0_51]
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) ~[?:1.7.0_51]
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.7.0_51]
        at java.lang.reflect.Constructor.newInstance(Constructor.java:526) ~[?:1.7.0_51]
        at java.lang.Class.newInstance(Class.java:374) ~[?:1.7.0_51]
        at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:52) ~[spigot-1.7.2-R0.3-SNAPSHOT.jar:git-Spigot-1278]
        at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:133) ~[spigot-1.7.2-R0.3-SNAPSHOT.jar:git-Spigot-1278]
        ... 6 more

Add support for making Purugins into a .jar

The practicality of Purugin falls short in that it is more difficult to distribute
(For example on dev.bukkit.org) than an ordinary plugin, and relies on Purugin.jar.
Even if one could just make a jar, still relying on Purugin.jar, it would be great.

Auto-Generation of Config Folders

One feature I would like to see, would be the ability to turn off auto-generation of a config folder from within the specific plugin's code.

:player_join event fails

a hello-world plugin works fine with Spigot, but a any plugin using the :player_join event fails like so:

[21:25:33 ERROR]: Could not pass event PlayerJoinEvent to Example v0.1
org.bukkit.event.EventException
    at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:302) ~[craftbukkit-1.8.8.jar:git-Bukkit-07c3001]
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[craftbukkit-1.8.8.jar:git-Bukkit-07c3001]
    at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:501) [craftbukkit-1.8.8.jar:git-Bukkit-07c3001]
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:486) [craftbukkit-1.8.8.jar:git-Bukkit-07c3001]
    at net.minecraft.server.v1_8_R3.PlayerList.onPlayerJoin(PlayerList.java:282) [craftbukkit-1.8.8.jar:git-Bukkit-07c3001]
    at net.minecraft.server.v1_8_R3.PlayerList.a(PlayerList.java:142) [craftbukkit-1.8.8.jar:git-Bukkit-07c3001]
    at net.minecraft.server.v1_8_R3.LoginListener.b(LoginListener.java:115) [craftbukkit-1.8.8.jar:git-Bukkit-07c3001]
    at net.minecraft.server.v1_8_R3.LoginListener.c(LoginListener.java:53) [craftbukkit-1.8.8.jar:git-Bukkit-07c3001]
    at net.minecraft.server.v1_8_R3.NetworkManager.a(NetworkManager.java:222) [craftbukkit-1.8.8.jar:git-Bukkit-07c3001]
    at net.minecraft.server.v1_8_R3.ServerConnection.c(SourceFile:168) [craftbukkit-1.8.8.jar:git-Bukkit-07c3001]
    at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:745) [craftbukkit-1.8.8.jar:git-Bukkit-07c3001]
    at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:335) [craftbukkit-1.8.8.jar:git-Bukkit-07c3001]
    at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:629) [craftbukkit-1.8.8.jar:git-Bukkit-07c3001]
    at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:537) [craftbukkit-1.8.8.jar:git-Bukkit-07c3001]
    at java.lang.Thread.run(Thread.java:745) [?:1.8.0_65]
Caused by: org.jruby.exceptions.RaiseException: (NoMethodError) undefined method `display_name' for #<Java::OrgBukkitEventPlayer::PlayerJoinEvent:0x736aa1a9>
    at RUBY.on_enable(/Users/brandon/Code/Spigot/plugins/example.rb:7) ~[?:?]
    at org.jruby.RubyProc.call(org/jruby/RubyProc.java:271) ~[?:?]
    at RUBY.on_event((eval):4) ~[?:?]
    at net.minecraft.server.v1_8_R3.ServerConnection.c(SourceFile:168) ~[craftbukkit-1.8.8.jar:git-Bukkit-07c3001]
[21:25:33 INFO]: iconoclast[/127.0.0.1:65218] logged in with entity id 310 at ([world]-176.2323580778468, 81.05547480394029, -9.923850870811815)

The plugin code was taken from the events wiki page:

class ExamplePlugin
  include Purugin::Plugin, Purugin::Colors
  description 'Example', 0.1

  def on_enable
    event(:player_join) do |s|
      server.broadcast_message yellow("#{s.display_name} has joined the game.")
    end
  end
end

I've tried starting up the minecraft server with both craftbukkit-1.8.8.jar and spigot-1.8.8.jar, and get similar results with both:

#!/bin/sh

cd "$( dirname "$0" )"
# GEM_HOME=./gems java -Xms1024M -Xmx1024M -jar spigot-1.8.8.jar
GEM_HOME=./gems java -Xms1024M -Xmx1024M -jar craftbukkit-1.8.8.jar

Examples of working with inventory items?

I'm just fiddling around with Purugin with my son here but we are totally unfamiliar with the Bukkit API. We would like to make a new type of item. We were thinking of making a tent that would be a cube-sized object that would expand into a fully-set-up tent when you clicked on it and then could be taken down and converted back into a block by clicking on it again. Most of your examples don't seem to deal with items. Any suggestions?

Work with Minecraft Server

I'm inferring (perhaps incorrectly?) based on the DMCA takedown that this project cannot be used anymore in its current state, unless you happen to have a copy of craftbukkit.jar from before the takedown.

Is it possible to make this work with a vanilla Minecraft server? (Or is that a ridiculously monumental undertaking?)

request - Redstone simple example

Hi Enebo,

Interesting plugin, I'm just loading it up now.

I see there is an :onBlockRedstoneChange, in (event.rb) ProcBlockListener

I'm interested in using that to create a "logic" block,

Can you post a simple example of how to read / write a block's sides ("ports") that have redstone dust connected to them ?

thx

Mike

getItem()

How would I use getItem() in the player_interact event? (Great plugin by the way.)

java.lang.NullPointerException for event(:player_inventory)

Hi,

I would like to use the following event :player_inventory but when I tried to load my plugin using this event with the following code :

class InventoryManagement
    include Purugin::Plugin
    description 'Inventory Management', 0.1

    def on_enable
        puts 'Hello inventory'
        event(:player_inventory) do |e|
            puts 'hi'
        end
    end

    def on_disbale
        puts 'Bye inventory'
    end

end

I get a java NullPointException on the line 7 which is the following :

event(:player_inventory) do |e| 

Here is the full trace :

Error occurred (in the plugin loader) while enabling Inventory Management v0.1 (Is it up to date?)
java.lang.NullPointerException
    at org.bukkit.plugin.java.JavaPluginLoader.createRegisteredListeners(org/bukkit/plugin/java/JavaPluginLoader.java:404) ~[craftbukkit-1.7.2-R0.2.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
    at org.purugin.RubyPluginLoader.createRegisteredListeners(org/purugin/RubyPluginLoader.java:66) ~[?:?]
    at org.bukkit.plugin.SimplePluginManager.registerEvents(org/bukkit/plugin/SimplePluginManager.java:506) ~[craftbukkit-1.7.2-R0.2.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
    at java.lang.reflect.Method.invoke(java/lang/reflect/Method.java:606) ~[?:1.7.0_51]
    at RUBY.event(file:/Volumes/Data/Developpement/Minecraft/bukkit/purugin/plugins/purugin-0.7.1-bukkit-1.7.2-R0.2.jar!/purugin/event.rb:212) ~[?:?]
    at RUBY.on_enable(/Volumes/Data/Developpement/Minecraft/bukkit/purugin/plugins/InventoryManagement.rb:7) ~[?:?]
    at RUBY.onEnable(file:/Volumes/Data/Developpement/Minecraft/bukkit/purugin/plugins/purugin-0.7.1-bukkit-1.7.2-R0.2.jar!/purugin/plugin.rb:142) ~[?:?]
    at InventoryManagement_1469695719.onEnable(InventoryManagement_1469695719.gen:13) ~[?:?]
    at InventoryManagement_1469695719.onEnable(InventoryManagement_1469695719.gen:13) ~[?:?]
    at org.purugin.RubyPluginLoader.enablePlugin(org/purugin/RubyPluginLoader.java:49) ~[?:?]
    at org.bukkit.plugin.SimplePluginManager.enablePlugin(org/bukkit/plugin/SimplePluginManager.java:384) ~[craftbukkit-1.7.2-R0.2.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
    at java.lang.reflect.Method.invoke(java/lang/reflect/Method.java:606) ~[?:1.7.0_51]
    at RUBY.onEnable(jar:file:/Volumes/Data/Developpement/Minecraft/bukkit/purugin/plugins/purugin-0.7.1-bukkit-1.7.2-R0.2.jar!/purugin.rb:71) ~[?:?]
    at org.jruby.RubyHash.each(org/jruby/RubyHash.java:1339) ~[jruby-complete-1.7.11.jar:?]
    at RUBY.onEnable(jar:file:/Volumes/Data/Developpement/Minecraft/bukkit/purugin/plugins/purugin-0.7.1-bukkit-1.7.2-R0.2.jar!/purugin.rb:71) ~[?:?]
    at org.purugin.PuruginPlugin.onEnable(org/purugin/PuruginPlugin.java:30) [purugin-0.7.1-bukkit-1.7.2-R0.2.jar:?]
    at org.bukkit.plugin.java.JavaPlugin.setEnabled(org/bukkit/plugin/java/JavaPlugin.java:218) [craftbukkit-1.7.2-R0.2.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
    at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(org/bukkit/plugin/java/JavaPluginLoader.java:457) [craftbukkit-1.7.2-R0.2.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
    at org.bukkit.plugin.SimplePluginManager.enablePlugin(org/bukkit/plugin/SimplePluginManager.java:384) [craftbukkit-1.7.2-R0.2.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
    at org.bukkit.craftbukkit.v1_7_R1.CraftServer.loadPlugin(org/bukkit/craftbukkit/v1_7_R1/CraftServer.java:298) [craftbukkit-1.7.2-R0.2.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
    at org.bukkit.craftbukkit.v1_7_R1.CraftServer.enablePlugins(org/bukkit/craftbukkit/v1_7_R1/CraftServer.java:280) [craftbukkit-1.7.2-R0.2.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
    at org.bukkit.craftbukkit.v1_7_R1.CraftServer.reload(org/bukkit/craftbukkit/v1_7_R1/CraftServer.java:630) [craftbukkit-1.7.2-R0.2.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
    at org.bukkit.Bukkit.reload(org/bukkit/Bukkit.java:279) [craftbukkit-1.7.2-R0.2.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
    at org.bukkit.command.defaults.ReloadCommand.execute(org/bukkit/command/defaults/ReloadCommand.java:23) [craftbukkit-1.7.2-R0.2.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
    at org.bukkit.command.SimpleCommandMap.dispatch(org/bukkit/command/SimpleCommandMap.java:196) [craftbukkit-1.7.2-R0.2.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
    at org.bukkit.craftbukkit.v1_7_R1.CraftServer.dispatchCommand(org/bukkit/craftbukkit/v1_7_R1/CraftServer.java:542) [craftbukkit-1.7.2-R0.2.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
    at org.bukkit.craftbukkit.v1_7_R1.CraftServer.dispatchServerCommand(org/bukkit/craftbukkit/v1_7_R1/CraftServer.java:529) [craftbukkit-1.7.2-R0.2.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
    at net.minecraft.server.v1_7_R1.DedicatedServer.aw(net/minecraft/server/v1_7_R1/DedicatedServer.java:286) [craftbukkit-1.7.2-R0.2.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
    at net.minecraft.server.v1_7_R1.DedicatedServer.u(net/minecraft/server/v1_7_R1/DedicatedServer.java:251) [craftbukkit-1.7.2-R0.2.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
    at net.minecraft.server.v1_7_R1.MinecraftServer.t(net/minecraft/server/v1_7_R1/MinecraftServer.java:545) [craftbukkit-1.7.2-R0.2.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
    at net.minecraft.server.v1_7_R1.MinecraftServer.run(net/minecraft/server/v1_7_R1/MinecraftServer.java:457) [craftbukkit-1.7.2-R0.2.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
    at net.minecraft.server.v1_7_R1.ThreadServerApplication.run(SourceFile:617) ~[craftbukkit-1.7.2-R0.2.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
    at net.minecraft.server.v1_7_R1.ThreadServerApplication.run(net/minecraft/server/v1_7_R1/SourceFile:617) [craftbukkit-1.7.2-R0.2.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]

For information, I have tried severals other PlayerEvent and they work without problems. So I don't really understand why this is happening for this one.

Documentation request regarding Spigot compatibility

It would be very useful to know up-front whether Spigot's fork of craftbukkit is compatible with Purugin (and Purogo). If this has been tested and the answer is known, it would be great if the person with that knowledge can update the README. If it has not been tested then those of us who want to try it will know we're not wasting our time attempting to get it working (and can update the README afterward).

Also, it would be useful to know what extra steps, if any, are needed to get the Spigot fork working with this.

Make error backtraces more salient

In issue #56 we see a typical backtrace in Purugin as it stands today. Here is one I just generated:

rg.bukkit.event.EventException
    at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:310) ~[spigot-1.8.8.jar:git-Spigot-db6de12-07c3001]
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[spigot-1.8.8.jar:git-Spigot-db6de12-07c3001]
    at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:502) [spigot-1.8.8.jar:git-Spigot-db6de12-07c3001]
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:487) [spigot-1.8.8.jar:git-Spigot-db6de12-07c3001]
    at net.minecraft.server.v1_8_R3.PlayerList.onPlayerJoin(PlayerList.java:298) [spigot-1.8.8.jar:git-Spigot-db6de12-07c3001]
    at net.minecraft.server.v1_8_R3.PlayerList.a(PlayerList.java:157) [spigot-1.8.8.jar:git-Spigot-db6de12-07c3001]
    at net.minecraft.server.v1_8_R3.LoginListener.b(LoginListener.java:144) [spigot-1.8.8.jar:git-Spigot-db6de12-07c3001]
    at net.minecraft.server.v1_8_R3.LoginListener.c(LoginListener.java:54) [spigot-1.8.8.jar:git-Spigot-db6de12-07c3001]
    at net.minecraft.server.v1_8_R3.NetworkManager.a(NetworkManager.java:231) [spigot-1.8.8.jar:git-Spigot-db6de12-07c3001]
    at net.minecraft.server.v1_8_R3.ServerConnection.c(ServerConnection.java:148) [spigot-1.8.8.jar:git-Spigot-db6de12-07c3001]
    at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:814) [spigot-1.8.8.jar:git-Spigot-db6de12-07c3001]
    at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:374) [spigot-1.8.8.jar:git-Spigot-db6de12-07c3001]
    at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:654) [spigot-1.8.8.jar:git-Spigot-db6de12-07c3001]
    at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:557) [spigot-1.8.8.jar:git-Spigot-db6de12-07c3001]
    at java.lang.Thread.run(Thread.java:745) [?:1.7.0_79]
Caused by: org.jruby.exceptions.RaiseException: (NoMethodError) undefined method `display_name' for #<Java::OrgBukkitEventPlayer::PlayerJoinEvent:0x5a3eca5e>
    at RUBY.on_enable(/Users/enebo/work/games/minecraft/plugins/a.rb:7) ~[?:?]
    at org.jruby.RubyProc.call(org/jruby/RubyProc.java:271) ~[?:?]
    at RUBY.on_event((eval):4) ~[?:?]
[

You will see Java framework is generating a wrapped exception but the real exception we want is our RaiseException generated from the ruby runtime itself.

So the challenge is to overload the handler OR possibly subclass the PluginException itself to not show all the other crud of spigot/craftbukkit in getMessages (or whatever Java exception backtrace generating method is called).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.