Tried to fix up powerup
This commit is contained in:
parent
45b88354e5
commit
bbacdc3529
8 changed files with 29 additions and 21 deletions
|
@ -29,6 +29,8 @@ commands:
|
|||
description: List all fighters currently in a button minigame
|
||||
setcolourspawn:
|
||||
description: sets the spawn points for each colour in a button minigame
|
||||
setmatchstate:
|
||||
description: sets the current state of the ultrahardcore game.
|
||||
addtouhc:
|
||||
description: Adds a player to the UltraHardcore match
|
||||
joinuhc:
|
||||
|
|
|
@ -10,7 +10,6 @@ public class FlairDoorModule extends Module {
|
|||
@Override
|
||||
public void register(JavaPlugin plugin) {
|
||||
registerCommand(plugin, new FlairMe());
|
||||
|
||||
registerListener(plugin, new PortalListener(plugin));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,9 +9,8 @@ public class FlairMe extends TBMCCommandBase {
|
|||
|
||||
@Override
|
||||
public boolean OnCommand(CommandSender sender, String label, String[] args) {
|
||||
sender.sendMessage("Flairing..." + sender.getName());
|
||||
PortalListener.playersToBeFlaired.add(sender.getName());
|
||||
sender.sendMessage("Finished Preparation! Walk through a portal to get your flair");
|
||||
sender.sendMessage("Setup Successful! Walk through a portal to get your flair");
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -57,19 +57,15 @@ public class PortalListener implements Listener{
|
|||
|
||||
//RECOLOUR PLAYER
|
||||
if(HigherBlock.getType() == Material.STONE){
|
||||
player.sendMessage("STONE DETECTED");
|
||||
recolourPlayer(player, DyeColor.GRAY);
|
||||
|
||||
//TOP BLOCK IS WOOL?
|
||||
}else if(HigherBlock.getType() == Material.WOOL){
|
||||
player.sendMessage("WOOL DETECTED T");
|
||||
Wool wool = (Wool) HigherBlock.getState().getData();
|
||||
recolourPlayer(player, wool.getColor());
|
||||
|
||||
//MIDDLE BLOCK IS WOOL?
|
||||
}else if(MiddleBlock.getType() == Material.WOOL){
|
||||
|
||||
player.sendMessage("WOOL DETECTED M");
|
||||
MaterialData mData = MiddleBlock.getState().getData();
|
||||
Wool wool = (Wool) mData;
|
||||
|
||||
|
@ -77,7 +73,6 @@ public class PortalListener implements Listener{
|
|||
|
||||
//BOTTOM BLOCK IS WOOL?
|
||||
}else if (BottomBlock.getType() == Material.WOOL){
|
||||
player.sendMessage("WOOL DETECTED B");
|
||||
Wool wool = (Wool) BottomBlock.getState().getData();
|
||||
recolourPlayer(player, wool.getColor());
|
||||
}
|
||||
|
@ -86,60 +81,58 @@ public class PortalListener implements Listener{
|
|||
public void recolourPlayer(Player player, DyeColor dyecolour){
|
||||
User user = essentials.getUser(player);
|
||||
|
||||
player.sendMessage("Recolouring Player as..." + dyecolour.toString());
|
||||
String name = user._getNickname();
|
||||
player.sendMessage("name:" + name);
|
||||
String tempName = "";
|
||||
for(int i = 0; i < name.length(); i++){
|
||||
player.sendMessage("|"+name.charAt(i)+"|");
|
||||
if (name.charAt(i) != '§'){
|
||||
|
||||
tempName += name.charAt(i);
|
||||
}else{
|
||||
i++;
|
||||
}
|
||||
}
|
||||
name = tempName;
|
||||
player.sendMessage("Adjusted Name: " + name);
|
||||
|
||||
switch(dyecolour){
|
||||
case GRAY:
|
||||
player.sendMessage("Adding GRAY");
|
||||
player.sendMessage("Adding §7GRAY!§f");
|
||||
name = "§7" + name;
|
||||
break;
|
||||
case RED:
|
||||
player.sendMessage("Adding RED");
|
||||
player.sendMessage("Adding §4RED!§f");
|
||||
name = "§4" + name;
|
||||
break;
|
||||
case ORANGE:
|
||||
player.sendMessage("Adding ORANGE");
|
||||
player.sendMessage("Adding §6ORANGE!§f");
|
||||
name = "§6" + name;
|
||||
break;
|
||||
case YELLOW:
|
||||
player.sendMessage("Adding YELLOW");
|
||||
player.sendMessage("Adding §eYELLOW!§f");
|
||||
name = "§e" + name;
|
||||
break;
|
||||
case LIME:
|
||||
case GREEN:
|
||||
player.sendMessage("Adding GREEN");
|
||||
player.sendMessage("Adding §aGREEN!§f");
|
||||
name = "§a" + name;
|
||||
break;
|
||||
case CYAN:
|
||||
case LIGHT_BLUE:
|
||||
case BLUE:
|
||||
player.sendMessage("Adding BLUE");
|
||||
player.sendMessage("Adding §9BLUE!§f");
|
||||
name = "§9" + name;
|
||||
break;
|
||||
case PURPLE:
|
||||
player.sendMessage("Adding PURPLE");
|
||||
player.sendMessage("Adding §5PURPLE!§f");
|
||||
name = "§5" + name;
|
||||
break;
|
||||
case WHITE:
|
||||
player.sendMessage("Adding §fWHITE!§f");
|
||||
name = "§f" + name;
|
||||
default:
|
||||
player.sendMessage("ERROR, PORTAL HAS INVALID UNDER-BLOCK");
|
||||
break;
|
||||
}
|
||||
user.setNickname(name);
|
||||
player.sendMessage("Your name is now: " + user.getNickname() +"! Removing you from playersToBeFlaired...");
|
||||
player.sendMessage("Your name is now: " + user.getNickname() +"!");
|
||||
playersToBeFlaired.remove(player.getName());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,17 +13,22 @@ public class GPowerMemory{
|
|||
poweredPlayerList.put(player.getUniqueId(), new poweredPlayer(player.getUniqueId(), colour, true));
|
||||
}
|
||||
public void PowerUpPlayer(Player player){
|
||||
player.sendMessage("Powering up!");
|
||||
if(poweredPlayerList.containsKey(player.getUniqueId())){
|
||||
poweredPlayerList.get(player.getUniqueId()).isPowersActive = true;
|
||||
player.sendMessage("Powered up!");
|
||||
}else{
|
||||
player.sendMessage("You must instantiate your power settings using /GPower");
|
||||
}
|
||||
}
|
||||
|
||||
public void PowerDownPlayer(Player player){
|
||||
player.sendMessage("Powering down!");
|
||||
if (poweredPlayerList.containsKey(player.getUniqueId())){
|
||||
player.sendMessage("Powered down!");
|
||||
poweredPlayerList.get(player.getUniqueId()).isPowersActive = false;
|
||||
}else{
|
||||
player.sendMessage("P down!");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@ public class PowerUp extends TBMCCommandBase {
|
|||
public boolean OnCommand(CommandSender sender, String label, String[] args) {
|
||||
if (!(sender instanceof Player))
|
||||
sender.sendMessage("You must be a player to use this command! Contact a dev/ali if you think this is wrong");
|
||||
|
||||
Player player = (Player) sender;
|
||||
gPowerMemory.PowerUpPlayer(player);
|
||||
return false;
|
||||
|
|
5
src/alisolarflare/uhc/intro/IntroductionCutscene.java
Normal file
5
src/alisolarflare/uhc/intro/IntroductionCutscene.java
Normal file
|
@ -0,0 +1,5 @@
|
|||
package alisolarflare.uhc.intro;
|
||||
|
||||
public class IntroductionCutscene {
|
||||
//TODO: Teleport all players to the area.
|
||||
}
|
|
@ -23,6 +23,10 @@ public class UHCMatch {
|
|||
public void setMatchState(MatchState newMS){
|
||||
matchState = newMS;
|
||||
fileConfiguration.set("UHCMatchState", newMS.toString());
|
||||
switch(newMS){
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue