Last active
March 7, 2016 01:38
-
-
Save avighnash/83df9c07d4f0e3c77c9c to your computer and use it in GitHub Desktop.
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 us.universalpvp.play; | |
import java.util.logging.Logger | |
import org.bukkit.Bukkit; | |
import org.bukkit.ChatColor; | |
import org.bukkit.Material; | |
import org.bukkit.command.Command; | |
import org.bukkit.command.CommandSender; | |
import org.bukkit.entity.Player; | |
import org.bukkit.inventory.ItemStack; | |
import org.bukkit.plugin.java.JavaPlugin; | |
import org.bukkit.inventory.Inventory | |
public class Inventory extends JavaPlugin | |
{ | |
Logger myPluginLogger = Bukkit.getLogger(); <- RED LINE HERE | |
@Override | |
public void onEnable() | |
{ | |
} | |
@Override | |
public void onDisable() | |
{ | |
} | |
public boolean onCommand(CommandSender theSender, Command cmd, String commandLabel, String[] args) | |
{ | |
if(theSender instanceof Player) | |
{ | |
Player player = (Player)theSender; | |
if(commandLabel.equalsIgnoreCase("openinventory")) | |
{ | |
ItemStack dirt = new ItemStack(Material.DIRT, 64); | |
Inventory inv = Bukkit.createInventory(null, 9) <- RED LINE AROUND HERE | |
inv.addItem(dirt); <- RED LINE AROUND HERE | |
player.openinventory(inv); <- RED LINE HERE ONCE AGAIN! | |
} | |
} | |
return true; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment