Fully digested ButtonMinigames

This commit is contained in:
alisolarflare 2016-11-03 07:35:25 -04:00
parent c3f642c65b
commit 73bdb7e0bf
49 changed files with 203 additions and 208 deletions

View file

@ -6,12 +6,12 @@ import org.bukkit.plugin.PluginDescriptionFile;
//import alisolarflare.links.AliLinkSubPlug;
import org.bukkit.plugin.java.JavaPlugin;
import alisolarflare.modules.components.flairdoor.FlairDoorModule;
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.magic.MagicModule;
import alisolarflare.components.flairdoor.FlairDoorModule;
import alisolarflare.components.gpowers.GPowerModule;
import alisolarflare.components.links.AliLinkModule;
import alisolarflare.components.shulker.AliShulkerModule;
import alisolarflare.events.uhc.UHCModule;
import alisolarflare.magic.MagicModule;
public class AliPresents extends JavaPlugin{
public void onEnable(){

View file

@ -1,4 +1,4 @@
package alisolarflare.modules;
package alisolarflare;
import org.bukkit.event.Listener;
import org.bukkit.plugin.java.JavaPlugin;
@ -18,7 +18,7 @@ import buttondevteam.lib.chat.TBMCCommandBase;
* @author Alisolarflare
*
*/
public abstract class Module implements Registerable{
public abstract class Module{
/**
* Registers the project, when called by the Main JavaPlugin class that handles
* the main plugin.

View file

@ -1,29 +0,0 @@
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

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

View file

@ -1,21 +0,0 @@
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

@ -1,25 +0,0 @@
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

@ -1,10 +1,10 @@
package alisolarflare.modules.components.flairdoor;
package alisolarflare.components.flairdoor;
import org.bukkit.plugin.java.JavaPlugin;
import alisolarflare.modules.Module;
import alisolarflare.modules.components.flairdoor.commands.FlairMe;
import alisolarflare.modules.components.flairdoor.listeners.PortalListener;
import alisolarflare.Module;
import alisolarflare.components.flairdoor.commands.FlairMe;
import alisolarflare.components.flairdoor.listeners.PortalListener;
import buttondevteam.lib.TBMCCoreAPI;
import buttondevteam.lib.chat.TBMCChatAPI;

View file

@ -1,8 +1,8 @@
package alisolarflare.modules.components.flairdoor.commands;
package alisolarflare.components.flairdoor.commands;
import org.bukkit.command.CommandSender;
import alisolarflare.modules.components.flairdoor.listeners.PortalListener;
import alisolarflare.components.flairdoor.listeners.PortalListener;
import buttondevteam.lib.chat.TBMCCommandBase;
public class FlairMe extends TBMCCommandBase {

View file

@ -1,4 +1,4 @@
package alisolarflare.modules.components.flairdoor.commands;
package alisolarflare.components.flairdoor.commands;
import java.util.Arrays;
import java.util.List;

View file

@ -1,4 +1,4 @@
package alisolarflare.modules.components.flairdoor.listeners;
package alisolarflare.components.flairdoor.listeners;
import java.util.AbstractMap;
import java.util.ArrayList;

View file

@ -1,10 +1,10 @@
package alisolarflare.modules.components.gpowers;
package alisolarflare.components.gpowers;
import org.bukkit.plugin.java.JavaPlugin;
import alisolarflare.modules.Module;
import alisolarflare.modules.components.gpowers.commands.gPowerCommand;
import alisolarflare.modules.components.gpowers.listeners.gPowerListener;
import alisolarflare.Module;
import alisolarflare.components.gpowers.commands.gPowerCommand;
import alisolarflare.components.gpowers.listeners.gPowerListener;
import buttondevteam.lib.TBMCCoreAPI;
import buttondevteam.lib.chat.TBMCChatAPI;

View file

@ -1,4 +1,4 @@
package alisolarflare.modules.components.gpowers.commands;
package alisolarflare.components.gpowers.commands;
import org.bukkit.command.CommandSender;

View file

@ -1,4 +1,4 @@
package alisolarflare.modules.components.gpowers.commands;
package alisolarflare.components.gpowers.commands;
import org.bukkit.command.CommandSender;

View file

@ -1,9 +1,9 @@
package alisolarflare.modules.components.gpowers.commands;
package alisolarflare.components.gpowers.commands;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import alisolarflare.modules.components.gpowers.gPowerMemory;
import alisolarflare.components.gpowers.gPowerMemory;
import buttondevteam.lib.chat.TBMCCommandBase;
public class gPowerCommand extends TBMCCommandBase {

View file

@ -1,4 +1,4 @@
package alisolarflare.modules.components.gpowers;
package alisolarflare.components.gpowers;
import java.util.HashMap;
import java.util.Map;

View file

@ -1,4 +1,4 @@
package alisolarflare.modules.components.gpowers.listeners;
package alisolarflare.components.gpowers.listeners;
import org.bukkit.Color;
import org.bukkit.entity.Player;
@ -7,7 +7,7 @@ import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import org.bukkit.scheduler.BukkitRunnable;
import alisolarflare.modules.components.gpowers.gPowerMemory;
import alisolarflare.components.gpowers.gPowerMemory;
public class gPowerApplyingTask extends BukkitRunnable{

View file

@ -1,4 +1,4 @@
package alisolarflare.modules.components.gpowers.listeners;
package alisolarflare.components.gpowers.listeners;
import org.bukkit.event.Listener;
import org.bukkit.plugin.java.JavaPlugin;

View file

@ -1,13 +1,13 @@
package alisolarflare.modules.components.links;
package alisolarflare.components.links;
import java.util.List;
import org.bukkit.plugin.java.JavaPlugin;
import alisolarflare.modules.Module;
import alisolarflare.modules.components.links.commands.PressAliLink;
import alisolarflare.modules.components.links.commands.SetAliLink;
import alisolarflare.modules.components.links.entities.Link;
import alisolarflare.Module;
import alisolarflare.components.links.commands.PressAliLink;
import alisolarflare.components.links.commands.SetAliLink;
import alisolarflare.components.links.entities.Link;
import buttondevteam.lib.chat.TBMCChatAPI;
public class AliLinkModule extends Module {

View file

@ -1,9 +1,9 @@
package alisolarflare.modules.components.links.commands;
package alisolarflare.components.links.commands;
import org.bukkit.command.CommandSender;
import org.bukkit.plugin.java.JavaPlugin;
import alisolarflare.modules.components.links.entities.Link;
import alisolarflare.components.links.entities.Link;
import buttondevteam.lib.chat.TBMCCommandBase;
public class PressAliLink extends TBMCCommandBase {

View file

@ -1,4 +1,4 @@
package alisolarflare.modules.components.links.commands;
package alisolarflare.components.links.commands;
import java.util.ArrayList;
import java.util.List;
@ -9,8 +9,8 @@ import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
import alisolarflare.modules.components.links.AliLinkModule;
import alisolarflare.modules.components.links.entities.Link;
import alisolarflare.components.links.AliLinkModule;
import alisolarflare.components.links.entities.Link;
import buttondevteam.lib.chat.TBMCCommandBase;
/**

View file

@ -1,4 +1,4 @@
package alisolarflare.modules.components.links.entities;
package alisolarflare.components.links.entities;
import java.io.Serializable;
@ -6,7 +6,7 @@ import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.plugin.java.JavaPlugin;
import alisolarflare.modules.components.links.tasks.UnpressTask;
import alisolarflare.components.links.tasks.UnpressTask;
public class Link implements Serializable{
/**

View file

@ -1,11 +1,11 @@
package alisolarflare.modules.components.links.serializer;
package alisolarflare.components.links.serializer;
import java.io.FileInputStream;
import java.io.ObjectInputStream;
import java.util.List;
import alisolarflare.modules.components.links.entities.Link;
import alisolarflare.components.links.entities.Link;
public class Deserializer{

View file

@ -1,11 +1,11 @@
package alisolarflare.modules.components.links.serializer;
package alisolarflare.components.links.serializer;
import java.io.FileOutputStream;
import java.io.ObjectOutputStream;
import java.util.List;
import alisolarflare.modules.components.links.entities.Link;
import alisolarflare.components.links.entities.Link;
public class Serializer {

View file

@ -1,4 +1,4 @@
package alisolarflare.modules.components.links.tasks;
package alisolarflare.components.links.tasks;
import org.bukkit.Location;
import org.bukkit.Material;

View file

@ -1,9 +1,9 @@
package alisolarflare.modules.components.shulker;
package alisolarflare.components.shulker;
import org.bukkit.plugin.java.JavaPlugin;
import alisolarflare.modules.Module;
import alisolarflare.modules.components.shulker.commands.AliShulker;
import alisolarflare.Module;
import alisolarflare.components.shulker.commands.AliShulker;
import buttondevteam.lib.chat.TBMCChatAPI;
public class AliShulkerModule extends Module {

View file

@ -1,4 +1,4 @@
package alisolarflare.modules.components.shulker.commands;
package alisolarflare.components.shulker.commands;
import org.bukkit.Location;
import org.bukkit.command.CommandSender;

View file

@ -1,10 +1,10 @@
package alisolarflare.modules.events.uhc;
package alisolarflare.events.uhc;
import org.bukkit.plugin.java.JavaPlugin;
import alisolarflare.modules.Module;
import alisolarflare.modules.events.uhc.commands.AddToUHC;
import alisolarflare.modules.events.uhc.memory.UHCMatch;
import alisolarflare.Module;
import alisolarflare.events.uhc.commands.AddToUHC;
import alisolarflare.events.uhc.memory.UHCMatch;
import buttondevteam.lib.chat.TBMCChatAPI;
public class UHCModule extends Module {

View file

@ -1,9 +1,9 @@
package alisolarflare.modules.events.uhc.commands;
package alisolarflare.events.uhc.commands;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import alisolarflare.modules.events.uhc.memory.UHCMatch;
import alisolarflare.events.uhc.memory.UHCMatch;
import buttondevteam.lib.chat.TBMCCommandBase;
/**

View file

@ -1,9 +1,9 @@
package alisolarflare.modules.events.uhc.commands;
package alisolarflare.events.uhc.commands;
import org.bukkit.command.CommandSender;
import alisolarflare.modules.events.uhc.memory.MatchState;
import alisolarflare.modules.events.uhc.memory.UHCMatch;
import alisolarflare.events.uhc.memory.MatchState;
import alisolarflare.events.uhc.memory.UHCMatch;
import buttondevteam.lib.chat.TBMCCommandBase;
public class StartMatch extends TBMCCommandBase {

View file

@ -1,4 +1,4 @@
package alisolarflare.modules.events.uhc.listeners;
package alisolarflare.events.uhc.listeners;
import org.bukkit.event.Listener;
import org.bukkit.plugin.java.JavaPlugin;

View file

@ -1,4 +1,4 @@
package alisolarflare.modules.events.uhc.listeners;
package alisolarflare.events.uhc.listeners;
import org.bukkit.scheduler.BukkitRunnable;

View file

@ -1,4 +1,4 @@
package alisolarflare.modules.events.uhc.memory;
package alisolarflare.events.uhc.memory;
public enum MatchState {
NULL, IDLE, WAITING, SETUP, INTRO, PEACE, TENSION, POWER, END

View file

@ -1,4 +1,4 @@
package alisolarflare.modules.events.uhc.memory;
package alisolarflare.events.uhc.memory;
import java.util.ArrayList;
import java.util.List;

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -0,0 +1,34 @@
package alisolarflare.minigames.freeforall;
import org.bukkit.plugin.java.JavaPlugin;
import alisolarflare.Module;
import alisolarflare.minigames.freeforall.commands.SetFFAS;
import alisolarflare.minigames.freeforall.data.SpawnSet;
import buttondevteam.lib.chat.TBMCChatAPI;
public class FreeForAllModule extends Module{
public SpawnSet spawnSet;
private int GameState;
@Override
public void register(JavaPlugin plugin) {
registerEvents();
registerCommands(plugin);
registerMemory();
}
private void registerEvents() {
}
private void registerCommands(JavaPlugin plugin) {
TBMCChatAPI.AddCommands(plugin, SetFFAS.class);
}
private void registerMemory() {
this.spawnSet = new SpawnSet();
}
public int getGameState() {return GameState;}
public void setGameState(int gameState) {GameState = gameState;}
}

View file

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

View file

@ -1,43 +1,35 @@
package alisolarflare.buttonminigames.freeforall.commands;
package alisolarflare.minigames.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;
import alisolarflare.minigames.freeforall.data.SpawnSet;
import buttondevteam.lib.chat.TBMCCommandBase;
public class SetFFAS implements CommandExecutor{
public class SetFFAS extends TBMCCommandBase{
private SpawnSet spawnSet;
public SetFFAS(SpawnSet spawnSet){
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!");
}
public boolean OnCommand(CommandSender sender, String label, String[] args) {
if (!(sender instanceof Player))
sender.sendMessage("ERROR: You must be a player to use this command!");
Player player = (Player) sender;
if(!(player.getName().equalsIgnoreCase("Alisolarflare"))){
if(!(player.getName().equalsIgnoreCase("Alisolarflare")))
player.sendMessage("ERROR: You must be Alisolarflare to use this command!");
}
if(args.length <= 0){
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"):
@ -73,5 +65,25 @@ public class SetFFAS implements CommandExecutor{
}
return false;
}
@Override
public String GetCommandPath() {
// TODO Auto-generated method stub
return "setFFAS";
}
@Override
public String[] GetHelpText(String arg0) {
// TODO Auto-generated method stub
return null;
}
@Override
public boolean GetModOnly() {
// TODO Auto-generated method stub
return false;
}
@Override
public boolean GetPlayerOnly() {
// TODO Auto-generated method stub
return false;
}
}

View file

@ -1,4 +1,4 @@
package alisolarflare.buttonminigames.freeforall.data;
package alisolarflare.minigames.freeforall.data;
public class Data {
public SpawnSet spawnset;

View file

@ -1,4 +1,4 @@
package alisolarflare.buttonminigames.freeforall.data;
package alisolarflare.minigames.freeforall.data;
import org.bukkit.Location;

View file

@ -1,4 +1,4 @@
package alisolarflare.buttonminigames.freeforall.entities;
package alisolarflare.minigames.freeforall.entities;
import org.bukkit.entity.Player;

View file

@ -0,0 +1,27 @@
package alisolarflare.minigames.lobby;
import java.util.List;
import org.bukkit.plugin.java.JavaPlugin;
import alisolarflare.Module;
import alisolarflare.minigames.lobby.commands.ButtonFight;
import alisolarflare.minigames.lobby.commands.ButtonLeave;
import alisolarflare.minigames.lobby.commands.ListFighters;
public class LobbyModule extends Module{
public List<String> fighters;
public void register(JavaPlugin plugin){
registerEvents();
registerCommands(plugin);
}
private void registerEvents() {
}
private void registerCommands(JavaPlugin plugin) {
plugin.getCommand("buttonfight").setExecutor(new ButtonFight(this));
plugin.getCommand("buttonleave").setExecutor(new ButtonLeave(this));
plugin.getCommand("listfighters").setExecutor(new ListFighters(this));
}
}

View file

@ -1,17 +1,19 @@
package alisolarflare.buttonminigames.lobby.commands;
package alisolarflare.minigames.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;
import alisolarflare.minigames.lobby.LobbyModule;
public class ButtonFight implements CommandExecutor{
private MainPlugin plugin;
public ButtonFight(MainPlugin initPlugin){
plugin = initPlugin;
private LobbyModule lobby;
public ButtonFight(LobbyModule lobby) {
this.lobby = lobby;
}
@Override
public boolean onCommand(CommandSender sender, Command arg1, String arg2, String[] arg3) {
@ -23,15 +25,15 @@ public class ButtonFight implements CommandExecutor{
Player player = (Player) sender;
player.sendMessage(player.toString());
if(plugin.fighters.contains(player)){
String name = player.getName();
if(lobby.fighters.contains(name)){
player.sendMessage("You are already in the button fight!");
return false;
}
plugin.fighters.add(player);
lobby.fighters.add(name);
if(plugin.fighters.contains(player)){
if(lobby.fighters.contains(name)){
player.sendMessage("You have joined the fighters category!");
}
return false;

View file

@ -1,18 +1,21 @@
package alisolarflare.buttonminigames.lobby.commands;
package alisolarflare.minigames.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;
import alisolarflare.minigames.lobby.LobbyModule;
public class ButtonLeave implements CommandExecutor{
private MainPlugin plugin;
public ButtonLeave(MainPlugin initPlugin){
plugin = initPlugin;
}
private LobbyModule lobby;
public ButtonLeave(LobbyModule lobby) {
this.lobby = lobby;
}
@Override
public boolean onCommand(CommandSender sender, Command arg1, String arg2, String[] arg3) {
if(!(sender instanceof Player)){
@ -21,12 +24,13 @@ public class ButtonLeave implements CommandExecutor{
}
Player player = (Player) sender;
if (!(plugin.fighters.contains(player))){
String name = player.getName();
if (!(lobby.fighters.contains(name))){
player.sendMessage("You are not fighting!");
return false;
}
plugin.fighters.remove(player);
if(!(plugin.fighters.contains(player))){
lobby.fighters.remove(name);
if(!(lobby.fighters.contains(name))){
player.sendMessage("You have left the fighters category!");
}
return false;

View file

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

View file

@ -1,11 +0,0 @@
package alisolarflare.modules;
import org.bukkit.plugin.java.JavaPlugin;
/**
* Allows the project to be registered by any Main JavaPlugin class, by calling //modulename.register(this)
* in any JavaPlugin class.
*/
public interface Registerable {
public void register(JavaPlugin plugin);
}