Add killer to hider death messages + Fix Minigames compat
This commit is contained in:
parent
1dc41a9b57
commit
8ad8d1ef6e
@ -57,7 +57,7 @@ public enum ConfigC {
|
||||
shop_blockChooserv1Enabled (true, W.config),
|
||||
shop_blockChooserv1IDname ("BOOK", W.config),
|
||||
shop_blockChooserv1Price (3000, W.config),
|
||||
shop_blockChooserv1Name ("%H&lBlock Chooser", W.config),
|
||||
shop_blockChooserv1Name ("%H&lBlockHunt Chooser", W.config),
|
||||
shop_blockChooserv1Description (new String[] {
|
||||
"%NUse this item before the arena starts.",
|
||||
"%ARight-Click%N in the lobby and choose",
|
||||
@ -127,13 +127,13 @@ public enum ConfigC {
|
||||
normal_reloadedConfigs ("%TAG&aReloaded all configs!", W.messages),
|
||||
normal_joinJoinedArena ("%TAG%A%playername%%N joined your arena. (%A%1%%N/%A%2%%N)",
|
||||
W.messages),
|
||||
normal_leaveYouLeft ("%TAG%NYou left the arena! Thanks for playing ;)!",
|
||||
normal_leaveYouLeft ("%TAG%NYou left the arena! Thanks for playing!",
|
||||
W.messages),
|
||||
normal_leaveLeftArena ("%TAG%A%playername%%N left your arena. (%A%1%%N/%A%2%%N)",
|
||||
W.messages),
|
||||
normal_startForced ("%TAG%NYou forced to start arena '%A%arenaname%%N'!",
|
||||
W.messages),
|
||||
normal_wandGaveWand ("%TAG%NHere you go ;)! &o(Use the %A&o%type%%N&o!)",
|
||||
normal_wandGaveWand ("%TAG%NHere you go! &o(Use the %A&o%type%%N&o!)",
|
||||
W.messages),
|
||||
normal_wandSetPosition ("%TAG%NSet position %A#%number%%N to location: (%A%x%%N, %A%y%%N, %A%z%%N).",
|
||||
W.messages),
|
||||
@ -152,9 +152,11 @@ public enum ConfigC {
|
||||
normal_ingameSeekerSpawned ("%TAG%A%playername%%N has spawned as a seeker!",
|
||||
W.messages),
|
||||
normal_ingameGivenSword ("%TAG%NYou were given a sword!", W.messages),
|
||||
normal_ingameHiderDied ("%TAG%NHider %A%playername%%N died! %A%left%%N hider(s) remain...",
|
||||
normal_ingameHiderDied ("%TAG%NHider %A%playername%%N was killed by %A%killer%%N!",
|
||||
W.messages),
|
||||
normal_ingameSeekerDied ("%TAG%NSeeker %A%playername%%N died! He will respawn in %A%secs%%N seconds!",
|
||||
normal_ingameHidersLeft ("%NHider(s) left: %A%left%%N",
|
||||
W.messages),
|
||||
normal_ingameSeekerDied ("%TAG%NSeeker %A%playername%%N died and will respawn in %A%secs%%N seconds!",
|
||||
W.messages),
|
||||
normal_winSeekers ("%TAG%NThe %ASEEKERS%N have won!", W.messages),
|
||||
normal_winHiders ("%TAG%NThe %AHIDERS%N have won!", W.messages),
|
||||
|
@ -35,13 +35,13 @@ public class InventoryHandler {
|
||||
.createInventory(
|
||||
null,
|
||||
54,
|
||||
MessageM.replaceAll("\u00A7r%N&lSettings of: %A"
|
||||
MessageM.replaceAll("\u00A7r%N&lBlockHunt Arena: %A"
|
||||
+ shorten));
|
||||
|
||||
ItemStack arenaNameNote = new ItemStack(Material.PAPER, 1);
|
||||
ItemMeta arenaNameNote_IM = arenaNameNote.getItemMeta();
|
||||
arenaNameNote_IM.setDisplayName(MessageM
|
||||
.replaceAll("%NSettings of arena: %A" + arena.arenaName));
|
||||
.replaceAll("%NBlockHunt arena: %A" + arena.arenaName));
|
||||
arenaNameNote.setItemMeta(arenaNameNote_IM);
|
||||
panel.setItem(0, arenaNameNote);
|
||||
|
||||
|
@ -1,5 +1,9 @@
|
||||
package nl.Steffion.BlockHunt.Listeners;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import me.libraryaddict.disguise.DisguiseAPI;
|
||||
import nl.Steffion.BlockHunt.Arena;
|
||||
import nl.Steffion.BlockHunt.Arena.ArenaState;
|
||||
@ -8,6 +12,7 @@ import nl.Steffion.BlockHunt.ConfigC;
|
||||
import nl.Steffion.BlockHunt.W;
|
||||
import nl.Steffion.BlockHunt.Managers.MessageM;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -27,8 +32,10 @@ public class OnEntityDamageByEntityEvent implements Listener {
|
||||
}
|
||||
|
||||
Player damager = null;
|
||||
String damagername = "unknown";
|
||||
if (event.getDamager() instanceof Player) {
|
||||
damager = (Player) event.getDamager();
|
||||
damagername = damager.getName();
|
||||
}
|
||||
|
||||
if (player != null) {
|
||||
@ -102,17 +109,28 @@ public class OnEntityDamageByEntityEvent implements Listener {
|
||||
.sendFMessage(
|
||||
arena,
|
||||
ConfigC.normal_ingameHiderDied,
|
||||
"playername-"
|
||||
+ player.getName(),
|
||||
"left-"
|
||||
+ (arena.playersInArena
|
||||
.size() - arena.seekers
|
||||
.size()));
|
||||
} else {
|
||||
ArenaHandler.sendFMessage(arena,
|
||||
ConfigC.normal_ingameSeekerDied,
|
||||
"playername-" + player.getName(),
|
||||
"secs-" + arena.waitingTimeSeeker);
|
||||
"playername-" + player.getName(),
|
||||
"killer-" + damagername);
|
||||
|
||||
int hidercount = (arena.playersInArena.size() - arena.seekers.size());
|
||||
if ((hidercount <= 3) && (hidercount > 0)) {
|
||||
List<String> hiders = new ArrayList<String>();
|
||||
for (Player p : arena.playersInArena) {
|
||||
if (!arena.seekers.contains(p)) {
|
||||
hiders.add(p.getName());
|
||||
System.out.println("[Debug] Adding hider: " + p.getName());
|
||||
}
|
||||
}
|
||||
Collections.sort(hiders);
|
||||
|
||||
ArenaHandler.sendFMessage(arena,
|
||||
ConfigC.normal_ingameHidersLeft,
|
||||
"left-" + StringUtils.join(hiders.toArray(), ", "));
|
||||
} else {
|
||||
ArenaHandler.sendFMessage(arena,
|
||||
ConfigC.normal_ingameHidersLeft,
|
||||
"left-" + hidercount);
|
||||
}
|
||||
}
|
||||
|
||||
player.getInventory().clear();
|
||||
|
@ -50,7 +50,12 @@ public class OnInventoryClickEvent implements Listener {
|
||||
}
|
||||
|
||||
return;
|
||||
} else if (inv.getName().startsWith("\u00A7r")) {
|
||||
}
|
||||
|
||||
// Early exit if this isnt a blockhunt inventory
|
||||
if (!inv.getName().contains("BlockHunt")) return;
|
||||
|
||||
if (inv.getName().startsWith("\u00A7r")) {
|
||||
if (inv.getName().equals(
|
||||
MessageM.replaceAll((String) "\u00A7r"
|
||||
+ W.config.get(ConfigC.shop_title)))) {
|
||||
@ -264,7 +269,7 @@ public class OnInventoryClickEvent implements Listener {
|
||||
.getItemMeta()
|
||||
.getDisplayName()
|
||||
.replaceAll(
|
||||
MessageM.replaceAll("%NSettings of arena: %A"),
|
||||
MessageM.replaceAll("%NBlockHunt arena: %A"),
|
||||
"");
|
||||
|
||||
Arena arena = null;
|
||||
|
Loading…
x
Reference in New Issue
Block a user