Run spotlessApply

This commit is contained in:
KingRainbow44
2023-04-18 17:17:55 -04:00
parent 75f163f704
commit ee298235c2
44 changed files with 598 additions and 424 deletions

View File

@@ -5,7 +5,6 @@ import emu.grasscutter.game.props.FightProperty;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.AvatarFightPropUpdateNotifyOuterClass.AvatarFightPropUpdateNotify;
import java.util.Map;
public class PacketAvatarFightPropUpdateNotify extends BasePacket {

View File

@@ -14,11 +14,14 @@ public class PacketAvatarTeamUpdateNotify extends BasePacket {
var teamManager = player.getTeamManager();
if (teamManager.isUsingTrialTeam()) {
proto.addAllTempAvatarGuidList(teamManager.getActiveTeam().stream()
.map(entity -> entity.getAvatar().getGuid()).toList());
proto.addAllTempAvatarGuidList(
teamManager.getActiveTeam().stream()
.map(entity -> entity.getAvatar().getGuid())
.toList());
} else {
teamManager.getTeams().forEach((key, value) ->
proto.putAvatarTeamMap(key, value.toProto(player)));
teamManager
.getTeams()
.forEach((key, value) -> proto.putAvatarTeamMap(key, value.toProto(player)));
}
this.setData(proto);

View File

@@ -10,9 +10,10 @@ public class PacketBuyResinRsp extends BasePacket {
public PacketBuyResinRsp(Player player, int ret) {
super(PacketOpcodes.BuyResinRsp);
this.setData(BuyResinRspOuterClass.BuyResinRsp.newBuilder()
.setCurValue(player.getProperty(PlayerProperty.PROP_PLAYER_RESIN))
.setRetcode(ret)
.build());
this.setData(
BuyResinRspOuterClass.BuyResinRsp.newBuilder()
.setCurValue(player.getProperty(PlayerProperty.PROP_PLAYER_RESIN))
.setRetcode(ret)
.build());
}
}

View File

@@ -12,9 +12,9 @@ public class PacketChangeGameTimeRsp extends BasePacket {
ChangeGameTimeRsp proto =
ChangeGameTimeRsp.newBuilder()
.setCurGameTime(player.getWorld().getGameTime())
.setExtraDays(extraDays)
.build();
.setCurGameTime(player.getWorld().getGameTime())
.setExtraDays(extraDays)
.build();
this.setData(proto);
}

View File

@@ -10,9 +10,7 @@ public class PacketDropHintNotify extends BasePacket {
public PacketDropHintNotify(int itemId, Vector position) {
super(PacketOpcodes.DropHintNotify);
var proto = DropHintNotify.newBuilder()
.addItemIdList(itemId)
.setPosition(position);
var proto = DropHintNotify.newBuilder().addItemIdList(itemId).setPosition(position);
this.setData(proto.build());
}

View File

@@ -5,7 +5,6 @@ import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.DungeonEntryInfoOuterClass.DungeonEntryInfo;
import emu.grasscutter.net.proto.DungeonEntryInfoRspOuterClass.DungeonEntryInfoRsp;
import java.util.Arrays;
import java.util.List;
@@ -36,19 +35,18 @@ public class PacketDungeonEntryInfoRsp extends BasePacket {
public PacketDungeonEntryInfoRsp(PointData pointData, List<Integer> additional) {
super(PacketOpcodes.DungeonEntryInfoRsp);
var packet = DungeonEntryInfoRsp.newBuilder()
.setPointId(pointData.getId());
var packet = DungeonEntryInfoRsp.newBuilder().setPointId(pointData.getId());
// Add dungeon IDs from the point data.
if (pointData.getDungeonIds() != null) {
Arrays.stream(pointData.getDungeonIds())
.forEach(id -> packet.addDungeonEntryList(
DungeonEntryInfo.newBuilder().setDungeonId(id)));
.forEach(
id -> packet.addDungeonEntryList(DungeonEntryInfo.newBuilder().setDungeonId(id)));
}
// Add additional dungeon IDs.
additional.forEach(id -> packet.addDungeonEntryList(
DungeonEntryInfo.newBuilder().setDungeonId(id)));
additional.forEach(
id -> packet.addDungeonEntryList(DungeonEntryInfo.newBuilder().setDungeonId(id)));
this.setData(packet);
}

View File

@@ -8,14 +8,15 @@ import emu.grasscutter.net.proto.ResinChangeNotifyOuterClass.ResinChangeNotify;
public class PacketResinChangeNotify extends BasePacket {
public PacketResinChangeNotify(Player player) {
public PacketResinChangeNotify(Player player) {
super(PacketOpcodes.ResinChangeNotify);
ResinChangeNotify proto = ResinChangeNotify.newBuilder()
.setCurValue(player.getProperty(PlayerProperty.PROP_PLAYER_RESIN))
.setNextAddTimestamp(player.getNextResinRefresh())
.setCurBuyCount(player.getResinBuyCount())
.build();
ResinChangeNotify proto =
ResinChangeNotify.newBuilder()
.setCurValue(player.getProperty(PlayerProperty.PROP_PLAYER_RESIN))
.setNextAddTimestamp(player.getNextResinRefresh())
.setCurBuyCount(player.getResinBuyCount())
.build();
this.setData(proto);
}

View File

@@ -7,17 +7,19 @@ import java.util.List;
public class PacketSceneAudioNotify extends BasePacket {
public PacketSceneAudioNotify(int sourceUid, List<Float> param2, List<String> param3, int type, List<Integer> param1) {
public PacketSceneAudioNotify(
int sourceUid, List<Float> param2, List<String> param3, int type, List<Integer> param1) {
super(PacketOpcodes.SceneAudioNotify);
SceneAudioNotifyOuterClass.SceneAudioNotify proto = SceneAudioNotifyOuterClass.SceneAudioNotify.newBuilder()
.setSourceUid(sourceUid)
.addAllParam2(param2)
.addAllParam3(param3)
.setType(type)
.addAllParam1(param1)
.build();
SceneAudioNotifyOuterClass.SceneAudioNotify proto =
SceneAudioNotifyOuterClass.SceneAudioNotify.newBuilder()
.setSourceUid(sourceUid)
.addAllParam2(param2)
.addAllParam3(param3)
.setType(type)
.addAllParam1(param1)
.build();
this.setData(proto);
}
}
}

View File

@@ -10,8 +10,10 @@ public final class PacketServerGlobalValueChangeNotify extends BasePacket {
public PacketServerGlobalValueChangeNotify(GameEntity entity, String abilityHash, int value) {
super(PacketOpcodes.ServerGlobalValueChangeNotify);
this.setData(ServerGlobalValueChangeNotify.newBuilder()
.setEntityId(entity.getId()).setValue(value)
.setKeyHash(Utils.abilityHash(abilityHash)));
this.setData(
ServerGlobalValueChangeNotify.newBuilder()
.setEntityId(entity.getId())
.setValue(value)
.setKeyHash(Utils.abilityHash(abilityHash)));
}
}

View File

@@ -5,13 +5,14 @@ import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.WorldChestOpenNotifyOuterClass.WorldChestOpenNotify;
public class PacketWorldChestOpenNotify extends BasePacket {
public PacketWorldChestOpenNotify(int groupId,int sceneId,int configId){
public PacketWorldChestOpenNotify(int groupId, int sceneId, int configId) {
super(PacketOpcodes.WorldChestOpenNotify);
this.setData(WorldChestOpenNotify.newBuilder()
.setGroupId(groupId)
.setSceneId(sceneId)
.setConfigId(configId)
.build());
this.setData(
WorldChestOpenNotify.newBuilder()
.setGroupId(groupId)
.setSceneId(sceneId)
.setConfigId(configId)
.build());
}
}