mirror of
https://github.com/DRE2N/DungeonsXL.git
synced 2024-11-25 03:55:22 +01:00
Add option to disable global death messages
This commit is contained in:
parent
a3a99ecc97
commit
d2a2adcacb
@ -47,7 +47,7 @@ public class MainConfig extends DREConfig {
|
|||||||
NEVER
|
NEVER
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final int CONFIG_VERSION = 14;
|
public static final int CONFIG_VERSION = 15;
|
||||||
|
|
||||||
private String language = "english";
|
private String language = "english";
|
||||||
private boolean enableEconomy = false;
|
private boolean enableEconomy = false;
|
||||||
@ -86,6 +86,7 @@ public class MainConfig extends DREConfig {
|
|||||||
|
|
||||||
/* Misc */
|
/* Misc */
|
||||||
private boolean sendFloorTitle = true;
|
private boolean sendFloorTitle = true;
|
||||||
|
private boolean globalDeathMessagesDisabled = true;
|
||||||
private Map<String, Object> externalMobProviders = new HashMap<>();
|
private Map<String, Object> externalMobProviders = new HashMap<>();
|
||||||
private Map<String, Object> resourcePacks = new HashMap<>();
|
private Map<String, Object> resourcePacks = new HashMap<>();
|
||||||
|
|
||||||
@ -300,6 +301,23 @@ public class MainConfig extends DREConfig {
|
|||||||
announcementInterval = interval;
|
announcementInterval = interval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return
|
||||||
|
* false if death messages shall be sent to players who are not in the dungeon,
|
||||||
|
* true if not
|
||||||
|
*/
|
||||||
|
public boolean areGlobalDeathMessagesDisabled() {
|
||||||
|
return globalDeathMessagesDisabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param disabled
|
||||||
|
* set if death messages shall be sent to players who are not in the dungeon
|
||||||
|
*/
|
||||||
|
public void setGlobalDeathMessagesDisabled(boolean disabled) {
|
||||||
|
globalDeathMessagesDisabled = false;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return if the floor title shall be sent
|
* @return if the floor title shall be sent
|
||||||
*/
|
*/
|
||||||
@ -514,6 +532,10 @@ public class MainConfig extends DREConfig {
|
|||||||
config.set("sendFloorTitle", sendFloorTitle);
|
config.set("sendFloorTitle", sendFloorTitle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!config.contains("globalDeathMessagesDisabled")) {
|
||||||
|
config.set("globalDeathMessagesDisabled", globalDeathMessagesDisabled);
|
||||||
|
}
|
||||||
|
|
||||||
if (!config.contains("externalMobProviders")) {
|
if (!config.contains("externalMobProviders")) {
|
||||||
config.createSection("externalMobProviders");
|
config.createSection("externalMobProviders");
|
||||||
}
|
}
|
||||||
@ -643,6 +665,10 @@ public class MainConfig extends DREConfig {
|
|||||||
sendFloorTitle = config.getBoolean("sendFloorTitle");
|
sendFloorTitle = config.getBoolean("sendFloorTitle");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (config.contains("globalDeathMessagesDisabled")) {
|
||||||
|
globalDeathMessagesDisabled = config.getBoolean("globalDeathMessagesDisabled");
|
||||||
|
}
|
||||||
|
|
||||||
if (config.contains("externalMobProviders")) {
|
if (config.contains("externalMobProviders")) {
|
||||||
externalMobProviders = config.getConfigurationSection("externalMobProviders").getValues(false);
|
externalMobProviders = config.getConfigurationSection("externalMobProviders").getValues(false);
|
||||||
}
|
}
|
||||||
|
@ -851,6 +851,10 @@ public class DGamePlayer extends DInstancePlayer {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (config.areGlobalDeathMessagesDisabled()) {
|
||||||
|
event.setDeathMessage(null);
|
||||||
|
}
|
||||||
|
|
||||||
if (game.getRules().getKeepInventoryOnDeath()) {
|
if (game.getRules().getKeepInventoryOnDeath()) {
|
||||||
setRespawnInventory(event.getEntity().getInventory().getContents());
|
setRespawnInventory(event.getEntity().getInventory().getContents());
|
||||||
setRespawnArmor(event.getEntity().getInventory().getArmorContents());
|
setRespawnArmor(event.getEntity().getInventory().getArmorContents());
|
||||||
|
Loading…
Reference in New Issue
Block a user