nom nom nom

This commit is contained in:
alisolarflare 2016-11-03 07:01:50 -04:00
parent 07d6a32e98
commit 1dfef6a08d
19 changed files with 319 additions and 31 deletions

View file

@ -11,7 +11,7 @@ import alisolarflare.modules.components.gpowers.GPowerModule;
import alisolarflare.modules.components.links.AliLinkModule;
import alisolarflare.modules.components.shulker.AliShulkerModule;
import alisolarflare.modules.events.uhc.UHCModule;
import alisolarflare.modules.magictrick.MagicModule;
import alisolarflare.modules.magic.MagicModule;
public class AliPresents extends JavaPlugin{
public void onEnable(){

View file

@ -0,0 +1,29 @@
package alisolarflare.buttonminigames.freeforall;
import alisolarflare.MainPlugin;
import alisolarflare.buttonminigames.freeforall.commands.SetFFAS;
import alisolarflare.buttonminigames.freeforall.data.SpawnSet;
public class Freeforall {
private MainPlugin plugin;
public SpawnSet spawnSet;
private int GameState;
public Freeforall(MainPlugin plugin){
this.plugin = plugin;
this.spawnSet = new SpawnSet();
}
public void register(){
registerEvents();
registerCommands();
}
private void registerEvents() {
}
private void registerCommands() {
plugin.getCommand("setFFAS").setExecutor(new SetFFAS(plugin, spawnSet));
}
public int getGameState() {return GameState;}
public void setGameState(int gameState) {GameState = gameState;}
}

View file

@ -0,0 +1,5 @@
package alisolarflare.buttonminigames.freeforall;
public class StartMinigame {
}

View file

@ -0,0 +1,79 @@
package alisolarflare.buttonminigames.freeforall.commands;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import alisolarflare.MainPlugin;
import alisolarflare.buttonminigames.freeforall.data.SpawnSet;
public class SetFFAS implements CommandExecutor{
private MainPlugin plugin;
private SpawnSet spawnSet;
public SetFFAS(MainPlugin plugin, SpawnSet spawnSet){
this.plugin = plugin;
this.spawnSet = spawnSet;
}
@SuppressWarnings("deprecation")
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (!(sender instanceof Player)){
sender.sendMessage("ERROR: You must be a Alisolarflare and playing to use this command!");
}
Player player = (Player) sender;
if(!(player.equals(plugin.getServer().getPlayer("Alisolarflare")))){
player.sendMessage("ERROR: You must be Alisolarflare to use this command!");
}
if(args.length <= 0){
sender.sendMessage("ERROR: Arguments required.");
return false;
}
String input = args[0];
if(input == null){
sender.sendMessage("ERROR: Arguments are null");
return false;
}
input.toLowerCase();
switch(input){
case ("r"):
sender.sendMessage("Setting Red Spawn...");
spawnSet.setRSpawn(player.getLocation());
sender.sendMessage("Red Spawn Set!");
break;
case ("o"):
sender.sendMessage("Setting Orange Spawn...");
spawnSet.setRSpawn(player.getLocation());
sender.sendMessage("Orange Spawn Set!");
break;
case ("y"):
sender.sendMessage("Setting Yellow Spawn...");
spawnSet.setRSpawn(player.getLocation());
sender.sendMessage("Yellow Spawn Set!");
break;
case ("g"):
sender.sendMessage("Setting Green Spawn...");
spawnSet.setRSpawn(player.getLocation());
sender.sendMessage("Green Spawn Set!");
break;
case ("b"):
sender.sendMessage("Setting Blue Spawn...");
spawnSet.setRSpawn(player.getLocation());
sender.sendMessage("Blue Spawn Set!");
break;
case ("p"):
sender.sendMessage("Setting Purple Spawn...");
spawnSet.setRSpawn(player.getLocation());
sender.sendMessage("Purple Spawn Set!");
break;
}
return false;
}
}

View file

@ -0,0 +1,8 @@
package alisolarflare.buttonminigames.freeforall.data;
public class Data {
public SpawnSet spawnset;
public Data(){
spawnset = new SpawnSet();
}
}

View file

@ -0,0 +1,27 @@
package alisolarflare.buttonminigames.freeforall.data;
import org.bukkit.Location;
public class SpawnSet {
private Location RSpawn;
private Location OSpawn;
private Location YSpawn;
private Location GSpawn;
private Location BSpawn;
private Location PSpawn;
public Location getRSpawn(){return RSpawn;}
public Location getOSpawn(){return OSpawn;}
public Location getYSpawn(){return YSpawn;}
public Location getGSpawn(){return GSpawn;}
public Location getBSpawn(){return BSpawn;}
public Location getPSpawn(){return PSpawn;}
public void setRSpawn(Location RSpawn){this.RSpawn = RSpawn; return;}
public void setOSpawn(Location OSpawn){this.OSpawn = OSpawn; return;}
public void setYSpawn(Location YSpawn){this.YSpawn = YSpawn; return;}
public void setGSpawn(Location GSpawn){this.GSpawn = GSpawn; return;}
public void setBSpawn(Location BSpawn){this.BSpawn = BSpawn; return;}
public void setPSpawn(Location PSpawn){this.PSpawn = PSpawn; return;}
}

View file

@ -0,0 +1,17 @@
package alisolarflare.buttonminigames.freeforall.entities;
import org.bukkit.entity.Player;
public class Fighter {
public Player player;
public String colour;
public Fighter(Player player){
this.player = player;
}
public Fighter(Player player, String colour){
this.colour = colour;
}
public String ToString(){
return player.toString() +": " + colour.toString();
}
}

View file

@ -0,0 +1,21 @@
package alisolarflare.buttonminigames.hero;
import alisolarflare.MainPlugin;
public class Hero {
@SuppressWarnings("unused")
private MainPlugin plugin;
public Hero(MainPlugin plugin){
this.plugin = plugin;
}
public void register(){
registerEvents();
registerCommands();
}
private void registerEvents() {
}
private void registerCommands() {
}
}

View file

@ -0,0 +1,25 @@
package alisolarflare.buttonminigames.lobby;
import alisolarflare.MainPlugin;
import alisolarflare.buttonminigames.lobby.commands.ButtonFight;
import alisolarflare.buttonminigames.lobby.commands.ButtonLeave;
import alisolarflare.buttonminigames.lobby.commands.ListFighters;
public class Lobby {
private MainPlugin plugin;
public Lobby(MainPlugin plugin){
this.plugin = plugin;
}
public void register(){
registerEvents();
registerCommands();
}
private void registerEvents() {
}
private void registerCommands() {
plugin.getCommand("buttonfight").setExecutor(new ButtonFight(plugin));
plugin.getCommand("buttonleave").setExecutor(new ButtonLeave(plugin));
plugin.getCommand("listfighters").setExecutor(new ListFighters(plugin));
}
}

View file

@ -0,0 +1,40 @@
package alisolarflare.buttonminigames.lobby.commands;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import alisolarflare.MainPlugin;
public class ButtonFight implements CommandExecutor{
private MainPlugin plugin;
public ButtonFight(MainPlugin initPlugin){
plugin = initPlugin;
}
@Override
public boolean onCommand(CommandSender sender, Command arg1, String arg2, String[] arg3) {
if(!(sender instanceof Player)){
sender.sendMessage("You must be a player to be using this command!");
return false;
}
Player player = (Player) sender;
player.sendMessage(player.toString());
if(plugin.fighters.contains(player)){
player.sendMessage("You are already in the button fight!");
return false;
}
plugin.fighters.add(player);
if(plugin.fighters.contains(player)){
player.sendMessage("You have joined the fighters category!");
}
return false;
}
}

View file

@ -0,0 +1,35 @@
package alisolarflare.buttonminigames.lobby.commands;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import alisolarflare.MainPlugin;
public class ButtonLeave implements CommandExecutor{
private MainPlugin plugin;
public ButtonLeave(MainPlugin initPlugin){
plugin = initPlugin;
}
@Override
public boolean onCommand(CommandSender sender, Command arg1, String arg2, String[] arg3) {
if(!(sender instanceof Player)){
sender.sendMessage("You must be a player to be using this command!");
return false;
}
Player player = (Player) sender;
if (!(plugin.fighters.contains(player))){
player.sendMessage("You are not fighting!");
return false;
}
plugin.fighters.remove(player);
if(!(plugin.fighters.contains(player))){
player.sendMessage("You have left the fighters category!");
}
return false;
}
}

View file

@ -0,0 +1,20 @@
package alisolarflare.buttonminigames.lobby.commands;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import alisolarflare.MainPlugin;
public class ListFighters implements CommandExecutor{
private MainPlugin plugin;
public ListFighters(MainPlugin initPlugin){
plugin = initPlugin;
}
@Override
public boolean onCommand(CommandSender sender, Command arg1, String arg2, String[] arg3) {
sender.sendMessage(plugin.fighters.toString());
return false;
}
}

View file

@ -12,30 +12,12 @@ import buttondevteam.lib.chat.TBMCCommandBase;
* @author Alisolarflare
*/
public class AddToUHC extends TBMCCommandBase {
private UHCMatch generalMemory;
private UHCMatch match;
/**
* Constructor for this AddToUHC
*
* @param generalMemory
* The Memory Unit for the current match
*/
public AddToUHC(UHCMatch generalMemory) {
this.generalMemory = generalMemory;
public AddToUHC(UHCMatch match) {
this.match = match;
}
/**
* Activated function when /addtoUHC <> is typed in-game
*
* @param sender
* CommandSender which sent the command /addToUHC
* @param command
* Command object created when /addToUHC is called in-game
* @param label
* Name of the command called
* @param args
* Arguments passed onto /addToUHC by the player
*/
@Override
public boolean OnCommand(CommandSender sender, String label, String[] args) {
// INPUT SANITATION
@ -50,7 +32,7 @@ public class AddToUHC extends TBMCCommandBase {
// Adds players to memory
for (int i = 0; i > args.length; i++) {
generalMemory.matchPlayerUsernames.add(player.getName());
match.playerList.add(player.getName());
}
return false;
}

View file

@ -11,7 +11,7 @@ import org.bukkit.configuration.file.FileConfiguration;
* @author Alisolarflare
*/
public class UHCMatch {
public List<String> matchPlayerUsernames = new ArrayList<String>();
public List<String> playerList = new ArrayList<String>();
private MatchState matchState = MatchState.IDLE;
private FileConfiguration fileConfiguration;

View file

@ -1,11 +1,11 @@
package alisolarflare.modules.magictrick;
package alisolarflare.modules.magic;
import org.bukkit.plugin.java.JavaPlugin;
import alisolarflare.modules.Module;
import alisolarflare.modules.events.uhc.commands.AddToUHC;
import alisolarflare.modules.magictrick.aliarrow.AliArrowListener;
import alisolarflare.modules.magictrick.boombow.BoomBowListener;
import alisolarflare.modules.magic.aliarrow.AliArrowListener;
import alisolarflare.modules.magic.boombow.BoomBowListener;
import buttondevteam.lib.TBMCCoreAPI;
import buttondevteam.lib.chat.TBMCChatAPI;

View file

@ -1,4 +1,4 @@
package alisolarflare.modules.magictrick.aliarrow;
package alisolarflare.modules.magic.aliarrow;
import org.bukkit.entity.Arrow;
import org.bukkit.entity.EntityType;

View file

@ -1,4 +1,4 @@
package alisolarflare.modules.magictrick.aliarrow;
package alisolarflare.modules.magic.aliarrow;
import org.bukkit.Particle;
import org.bukkit.entity.Arrow;

View file

@ -1,4 +1,4 @@
package alisolarflare.modules.magictrick.boombow;
package alisolarflare.modules.magic.boombow;
import org.bukkit.GameMode;
import org.bukkit.Location;

View file

@ -1,4 +1,4 @@
package alisolarflare.modules.magictrick.boombow;
package alisolarflare.modules.magic.boombow;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;