	public static boolean handlePortalEnter(Entity e, Material portalMaterial) {
		Portal portal = getNear(e.getLocation());
		if (portal == null) {
			String def = null;
			if (portalMaterial == Material.PORTAL) {
				def = WorldConfig.get(e).getNetherPortal();
			} else if (portalMaterial == Material.ENDER_PORTAL) {
				def = WorldConfig.get(e).getEndPortal();
			}
			if (def != null) {
				portal = get(getPortalLocation(def, e.getWorld().getName()));
				if (portal == null) {
					World w = WorldManager.getWorld(def);
					if (w != null) {
						final Location dest;
						if (MyWorlds.allowPersonalPortals) {
							double blockRatio = w.getEnvironment() == Environment.NORMAL ? 8 : 0.125;
							Location entityLoc = e.getLocation();
							IntVector3 blockPos = new IntVector3(blockRatio * entityLoc.getX(), entityLoc.getY(), blockRatio * entityLoc.getZ());
							dest = WorldUtil.findSpawnLocation(new Location(w, blockPos.x + 0.5, blockPos.y + 0.5, blockPos.z + 0.5));
						} else {
							dest = WorldManager.getSpawnLocation(w);
						}
						if (dest != null) {
							EntityUtil.teleportNextTick(e, dest);
							return true;
						}
					}
				}
			}
		}
		if (portal != null) {
			portal.teleportNextTick(e);
			return true;
		}
		return false;
	}

	public static boolean handlePortalEnter(Entity e, Material portalMaterial) {
		Portal portal = getNear(e.getLocation());
		if (portal == null) {
			String def = null;
			if (portalMaterial == Material.PORTAL) {
				def = WorldConfig.get(e).getNetherPortal();
			} else if (portalMaterial == Material.ENDER_PORTAL) {
				def = WorldConfig.get(e).getEndPortal();
			}
			if (def != null) {
				portal = get(getPortalLocation(def, e.getWorld().getName()));
				if (portal == null) {
					World w = WorldManager.getWorld(def);
					if (w != null) {
						final Location dest;
						if (MyWorlds.allowPersonalPortals) {
							double blockRatio = w.getEnvironment() == Environment.NORMAL ? 8 : 0.125;
							Location start = e.getLocation();
							dest = WorldUtil.findSpawnLocation(new Location(w, blockRatio * start.getX(), start.getY(), blockRatio * start.getZ())).add(0.5, 0.0, 0.5);
						} else {
							dest = WorldManager.getSpawnLocation(w);
						}
						if (dest != null) {
							EntityUtil.teleportNextTick(e, dest);
							return true;
						}
					}
				}
			}
		}
		if (portal != null) {
			portal.teleportNextTick(e);
			return true;
		}
		return false;
	}
