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