Created
March 14, 2012 22:06
-
-
Save ericpauley/2039910 to your computer and use it in GitHub Desktop.
Plugin to test Bukkit Inventory API
This file contains hidden or 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 org.zonedabone.chesttest; | |
import org.bukkit.command.Command; | |
import org.bukkit.command.CommandSender; | |
import org.bukkit.entity.Player; | |
import org.bukkit.event.inventory.InventoryType; | |
import org.bukkit.inventory.Inventory; | |
import org.bukkit.inventory.InventoryHolder; | |
import org.bukkit.plugin.java.JavaPlugin; | |
public class ChestTest extends JavaPlugin implements InventoryHolder{ | |
private Inventory i; | |
@Override | |
public void onEnable(){ | |
i = this.getServer().createInventory(this, InventoryType.CHEST); | |
} | |
@Override | |
public boolean onCommand(CommandSender cs,Command c,String label,String[] args){ | |
((Player)cs).openInventory(i); | |
return true; | |
} | |
@Override | |
public Inventory getInventory() { | |
return i; | |
} | |
} |
This file contains hidden or 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: ChestTest | |
version: 1.0.0 | |
main: org.zonedabone.chesttest.ChestTest | |
commands: | |
open: | |
usage: /command |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment