mirror of
				https://github.com/mcMMO-Dev/mcMMO.git
				synced 2025-10-31 09:13:43 +01:00 
			
		
		
		
	Use tree species for Woodcutting double drops in config.yml
Oak is now Generic, and Spruce is now Redwood.
This commit is contained in:
		| @@ -13,7 +13,7 @@ Version 1.5.00-dev | |||||||
|  + Added Salmon, Clownfish, and Pufferfish to Fishing XP |  + Added Salmon, Clownfish, and Pufferfish to Fishing XP | ||||||
|  + Added new flowers and grasses to Herbalism XP |  + Added new flowers and grasses to Herbalism XP | ||||||
|  ! Fishing XP now depends on the type of fish. |  ! Fishing XP now depends on the type of fish. | ||||||
|  ! Woodcutting XP in experience.yml now uses the tree species names. Oak is now Generic, and Spruce is now Redwood. |  ! Woodcutting XP in experience.yml and Woodcutting double drops in config.yml now use the tree species names. Oak is now Generic, and Spruce is now Redwood. | ||||||
|  ! Red_Rose was replaced by Poppy, and so the key in experience.yml has been updated accordingly. |  ! Red_Rose was replaced by Poppy, and so the key in experience.yml has been updated accordingly. | ||||||
|  - Removed deprecated permission nodes |  - Removed deprecated permission nodes | ||||||
|  |  | ||||||
|   | |||||||
| @@ -5,6 +5,7 @@ import java.util.List; | |||||||
| import java.util.Set; | import java.util.Set; | ||||||
|  |  | ||||||
| import org.bukkit.Material; | import org.bukkit.Material; | ||||||
|  | import org.bukkit.TreeSpecies; | ||||||
| import org.bukkit.configuration.ConfigurationSection; | import org.bukkit.configuration.ConfigurationSection; | ||||||
| import org.bukkit.entity.EntityType; | import org.bukkit.entity.EntityType; | ||||||
|  |  | ||||||
| @@ -475,10 +476,7 @@ public class Config extends AutoUpdateConfigLoader { | |||||||
|     public double getTamingCOTWRange() { return config.getDouble("Skills.Taming.Call_Of_The_Wild.Range", 40.0D); } |     public double getTamingCOTWRange() { return config.getDouble("Skills.Taming.Call_Of_The_Wild.Range", 40.0D); } | ||||||
|  |  | ||||||
|     /* Woodcutting */ |     /* Woodcutting */ | ||||||
|     public boolean getOakDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Woodcutting.Oak", true); } |     public boolean getWoodcuttingDoubleDropsEnabled(TreeSpecies species) { return config.getBoolean("Double_Drops.Woodcutting." + StringUtils.getPrettyTreeSpeciesString(species).replace(" ", "_")); } | ||||||
|     public boolean getBirchDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Woodcutting.Birch", true); } |  | ||||||
|     public boolean getSpruceDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Woodcutting.Spruce", true); } |  | ||||||
|     public boolean getJungleDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Woodcutting.Jungle", true); } |  | ||||||
|     public boolean getTreeFellerSoundsEnabled() { return config.getBoolean("Skills.Woodcutting.Tree_Feller_Sounds", true); } |     public boolean getTreeFellerSoundsEnabled() { return config.getBoolean("Skills.Woodcutting.Tree_Feller_Sounds", true); } | ||||||
|  |  | ||||||
|     /* AFK Leveling */ |     /* AFK Leveling */ | ||||||
|   | |||||||
| @@ -75,36 +75,9 @@ public final class Woodcutting { | |||||||
|         if (mcMMO.getModManager().isCustomLog(blockState) && mcMMO.getModManager().getBlock(blockState).isDoubleDropEnabled()) { |         if (mcMMO.getModManager().isCustomLog(blockState) && mcMMO.getModManager().getBlock(blockState).isDoubleDropEnabled()) { | ||||||
|             Misc.dropItems(blockState.getLocation(), blockState.getBlock().getDrops()); |             Misc.dropItems(blockState.getLocation(), blockState.getBlock().getDrops()); | ||||||
|         } |         } | ||||||
|         else { |         else if (Config.getInstance().getWoodcuttingDoubleDropsEnabled(((Tree) blockState.getData()).getSpecies())) { | ||||||
|             switch (((Tree) blockState.getData()).getSpecies()) { |  | ||||||
|                 case GENERIC: |  | ||||||
|                     if (Config.getInstance().getOakDoubleDropsEnabled()) { |  | ||||||
|             Misc.dropItems(blockState.getLocation(), blockState.getBlock().getDrops()); |             Misc.dropItems(blockState.getLocation(), blockState.getBlock().getDrops()); | ||||||
|         } |         } | ||||||
|                     return; |  | ||||||
|  |  | ||||||
|                 case REDWOOD: |  | ||||||
|                     if (Config.getInstance().getSpruceDoubleDropsEnabled()) { |  | ||||||
|                         Misc.dropItems(blockState.getLocation(), blockState.getBlock().getDrops()); |  | ||||||
|                     } |  | ||||||
|                     return; |  | ||||||
|  |  | ||||||
|                 case BIRCH: |  | ||||||
|                     if (Config.getInstance().getBirchDoubleDropsEnabled()) { |  | ||||||
|                         Misc.dropItems(blockState.getLocation(), blockState.getBlock().getDrops()); |  | ||||||
|                     } |  | ||||||
|                     return; |  | ||||||
|  |  | ||||||
|                 case JUNGLE: |  | ||||||
|                     if (Config.getInstance().getJungleDoubleDropsEnabled()) { |  | ||||||
|                         Misc.dropItems(blockState.getLocation(), blockState.getBlock().getDrops()); |  | ||||||
|                     } |  | ||||||
|                     return; |  | ||||||
|  |  | ||||||
|                 default: |  | ||||||
|                     return; |  | ||||||
|             } |  | ||||||
|         } |  | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     /** |     /** | ||||||
|   | |||||||
| @@ -382,10 +382,12 @@ Double_Drops: | |||||||
|         Sandstone: true |         Sandstone: true | ||||||
|         Stone: true |         Stone: true | ||||||
|     Woodcutting: |     Woodcutting: | ||||||
|         Oak: true |         Acacia: true | ||||||
|         Birch: true |         Birch: true | ||||||
|         Spruce: true |         Dark_Oak: true | ||||||
|  |         Generic: true | ||||||
|         Jungle: true |         Jungle: true | ||||||
|  |         Redwood: true | ||||||
|  |  | ||||||
| # | # | ||||||
| #  Settings for commands | #  Settings for commands | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 TfT_02
					TfT_02