Created
April 7, 2013 00:16
-
-
Save riking/5328233 to your computer and use it in GitHub Desktop.
InventoryPaintEvent test plugin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: TestPlugin | |
main: test.TestPlugin | |
version: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package test; | |
import org.bukkit.plugin.java.JavaPlugin; | |
import org.bukkit.event.Listener; | |
import org.bukkit.event.EventHandler; | |
import org.bukkit.event.inventory.InventoryPaintEvent; | |
public class TestPlugin extends JavaPlugin implements Listener { | |
public void onEnable() { | |
getServer().getPluginManager().registerEvents((Listener)this, (JavaPlugin)this); | |
} | |
@EventHandler | |
public void onPaint(InventoryPaintEvent e) { | |
System.out.println("Paint event"); | |
System.out.println("R/L: " + (e.isRightClick() ? "Right" : "Left")); | |
System.out.println("Player: " + e.getWhoClicked().getName()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment