mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-12-22 20:04:56 +01:00
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:
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user