-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
172 additions
and
20 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
136 changes: 135 additions & 1 deletion
136
src/main/java/me/kadotcom/lifestolen/Commands/ViewRecipes.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,138 @@ | ||
package me.kadotcom.lifestolen.Commands; | ||
|
||
public class ViewRecipes { | ||
import me.kadotcom.lifestolen.LifeStolen; | ||
import org.bukkit.Bukkit; | ||
import org.bukkit.Material; | ||
import org.bukkit.command.Command; | ||
import org.bukkit.command.CommandExecutor; | ||
import org.bukkit.command.CommandSender; | ||
import org.bukkit.entity.Player; | ||
import org.bukkit.inventory.Inventory; | ||
import org.bukkit.inventory.ItemStack; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class ViewRecipes implements CommandExecutor { | ||
LifeStolen plugin; | ||
public ViewRecipes(LifeStolen ls){ | ||
plugin = ls; | ||
} | ||
|
||
@Override | ||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { | ||
|
||
if(sender instanceof Player){ | ||
Player p = (Player) sender; | ||
|
||
Inventory gui = Bukkit.createInventory(p,45, "LifeStolen Crafting View"); | ||
if(args[0].equalsIgnoreCase("heart")){ | ||
ItemStack[] menu = { | ||
new ItemStack(Material.GRAY_STAINED_GLASS_PANE), | ||
new ItemStack(Material.GRAY_STAINED_GLASS_PANE), | ||
new ItemStack(Material.GRAY_STAINED_GLASS_PANE), | ||
new ItemStack(Material.GRAY_STAINED_GLASS_PANE), | ||
new ItemStack(Material.GRAY_STAINED_GLASS_PANE), | ||
new ItemStack(Material.GRAY_STAINED_GLASS_PANE), | ||
new ItemStack(Material.GRAY_STAINED_GLASS_PANE), | ||
new ItemStack(Material.GRAY_STAINED_GLASS_PANE), | ||
new ItemStack(Material.GRAY_STAINED_GLASS_PANE), | ||
new ItemStack(Material.GRAY_STAINED_GLASS_PANE), | ||
new ItemStack(Material.GRAY_STAINED_GLASS_PANE), | ||
new ItemStack(Material.GRAY_STAINED_GLASS_PANE), | ||
new ItemStack(Material.valueOf(plugin.getConfig().getString("HeartRecipe.Slot1"))), | ||
new ItemStack(Material.valueOf(plugin.getConfig().getString("HeartRecipe.Slot2"))), | ||
new ItemStack(Material.valueOf(plugin.getConfig().getString("HeartRecipe.Slot3"))), | ||
new ItemStack(Material.GRAY_STAINED_GLASS_PANE), | ||
new ItemStack(Material.GRAY_STAINED_GLASS_PANE), | ||
new ItemStack(Material.GRAY_STAINED_GLASS_PANE), | ||
new ItemStack(Material.GRAY_STAINED_GLASS_PANE), | ||
new ItemStack(Material.GRAY_STAINED_GLASS_PANE), | ||
new ItemStack(Material.GRAY_STAINED_GLASS_PANE), | ||
new ItemStack(Material.valueOf(plugin.getConfig().getString("HeartRecipe.Slot4"))), | ||
new ItemStack(Material.valueOf(plugin.getConfig().getString("HeartRecipe.Slot5"))), | ||
new ItemStack(Material.valueOf(plugin.getConfig().getString("HeartRecipe.Slot6"))), | ||
new ItemStack(Material.GRAY_STAINED_GLASS_PANE), | ||
new ItemStack(Material.GRAY_STAINED_GLASS_PANE), | ||
new ItemStack(Material.GRAY_STAINED_GLASS_PANE), | ||
new ItemStack(Material.GRAY_STAINED_GLASS_PANE), | ||
new ItemStack(Material.GRAY_STAINED_GLASS_PANE), | ||
new ItemStack(Material.GRAY_STAINED_GLASS_PANE), | ||
new ItemStack(Material.valueOf(plugin.getConfig().getString("HeartRecipe.Slot7"))), | ||
new ItemStack(Material.valueOf(plugin.getConfig().getString("HeartRecipe.Slot8"))), | ||
new ItemStack(Material.valueOf(plugin.getConfig().getString("HeartRecipe.Slot9"))), | ||
new ItemStack(Material.GRAY_STAINED_GLASS_PANE), | ||
new ItemStack(Material.GRAY_STAINED_GLASS_PANE), | ||
new ItemStack(Material.GRAY_STAINED_GLASS_PANE), | ||
new ItemStack(Material.GRAY_STAINED_GLASS_PANE), | ||
new ItemStack(Material.GRAY_STAINED_GLASS_PANE), | ||
new ItemStack(Material.GRAY_STAINED_GLASS_PANE), | ||
new ItemStack(Material.GRAY_STAINED_GLASS_PANE), | ||
new ItemStack(Material.GRAY_STAINED_GLASS_PANE), | ||
new ItemStack(Material.GRAY_STAINED_GLASS_PANE), | ||
new ItemStack(Material.GRAY_STAINED_GLASS_PANE), | ||
new ItemStack(Material.GRAY_STAINED_GLASS_PANE), | ||
new ItemStack(Material.GRAY_STAINED_GLASS_PANE), | ||
}; | ||
gui.setContents(menu); | ||
}else if(args[0].equalsIgnoreCase("reviver")){ | ||
ItemStack[] menu = { | ||
new ItemStack(Material.GRAY_STAINED_GLASS_PANE), | ||
new ItemStack(Material.GRAY_STAINED_GLASS_PANE), | ||
new ItemStack(Material.GRAY_STAINED_GLASS_PANE), | ||
new ItemStack(Material.GRAY_STAINED_GLASS_PANE), | ||
new ItemStack(Material.GRAY_STAINED_GLASS_PANE), | ||
new ItemStack(Material.GRAY_STAINED_GLASS_PANE), | ||
new ItemStack(Material.GRAY_STAINED_GLASS_PANE), | ||
new ItemStack(Material.GRAY_STAINED_GLASS_PANE), | ||
new ItemStack(Material.GRAY_STAINED_GLASS_PANE), | ||
new ItemStack(Material.GRAY_STAINED_GLASS_PANE), | ||
new ItemStack(Material.GRAY_STAINED_GLASS_PANE), | ||
new ItemStack(Material.GRAY_STAINED_GLASS_PANE), | ||
new ItemStack(Material.valueOf(plugin.getConfig().getString("ReviverRecipe.Slot1"))), | ||
new ItemStack(Material.valueOf(plugin.getConfig().getString("ReviverRecipe.Slot2"))), | ||
new ItemStack(Material.valueOf(plugin.getConfig().getString("ReviverRecipe.Slot3"))), | ||
new ItemStack(Material.GRAY_STAINED_GLASS_PANE), | ||
new ItemStack(Material.GRAY_STAINED_GLASS_PANE), | ||
new ItemStack(Material.GRAY_STAINED_GLASS_PANE), | ||
new ItemStack(Material.GRAY_STAINED_GLASS_PANE), | ||
new ItemStack(Material.GRAY_STAINED_GLASS_PANE), | ||
new ItemStack(Material.GRAY_STAINED_GLASS_PANE), | ||
new ItemStack(Material.valueOf(plugin.getConfig().getString("ReviverRecipe.Slot4"))), | ||
new ItemStack(Material.valueOf(plugin.getConfig().getString("ReviverRecipe.Slot5"))), | ||
new ItemStack(Material.valueOf(plugin.getConfig().getString("ReviverRecipe.Slot6"))), | ||
new ItemStack(Material.GRAY_STAINED_GLASS_PANE), | ||
new ItemStack(Material.GRAY_STAINED_GLASS_PANE), | ||
new ItemStack(Material.GRAY_STAINED_GLASS_PANE), | ||
new ItemStack(Material.GRAY_STAINED_GLASS_PANE), | ||
new ItemStack(Material.GRAY_STAINED_GLASS_PANE), | ||
new ItemStack(Material.GRAY_STAINED_GLASS_PANE), | ||
new ItemStack(Material.valueOf(plugin.getConfig().getString("ReviverRecipe.Slot7"))), | ||
new ItemStack(Material.valueOf(plugin.getConfig().getString("ReviverRecipe.Slot8"))), | ||
new ItemStack(Material.valueOf(plugin.getConfig().getString("ReviverRecipe.Slot9"))), | ||
new ItemStack(Material.GRAY_STAINED_GLASS_PANE), | ||
new ItemStack(Material.GRAY_STAINED_GLASS_PANE), | ||
new ItemStack(Material.GRAY_STAINED_GLASS_PANE), | ||
new ItemStack(Material.GRAY_STAINED_GLASS_PANE), | ||
new ItemStack(Material.GRAY_STAINED_GLASS_PANE), | ||
new ItemStack(Material.GRAY_STAINED_GLASS_PANE), | ||
new ItemStack(Material.GRAY_STAINED_GLASS_PANE), | ||
new ItemStack(Material.GRAY_STAINED_GLASS_PANE), | ||
new ItemStack(Material.GRAY_STAINED_GLASS_PANE), | ||
new ItemStack(Material.GRAY_STAINED_GLASS_PANE), | ||
new ItemStack(Material.GRAY_STAINED_GLASS_PANE), | ||
new ItemStack(Material.GRAY_STAINED_GLASS_PANE), | ||
}; | ||
gui.setContents(menu); | ||
}else{ | ||
p.sendMessage("§f[§cLifeStolen§f] " + args[0] + " isn't a valid item in LifeStolen."); | ||
gui = null; | ||
return true; | ||
} | ||
|
||
p.openInventory(gui); | ||
} | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package me.kadotcom.lifestolen.Events; | ||
|
||
import me.kadotcom.lifestolen.LifeStolen; | ||
import org.bukkit.event.EventHandler; | ||
import org.bukkit.event.Listener; | ||
import org.bukkit.event.inventory.InventoryClickEvent; | ||
|
||
public class GUIEvent implements Listener { | ||
|
||
LifeStolen plugin; | ||
public GUIEvent(LifeStolen ls){ | ||
plugin = ls; | ||
} | ||
|
||
@EventHandler | ||
public void ClickEvent(InventoryClickEvent e){ | ||
if(e.getView().getTitle().equalsIgnoreCase("LifeStolen Crafting View")){ | ||
e.setCancelled(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
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
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