@@ -0,0 +1,576 @@
+package net.simpvp.Portals;%0D%0A%0D%0Aimport org.bukkit.entity.Entity;%0D%0Aimport org.bukkit.event.EventHandler;%0D%0Aimport org.bukkit.event.Listener;%0D%0Aimport org.bukkit.event.world.ChunkUnloadEvent;%0D%0A%0D%0Apublic class ChunkUnload implements Listener %7B%0D%0A%0D%0A%09@EventHandler%0D%0A%09public void onChunkUnload(ChunkUnloadEvent event) %7B%0D%0A%09%09%0D%0A%09%09/* Do not let chunks containing entities about to be teleported unload */%0D%0A%09%09for (Entity entity : event.getChunk().getEntities()) %7B%0D%0A%09%09%09if (Portals.justTeleportedEntities.contains(entity.getUniqueId())) %7B%0D%0A%09%09%09%09event.setCancelled(true);%0D%0A%09%09%09%7D%09%0D%0A%09%09%7D%0D%0A%09%09%0D%0A%09%7D%0D%0A%7D%0D%0A

Stop chunks from unloading while teleporting entities are inside