Skip to content
Snippets Groups Projects
Unverified Commit ef55e551 authored by hamusuke's avatar hamusuke Committed by GitHub
Browse files

fix: ConcurrentModificationError by removing gadget (#1849)

parent 55847123
Branches
Tags
No related merge requests found
package emu.grasscutter.game.entity; 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.EntityPlatform;
import emu.grasscutter.game.entity.platform.EntitySolarIsotomaElevatorPlatform;
import emu.grasscutter.game.player.Player; import emu.grasscutter.game.player.Player;
import emu.grasscutter.game.world.Scene; import emu.grasscutter.game.world.Scene;
import emu.grasscutter.net.proto.EvtCreateGadgetNotifyOuterClass; import emu.grasscutter.net.proto.EvtCreateGadgetNotifyOuterClass;
...@@ -21,13 +21,11 @@ public class EntitySolarIsotomaClientGadget extends EntityClientGadget { ...@@ -21,13 +21,11 @@ public class EntitySolarIsotomaClientGadget extends EntityClientGadget {
//Create solar isotoma elevator and send to all. //Create solar isotoma elevator and send to all.
this.platformGadget = new EntitySolarIsotomaElevatorPlatform(this, getScene(), getOwner(), ELEVATOR_GADGET_ID, getPosition(), getRotation()); this.platformGadget = new EntitySolarIsotomaElevatorPlatform(this, getScene(), getOwner(), ELEVATOR_GADGET_ID, getPosition(), getRotation());
getScene().addEntity(this.platformGadget); getScene().addEntity(this.platformGadget);
getOwner().getTeamManager().getGadgets().add(this.platformGadget);
} }
@Override @Override
public void onRemoved() { public void onRemoved() {
//Remove solar isotoma elevator entity. //Remove solar isotoma elevator entity.
getScene().removeEntity(this.platformGadget); getScene().removeEntity(this.platformGadget);
getOwner().getTeamManager().getGadgets().remove(this.platformGadget);
} }
} }
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment