mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2026-05-18 11:31:18 +08:00
Initial commit
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
package emu.grasscutter.server.packet.send;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import emu.grasscutter.game.inventory.GenshinItem;
|
||||
import emu.grasscutter.game.props.ActionReason;
|
||||
import emu.grasscutter.net.packet.GenshinPacket;
|
||||
import emu.grasscutter.net.packet.PacketOpcodes;
|
||||
import emu.grasscutter.net.proto.ItemAddHintNotifyOuterClass.ItemAddHintNotify;
|
||||
|
||||
public class PacketItemAddHintNotify extends GenshinPacket {
|
||||
|
||||
public PacketItemAddHintNotify(GenshinItem item, ActionReason reason) {
|
||||
super(PacketOpcodes.ItemAddHintNotify);
|
||||
|
||||
ItemAddHintNotify proto = ItemAddHintNotify.newBuilder()
|
||||
.addItemList(item.toItemHintProto())
|
||||
.setReason(reason.getValue())
|
||||
.build();
|
||||
|
||||
this.setData(proto);
|
||||
}
|
||||
|
||||
public PacketItemAddHintNotify(List<GenshinItem> items, ActionReason reason) {
|
||||
super(PacketOpcodes.ItemAddHintNotify);
|
||||
|
||||
ItemAddHintNotify.Builder proto = ItemAddHintNotify.newBuilder()
|
||||
.setReason(reason.getValue());
|
||||
|
||||
for (GenshinItem item : items) {
|
||||
proto.addItemList(item.toItemHintProto());
|
||||
}
|
||||
|
||||
this.setData(proto);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user