Added custom kill types

This commit is contained in:
luisc committed 2022-02-02 22:11:49 -06:00
1 parent 7e0ff3c836
commit 47f41ff5b7
3 files changed
+26 -6

No files matched your search

@@ -308,7 +308,16 @@ public class ServerEventsHandler {
}
String name = entityName;
QuestKill quest = (QuestKill) data.quest.questInterface;
if(quest.targetType == 1 && !(entity instanceof EntityNPCInterface))
Class entityType = EntityNPCInterface.class;
if(quest.targetType == 2) {
try {
entityType = Class.forName(quest.customTargetType);
} catch (ClassNotFoundException notFoundException) {
continue;
}
}
if(quest.targetType > 0 && !(entityType.isInstance(entity)))
continue;
if(quest.targets.containsKey(entity.getCommandSenderName()))
name = entity.getCommandSenderName();