mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-01-24 15:42:53 +08:00
fix: ConcurrentModificationError by removing gadget (#1849)
This commit is contained in:
parent
558471237a
commit
ef55e5515c
@ -1,7 +1,7 @@
|
||||
package emu.grasscutter.game.entity;
|
||||
|
||||
import emu.grasscutter.game.entity.platform.EntitySolarIsotomaElevatorPlatform;
|
||||
import emu.grasscutter.game.entity.platform.EntityPlatform;
|
||||
import emu.grasscutter.game.entity.platform.EntitySolarIsotomaElevatorPlatform;
|
||||
import emu.grasscutter.game.player.Player;
|
||||
import emu.grasscutter.game.world.Scene;
|
||||
import emu.grasscutter.net.proto.EvtCreateGadgetNotifyOuterClass;
|
||||
@ -21,13 +21,11 @@ public class EntitySolarIsotomaClientGadget extends EntityClientGadget {
|
||||
//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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user