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,33 @@
package emu.grasscutter.game.entity;
import emu.grasscutter.game.entity.platform.EntitySolarIsotomaElevatorPlatform;
import emu.grasscutter.game.entity.platform.EntityPlatform;
import emu.grasscutter.game.player.Player;
import emu.grasscutter.game.world.Scene;
import emu.grasscutter.net.proto.EvtCreateGadgetNotifyOuterClass;
import lombok.Getter;
public class EntitySolarIsotomaClientGadget extends EntityClientGadget {
public static final int GADGET_ID = 41038001;
public static final int ELEVATOR_GADGET_ID = 41038002;
@Getter private EntityPlatform platformGadget;
public EntitySolarIsotomaClientGadget(Scene scene, Player player, EvtCreateGadgetNotifyOuterClass.EvtCreateGadgetNotify notify) {
super(scene, player, notify);
}
@Override
public void onCreate() {
//Create solar isotoma elevator and send to all.
this.platformGadget = new EntitySolarIsotomaElevatorPlatform(this, getScene(), getOwner(), ELEVATOR_GADGET_ID, getPosition(), getRotation());
getScene().addEntity(this.platformGadget);
getOwner().getTeamManager().getGadgets().add(this.platformGadget);
}
@Override
public void onRemoved() {
//Remove solar isotoma elevator entity.
getScene().removeEntity(this.platformGadget);
getOwner().getTeamManager().getGadgets().remove(this.platformGadget);
}
}