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