Added a blockAnnouncer
* Configurable time to announce when the remaining hiders have their block types announced to everyone in the arena.
This commit is contained in:
		| @@ -329,6 +329,22 @@ public class BlockHunt extends JavaPlugin implements Listener { | ||||
| 									} | ||||
| 								} | ||||
| 							} | ||||
|  | ||||
| 							// blockAnnouncer code. | ||||
| 							if (arena.timer == (Integer)W.config.get(ConfigC.blockAnnouncer_timer) && (Boolean)W.config.get(ConfigC.blockAnnouncer_enabled)) { | ||||
| 								ArrayList<String> remainingBlocks = new ArrayList<String>(); | ||||
| 								for (Player arenaPlayer : arena.playersInArena) { | ||||
| 									if (!arena.seekers.contains(arenaPlayer)) { | ||||
| 										String block = arenaPlayer.getInventory().getItem(8).getType().name(); | ||||
| 										block = block.substring(0, 1).toUpperCase() + block.substring(1).toLowerCase(); //Make lowercase and capitalise first letter. | ||||
| 										if (!remainingBlocks.contains(block)) { //Don't print double up block names. | ||||
| 											remainingBlocks.add(block); | ||||
| 										} | ||||
| 									} | ||||
| 								} | ||||
| 								ArenaHandler.sendFMessage(arena, ConfigC.normal_ingameBlocksLeft, "1-" + remainingBlocks.toString()); | ||||
| 							} | ||||
|  | ||||
| 							if (arena.timer == 190) { | ||||
| 								ArenaHandler.sendFMessage(arena, ConfigC.normal_ingameArenaEnd, "1-190"); | ||||
| 							} else if (arena.timer == 60) { | ||||
|   | ||||
| @@ -50,6 +50,8 @@ public enum ConfigC { | ||||
|  | ||||
| 	requireInventoryClearOnJoin(false, W.config), | ||||
|  | ||||
| 	blockAnnouncer_enabled(true, W.config), blockAnnouncer_timer(20, W.config), | ||||
|  | ||||
| 	log_enabledPlugin("%TAG%N%name%&a&k + %N%version% is now Enabled. Made by %A%autors%%N.", W.messages), log_disabledPlugin( | ||||
| 			"%TAG%N%name%&c&k - %N%version% is now Disabled. Made by %A%autors%%N.", W.messages), | ||||
|  | ||||
| @@ -79,7 +81,7 @@ public enum ConfigC { | ||||
| 			"%TAG%NPlayer %A%playername%%N %N%option% %A%amount%%N %option2% your tokens.", W.messages), normal_ingameNowSolid( | ||||
| 			"%TAG%NYou're now a solid '%A%block%%N' block!", W.messages), normal_ingameNoMoreSolid("%TAG%NYou're no longer a solid block!", W.messages), normal_shopBoughtItem( | ||||
| 			"%TAG%NYou've bought the '%A%itemname%%N' item!", W.messages), normal_shopChoosenBlock("%TAG%NYou've choosen to be a(n) '%A%block%%N' block!", W.messages), normal_shopChoosenSeeker( | ||||
| 			"%TAG%NYou've choosen to be a %Aseeker%N!", W.messages), normal_shopChoosenHiders("%TAG%NYou've choosen to be a %Ahider%N!", W.messages), | ||||
| 			"%TAG%NYou've choosen to be a %Aseeker%N!", W.messages), normal_shopChoosenHiders("%TAG%NYou've choosen to be a %Ahider%N!", W.messages), normal_ingameBlocksLeft("%TAG%NRemaining blocks: %A%1%%N", W.messages), | ||||
|  | ||||
| 	warning_lobbyNeedAtleast("%TAG%WYou need atleast %A%1%%W player(s) to start the game!", W.messages), warning_ingameNEWSeekerChoosen( | ||||
| 			"%TAG%WThe last seeker left and a new seeker has been choosen!", W.messages), warning_unableToCommand( | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 
				 RobotoRaccoon
					RobotoRaccoon