added get set refuse soul stone

one may want an npc to not be able to be picked up by soul stone in any circumstance
This commit is contained in:
1whohears committed 2022-05-29 02:46:24 -05:00
1 parent 9fef65b194
commit fb0ff50994
4 files changed
+39 -12

No files matched your search

@@ -76,17 +76,19 @@ public class ItemSoulstoneEmpty extends Item {
return true;
if(entity instanceof EntityNPCInterface){
EntityNPCInterface npc = (EntityNPCInterface) entity;
if(npc.advanced.role == EnumRoleType.Companion){
if (npc.advanced.refuseSoulStone) return false;
if (npc.getFaction() != null && npc.getFaction().isFriendlyToPlayer(player)
&& CustomNpcs.SoulStoneFriendlyNPCs) return true;
if (npc.advanced.role == EnumRoleType.Companion){
RoleCompanion role = (RoleCompanion) npc.roleInterface;
if(role.getOwner() == player)
return true;
}
if(npc.advanced.role == EnumRoleType.Follower){
if (npc.advanced.role == EnumRoleType.Follower){
RoleFollower role = (RoleFollower) npc.roleInterface;
if(role.getOwner() == player)
return !role.refuseSoulStone;
}
if (npc.getFaction() != null && npc.getFaction().isFriendlyToPlayer(player) && CustomNpcs.SoulStoneFriendlyNPCs) return true;
return CustomNpcs.SoulStoneNPCs;
}
if (entity instanceof EntityAnimal) return CustomNpcs.SoulStoneAnimals;