@@ -890,12 +890,24 @@ public void completeQuest(final Quester quester, final boolean allowMultiplayer)
890
890
}
891
891
issuedReward = true ;
892
892
}
893
- if (!rewards .getCustomRewards ().isEmpty ()) {
894
- issuedReward = true ;
895
- if (plugin .getConfigSettings ().getConsoleLogging () > 2 ) {
896
- for (final String s : rewards .getCustomRewards ().keySet ()) {
893
+ for (final String s : rewards .getCustomRewards ().keySet ()) {
894
+ CustomReward found = null ;
895
+ for (final CustomReward cr : plugin .getCustomRewards ()) {
896
+ if (cr .getName ().equalsIgnoreCase (s )) {
897
+ found = cr ;
898
+ break ;
899
+ }
900
+ }
901
+ if (found != null ) {
902
+ found .giveReward (player .getUniqueId (), rewards .getCustomRewards ().get (s ));
903
+ issuedReward = true ;
904
+ if (plugin .getConfigSettings ().getConsoleLogging () > 2 ) {
897
905
plugin .getLogger ().info (player .getUniqueId () + " was custom rewarded " + s );
898
906
}
907
+ } else {
908
+ plugin .getLogger ().warning ("Quester \" " + player .getName () + "\" completed the Quest \" "
909
+ + name + "\" , but the Custom Reward \" " + s
910
+ + "\" could not be found. Does it still exist?" );
899
911
}
900
912
}
901
913
@@ -1064,11 +1076,6 @@ public void completeQuest(final Quester quester, final boolean allowMultiplayer)
1064
1076
plugin .getLogger ().warning ("Failed to notify player: "
1065
1077
+ "Custom Reward does not have an assigned name" );
1066
1078
}
1067
- found .giveReward (p .getUniqueId (), rewards .getCustomRewards ().get (s ));
1068
- } else {
1069
- plugin .getLogger ().warning ("Quester \" " + player .getName () + "\" completed the Quest \" "
1070
- + name + "\" , but the Custom Reward \" " + s
1071
- + "\" could not be found. Does it still exist?" );
1072
1079
}
1073
1080
}
1074
1081
}
0 commit comments