Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package me.zach.glasscoins;
- import java.util.ArrayList;
- import java.util.List;
- import java.util.logging.Logger;
- 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.event.EventHandler;
- import org.bukkit.event.Listener;
- import org.bukkit.event.player.PlayerJoinEvent;
- import org.bukkit.inventory.ItemStack;
- import org.bukkit.inventory.meta.ItemMeta;
- import org.bukkit.plugin.PluginDescriptionFile;
- import org.bukkit.plugin.java.JavaPlugin;
- public class Main extends JavaPlugin implements Listener{
- Logger logger = Logger.getLogger("Minecraft");
- static Main plugin;
- public void onEnable(){
- PluginDescriptionFile pdfFile = this.getDescription();
- this.logger.info(pdfFile.getName() + " enabled!");
- this.logger.info("By: Zach Farley / Legostarwarszach");
- }
- public void onDisable(){
- PluginDescriptionFile pdfFile = this.getDescription();
- this.logger.info(pdfFile.getName() + " disabled!");
- }
- public boolean onCommand(CommandSender sender, Command cmd, String commandLable, String[] arges){
- Player player = (Player) sender;
- if(commandLable.equalsIgnoreCase("glasscoins")) if(commandLable.equalsIgnoreCase("gc")){
- if(arges.length==0){
- player.sendMessage(ChatColor.AQUA + "A plugin made by: Zach / Legostarwarszach");
- }if(arges.length==1){
- ((Player) sender).getInventory().addItem(setName(new ItemStack(Material.SNOW_BALL),"1 GlassCoin","Use this as currecnty!"));
- player.sendMessage(ChatColor.GREEN + "You have recieved 1 GlassCoin!");
- }
- }
- return false;
- }
- private ItemStack setName(ItemStack itemStack, String string, String string2) {
- ItemMeta im = itemStack.getItemMeta();
- if(string != null)
- im.setDisplayName(string);
- if(string2 != null)
- itemStack.setItemMeta(im);
- return itemStack;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement