[refactoring] Updated for multiproto 0.2 gadget refactoring

This commit is contained in:
hartie95 2024-08-19 18:38:09 +02:00
parent 76c45ba3a7
commit 36f584a81c
5 changed files with 11 additions and 6 deletions

View File

@ -135,8 +135,11 @@ public class BlossomManager extends BasePlayerDataManager {
.map(this.blossomSchedule::get);
scheduleOption.ifPresent(schedule -> schedule.getRemainingUid().addAll(playersUid));
return scheduleOption.map(schedule -> {
val proto = new BlossomChestInfo(schedule.getResin(), playersUid, playersUid);
val proto = new BlossomChestInfo();
proto.setQualifyUidList(playersUid);
proto.setRemainUidList(playersUid);
proto.setResin(schedule.getResin());
proto.setRefreshId(schedule.getRefreshId());
proto.setBlossomRefreshType(schedule.getRefreshType().getValue());
return proto;

View File

@ -17,7 +17,7 @@ public class HandlerProjectorOptionReq extends TypedPacketHandler<ProjectorOptio
Grasscutter.getLogger().debug("JUST SOME DEBUG " + req.getOpType());
if(session.getPlayer().getScene().getEntityById(req.getEntityId()) instanceof EntityGadget gadget) {
ProjectorOpType type = ProjectorOpType.values()[req.getOpType()];
ProjectorOpType type = req.getOpType();
if(type == ProjectorOpType.PROJECTOR_OP_CREATE) {
if(gadget.getState() != ScriptGadgetState.GearStart)
gadget.setState(ScriptGadgetState.GearStart);

View File

@ -16,7 +16,7 @@ import java.util.List;
public class PacketCreateVehicleRsp extends BaseTypedPacket<CreateVehicleRsp> {
public PacketCreateVehicleRsp(Player player, int vehicleId, int pointId, Position pos, Position rot) {
super(new CreateVehicleRsp(vehicleId, pointId));
super(new CreateVehicleRsp());
// Eject vehicle members and Kill previous vehicles if there are any
List<GameEntity> previousVehicles = player.getScene().getEntities().values().stream()

View File

@ -13,9 +13,10 @@ public class PacketGadgetInteractRsp extends BaseTypedPacket<GadgetInteractRsp>
}
public PacketGadgetInteractRsp(EntityBaseGadget gadget, InteractType interact, InterOpType opType) {
super(new GadgetInteractRsp(gadget.getId(), interact));
super(new GadgetInteractRsp(gadget.getId()));
proto.setGadgetId(gadget.getGadgetId());
proto.setInteractType(interact);
if (opType != null) {
proto.setOpType(opType);

View File

@ -1,11 +1,12 @@
package emu.grasscutter.server.packet.send;
import emu.grasscutter.net.packet.BaseTypedPacket;
import org.anime_game_servers.multi_proto.gi.messages.gadget.ProjectorOpType;
import org.anime_game_servers.multi_proto.gi.messages.gadget.ProjectorOptionRsp;
public class PacketProjectorOptionRsp extends BaseTypedPacket<ProjectorOptionRsp> {
public PacketProjectorOptionRsp(int entityId, int opType, int retcode) {
super(new ProjectorOptionRsp(opType, entityId, retcode));
public PacketProjectorOptionRsp(int entityId, ProjectorOpType opType, int retcode) {
super(new ProjectorOptionRsp(entityId, opType, retcode));
}
}