2
0
Эх сурвалжийг харах

Merge branch 'master' of github.com:mcMMO-Dev/mcMMO

nossr50 13 жил өмнө
parent
commit
86166a58e1

+ 42 - 41
src/main/java/com/gmail/nossr50/skills/WoodCutting.java

@@ -70,56 +70,57 @@ public class WoodCutting
             
             if(m.blockBreakSimulate(x, player))
             {
-                if(x.getType() == Material.LOG || x.getType() == Material.LEAVES)
+                if(x.getType() == Material.LOG)
                 {
-                    durabilityLoss++; //Damage the tool more if the Tree is larger
-                    
-                    if(x.getType() == Material.LOG)
-                    {
-                        byte type = x.getData();
-                        ItemStack item = new ItemStack(x.getType(), 1, (byte)0, type);
+                    byte type = x.getData();
+                    ItemStack item = new ItemStack(x.getType(), 1, (byte)0, type);
                         
-                        if(!plugin.misc.blockWatchList.contains(x))
-                        {
-                            WoodCutting.woodCuttingProcCheck(player, x);
-                            int xp = 0;
-                            
-                            switch(x.getData())
-                            {
-                                case 0:
-                                    xp += LoadProperties.mpine;
-                                    break;
-                                case 1:
-                                    xp += LoadProperties.mspruce;
-                                    break;
-                                case 2:
-                                    xp += LoadProperties.mbirch;
-                                    break;
-                            }
+                    if(!plugin.misc.blockWatchList.contains(x))
+                    {
+                        WoodCutting.woodCuttingProcCheck(player, x);
+                        int xp = 0;
                             
-                            PP.addXP(SkillType.WOODCUTTING, xp, player);
+                        switch(x.getData())
+                        {
+                            case 0:
+                                xp += LoadProperties.mpine;
+                                break;
+                            case 1:
+                                xp += LoadProperties.mspruce;
+                                break;
+                            case 2:
+                                xp += LoadProperties.mbirch;
+                                break;
                         }
+                            
+                        PP.addXP(SkillType.WOODCUTTING, xp, player);
+                    }
                         
-                        //Drop the block
-                        x.getWorld().dropItemNaturally(x.getLocation(), item);
+                    //Drop the block
+                    x.getWorld().dropItemNaturally(x.getLocation(), item);
                         
-                        //Remove the block
-                        x.setData((byte) 0);
-                        x.setType(Material.AIR);
+                    //Remove the block
+                    x.setData((byte) 0);
+                    x.setType(Material.AIR);
                         
-                    } else if(x.getType() == Material.LEAVES) 
-                    {
-                        Material mat = Material.SAPLING;
-                        ItemStack item = new ItemStack(mat, 1, (short)0, (byte)(x.getData()-8));
+                    //Damage the tool more if the Tree is larger
+                    durabilityLoss++;
+                        
+                } else if(x.getType() == Material.LEAVES) 
+                {
+                    Material mat = Material.SAPLING;
+                    ItemStack item = new ItemStack(mat, 1, (short)0, (byte)(x.getData()-8));
                         
-                        //1 in 10 chance to drop sapling
-                        if(Math.random() * 10 > 9)
-                            m.mcDropItem(x.getLocation(), item);
+                    //1 in 10 chance to drop sapling
+                    if(Math.random() * 10 > 9)
+                        m.mcDropItem(x.getLocation(), item);
                         
-                        //Remove the block
-                        x.setData((byte) 0);
-                        x.setType(Material.AIR);
-                    }
+                    //Remove the block
+                    x.setData((byte) 0);
+                    x.setType(Material.AIR);
+                        
+                    //Damage the tool more if the Tree is larger
+                    durabilityLoss++;
                 }
             }
         }