Implements custom configuration values for blacksmiths and sentinels
This commit is contained in:
parent
1906e593e3
commit
be127d0733
@ -71,7 +71,9 @@ public class BlacksmithHandler extends AbstractTraitHandler {
|
|||||||
*/
|
*/
|
||||||
private String getDetailedBlacksmithInfo(NPC npc, NPCSettings npcSettings) {
|
private String getDetailedBlacksmithInfo(NPC npc, NPCSettings npcSettings) {
|
||||||
String info = "<h2>" + npc.getName() + " the " +
|
String info = "<h2>" + npc.getName() + " the " +
|
||||||
npcSettings.getBlacksmithTitle() + "</h2><b>Fail chance:</b> " + npcSettings.getFailChance() +
|
npcSettings.getBlacksmithTitle() + "</h2>";
|
||||||
|
if (settings.displayBlacksmithSettings()) {
|
||||||
|
info += "<b>Fail chance:</b> " + npcSettings.getFailChance() +
|
||||||
"<br><b>Enchantment chance:</b> " + npcSettings.getExtraEnchantmentChance() + "<br><b>Delay:</b> " +
|
"<br><b>Enchantment chance:</b> " + npcSettings.getExtraEnchantmentChance() + "<br><b>Delay:</b> " +
|
||||||
npcSettings.getMinReforgeDelay() + " to " + npcSettings.getMaxReforgeDelay() +
|
npcSettings.getMinReforgeDelay() + " to " + npcSettings.getMaxReforgeDelay() +
|
||||||
" seconds<br><b>Cool-down:</b> " + npcSettings.getReforgeCoolDown() + " seconds<br><b>Drop item:</b> " +
|
" seconds<br><b>Cool-down:</b> " + npcSettings.getReforgeCoolDown() + " seconds<br><b>Drop item:</b> " +
|
||||||
@ -79,6 +81,7 @@ public class BlacksmithHandler extends AbstractTraitHandler {
|
|||||||
if (!npcSettings.getReforgeAbleItems().isEmpty()) {
|
if (!npcSettings.getReforgeAbleItems().isEmpty()) {
|
||||||
info += "<br><b>Reforge-able items:</b> " + getReforgeAbleItemsString(npcSettings.getReforgeAbleItems());
|
info += "<br><b>Reforge-able items:</b> " + getReforgeAbleItemsString(npcSettings.getReforgeAbleItems());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,12 +46,14 @@ public class SentinelHandler extends AbstractTraitHandler {
|
|||||||
if (trait.squad != null) {
|
if (trait.squad != null) {
|
||||||
description += "<br><b>Squad:</b> " + trait.squad;
|
description += "<br><b>Squad:</b> " + trait.squad;
|
||||||
}
|
}
|
||||||
|
if (settings.displaySentinelStats()) {
|
||||||
description += "<br><b>Invincible:</b> " + trait.invincible + "<br><b>Armor:</b> " +
|
description += "<br><b>Invincible:</b> " + trait.invincible + "<br><b>Armor:</b> " +
|
||||||
trait.armor + "<br><b>Health:</b> " + trait.health + "<br><b>Accuracy:</b> " + trait.accuracy +
|
trait.armor + "<br><b>Health:</b> " + trait.health + "<br><b>Accuracy:</b> " + trait.accuracy +
|
||||||
"<br><b>Damage:</b> " + trait.damage + "<br><b>Allow knockback:</b> " + trait.allowKnockback;
|
"<br><b>Damage:</b> " + trait.damage + "<br><b>Allow knockback:</b> " + trait.allowKnockback;
|
||||||
description += "<br><b>Range:</b> " + trait.range + "<br><b>Reach:</b> " + trait.reach;
|
description += "<br><b>Range:</b> " + trait.range + "<br><b>Reach:</b> " + trait.reach;
|
||||||
description += "<br><b>Targets:</b> " + trait.allTargets.toAllInOneString() + "<br><b>Avoids:</b> " +
|
description += "<br><b>Targets:</b> " + trait.allTargets.toAllInOneString() + "<br><b>Avoids:</b> " +
|
||||||
trait.allAvoids.toAllInOneString() + "<br><b>Ignores:</b> " + trait.allIgnores.toAllInOneString();
|
trait.allAvoids.toAllInOneString() + "<br><b>Ignores:</b> " + trait.allIgnores.toAllInOneString();
|
||||||
|
}
|
||||||
addNPCMarker(npc.getUniqueId(), "Sentinel NPC: ", description,
|
addNPCMarker(npc.getUniqueId(), "Sentinel NPC: ", description,
|
||||||
DynmapCitizens.getInstance().getGlobalSettings().getMarkerIcons().get(Icon.SENTINEL), super.markerSet);
|
DynmapCitizens.getInstance().getGlobalSettings().getMarkerIcons().get(Icon.SENTINEL), super.markerSet);
|
||||||
}
|
}
|
||||||
|
@ -7,9 +7,12 @@ import org.bukkit.configuration.file.FileConfiguration;
|
|||||||
*/
|
*/
|
||||||
public class BlacksmithSettings extends AbstractTraitSettings {
|
public class BlacksmithSettings extends AbstractTraitSettings {
|
||||||
|
|
||||||
|
private boolean displayBlacksmithSettings;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void load(FileConfiguration configuration) {
|
public void load(FileConfiguration configuration) {
|
||||||
super.load(configuration);
|
super.load(configuration);
|
||||||
|
displayBlacksmithSettings = configuration.getBoolean(getTraitConfigRoot() + ".displayBlacksmithSettings", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -17,4 +20,13 @@ public class BlacksmithSettings extends AbstractTraitSettings {
|
|||||||
return "traits.blacksmith";
|
return "traits.blacksmith";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets whether to display information about a blacksmith's settings, such as cool-down, in the marker description
|
||||||
|
*
|
||||||
|
* @return <p>True if blacksmith settings should be displayed</p>
|
||||||
|
*/
|
||||||
|
public boolean displayBlacksmithSettings() {
|
||||||
|
return displayBlacksmithSettings;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -7,9 +7,12 @@ import org.bukkit.configuration.file.FileConfiguration;
|
|||||||
*/
|
*/
|
||||||
public class SentinelSettings extends AbstractTraitSettings {
|
public class SentinelSettings extends AbstractTraitSettings {
|
||||||
|
|
||||||
|
private boolean displaySentinelStats;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void load(FileConfiguration configuration) {
|
public void load(FileConfiguration configuration) {
|
||||||
super.load(configuration);
|
super.load(configuration);
|
||||||
|
displaySentinelStats = configuration.getBoolean(getTraitConfigRoot() + ".displaySentinelStats", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -17,4 +20,13 @@ public class SentinelSettings extends AbstractTraitSettings {
|
|||||||
return "traits.sentinel";
|
return "traits.sentinel";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets whether to display information about a sentinel such as health, attack and targets in marker descriptions
|
||||||
|
*
|
||||||
|
* @return <p>True if sentinel stats should be displayed</p>
|
||||||
|
*/
|
||||||
|
public boolean displaySentinelStats() {
|
||||||
|
return displaySentinelStats;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -112,7 +112,7 @@ traits:
|
|||||||
# Whether to hide the sentinel icon layer by default
|
# Whether to hide the sentinel icon layer by default
|
||||||
markersHiddenByDefault: false
|
markersHiddenByDefault: false
|
||||||
# Whether to display information about a sentinel's health, armor and damage in the marker description
|
# Whether to display information about a sentinel's health, armor and damage in the marker description
|
||||||
displaySentinelStrength: true
|
displaySentinelStats: true
|
||||||
# Settings for the minstrel trait
|
# Settings for the minstrel trait
|
||||||
minstrel:
|
minstrel:
|
||||||
enabled: true
|
enabled: true
|
||||||
|
Loading…
Reference in New Issue
Block a user