mirror of
https://github.com/taoneill/war.git
synced 2024-11-27 12:46:11 +01:00
PVP Message can now be disabled
Closes https://github.com/taoneill/war/issues/138
This commit is contained in:
parent
84452d6654
commit
d57d181f68
@ -83,6 +83,7 @@ public class War extends JavaPlugin {
|
||||
|
||||
private boolean pvpInZonesOnly = false;
|
||||
private boolean buildInZonesOnly = false;
|
||||
private boolean disablePVPMessage = false;
|
||||
|
||||
private WarHub warHub;
|
||||
|
||||
@ -1595,6 +1596,14 @@ public class War extends JavaPlugin {
|
||||
return buildInZonesOnly;
|
||||
}
|
||||
|
||||
public void setDisablePVPMessage(boolean disablePVPMessage) {
|
||||
this.disablePVPMessage = disablePVPMessage;
|
||||
}
|
||||
|
||||
public boolean isDisablePVPMessage() {
|
||||
return disablePVPMessage;
|
||||
}
|
||||
|
||||
public void setDefaultUnbreakableZoneBlocks(boolean defaultUnbreakableZoneBlocks) {
|
||||
this.defaultUnbreakableZoneBlocks = defaultUnbreakableZoneBlocks;
|
||||
}
|
||||
|
@ -106,7 +106,9 @@ public class WarEntityListener extends EntityListener {
|
||||
} else if (attackerTeam == null && defenderTeam == null && (!war.isPvpInZonesOnly() || a.getLocation().getWorld().getName().equals("pvp"))){
|
||||
// let normal PVP through is its not turned off
|
||||
} else if (attackerTeam == null && defenderTeam == null && war.isPvpInZonesOnly()) {
|
||||
if (!war.isDisablePVPMessage()) {
|
||||
war.badMsg(a, "Your attack missed! Global PVP is turned off. You can only attack other players in warzones. Try /warhub, /zones and /zone.");
|
||||
}
|
||||
event.setCancelled(true); // global pvp is off
|
||||
} else {
|
||||
war.badMsg(a, "Your attack missed!");
|
||||
|
@ -106,6 +106,9 @@ public class WarMapper {
|
||||
// buildInZonesOnly
|
||||
war.setBuildInZonesOnly(warConfig.getBoolean("buildInZonesOnly"));
|
||||
|
||||
// disablePVPMessage
|
||||
war.setDisablePVPMessage(warConfig.getBoolean("disablePVPMessage"));
|
||||
|
||||
// defaultSpawnStyle
|
||||
String spawnStyle = warConfig.getString("defaultspawnStyle");
|
||||
if(spawnStyle != null && !spawnStyle.equals("")){
|
||||
@ -214,6 +217,9 @@ public class WarMapper {
|
||||
// buildInZonesOnly
|
||||
warConfig.setBoolean("buildInZonesOnly", war.isBuildInZonesOnly());
|
||||
|
||||
// disablePVPMessage
|
||||
warConfig.setBoolean("disablePVPMessage", war.isDisablePVPMessage());
|
||||
|
||||
// spawnStyle
|
||||
warConfig.setString("spawnStyle", war.getDefaultSpawnStyle());
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user