mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 15:16:45 +01:00
Removed redundant if statement
This commit is contained in:
parent
d1b522b534
commit
94387045e4
@ -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
|
||||
byte type = x.getData();
|
||||
ItemStack item = new ItemStack(x.getType(), 1, (byte)0, type);
|
||||
|
||||
if(x.getType() == Material.LOG)
|
||||
if(!plugin.misc.blockWatchList.contains(x))
|
||||
{
|
||||
byte type = x.getData();
|
||||
ItemStack item = new ItemStack(x.getType(), 1, (byte)0, type);
|
||||
WoodCutting.woodCuttingProcCheck(player, x);
|
||||
int xp = 0;
|
||||
|
||||
if(!plugin.misc.blockWatchList.contains(x))
|
||||
switch(x.getData())
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
PP.addXP(SkillType.WOODCUTTING, xp, player);
|
||||
case 0:
|
||||
xp += LoadProperties.mpine;
|
||||
break;
|
||||
case 1:
|
||||
xp += LoadProperties.mspruce;
|
||||
break;
|
||||
case 2:
|
||||
xp += LoadProperties.mbirch;
|
||||
break;
|
||||
}
|
||||
|
||||
//Drop the block
|
||||
x.getWorld().dropItemNaturally(x.getLocation(), item);
|
||||
|
||||
//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));
|
||||
|
||||
//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);
|
||||
PP.addXP(SkillType.WOODCUTTING, xp, player);
|
||||
}
|
||||
|
||||
//Drop the block
|
||||
x.getWorld().dropItemNaturally(x.getLocation(), item);
|
||||
|
||||
//Remove the block
|
||||
x.setData((byte) 0);
|
||||
x.setType(Material.AIR);
|
||||
|
||||
//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);
|
||||
|
||||
//Remove the block
|
||||
x.setData((byte) 0);
|
||||
x.setType(Material.AIR);
|
||||
|
||||
//Damage the tool more if the Tree is larger
|
||||
durabilityLoss++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user