mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-22 20:03:21 +00:00
Add more information to the 'unknown condition handler' message
This commit is contained in:
parent
02a9c55b0f
commit
82b193945e
@ -20,9 +20,6 @@ public class BasicActivityConditionExecutor implements ActivityConditionExecutor
|
||||
private final Int2ObjectMap<PlayerActivityData> playerActivityDataByActivityCondId;
|
||||
private final Map<ActivityConditions, ActivityConditionBaseHandler> activityConditionsHandlers;
|
||||
|
||||
private static final UnknownActivityConditionHandler UNKNOWN_CONDITION_HANDLER =
|
||||
new UnknownActivityConditionHandler();
|
||||
|
||||
public BasicActivityConditionExecutor(
|
||||
Map<Integer, ActivityConfigItem> activityConfigItemMap,
|
||||
Int2ObjectMap<ActivityCondExcelConfigData> activityConditions,
|
||||
@ -66,7 +63,7 @@ public class BasicActivityConditionExecutor implements ActivityConditionExecutor
|
||||
(BooleanSupplier)
|
||||
() ->
|
||||
activityConditionsHandlers
|
||||
.getOrDefault(c.getType(), UNKNOWN_CONDITION_HANDLER)
|
||||
.getOrDefault(c.getType(), new UnknownActivityConditionHandler(c.getType()))
|
||||
.execute(activity, activityConfig, c.paramArray()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
|
@ -4,14 +4,19 @@ import emu.grasscutter.Grasscutter;
|
||||
import emu.grasscutter.game.activity.ActivityConfigItem;
|
||||
import emu.grasscutter.game.activity.PlayerActivityData;
|
||||
import emu.grasscutter.game.activity.condition.ActivityConditionBaseHandler;
|
||||
import emu.grasscutter.game.activity.condition.ActivityConditions;
|
||||
import lombok.AllArgsConstructor;
|
||||
|
||||
/** This class is used when condition was not found */
|
||||
@AllArgsConstructor
|
||||
public class UnknownActivityConditionHandler extends ActivityConditionBaseHandler {
|
||||
private final ActivityConditions conditions;
|
||||
|
||||
@Override
|
||||
public boolean execute(
|
||||
PlayerActivityData activityData, ActivityConfigItem activityConfig, int... params) {
|
||||
Grasscutter.getLogger().error("Called unknown condition handler");
|
||||
Grasscutter.getLogger().error("Called unknown condition handler {}.",
|
||||
conditions.name());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user