mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-12-17 17:34:39 +01:00
Remove gadgets from world when a player leaves
This commit is contained in:
@@ -19,6 +19,11 @@ public class HandlerEvtCreateGadgetNotify extends PacketHandler {
|
||||
return;
|
||||
}
|
||||
|
||||
// Sanity check - dont add duplicate entities
|
||||
if (session.getPlayer().getWorld().getEntityById(notify.getEntityId()) != null) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Create entity and summon in world
|
||||
EntityClientGadget gadget = new EntityClientGadget(session.getPlayer().getWorld(), session.getPlayer(), notify);
|
||||
session.getPlayer().getWorld().onPlayerCreateGadget(gadget);
|
||||
|
||||
Reference in New Issue
Block a user