Format code [skip actions]

This commit is contained in:
github-actions 2023-06-04 21:57:29 +00:00
parent c40213affc
commit ddb76a0c2a
5 changed files with 21 additions and 17 deletions

View File

@ -3,9 +3,8 @@ package emu.grasscutter.data.binout;
import com.google.gson.annotations.SerializedName;
import emu.grasscutter.data.common.DynamicFloat;
import emu.grasscutter.game.props.ElementType;
import lombok.ToString;
import java.io.Serializable;
import lombok.ToString;
public class AbilityModifier implements Serializable {
private static final long serialVersionUID = -2001232313615923575L;

View File

@ -3,9 +3,8 @@ package emu.grasscutter.game.ability;
import emu.grasscutter.Grasscutter;
import emu.grasscutter.data.binout.AbilityMixinData;
import emu.grasscutter.data.binout.AbilityModifier.AbilityModifierAction;
import lombok.AllArgsConstructor;
import java.util.Map;
import lombok.AllArgsConstructor;
@SuppressWarnings("ALL")
public class AbilityLocalIdGenerator {
@ -30,8 +29,8 @@ public class AbilityLocalIdGenerator {
this.type = type;
}
public void initializeActionLocalIds(AbilityModifierAction actions[], Map<Integer, AbilityModifierAction> localIdToAction)
{
public void initializeActionLocalIds(
AbilityModifierAction actions[], Map<Integer, AbilityModifierAction> localIdToAction) {
this.initializeActionLocalIds(actions, localIdToAction, false);
}
@ -52,7 +51,9 @@ public class AbilityLocalIdGenerator {
else {
if (actions[i].successActions != null)
this.initializeActionLocalIds(
actions[i].successActions, localIdToAction, true); // Need to check this specific order
actions[i].successActions,
localIdToAction,
true); // Need to check this specific order
if (actions[i].failActions != null)
this.initializeActionLocalIds(actions[i].failActions, localIdToAction, true);
}

View File

@ -29,8 +29,8 @@ public final class ActionGenerateElemBall extends AbilityActionHandler {
return false;
}
//Check if we should allow elem ball generation
if(action.dropType == DropType.LevelControl) {
// Check if we should allow elem ball generation
if (action.dropType == DropType.LevelControl) {
String levelEntityConfig = owner.getScene().getSceneData().getLevelEntityConfig();
ConfigLevelEntity config = GameData.getConfigLevelEntityDataMap().get(levelEntityConfig);
if (config != null
@ -39,8 +39,8 @@ public final class ActionGenerateElemBall extends AbilityActionHandler {
Grasscutter.getLogger().warn("This level config don't allow element balls");
return true;
}
} else if(action.dropType == DropType.BigWorldOnly) {
if(owner.getScene().getSceneData().getSceneType() != SceneType.SCENE_WORLD) {
} else if (action.dropType == DropType.BigWorldOnly) {
if (owner.getScene().getSceneData().getSceneType() != SceneType.SCENE_WORLD) {
Grasscutter.getLogger().warn("This level config only allows element balls on big world");
return true;
}

View File

@ -2,7 +2,6 @@ package emu.grasscutter.game.ability.actions;
import com.google.protobuf.ByteString;
import com.google.protobuf.InvalidProtocolBufferException;
import emu.grasscutter.Grasscutter;
import emu.grasscutter.data.binout.AbilityModifier.AbilityModifierAction;
import emu.grasscutter.game.ability.Ability;
@ -12,7 +11,8 @@ import emu.grasscutter.net.proto.AbilityActionSetRandomOverrideMapValueOuterClas
@AbilityAction(AbilityModifierAction.Type.SetRandomOverrideMapValue)
public class ActionSetRandomOverrideMapValue extends AbilityActionHandler {
@Override
public boolean execute(Ability ability, AbilityModifierAction action, ByteString abilityData, GameEntity target) {
public boolean execute(
Ability ability, AbilityModifierAction action, ByteString abilityData, GameEntity target) {
AbilityActionSetRandomOverrideMapValue valueProto;
try {
valueProto = AbilityActionSetRandomOverrideMapValue.parseFrom(abilityData);
@ -24,8 +24,13 @@ public class ActionSetRandomOverrideMapValue extends AbilityActionHandler {
float valueRangeMin = action.valueRangeMin.get(ability);
float valueRangeMax = action.valueRangeMax.get(ability);
if(value < valueRangeMin || value > valueRangeMax) {
Grasscutter.getLogger().warn("Tried setting value out of range: {} inside [{}, {}]", value, valueRangeMin, valueRangeMax);
if (value < valueRangeMin || value > valueRangeMax) {
Grasscutter.getLogger()
.warn(
"Tried setting value out of range: {} inside [{}, {}]",
value,
valueRangeMin,
valueRangeMax);
return true;
}

View File

@ -7,11 +7,10 @@ import emu.grasscutter.data.common.DynamicFloat;
import emu.grasscutter.game.world.*;
import it.unimi.dsi.fastutil.floats.FloatArrayList;
import it.unimi.dsi.fastutil.ints.*;
import lombok.val;
import java.io.IOException;
import java.lang.reflect.Field;
import java.util.*;
import lombok.val;
public interface JsonAdapters {
class DynamicFloatAdapter extends TypeAdapter<DynamicFloat> {