fix: albedo elevator doesn't work (#1845)

* Packet preparation

* elevator creation

* Make elevator work, scene time, entity removed event.

* Avoid referencing certain character name.
This commit is contained in:
hamusuke
2022-10-12 15:56:45 +09:00
committed by GitHub
parent f801fe0305
commit bf8ee32382
13 changed files with 2839 additions and 9 deletions

View File

@@ -0,0 +1,21 @@
package emu.grasscutter.server.packet.send;
import emu.grasscutter.game.entity.platform.EntityPlatform;
import emu.grasscutter.game.world.Scene;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.PlatformStartRouteNotifyOuterClass;
public class PacketPlatformStartRouteNotify extends BasePacket {
public PacketPlatformStartRouteNotify(int clientSequence, EntityPlatform entity, Scene scene) {
super(PacketOpcodes.PlatformStartRouteNotify, clientSequence);
var notify = PlatformStartRouteNotifyOuterClass.PlatformStartRouteNotify.newBuilder()
.setEntityId(entity.getId())
.setSceneTime(scene.getSceneTime())
.setPlatform(entity.onStartRoute())
.build();
this.setData(notify);
}
}

View File

@@ -0,0 +1,21 @@
package emu.grasscutter.server.packet.send;
import emu.grasscutter.game.entity.platform.EntityPlatform;
import emu.grasscutter.game.world.Scene;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.PlatformStopRouteNotifyOuterClass;
public class PacketPlatformStopRouteNotify extends BasePacket {
public PacketPlatformStopRouteNotify(int clientSequence, EntityPlatform entity, Scene scene) {
super(PacketOpcodes.PlatformStopRouteNotify, clientSequence);
var notify = PlatformStopRouteNotifyOuterClass.PlatformStopRouteNotify.newBuilder()
.setPlatform(entity.onStopRoute())
.setSceneTime(scene.getSceneTime())
.setEntityId(entity.getId())
.build();
this.setData(notify);
}
}

View File

@@ -6,15 +6,15 @@ import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.SceneTimeNotifyOuterClass.SceneTimeNotify;
public class PacketSceneTimeNotify extends BasePacket {
public PacketSceneTimeNotify(Player player) {
super(PacketOpcodes.SceneTimeNotify);
SceneTimeNotify proto = SceneTimeNotify.newBuilder()
.setSceneId(player.getSceneId())
.setSceneTime(0)
.setSceneTime(player.getScene().getSceneTime())
.build();
this.setData(proto);
}
}