Citizens compatibility. Bug fix for Woodcutting/custom trees.

This commit is contained in:
nossr50 2012-08-14 14:09:49 -07:00
parent 3934392219
commit 7b47d32a96
3 changed files with 12 additions and 0 deletions

View File

@ -8,6 +8,8 @@ Key:
- Removal - Removal
Version 1.3.11 Version 1.3.11
+ Added compatibility with bow-wielding NPCs from Citizens/NPC mods
= Fixed bug where mcMMO could throw NPE errors if trees cut down were from a custom mod and had an id of 17
= Fixed bug where mcMMO would ignore other block-protection plugins for various abilities = Fixed bug where mcMMO would ignore other block-protection plugins for various abilities
Version 1.3.10 Version 1.3.10

View File

@ -18,6 +18,11 @@ public class ArcheryManager {
public ArcheryManager (Player player) { public ArcheryManager (Player player) {
this.player = player; this.player = player;
this.profile = Users.getProfile(player); this.profile = Users.getProfile(player);
//Compatibility with Citizens, Citizens NPCs won't create a profile so we'll check for it here
if(this.profile == null)
return;
this.skillLevel = profile.getSkillLevel(SkillType.ARCHERY); this.skillLevel = profile.getSkillLevel(SkillType.ARCHERY);
this.permissionsInstance = Permissions.getInstance(); this.permissionsInstance = Permissions.getInstance();
} }

View File

@ -385,6 +385,11 @@ public class WoodCutting {
} }
else { else {
TreeSpecies species = TreeSpecies.getByData(block.getData()); TreeSpecies species = TreeSpecies.getByData(block.getData());
//Apparently species can be null in certain cases (custom server mods?)
//https://github.com/mcMMO-Dev/mcMMO/issues/229
if(species == null)
return;
switch (species) { switch (species) {
case GENERIC: case GENERIC: