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 pvpInZonesOnly = false;
|
||||||
private boolean buildInZonesOnly = false;
|
private boolean buildInZonesOnly = false;
|
||||||
|
private boolean disablePVPMessage = false;
|
||||||
|
|
||||||
private WarHub warHub;
|
private WarHub warHub;
|
||||||
|
|
||||||
@ -1595,6 +1596,14 @@ public class War extends JavaPlugin {
|
|||||||
return buildInZonesOnly;
|
return buildInZonesOnly;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setDisablePVPMessage(boolean disablePVPMessage) {
|
||||||
|
this.disablePVPMessage = disablePVPMessage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isDisablePVPMessage() {
|
||||||
|
return disablePVPMessage;
|
||||||
|
}
|
||||||
|
|
||||||
public void setDefaultUnbreakableZoneBlocks(boolean defaultUnbreakableZoneBlocks) {
|
public void setDefaultUnbreakableZoneBlocks(boolean defaultUnbreakableZoneBlocks) {
|
||||||
this.defaultUnbreakableZoneBlocks = 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"))){
|
} else if (attackerTeam == null && defenderTeam == null && (!war.isPvpInZonesOnly() || a.getLocation().getWorld().getName().equals("pvp"))){
|
||||||
// let normal PVP through is its not turned off
|
// let normal PVP through is its not turned off
|
||||||
} else if (attackerTeam == null && defenderTeam == null && war.isPvpInZonesOnly()) {
|
} 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.");
|
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
|
event.setCancelled(true); // global pvp is off
|
||||||
} else {
|
} else {
|
||||||
war.badMsg(a, "Your attack missed!");
|
war.badMsg(a, "Your attack missed!");
|
||||||
|
@ -106,6 +106,9 @@ public class WarMapper {
|
|||||||
// buildInZonesOnly
|
// buildInZonesOnly
|
||||||
war.setBuildInZonesOnly(warConfig.getBoolean("buildInZonesOnly"));
|
war.setBuildInZonesOnly(warConfig.getBoolean("buildInZonesOnly"));
|
||||||
|
|
||||||
|
// disablePVPMessage
|
||||||
|
war.setDisablePVPMessage(warConfig.getBoolean("disablePVPMessage"));
|
||||||
|
|
||||||
// defaultSpawnStyle
|
// defaultSpawnStyle
|
||||||
String spawnStyle = warConfig.getString("defaultspawnStyle");
|
String spawnStyle = warConfig.getString("defaultspawnStyle");
|
||||||
if(spawnStyle != null && !spawnStyle.equals("")){
|
if(spawnStyle != null && !spawnStyle.equals("")){
|
||||||
@ -214,6 +217,9 @@ public class WarMapper {
|
|||||||
// buildInZonesOnly
|
// buildInZonesOnly
|
||||||
warConfig.setBoolean("buildInZonesOnly", war.isBuildInZonesOnly());
|
warConfig.setBoolean("buildInZonesOnly", war.isBuildInZonesOnly());
|
||||||
|
|
||||||
|
// disablePVPMessage
|
||||||
|
warConfig.setBoolean("disablePVPMessage", war.isDisablePVPMessage());
|
||||||
|
|
||||||
// spawnStyle
|
// spawnStyle
|
||||||
warConfig.setString("spawnStyle", war.getDefaultSpawnStyle());
|
warConfig.setString("spawnStyle", war.getDefaultSpawnStyle());
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user