mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-12-22 03:45:10 +01:00
Merge branch 'development' into dev-quests
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
package emu.grasscutter.server.packet.send;
|
||||
|
||||
import emu.grasscutter.game.player.Player;
|
||||
import emu.grasscutter.net.packet.BasePacket;
|
||||
import emu.grasscutter.net.packet.PacketOpcodes;
|
||||
import emu.grasscutter.net.proto.AllWidgetDataNotifyOuterClass.AllWidgetDataNotify;
|
||||
import emu.grasscutter.net.proto.LunchBoxDataOuterClass;
|
||||
import emu.grasscutter.net.proto.WidgetSlotDataOuterClass;
|
||||
import emu.grasscutter.net.proto.WidgetSlotTagOuterClass;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class PacketAllWidgetDataNotify extends BasePacket {
|
||||
|
||||
public PacketAllWidgetDataNotify(Player player) {
|
||||
super(PacketOpcodes.AllWidgetDataNotify);
|
||||
|
||||
// TODO: Implement this
|
||||
|
||||
AllWidgetDataNotify.Builder proto = AllWidgetDataNotify.newBuilder()
|
||||
// If you want to implement this, feel free to do so. :)
|
||||
.setLunchBoxData(
|
||||
LunchBoxDataOuterClass.LunchBoxData.newBuilder().build()
|
||||
)
|
||||
// Maybe it's a little difficult, or it makes you upset :(
|
||||
.addAllOneoffGatherPointDetectorDataList(List.of())
|
||||
// So, goodbye, and hopefully sometime in the future o(* ̄▽ ̄*)ブ
|
||||
.addAllCoolDownGroupDataList(List.of())
|
||||
// I'll see your PR with a title that says (・∀・(・∀・(・∀・*)
|
||||
.addAllAnchorPointList(List.of())
|
||||
// "Complete implementation of widget functionality" b( ̄▽ ̄)d
|
||||
.addAllClientCollectorDataList(List.of())
|
||||
// Good luck, my boy.
|
||||
.addAllNormalCoolDownDataList(List.of());
|
||||
|
||||
if (player.getWidgetId() == null) {
|
||||
proto.addAllSlotList(List.of());
|
||||
} else {
|
||||
proto.addSlotList(
|
||||
WidgetSlotDataOuterClass.WidgetSlotData.newBuilder()
|
||||
.setIsActive(true)
|
||||
.setMaterialId(player.getWidgetId())
|
||||
.build()
|
||||
);
|
||||
|
||||
proto.addSlotList(
|
||||
WidgetSlotDataOuterClass.WidgetSlotData.newBuilder()
|
||||
.setTag(WidgetSlotTagOuterClass.WidgetSlotTag.WIDGET_SLOT_ATTACH_AVATAR)
|
||||
.build()
|
||||
);
|
||||
}
|
||||
|
||||
AllWidgetDataNotify protoData = proto.build();
|
||||
|
||||
this.setData(protoData);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
package emu.grasscutter.server.packet.send;
|
||||
|
||||
import emu.grasscutter.game.player.Player;
|
||||
import emu.grasscutter.net.packet.BasePacket;
|
||||
import emu.grasscutter.net.packet.PacketOpcodes;
|
||||
import emu.grasscutter.net.proto.GetWidgetSlotRspOuterClass;
|
||||
import emu.grasscutter.net.proto.WidgetSlotDataOuterClass;
|
||||
import emu.grasscutter.net.proto.WidgetSlotTagOuterClass;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class PacketGetWidgetSlotRsp extends BasePacket {
|
||||
|
||||
public PacketGetWidgetSlotRsp(Player player) {
|
||||
super(PacketOpcodes.GetWidgetSlotRsp);
|
||||
|
||||
GetWidgetSlotRspOuterClass.GetWidgetSlotRsp.Builder proto =
|
||||
GetWidgetSlotRspOuterClass.GetWidgetSlotRsp.newBuilder();
|
||||
|
||||
if (player.getWidgetId() == null) {
|
||||
proto.addAllSlotList(List.of());
|
||||
} else {
|
||||
proto.addSlotList(
|
||||
WidgetSlotDataOuterClass.WidgetSlotData.newBuilder()
|
||||
.setIsActive(true)
|
||||
.setMaterialId(player.getWidgetId())
|
||||
.build()
|
||||
);
|
||||
|
||||
proto.addSlotList(
|
||||
WidgetSlotDataOuterClass.WidgetSlotData.newBuilder()
|
||||
.setTag(WidgetSlotTagOuterClass.WidgetSlotTag.WIDGET_SLOT_ATTACH_AVATAR)
|
||||
.build()
|
||||
);
|
||||
}
|
||||
|
||||
GetWidgetSlotRspOuterClass.GetWidgetSlotRsp protoData = proto.build();
|
||||
|
||||
this.setData(protoData);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package emu.grasscutter.server.packet.send;
|
||||
|
||||
import emu.grasscutter.net.packet.BasePacket;
|
||||
import emu.grasscutter.net.packet.PacketOpcodes;
|
||||
import emu.grasscutter.net.proto.SetWidgetSlotRspOuterClass;
|
||||
|
||||
public class PacketSetWidgetSlotRsp extends BasePacket {
|
||||
|
||||
public PacketSetWidgetSlotRsp(int materialId) {
|
||||
super(PacketOpcodes.SetWidgetSlotRsp);
|
||||
|
||||
SetWidgetSlotRspOuterClass.SetWidgetSlotRsp proto = SetWidgetSlotRspOuterClass.SetWidgetSlotRsp.newBuilder()
|
||||
.setMaterialId(materialId)
|
||||
.build();
|
||||
|
||||
this.setData(proto);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package emu.grasscutter.server.packet.send;
|
||||
|
||||
import emu.grasscutter.net.packet.BasePacket;
|
||||
import emu.grasscutter.net.packet.PacketOpcodes;
|
||||
import emu.grasscutter.net.proto.VehicleStaminaNotifyOuterClass.VehicleStaminaNotify;
|
||||
|
||||
public class PacketVehicleStaminaNotify extends BasePacket {
|
||||
|
||||
public PacketVehicleStaminaNotify(int vehicleId, float newStamina) {
|
||||
super(PacketOpcodes.VehicleStaminaNotify);
|
||||
VehicleStaminaNotify.Builder proto = VehicleStaminaNotify.newBuilder();
|
||||
|
||||
proto.setEntityId(vehicleId);
|
||||
proto.setCurStamina(newStamina);
|
||||
|
||||
this.setData(proto.build());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package emu.grasscutter.server.packet.send;
|
||||
|
||||
import emu.grasscutter.net.packet.BasePacket;
|
||||
import emu.grasscutter.net.packet.PacketOpcodes;
|
||||
import emu.grasscutter.net.proto.WidgetGadgetAllDataNotifyOuterClass.WidgetGadgetAllDataNotify;
|
||||
|
||||
public class PacketWidgetGadgetAllDataNotify extends BasePacket {
|
||||
|
||||
public PacketWidgetGadgetAllDataNotify() {
|
||||
super(PacketOpcodes.AllWidgetDataNotify);
|
||||
|
||||
WidgetGadgetAllDataNotify proto = WidgetGadgetAllDataNotify.newBuilder().build();
|
||||
|
||||
this.setData(proto);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package emu.grasscutter.server.packet.send;
|
||||
|
||||
import emu.grasscutter.net.packet.BasePacket;
|
||||
import emu.grasscutter.net.packet.PacketOpcodes;
|
||||
import emu.grasscutter.net.proto.WidgetSlotChangeNotifyOuterClass;
|
||||
import emu.grasscutter.net.proto.WidgetSlotDataOuterClass;
|
||||
import emu.grasscutter.net.proto.WidgetSlotOpOuterClass;
|
||||
|
||||
public class PacketWidgetSlotChangeNotify extends BasePacket {
|
||||
|
||||
public PacketWidgetSlotChangeNotify(WidgetSlotChangeNotifyOuterClass.WidgetSlotChangeNotify proto) {
|
||||
super(PacketOpcodes.WidgetSlotChangeNotify);
|
||||
|
||||
this.setData(proto);
|
||||
}
|
||||
|
||||
public PacketWidgetSlotChangeNotify(WidgetSlotOpOuterClass.WidgetSlotOp op) {
|
||||
super(PacketOpcodes.WidgetSlotChangeNotify);
|
||||
|
||||
WidgetSlotChangeNotifyOuterClass.WidgetSlotChangeNotify proto = WidgetSlotChangeNotifyOuterClass.WidgetSlotChangeNotify.newBuilder()
|
||||
.setOp(op)
|
||||
.setSlot(
|
||||
WidgetSlotDataOuterClass.WidgetSlotData.newBuilder()
|
||||
.setIsActive(true)
|
||||
.build()
|
||||
)
|
||||
.build();
|
||||
|
||||
this.setData(proto);
|
||||
}
|
||||
|
||||
public PacketWidgetSlotChangeNotify(int materialId) {
|
||||
super(PacketOpcodes.WidgetSlotChangeNotify);
|
||||
|
||||
WidgetSlotChangeNotifyOuterClass.WidgetSlotChangeNotify proto = WidgetSlotChangeNotifyOuterClass.WidgetSlotChangeNotify.newBuilder()
|
||||
.setSlot(
|
||||
WidgetSlotDataOuterClass.WidgetSlotData.newBuilder()
|
||||
.setIsActive(true)
|
||||
.setMaterialId(materialId)
|
||||
.build()
|
||||
)
|
||||
.build();
|
||||
|
||||
this.setData(proto);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user