mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-23 16:16:46 +00:00
Refactor Revive Command + fix syntax error
No idea how I missed the syntax error while reviewing
This commit is contained in:
parent
18707f9309
commit
eb44fc88c4
@ -1,33 +1,33 @@
|
||||
package emu.grasscutter.command.commands;
|
||||
|
||||
import emu.grasscutter.command.Command;
|
||||
import emu.grasscutter.command.CommandHandler;
|
||||
import emu.grasscutter.game.GenshinPlayer;
|
||||
import emu.grasscutter.game.TeamManager;
|
||||
//import emu.grasscutter.game.avatar.GenshinAvatar;
|
||||
//import emu.grasscutter.game.TeamInfo;
|
||||
import emu.grasscutter.game.entity.EntityAvatar;
|
||||
import emu.grasscutter.game.props.FightProperty;
|
||||
import emu.grasscutter.server.packet.send.PacketAvatarFightPropUpdateNotify;
|
||||
import emu.grasscutter.server.packet.send.PacketAvatarLifeStateChangeNotify;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Command(label = "revive", aliases = {"rev"},
|
||||
usage = "revive|rev", description = "Revive character(s) that died)")
|
||||
public class Revive implements CommandHandler {
|
||||
//private Object teamId;
|
||||
|
||||
@Override
|
||||
public void execute(GenshinPlayer player, List<String> args) {
|
||||
for (EntityAvatar entity2 : TeamManager.getActiveTeam()) {
|
||||
entity2.setFightProperty(
|
||||
FightProperty.FIGHT_PROP_CUR_HP,
|
||||
entity2.getFightProperty(FightProperty.FIGHT_PROP_MAX_HP) * .4f
|
||||
);
|
||||
player.sendPacket(new PacketAvatarFightPropUpdateNotify(entity2.getAvatar(), FightProperty.FIGHT_PROP_CUR_HP));
|
||||
player.sendPacket(new PacketAvatarLifeStateChangeNotify(entity2.getAvatar()));
|
||||
}
|
||||
player.dropMessage("Character revived.");
|
||||
}
|
||||
}
|
||||
package emu.grasscutter.command.commands;
|
||||
|
||||
import emu.grasscutter.command.Command;
|
||||
import emu.grasscutter.command.CommandHandler;
|
||||
import emu.grasscutter.game.GenshinPlayer;
|
||||
import emu.grasscutter.game.TeamManager;
|
||||
//import emu.grasscutter.game.avatar.GenshinAvatar;
|
||||
//import emu.grasscutter.game.TeamInfo;
|
||||
import emu.grasscutter.game.entity.EntityAvatar;
|
||||
import emu.grasscutter.game.props.FightProperty;
|
||||
import emu.grasscutter.server.packet.send.PacketAvatarFightPropUpdateNotify;
|
||||
import emu.grasscutter.server.packet.send.PacketAvatarLifeStateChangeNotify;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Command(label = "revive", aliases = {"rev"},
|
||||
usage = "revive|rev", description = "Revive character(s) that died)")
|
||||
public class ReviveCommand implements CommandHandler {
|
||||
//private Object teamId;
|
||||
|
||||
@Override
|
||||
public void execute(GenshinPlayer player, List<String> args) {
|
||||
for (EntityAvatar entity2 : player.getTeamManager().getActiveTeam()) {
|
||||
entity2.setFightProperty(
|
||||
FightProperty.FIGHT_PROP_CUR_HP,
|
||||
entity2.getFightProperty(FightProperty.FIGHT_PROP_MAX_HP) * .4f
|
||||
);
|
||||
player.sendPacket(new PacketAvatarFightPropUpdateNotify(entity2.getAvatar(), FightProperty.FIGHT_PROP_CUR_HP));
|
||||
player.sendPacket(new PacketAvatarLifeStateChangeNotify(entity2.getAvatar()));
|
||||
}
|
||||
player.dropMessage("Character revived.");
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user