added new files
This commit is contained in:
parent
86bc063718
commit
bf18473750
7 changed files with 55 additions and 42 deletions
5
src/alisolarflare/modules/events/uhc/MatchState.java
Normal file
5
src/alisolarflare/modules/events/uhc/MatchState.java
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
package alisolarflare.modules.events.uhc;
|
||||||
|
|
||||||
|
public enum MatchState {
|
||||||
|
|
||||||
|
}
|
|
@ -11,46 +11,6 @@ import org.bukkit.entity.Player;
|
||||||
* @author Alisolarflare
|
* @author Alisolarflare
|
||||||
*/
|
*/
|
||||||
public class UHCMatch {
|
public class UHCMatch {
|
||||||
private List<String> matchPlayerUsernames = new ArrayList<String>();
|
public List<String> matchPlayerUsernames = new ArrayList<String>();
|
||||||
|
|
||||||
/**
|
|
||||||
* Adds a player to an Ultrahardcore match, storing their name
|
|
||||||
* @param playername player.getName();
|
|
||||||
*/
|
|
||||||
public void addPlayerToMatch(String playername){
|
|
||||||
if (!(matchPlayerUsernames.contains(playername))){
|
|
||||||
matchPlayerUsernames.add(playername);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Adds a player to an Ultrahardcore match, storing their name
|
|
||||||
* @param player Player to be added
|
|
||||||
*/
|
|
||||||
public void addPlayerToMatch(Player player){
|
|
||||||
if (!(matchPlayerUsernames.contains(player.getName()))){
|
|
||||||
matchPlayerUsernames.add(player.getName());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Removes a player from an Ultrahardcore match, removing their username from the list
|
|
||||||
* @param player
|
|
||||||
*/
|
|
||||||
public void removePlayerFromMatch(Player player){
|
|
||||||
if (matchPlayerUsernames.contains(player)){
|
|
||||||
matchPlayerUsernames.remove(player.getName());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Removes all players from the match
|
|
||||||
*/
|
|
||||||
public void removeAllPlayersFromMatch(){
|
|
||||||
matchPlayerUsernames.clear();
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Fully de-loads and clears out this match, reverting all values to the initialized setting
|
|
||||||
*/
|
|
||||||
public void endMatch(){
|
|
||||||
matchPlayerUsernames.clear();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,7 @@ import alisolarflare.modules.events.uhc.commands.AddToUHC;
|
||||||
|
|
||||||
public class UHCModule extends Module {
|
public class UHCModule extends Module {
|
||||||
public UHCMatch generalMemory;
|
public UHCMatch generalMemory;
|
||||||
|
public String[] finiteStates = {"SETUP", "INTRO", "PEACE", "TENSION", "POWER", "END"};
|
||||||
|
|
||||||
public void register(JavaPlugin plugin){
|
public void register(JavaPlugin plugin){
|
||||||
registerCommands(plugin);
|
registerCommands(plugin);
|
||||||
|
|
|
@ -50,7 +50,7 @@ public class AddToUHC implements CommandExecutor{
|
||||||
|
|
||||||
//Adds players to memory
|
//Adds players to memory
|
||||||
for (int i = 0; i > args.length; i++){
|
for (int i = 0; i > args.length; i++){
|
||||||
generalMemory.addPlayerToMatch(player);
|
generalMemory.matchPlayerUsernames.add(player.getName());
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
package alisolarflare.modules.events.uhc.listeners;
|
||||||
|
|
||||||
|
import org.bukkit.event.Listener;
|
||||||
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
import org.bukkit.scheduler.BukkitTask;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Main launcher for the repeating task that activates the
|
||||||
|
* ghostie powers, if an Ultrahardcore Match is going on,
|
||||||
|
* and it's time for powers to activate
|
||||||
|
*/
|
||||||
|
public class PlayerPowerCyclingListener implements Listener {
|
||||||
|
public BukkitTask PowerCyclingTask;
|
||||||
|
|
||||||
|
public PlayerPowerCyclingListener(JavaPlugin plugin){
|
||||||
|
PowerCyclingTask = (new PlayerPowerTask(plugin)).runTaskTimer(plugin, 20, 20);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,24 @@
|
||||||
|
package alisolarflare.modules.events.uhc.listeners;
|
||||||
|
|
||||||
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
import org.bukkit.scheduler.BukkitRunnable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is the main class that creates and implemnts Ghostie powers
|
||||||
|
* When run, it will apply the right potion effects to different players
|
||||||
|
* based on what colours they identify as in that time.
|
||||||
|
* @author Alisolarflare
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class PlayerPowerTask extends BukkitRunnable{
|
||||||
|
private JavaPlugin plugin;
|
||||||
|
public PlayerPowerTask(JavaPlugin plugin){
|
||||||
|
this.plugin = plugin;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
package alisolarflare.modules.events.uhc.memory;
|
||||||
|
|
||||||
|
public class PlayerPowerModule {
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in a new issue