mirror of
https://github.com/libraryaddict/LibsDisguises.git
synced 2024-12-12 15:07:22 +01:00
Add ability to hide death messages for disguised players in config
This commit is contained in:
parent
762368cef5
commit
0950910b39
@ -301,6 +301,9 @@ public class DisguiseConfig {
|
|||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
private static boolean uniquePlayerDisguiseUUIDs;
|
private static boolean uniquePlayerDisguiseUUIDs;
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
private static boolean hideDeathMessages;
|
||||||
|
|
||||||
public static boolean isArmorstandsName() {
|
public static boolean isArmorstandsName() {
|
||||||
return getPlayerNameType() == PlayerNameType.ARMORSTANDS;
|
return getPlayerNameType() == PlayerNameType.ARMORSTANDS;
|
||||||
@ -710,6 +713,7 @@ public class DisguiseConfig {
|
|||||||
String apiKey = config.getString("MineSkinAPIKey");
|
String apiKey = config.getString("MineSkinAPIKey");
|
||||||
setSoundsEnabled(config.getBoolean("DisguiseSounds"));
|
setSoundsEnabled(config.getBoolean("DisguiseSounds"));
|
||||||
setUniquePlayerDisguiseUUIDs(config.getBoolean("UniquePlayerUUID"));
|
setUniquePlayerDisguiseUUIDs(config.getBoolean("UniquePlayerUUID"));
|
||||||
|
setHideDeathMessages(config.getBoolean("HideDeathMessages"));
|
||||||
|
|
||||||
if (apiKey != null && apiKey.matches("[a-zA-Z\\d]{8,}")) {
|
if (apiKey != null && apiKey.matches("[a-zA-Z\\d]{8,}")) {
|
||||||
DisguiseUtilities.getMineSkinAPI().setApiKey(apiKey);
|
DisguiseUtilities.getMineSkinAPI().setApiKey(apiKey);
|
||||||
|
@ -40,6 +40,7 @@ import org.bukkit.event.block.BlockPlaceEvent;
|
|||||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||||
import org.bukkit.event.entity.EntityDamageEvent;
|
import org.bukkit.event.entity.EntityDamageEvent;
|
||||||
import org.bukkit.event.entity.EntityTargetEvent;
|
import org.bukkit.event.entity.EntityTargetEvent;
|
||||||
|
import org.bukkit.event.entity.PlayerDeathEvent;
|
||||||
import org.bukkit.event.player.PlayerChangedWorldEvent;
|
import org.bukkit.event.player.PlayerChangedWorldEvent;
|
||||||
import org.bukkit.event.player.PlayerInteractAtEntityEvent;
|
import org.bukkit.event.player.PlayerInteractAtEntityEvent;
|
||||||
import org.bukkit.event.player.PlayerInteractEntityEvent;
|
import org.bukkit.event.player.PlayerInteractEntityEvent;
|
||||||
@ -842,4 +843,13 @@ public class DisguiseListener implements Listener {
|
|||||||
|
|
||||||
disguiseRunnable.put(playerName, runnable);
|
disguiseRunnable.put(playerName, runnable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onPlayerDeath(PlayerDeathEvent event) {
|
||||||
|
if (!DisguiseConfig.isHideDeathMessages() || !DisguiseAPI.isDisguised(event.getPlayer())) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
event.setDeathMessage(null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -37,4 +37,7 @@ RetaliationCombat: false
|
|||||||
# If pvp or pve is disabled, this takes effect.
|
# If pvp or pve is disabled, this takes effect.
|
||||||
# If RetaliationCombat is false, or it's true but they haven't fought back in PvPTimer seconds, then they can't fight back.
|
# If RetaliationCombat is false, or it's true but they haven't fought back in PvPTimer seconds, then they can't fight back.
|
||||||
# This also controls it so they can't fight back PvPTimer seconds after applying a disguise
|
# This also controls it so they can't fight back PvPTimer seconds after applying a disguise
|
||||||
PvPTimer: 5
|
PvPTimer: 5
|
||||||
|
|
||||||
|
# If this is enabled, death messages will not show for players if they were disguised
|
||||||
|
HideDeathMessages: false
|
Loading…
Reference in New Issue
Block a user