mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 21:26:46 +01:00
Started moving stuff from mcBlockListener into their respective skill
files.
This commit is contained in:
parent
3d401ac4cb
commit
3e62697567
@ -1,7 +1,7 @@
|
||||
Changelog:
|
||||
#Versions without changelogs probably had very small misc fixes, like tweaks to the source code
|
||||
|
||||
Version 1.2.10
|
||||
Version 2.0-dev
|
||||
|
||||
Version 1.2.09
|
||||
- Fixed issue with Repair Mastery (Issue #47)
|
||||
|
@ -157,6 +157,7 @@ public class mcBlockListener implements Listener
|
||||
/*
|
||||
* MINING
|
||||
*/
|
||||
|
||||
if(mcPermissions.getInstance().mining(player))
|
||||
{
|
||||
if(LoadProperties.miningrequirespickaxe)
|
||||
@ -170,47 +171,24 @@ public class mcBlockListener implements Listener
|
||||
Mining.miningBlockCheck(player, block, plugin);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* WOOD CUTTING
|
||||
*/
|
||||
|
||||
if(player != null && block.getTypeId() == 17 && mcPermissions.getInstance().woodcutting(player))
|
||||
if(mcPermissions.getInstance().woodcutting(player))
|
||||
{
|
||||
if(LoadProperties.woodcuttingrequiresaxe)
|
||||
{
|
||||
if(m.isAxes(inhand))
|
||||
{
|
||||
if(!plugin.misc.blockWatchList.contains(block))
|
||||
{
|
||||
WoodCutting.woodCuttingProcCheck(player, block);
|
||||
//Default
|
||||
if(block.getData() == (byte)0)
|
||||
PP.addXP(SkillType.WOODCUTTING, LoadProperties.mpine, player);
|
||||
//Spruce
|
||||
if(block.getData() == (byte)1)
|
||||
PP.addXP(SkillType.WOODCUTTING, LoadProperties.mspruce, player);
|
||||
//Birch
|
||||
if(block.getData() == (byte)2)
|
||||
PP.addXP(SkillType.WOODCUTTING, LoadProperties.mbirch, player);
|
||||
}
|
||||
WoodCutting.woodcuttingBlockCheck(player, block, plugin);
|
||||
}
|
||||
} else
|
||||
{
|
||||
if(!plugin.misc.blockWatchList.contains(block))
|
||||
{
|
||||
WoodCutting.woodCuttingProcCheck(player, block);
|
||||
//Default
|
||||
if(block.getData() == (byte)0)
|
||||
PP.addXP(SkillType.WOODCUTTING, LoadProperties.mpine, player);
|
||||
//Spruce
|
||||
if(block.getData() == (byte)1)
|
||||
PP.addXP(SkillType.WOODCUTTING, LoadProperties.mspruce, player);
|
||||
//Birch
|
||||
if(block.getData() == (byte)2)
|
||||
PP.addXP(SkillType.WOODCUTTING, LoadProperties.mbirch, player);
|
||||
}
|
||||
WoodCutting.woodcuttingBlockCheck(player, block, plugin);
|
||||
}
|
||||
Skills.XpCheckSkill(SkillType.WOODCUTTING, player);
|
||||
|
||||
/*
|
||||
* IF PLAYER IS USING TREEFELLER
|
||||
|
@ -166,4 +166,34 @@ public class WoodCutting
|
||||
isdone = false;
|
||||
}
|
||||
}
|
||||
|
||||
public static void woodcuttingBlockCheck(Player player, Block block, mcMMO plugin)
|
||||
{
|
||||
PlayerProfile PP = Users.getProfile(player);
|
||||
int xp = 0;
|
||||
byte data = block.getData();
|
||||
|
||||
if(plugin.misc.blockWatchList.contains(block))
|
||||
return;
|
||||
|
||||
switch(data)
|
||||
{
|
||||
case 0:
|
||||
xp += LoadProperties.mpine;
|
||||
break;
|
||||
case 1:
|
||||
xp += LoadProperties.mspruce;
|
||||
break;
|
||||
case 2:
|
||||
xp += LoadProperties.mbirch;
|
||||
break;
|
||||
}
|
||||
|
||||
if(block.getTypeId() == 17)
|
||||
WoodCutting.woodCuttingProcCheck(player, block);
|
||||
|
||||
PP.addXP(SkillType.WOODCUTTING, xp, player);
|
||||
Skills.XpCheckSkill(SkillType.WOODCUTTING, player);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user