-
-
Save stefvanschie/0d6d67d6425d665be7529a0769b8b9aa to your computer and use it in GitHub Desktop.
Spigot issue test code 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
package com.github.stefvanschiedev.invframework.test; | |
import org.bukkit.Bukkit; | |
import org.bukkit.Material; | |
import org.bukkit.command.Command; | |
import org.bukkit.command.CommandSender; | |
import org.bukkit.entity.HumanEntity; | |
import org.bukkit.inventory.Inventory; | |
import org.bukkit.inventory.ItemStack; | |
import org.bukkit.plugin.java.JavaPlugin; | |
public class Main extends JavaPlugin { | |
ItemStack itemStack = new ItemStack(Material.GREEN_WOOL); | |
Inventory inventory = Bukkit.createInventory(null, 54, "Test"); | |
@Override | |
public void onEnable() { | |
inventory.addItem(itemStack); | |
} | |
@Override | |
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { | |
if (!(sender instanceof HumanEntity)) | |
return false; | |
if (args[0].equalsIgnoreCase("open")) { | |
((HumanEntity) sender).openInventory(inventory); | |
} else if (args[0].equalsIgnoreCase("change")) { | |
itemStack.setType(Material.RED_WOOL); | |
} | |
return true; | |
} | |
} |
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
main: com.github.stefvanschiedev.invframework.test.Main | |
name: IFTest | |
version: 0.0.0 | |
api-version: 1.13 | |
commands: | |
gui: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment