mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-05 18:30:26 +01:00
Eject player on quitting when mounted on an NPC
This commit is contained in:
parent
2b0e7af138
commit
4b6191b705
@ -98,7 +98,8 @@ public class Citizens extends JavaPlugin implements CitizensPlugin {
|
||||
Messaging.logTr(Messages.DATABASE_CONNECTION_FAILED);
|
||||
}
|
||||
} else if (type.equalsIgnoreCase("nbt")) {
|
||||
saves = new NBTStorage(folder + File.separator + Setting.STORAGE_FILE.asString(), "Citizens NPC Storage");
|
||||
saves = new NBTStorage(new File(folder + File.separator + Setting.STORAGE_FILE.asString()),
|
||||
"Citizens NPC Storage");
|
||||
}
|
||||
if (saves == null)
|
||||
saves = new YamlStorage(new File(folder, Setting.STORAGE_FILE.asString()), "Citizens NPC Storage");
|
||||
|
@ -253,6 +253,12 @@ public class EventListen implements Listener {
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||
public void onPlayerQuit(PlayerQuitEvent event) {
|
||||
Editor.leave(event.getPlayer());
|
||||
if (event.getPlayer().isInsideVehicle()) {
|
||||
NPC npc = npcRegistry.getNPC(event.getPlayer().getVehicle());
|
||||
if (npc != null) {
|
||||
event.getPlayer().leaveVehicle();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(ignoreCancelled = true)
|
||||
|
Loading…
Reference in New Issue
Block a user