From 1ae11da036954cbe3149558f729ecad461e30c33 Mon Sep 17 00:00:00 2001 From: GJ Date: Tue, 1 May 2012 22:42:45 -0400 Subject: [PATCH] Start of work on allowing Combat skills to be enabled for just PVP or PVE --- src/main/java/com/gmail/nossr50/config/Config.java | 12 ++++++++++++ .../com/gmail/nossr50/listeners/PlayerListener.java | 4 ++-- src/main/resources/config.yml | 10 ++++++++++ 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/config/Config.java b/src/main/java/com/gmail/nossr50/config/Config.java index a2a3170e2..ef997ec8e 100644 --- a/src/main/java/com/gmail/nossr50/config/Config.java +++ b/src/main/java/com/gmail/nossr50/config/Config.java @@ -314,6 +314,18 @@ public class Config extends ConfigLoader { public int getLevelCapWoodcutting() { return config.getInt("Skills.Woodcutting.Level_Cap", 0); } public int getPowerLevelCap() { return config.getInt("General.Power_Level_Cap", 0); } + /* PVP & PVE Settings */ + public boolean getArcheryPVP() { return config.getBoolean("Skills.Archery.Enabled_For_PVP", true); } + public boolean getArcheryPVE() { return config.getBoolean("Skills.Archery.Enabled_For_PVE", true); } + public boolean getAxesPVP() { return config.getBoolean("Skills.Axes.Enabled_For_PVP", true); } + public boolean getAxesPVE() { return config.getBoolean("Skills.Axes.Enabled_For_PVE", true); } + public boolean getSwordsPVP() { return config.getBoolean("Skills.Swords.Enabled_For_PVP", true); } + public boolean getSwordsPVE() { return config.getBoolean("Skills.Swords.Enabled_For_PVE", true); } + public boolean getTamingPVP() { return config.getBoolean("Skills.Taming.Enabled_For_PVP", true); } + public boolean getTamingPVE() { return config.getBoolean("Skills.Taming.Enabled_For_PVE", true); } + public boolean getUnarmedPVP() { return config.getBoolean("Skills.Unarmed.Enabled_For_PVP", true); } + public boolean getUnarmedPVE() { return config.getBoolean("Skills.Unarmed.Enabled_For_PVE", true); } + /* * XP SETTINGS */ diff --git a/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java b/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java index 1b32c67df..eb6d729d5 100644 --- a/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java @@ -300,7 +300,7 @@ public class PlayerListener implements Listener { McMMOPartyChatEvent chatEvent = new McMMOPartyChatEvent(player.getName(), PP.getParty(), event.getMessage()); plugin.getServer().getPluginManager().callEvent(chatEvent); - if(chatEvent.isCancelled()) { + if (chatEvent.isCancelled()) { return; } @@ -321,7 +321,7 @@ public class PlayerListener implements Listener { McMMOAdminChatEvent chatEvent = new McMMOAdminChatEvent(player.getName(), event.getMessage()); plugin.getServer().getPluginManager().callEvent(chatEvent); - if(chatEvent.isCancelled()) { + if (chatEvent.isCancelled()) { return; } diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 68e797565..8364203df 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -116,8 +116,12 @@ Skills: Acrobatics: Level_Cap: 0 Archery: + Enabled_For_PVP: true + Enabled_For_PVE: true Level_Cap: 0 Axes: + Enabled_For_PVP: true + Enabled_For_PVE: true Level_Cap: 0 Excavation: Level_Cap: 0 @@ -157,13 +161,19 @@ Skills: Level_Required: 50 ID: 264 Swords: + Enabled_For_PVP: true + Enabled_For_PVE: true Level_Cap: 0 Taming: + Enabled_For_PVP: true + Enabled_For_PVE: true Level_Cap: 0 Call_Of_The_Wild: Bones_Required: 10 Fish_Required: 10 Unarmed: + Enabled_For_PVP: true + Enabled_For_PVE: true Level_Cap: 0 Woodcutting: Level_Cap: 0