Browse Source

Merge pull request #332 from TfT-02/master

Fixed and patches
Grant 12 năm trước cách đây
mục cha
commit
abd051d07b

+ 1 - 1
.gitignore

@@ -1,4 +1,4 @@
-# Eclipse stuffs
+# Eclipse stuff
 /.classpath
 /.project
 /.settings

+ 2 - 1
src/main/java/com/gmail/nossr50/config/AdvancedConfig.java

@@ -57,9 +57,10 @@ public class AdvancedConfig extends ConfigLoader {
     public int getAxesCriticalPVEModifier() { return config.getInt("Skills.Axes.AxesCritical_PVE_Modifier", 2); }
     
     public int getGreaterImpactChance() { return config.getInt("Skills.Axes.GreaterImpact_Chance", 25); }
-    public int getGreaterImpactIncreaseLevel() { return config.getInt("Skills.Axes.GreaterImpact_IncreaseLevel", 50); }
     public double getGreaterImpactModifier() { return config.getDouble("Skills.Axes.GreaterImpact_KnockbackModifier", 1.5); }
     public int getGreaterImpactBonusDamage() { return config.getInt("Skills.Axes.GreaterImpact_BonusDamage", 2); }
+
+    public int getArmorImpactIncreaseLevel() { return config.getInt("Skills.Axes.ArmorImpact_IncreaseLevel", 50); }
     
     /* EXCAVATION */
     //Nothing to configure, everything is already configurable in config.yml

+ 1 - 1
src/main/java/com/gmail/nossr50/skills/combat/Axes.java

@@ -129,7 +129,7 @@ public class Axes {
             short durabilityDamage = 1; //Start with 1 durability damage
 
             /* Every 30 Skill Levels you gain 1 durability damage */
-            int impactIncreaseLevel = advancedConfig.getGreaterImpactIncreaseLevel();
+            int impactIncreaseLevel = advancedConfig.getArmorImpactIncreaseLevel();
             durabilityDamage += (int) ((double) Users.getProfile(attacker).getSkillLevel(SkillType.AXES) / (double) impactIncreaseLevel);
 
             if (!hasArmor(targetPlayer)) {

+ 20 - 18
src/main/java/com/gmail/nossr50/skills/repair/Salvage.java

@@ -27,27 +27,29 @@ public class Salvage {
             return;
         }
 
-        final PlayerProfile profile = Users.getProfile(player);
-        final int skillLevel = profile.getSkillLevel(SkillType.REPAIR);
-        final int unlockLevel = configInstance.getSalvageUnlockLevel();
+        if (player.getGameMode().equals(0)){
+        	final PlayerProfile profile = Users.getProfile(player);
+        	final int skillLevel = profile.getSkillLevel(SkillType.REPAIR);
+        	final int unlockLevel = configInstance.getSalvageUnlockLevel();
 
-        if (skillLevel >= unlockLevel) {
-            final World world = player.getWorld();
-            final float currentdura = inHand.getDurability();
+        	if (skillLevel >= unlockLevel) {
+        		final World world = player.getWorld();
+        		final float currentdura = inHand.getDurability();
 
-            if (currentdura == 0) {
-                final int salvagedAmount = getSalvagedAmount(inHand);
-                final int itemID = getSalvagedItemID(inHand);
+        		if (currentdura == 0) {
+        			final int salvagedAmount = getSalvagedAmount(inHand);
+        			final int itemID = getSalvagedItemID(inHand);
 
-                player.setItemInHand(new ItemStack(0));
-                location.setY(location.getY() + 1);
-                world.dropItem(location, new ItemStack(itemID, salvagedAmount));
-                player.sendMessage(LocaleLoader.getString("Repair.Skills.SalvageSuccess"));
-            } else {
-                player.sendMessage(LocaleLoader.getString("Repair.Skills.NotFullDurability"));
-            }
-        } else {
-            player.sendMessage(LocaleLoader.getString("Repair.Skills.AdeptSalvage"));
+        			player.setItemInHand(new ItemStack(0));
+        			location.setY(location.getY() + 1);
+        			world.dropItem(location, new ItemStack(itemID, salvagedAmount));
+        			player.sendMessage(LocaleLoader.getString("Repair.Skills.SalvageSuccess"));
+        		} else {
+        			player.sendMessage(LocaleLoader.getString("Repair.Skills.NotFullDurability"));
+        		}
+        	} else {
+        		player.sendMessage(LocaleLoader.getString("Repair.Skills.AdeptSalvage"));
+        	}
         }
     }
 

+ 1 - 1
src/main/resources/advanced.yml

@@ -42,9 +42,9 @@ Skills:
         AxesCritical_PVP_Modifier: 1.5
         AxesCritical_PVE_Modifier: 2
         GreaterImpact_Chance: 25
-        GreaterImpact_IncreaseLevel: 50
         GreaterImpact_KnockbackModifier: 1.5
         GreaterImpact_BonusDamage: 2
+        ArmorImpact_IncreaseLevel: 50
     Fishing:
         Shake_UnlockLevel: 150
         Enchantment_Chance: 10