package net.simpvp.Portals;

import org.bukkit.entity.Entity;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.world.ChunkUnloadEvent;

public class ChunkUnload implements Listener {

	@EventHandler
	public void onChunkUnload(ChunkUnloadEvent event) {
		
		/* Do not let chunks containing entities about to be teleported unload */
		for (Entity entity : event.getChunk().getEntities()) {
			if (Portals.justTeleportedEntities.contains(entity.getUniqueId())) {
				event.setCancelled(true);
			}	
		}
		
	}
}

@@ -20,19 +20,17 @@
 Portals;
-%0D%0A%0D
+%0A
 %0Aimport 
@@ -54,17 +54,16 @@
 .Entity;
-%0D
 %0Aimport 
@@ -92,17 +92,16 @@
 Handler;
-%0D
 %0Aimport 
@@ -126,17 +126,16 @@
 istener;
-%0D
 %0Aimport 
@@ -174,19 +174,17 @@
 adEvent;
-%0D%0A%0D
+%0A
 %0Apublic 
@@ -226,11 +226,9 @@
 er %7B
-%0D%0A%0D
+%0A
 %0A%09@E
@@ -238,17 +238,16 @@
 tHandler
-%0D
 %0A%09public
@@ -291,21 +291,16 @@
 event) %7B
-%0D%0A%09%09%0D
 %0A%09%09/* Do
@@ -367,17 +367,16 @@
 nload */
-%0D
 %0A%09%09for (
@@ -420,25 +420,24 @@
 ntities()) %7B
-%0D
 %0A%09%09%09if (Port
@@ -496,17 +496,16 @@
 Id())) %7B
-%0D
 %0A%09%09%09%09eve
@@ -530,29 +530,19 @@
 ue);
-%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

Fix line endings in ChunkUnload.java