Skip to content

Commit

Permalink
Attempt fix for Factions NPC extension errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Morphan1 committed Dec 9, 2014
1 parent 30e7d3c commit 329570c
Showing 1 changed file with 5 additions and 2 deletions.
@@ -1,6 +1,7 @@
package net.gnomeffinway.depenizen.extensions.factions;

import com.massivecraft.factions.entity.MPlayer;
import com.massivecraft.factions.entity.MPlayerColl;
import com.massivecraft.massivecore.util.IdUtil;
import net.aufdemrand.denizen.objects.Element;
import net.aufdemrand.denizen.objects.dNPC;
Expand Down Expand Up @@ -31,8 +32,10 @@ private FactionsPlayerNPCExtension(dObject obj) {
return;
}
player = MPlayer.get(IdUtil.getId(name));
if (player == null)
dB.echoError("No Factions player data found for '" + name + "'!");
if (player == null) {
// Attempt to force NPCs into Factions
player = MPlayerColl.get().create(IdUtil.getId(name));
}
}

MPlayer player = null;
Expand Down

0 comments on commit 329570c

Please sign in to comment.