Bladeren bron

Fixed Leaf Blower not respected the unlock level set in advanced.yml

GJ 12 jaren geleden
bovenliggende
commit
c220f0dee5
2 gewijzigde bestanden met toevoegingen van 3 en 3 verwijderingen
  1. 1 0
      Changelog.txt
  2. 2 3
      src/main/java/com/gmail/nossr50/listeners/BlockListener.java

+ 1 - 0
Changelog.txt

@@ -20,6 +20,7 @@ Version 1.4.00-dev
  = Fixed Woodcutting accidentally using Mining double drop values.
  = Fixed Hylian Luck not removing the block-placed flag from flowers.
  = Fixed Hylian Luck not checking the block-placed flag on flowers.
+ = Fixed Leaf Blower not respected the unlock level set in advanced.yml
  ! Changed how Berserk handles not picking up items to avoid listening to PlayerPickupItemEvent
  ! Moved Hylian Luck into a separate listener since it actually cancels the event and shouldn't just be on MONITOR.
  ! Changed how Tree Feller is handled, it should now put less stress on the CPU

+ 2 - 3
src/main/java/com/gmail/nossr50/listeners/BlockListener.java

@@ -20,6 +20,7 @@ import org.bukkit.metadata.FixedMetadataValue;
 import org.getspout.spoutapi.sound.SoundEffect;
 
 import com.gmail.nossr50.mcMMO;
+import com.gmail.nossr50.config.AdvancedConfig;
 import com.gmail.nossr50.config.Config;
 import com.gmail.nossr50.datatypes.PlayerProfile;
 import com.gmail.nossr50.events.fake.FakeBlockBreakEvent;
@@ -249,12 +250,10 @@ public class BlockListener implements Listener {
      */
     @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
     public void onBlockDamage(BlockDamageEvent event) {
-
         if (event instanceof FakeBlockDamageEvent) {
             return;
         }
 
-        final int LEAF_BLOWER_LEVEL = 100;
 
         Player player = event.getPlayer();
 
@@ -342,7 +341,7 @@ public class BlockListener implements Listener {
                 miningManager.superBreakerBlockCheck(block);
             }
         }
-        else if (profile.getSkillLevel(SkillType.WOODCUTTING) >= LEAF_BLOWER_LEVEL && (material.equals(Material.LEAVES) || (configInstance.getBlockModsEnabled() && ModChecks.isCustomLeafBlock(block)))) {
+        else if (profile.getSkillLevel(SkillType.WOODCUTTING) >= AdvancedConfig.getInstance().getLeafBlowUnlockLevel() && (material.equals(Material.LEAVES) || (configInstance.getBlockModsEnabled() && ModChecks.isCustomLeafBlock(block)))) {
             if (Skills.triggerCheck(player, block, AbilityType.LEAF_BLOWER)) {
                 if (configInstance.getWoodcuttingRequiresTool()) {
                     if (ItemChecks.isAxe(inHand)) {