Update canBind() for spirits.

This commit is contained in:
jedk1 2016-03-10 18:32:11 +00:00
parent a922b8bd17
commit 995b20f7e0

View file

@ -28,6 +28,8 @@ import com.projectkorra.projectkorra.event.PlayerCooldownChangeEvent;
import com.projectkorra.projectkorra.event.PlayerCooldownChangeEvent.Result;
import com.projectkorra.projectkorra.storage.DBConnection;
import com.projectkorra.projectkorra.waterbending.Bloodbending;
import com.projectkorra.spirits.SpiritElement;
import com.projectkorra.spirits.SpiritPlayer;
/**
* Class that presents a player and stores all bending information about the player.
@ -241,6 +243,17 @@ public class BendingPlayer {
if (!hasElement(subElement.getParentElement())) {
return false;
}
if (GeneralMethods.hasSpirits()) {
if (GeneralMethods.hasSpirits()) {
SpiritPlayer sPlayer = SpiritPlayer.getSpiritPlayer(player);
if (subElement.equals(SpiritElement.DARK) && sPlayer.isLightSpirit()) {
return false;
}
if (subElement.equals(SpiritElement.LIGHT) && sPlayer.isDarkSpirit()) {
return false;
}
}
}
}
return true;
}